# Co-Maintainer: Joel Selvaraj <foss@joelselvaraj.com>
# Co-Maintainer: Casey Connolly <kcxt@postmarketos.org>
maintainer="Victoria Brekenfeld <postmarketos@drakulix.de>"
pkgname=firmware-google-blueline
pkgver=2
pkgrel=0
pkgdesc="Firmware for Google Pixel 3 (blueline)"
# Suggested by Caleb as it has working Wifi
url="https://gitlab.com/sdm845-mainline/firmware-google-pixel3"
arch="aarch64"
depends="linux-firmware-qca linux-firmware-qcom linux-firmware-ath10k"
license="proprietary"
options="!check !strip !archcheck !tracedeps pmb:cross-native"

_commit="2a15e29129a607ee066b3950c578aab64e9bd82a"

source="firmware-google-pixel3-$_commit.tar.gz::https://gitlab.com/sdm845-mainline/firmware-google-pixel3/-/archive/$_commit/firmware-google-pixel3-$_commit.tar.gz
	firmware.files"

builddir="$srcdir/firmware-google-pixel3-$_commit"

package() {

	while IFS="" read -r _i || [ -n "$_i" ]; do
		[ ! -d $(dirname $_i) ] && mkdir -p $(dirname $_i)
		install -Dm644 "$builddir/$_i" "$pkgdir/usr/$_i"
	done < "$srcdir/firmware.files"

	# TODO: Do we need these? If so put them into correct paths and into
	# NFC/Secure Element firmware
	#install -Dm644 misc/pn557.bin "$pkgdir/lib/firmware/postmarketos/"
	# Haptic driver firmware
	#install -Dm644 misc/cs40l20.bin "$pkgdir/lib/firmware/postmarketos/"
	# Haptic driver firmware
	#install -Dm644 misc/drv2624.bin "$pkgdir/lib/firmware/postmarketos/"
}

sha512sums="
ada19a0bda67e91cfed337045cc2b95505914e4732491d28fb6d8e38318bd51822222b12ed0337509da5d20fce5b592f9736b5039e67bfeaa7ac9de4109a9453  firmware-google-pixel3-2a15e29129a607ee066b3950c578aab64e9bd82a.tar.gz
05114af30b7207c76bd3f217abbb6cd2e45be22419d19dee5405bc25810664e009c24ebc03f5364874b99f2ce09f2f664624fb506219934494f53de769b6da02  firmware.files
"
