# Reference: <https://postmarketos.org/devicepkg>
# Maintainer: Jenneron <jenneron@protonmail.com>
pkgname=device-google-gru
pkgdesc="Google Gru Chromebooks"
pkgver=6
pkgrel=0
url="https://postmarketos.org"
license="MIT"
arch="aarch64"
options="!check !archcheck"
depends="
	alsa-ucm-conf-google-gru
	depthcharge-tools
	eudev-hwids>=3.2.12-r0
	linux-postmarketos-rockchip
	postmarketos-base
	postmarketos-cros-common
	soc-rockchip-rk3399
"
makedepends="devicepkg-dev"
subpackages="$pkgname-nonfree-firmware:nonfree_firmware"
source="deviceinfo modules-initfs"

# provides and replaces to switch old installations to this package
provides="
	device-google-dru=$pkgver-r$pkgrel
	device-google-druwl=$pkgver-r$pkgrel
	device-google-dumo=$pkgver-r$pkgrel
	device-google-kevin=$pkgver-r$pkgrel
	device-google-bob=$pkgver-r$pkgrel
"
replaces="
	device-google-dru
	device-google-druwl
	device-google-dumo
	device-google-kevin
	device-google-bob
"

build() {
	devicepkg_build $startdir $pkgname
}

package() {
	devicepkg_package $startdir $pkgname
}

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


sha512sums="
6a8aba7e13f864a223a658f724ad8ff6c04ed986a747439cf88a6365c5fa037da9fb4950fa94794eff64937979f988015af9d0a6359deb041d1a2b128baac75e  deviceinfo
a750a0c41068082e0b82351d5aec91715e1a5215b09b26fec644dfe259cea2d662e878433a732a8c06dab2a9b420baec2bcc6161d8357cf3ed770239c5165090  modules-initfs
"
