# Reference: <https://postmarketos.org/devicepkg>
# Maintainer: David Wronek <david@mainlining.org>
pkgname=device-xiaomi-miatoll
pkgdesc="Xiaomi Redmi Note 9 Pro / Redmi Note 9S"
pkgver=1
pkgrel=0
url="https://postmarketos.org"
license="MIT"
arch="aarch64"
options="!check !archcheck"
depends="
	make-dynpart-mappings
	mkbootimg
	postmarketos-base
	swclock-offset
"
makedepends="devicepkg-dev"
source="deviceinfo"

subpackages="
	$pkgname-kernel-curtana:kernel_curtana
	$pkgname-kernel-joyeuse:kernel_joyeuse
"

build() {
	devicepkg_build $startdir $pkgname
}

package() {
	devicepkg_package $startdir $pkgname
}

kernel_curtana() {
	pkgdesc="Xiaomi Redmi Note 9S. To know which model you have, visit https://wiki.postmarketos.org/wiki/Xiaomi-miatoll-variants"
	depends="linux-postmarketos-qcom-sm7125"
	devicepkg_subpackage_kernel $startdir $pkgname $subpkgname
}

kernel_joyeuse() {
	pkgdesc="Xiaomi Redmi Note 9 Pro (Global). To know which model you have, visit https://wiki.postmarketos.org/wiki/Xiaomi-miatoll-variants"
	depends="linux-postmarketos-qcom-sm7125"
	devicepkg_subpackage_kernel $startdir $pkgname $subpkgname
}

sha512sums="
8127f706f04c9e57902c3287ef088441fa3efd3d922805ef4957897f4b193e6c1b022b933834684b3db3d0d9739769dcb5084a556ef3cda77e80e8443401bccf  deviceinfo
"
