#!/usr/bin/env bash
# Copyright (c) 2020 The Toltec Contributors
# SPDX-License-Identifier: MIT

pkgnames=(tilem)
pkgdesc="TI-84+ calculator emulator"
url=https://github.com/timower/rM2-stuff/tree/master/apps/tilem
pkgver=0.0.7-3
timestamp=2021-04-30T10:42Z
maintainer="Mattéo Delabre <spam@delab.re>"
license=GPL-3.0
section="utils"
image=base:v2.1
installdepends=(display)

source=(https://github.com/timower/rM2-stuff/archive/refs/tags/v0.0.7.tar.gz)
sha256sums=(ed2db5f1aa7c9e8b0bead53bd60cb8fd9eec24c028d789fdbdc4b1655d6c78ce)

build() {
    mkdir build
    mkdir install
    cd build
    cmake -DCMAKE_TOOLCHAIN_FILE="/usr/share/cmake/$CHOST.cmake" \
        -DCMAKE_INSTALL_PREFIX="../install" -DCMAKE_BUILD_TYPE=Release ..
    cd apps/tilem
    make
    make install
}

package() {
    cp -r "$srcdir/install/." "$pkgdir"
}
