# Reference: <https://postmarketos.org/devicepkg>
# Maintainer: Jenneron <jenneron@protonmail.com>
pkgname=device-google-kevin
pkgdesc="Samsung Chromebook Plus"
pkgver=3
pkgrel=0
url="https://postmarketos.org"
license="MIT"
arch="aarch64"
options="!check !archcheck"
depends="
	alsa-ucm-conf-google-gru
	depthcharge-tools
	linux-postmarketos-rockchip
	postmarketos-base
	postmarketos-update-depthcharge-kernel
"
makedepends="devicepkg-dev"
subpackages="
	$pkgname-nonfree-firmware:nonfree_firmware
	$pkgname-phosh
"
source="
	deviceinfo
	phoc.ini
	modprobe.d/accel.conf
	pointercal
"

build() {
	devicepkg_build $startdir $pkgname
}

package() {
	devicepkg_package $startdir $pkgname

	install -Dm644 "$srcdir"/accel.conf \
		"$pkgdir"/etc/modprobe.d/accel.conf

	install -Dm644 "$srcdir"/pointercal \
		"$pkgdir"/etc/pointercal
}

nonfree_firmware() {
	pkgdesc="WiFi/BT and DP firmware"
	depends="linux-firmware-mrvl linux-firmware-rockchip"
	mkdir "$subpkgdir"
}

phosh() {
	install_if="$pkgname=$pkgver-r$pkgrel postmarketos-ui-phosh"
	install -Dm644 "$srcdir"/phoc.ini \
		"$subpkgdir"/etc/phosh/phoc.ini
}

sha512sums="
c6580a56b36f587cd25c913cc5f8cc9af3d4401d2925055ebf65d8370cfe1360bf34c9a9a0169eececc6d5d194cb97ea884133ee1e4fe6fa717f401be8f3b49d  deviceinfo
e8186b97016b49f810cce60c1c08d703ae0d91c25f776ed804f20f3f5e477693086c83a1ec5849a6cb5c9f0f2503b88d5fcac7c68ff0d6018812e43557839808  phoc.ini
1ba29c50747458b68ed98706c008cfaeea9eff56d2977a23e060f3a9fcf306c9d62d162e2906472d24a6c25596af95e26722c6b55ca97a031b2d5c8db2661390  accel.conf
926b662d7836046c7be53e75cf05989d6ab12296f1ad0fea61f7718adb360abbd4cf96666e9e154526a1fe179ce5b08391d85d01a4b17fca37b6615d2e6b3b0d  pointercal
"
