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

pkgnames=(chessmarkable)
pkgdesc="Chess game"
url=https://github.com/LinusCDE/chessmarkable
pkgver=0.8.0-2
timestamp=2021-07-22T12:04Z
section="games"
maintainer="Linus K. <linus@cosmos-ink.net>"
license=MIT
installdepends=(display)
flags=(patch_rm2fb)

image=rust:v2.1
source=(https://github.com/LinusCDE/chessmarkable/archive/0.8.0-1.zip)
sha256sums=(17675d30bb45050c1db5bc81d3d76b99a1b18e497c9a331177b853a5f9aa12af)

build() {
    # Fall back to system-wide config
    rm .cargo/config
    cargo build --release --bin chessmarkable
}

package() {
    install -D -m 755 -t "$pkgdir"/opt/bin "$srcdir"/target/armv7-unknown-linux-gnueabihf/release/chessmarkable
    install -D -m 644 "$srcdir"/oxide "$pkgdir"/opt/etc/draft/chessmarkable
    install -D -m 644 "$srcdir"/icon.png "$pkgdir"/opt/etc/draft/icons/chessmarkable.png
}
