# Contributor: Milan P. Stanić <mps@arvanta.net>
# Maintainer: Milan P. Stanić <mps@arvanta.net>
pkgname=tiny-dfr
pkgver=0.3.1
pkgrel=0
pkgdesc="Apple silicon touch bar input / display daemon"
url="https://github.com/WhatAmISupposedToPutHere/tiny-dfr"
arch="aarch64"
license="MIT"
makedepends="cargo pango-dev libinput-dev gdk-pixbuf-dev libxml2-dev"
subpackages="$pkgname-openrc"
source="$pkgname-$pkgver.tar.gz::https://github.com/WhatAmISupposedToPutHere/tiny-dfr/archive/refs/tags/v$pkgver.tar.gz
	tiny-dfr.initd"

build() {
	cargo build --release --all-features
}


package() {
	install -m755 -D "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname
	install -Dm755 target/release/$pkgname "$pkgdir"/usr/bin/$pkgname
	install -Dm644 share/$pkgname/*.svg -t "$pkgdir/usr/share/$pkgname"
	install -Dm644 share/$pkgname/config.toml -t "$pkgdir/usr/share/$pkgname"
	install -Dm644 etc/udev/rules.d/99-touchbar-seat.rules "$pkgdir/usr/lib/udev/rules.d/99-touchbar-seat.rules"
	install -Dm644 etc/udev/rules.d/99-touchbar-tiny-dfr.rules "$pkgdir/usr/lib/udev/rules.d/99-touchbar-tiny-dfr.rules"
}

sha512sums="
2455aab3a708e208ce44a4d013a2d91614c8e9bf4a9d2a7461f1d9c709d3c529f33b2921c4a30e8777c71e567c8b6151a96ae954692368d89eedaa450fca7488  tiny-dfr-0.3.1.tar.gz
02f8ad47061de4048306c3ac49873f36c6768ba6812d244524e366909baf3e96ddc38c0177a9eb03a30132bfa025e007c8a93ee22157bfcea52bded8cffeda3f  tiny-dfr.initd
"
