# Archived: Downstream port, only for testing. Use mainline port!
# Reference: <https://postmarketos.org/devicepkg>
maintainer="Luca Weiss <luca@lucaweiss.eu>"
pkgname=device-lg-lenok-downstream
pkgdesc="LG G Watch R (Downstream)"
pkgver=2
pkgrel=0
url="https://postmarketos.org"
license="MIT"
arch="armv7"
options="!check !archcheck"
depends="
	firmware-lg-lenok-adsp
	firmware-lg-lenok-wifi
	firmware-qcom-adreno-a330
	linux-lg-lenok-downstream
	mkbootimg
	postmarketos-base
	soc-qcom-msm8226
	"
makedepends="devicepkg-dev"
subpackages="
	$pkgname-asteroid
	"
source="
	90-android-touch-dev.rules
	deviceinfo
	fb_fix.sh
	initfs-hook.sh
	machine.conf
	"

build() {
	devicepkg_build $startdir $pkgname
}

package() {
	devicepkg_package $startdir $pkgname

	install -Dm644 -t "$pkgdir"/etc/udev/rules.d \
		"$srcdir"/90-android-touch-dev.rules
	install -Dm644 -t "$pkgdir"/etc/profile.d \
		"$srcdir"/fb_fix.sh
}

asteroid() {
	install_if="$pkgname=$pkgver-r$pkgrel asteroid-launcher"

	install -Dm644 -t "$subpkgdir"/etc/asteroid \
		"$srcdir"/machine.conf
}

sha512sums="
a36ba9017df3b4be233783096c303abafa873dcdf50f6357b82f3c5526fd161a1914dafe143377cb5982955108b987890638b51911d0dd339172554e39a82d9f  90-android-touch-dev.rules
f5d9698b37c69a51cd4d821b3e54f370681f6c04979de890aafa98e5dc4b0226159fc62778a82b2994e2841f7daa9c939a4d21f29d24f083569682356d70e24c  deviceinfo
1fc5a7609d8f79f74f29d55ce492dc6b77bb247da1b79abc1361e5e9072b5283816cef02c4cc283300031d708733c5fdbed94f539ae1c16b1dca96bf4d512234  fb_fix.sh
d29105805adcd79d4f73c2f2c4483a2c627dc7b70acb77f43d085742ef930407c9b1423f7020c34f38e8a09f40cadd991b9acae23e936c90d6a4c0900250da22  initfs-hook.sh
81cf2c20d2efa0f71f18116efeda11ae4f18fee96ba998dc4d6a36205626dce496cb36711af5c4e3215578b174942e721290cfcff8db6fb1c998b90b7345244d  machine.conf
"
