pkgname=firmware-htc-flounder
pkgver=1.0
pkgrel=0
pkgdesc="Firmware for the HTC Google Nexus 9"
_commit="27024f568d1eee70c4a12f3f46aec33f6ee2f225"
url="https://github.com/Alexandroid99/vendor_htc_flounder"
arch="aarch64"
license="proprietary"
makedepends="git"
install=""
source=""
options="!check !strip"

# Sources
_files1="bcm20795_firmware.ncd bcm4350b1.hcd bcm4350c0.hcd bcm4354.hcd bcmdhd.cal
	fw_bcmdhd.bin fw_bcmdhd_apsta.bin maxim_fp35.bin nvavp_aacdec_ucode.bin
	nvavp_aud_ucode.bin nvavp_mp3dec_ucode.bin nvavp_os_0ff00000.bin
	nvavp_os_8ff00000.bin nvavp_os_eff00000.bin nvavp_os_f7e00000.bin
	nvavp_vid_ucode_alt.bin rt5677_elf_vad sar0_CY8C.img sar1_CY8C.img
	sensor_hub.img synaptics.img touch_fusion.cfg"
_files2="NETB_img.bin fecs.bin gpccs.bin gpmu_ucode.bin nvhost_msenc031.fw
	nvhost_tsec.fw vic03_ucode.bin"

_url1="https://github.com/Alexandroid99/vendor_htc_flounder/raw/$_commit/firmware"
_url2="https://github.com/Alexandroid99/vendor_htc_flounder/raw/$_commit/firmware/tegra13x"
source=""

for _i in $_files1; do
		source="$source $pkgname-$_commit-$_i::$_url1/$_i";
done

for _i in $_files2; do
		source="$source $pkgname-$_commit-$_i::$_url2/$_i";
done


package() {
	cd "$srcdir"

	for _i in $_files1; do
	install -Dm644 "$srcdir/$pkgname-$_commit-$_i" \
			"$pkgdir/lib/firmware/postmarketos/$_i"
	done

	for _i in $_files2; do
	install -Dm644 "$srcdir/$pkgname-$_commit-$_i" \
			"$pkgdir/lib/firmware/postmarketos/tegra13x/$_i"
	done
}
sha512sums="b39189fbf7782015a1fa254ba3731bb49cfaca48474c279d3ab02ffc9b9244c278fbae9c673a28175cb00dd28b5349c84f9f0558ff5db04a2a544726abe3b9e1  firmware-htc-flounder-27024f568d1eee70c4a12f3f46aec33f6ee2f225-bcm20795_firmware.ncd
4da941f23182f41be587517f53934560185a413224ba0e14cf90746ada83c39a28efa80ef403f0c290f8b72482d65122b55caef06ab5a276a2b96b0ac557ff81  firmware-htc-flounder-27024f568d1eee70c4a12f3f46aec33f6ee2f225-bcm4350b1.hcd
948e7ba28c8a9ded5f755150b08862d37f489fb5473311979417c123254609e220c1809e71b2dbe041732997905fafe3900853e001d8f70be45c05c265e0eba4  firmware-htc-flounder-27024f568d1eee70c4a12f3f46aec33f6ee2f225-bcm4350c0.hcd
3d8386ff4a573d4aad7e08c36f764e7ac145c7b0772c47913ac583b2b874e43c464488e55457581f4ad0d9b24c5c7514260a08bc84921c5b5ea83b464d2ba8d9  firmware-htc-flounder-27024f568d1eee70c4a12f3f46aec33f6ee2f225-bcm4354.hcd
787a199215280278279cc9520a75447d01d707cb1eacb0bb16ebc09618c09e3932066e4060f5b98cc3667d9d54c1b19c12cbc883b488a5b002f7cf745b041ab1  firmware-htc-flounder-27024f568d1eee70c4a12f3f46aec33f6ee2f225-bcmdhd.cal
1ae8fdbe633782fba23ddf3843c3b5baaabceb2d8d6f75517356884762f972829c5fd5deac3956e2183d49469823df9a9c2fbbdd5221f6863e45292c1c6f1a6b  firmware-htc-flounder-27024f568d1eee70c4a12f3f46aec33f6ee2f225-fw_bcmdhd.bin
1031b74b35ed9619e60e693af214d4ab2eac40505220ef765882e28e68108b8915e7847bfd64cbc20abc7708341d3a77060ab3d36494bd0f0b6ee8a159c71741  firmware-htc-flounder-27024f568d1eee70c4a12f3f46aec33f6ee2f225-fw_bcmdhd_apsta.bin
b47c56b56967222dc3db53b3ccb66d856855bd30ac91350faed22ae7ff71906ff090faeffdb1d247ada0f6f5bc75f762717cc433b7b724b4274f1c52994bb88a  firmware-htc-flounder-27024f568d1eee70c4a12f3f46aec33f6ee2f225-maxim_fp35.bin
a1afa34d40bdcb92805c9a054800d223a340d5d032de44b7774cbd5ae599c52e3c03bb1d260d7dbc5f592f0ca22a4ba88f9bb50af479f60f482dac40b1c72a46  firmware-htc-flounder-27024f568d1eee70c4a12f3f46aec33f6ee2f225-nvavp_aacdec_ucode.bin
50f655500bc4545f57d91e5b6259c41728ede8873b490f2c758f5e6d1be0c652cae6b6b8ec459eaa4465fb6701aef4d49772092865306e60348b2d2ec9105c49  firmware-htc-flounder-27024f568d1eee70c4a12f3f46aec33f6ee2f225-nvavp_aud_ucode.bin
e5fc4fb733fdb3d01ef6207d3e8c4276938707d2bfee6a1577c8ca350649ff7fdeba29fb62b405101db395c1d5ae9f87c3e7cbd1660a6b6b0e5287e0cb26879e  firmware-htc-flounder-27024f568d1eee70c4a12f3f46aec33f6ee2f225-nvavp_mp3dec_ucode.bin
d29187d8d0023bff50d164885e46c4d819d8655ed50b4d77079b2aed3af24ea53cfa7950380c39f6309f5f9bba57b94dedee8e27a6a4b57dba48b4452b06c75e  firmware-htc-flounder-27024f568d1eee70c4a12f3f46aec33f6ee2f225-nvavp_os_0ff00000.bin
7df371b6b364e2aef6125795211badd557c886fb47a34486df054ee26d13b5d98500395a5b233c4b851564e0fae7d4a9a1a94a5f0d1813381fa86690a07f4c92  firmware-htc-flounder-27024f568d1eee70c4a12f3f46aec33f6ee2f225-nvavp_os_8ff00000.bin
b7c266a049f513c50ab0706e7be8d11ca66f247a384d19320f47ed34ab3deb3089d386902057dd42eaec5b7ea6e34d2ed7a4c5951b3bd576270c5ca5c8cfd5fd  firmware-htc-flounder-27024f568d1eee70c4a12f3f46aec33f6ee2f225-nvavp_os_eff00000.bin
15aceb3948df89859fbb0451a567bd9e209d716ebf514acb47c991c5a88b8393d2895567b5587e396b977366e8b99fbfd8f1a0e927f1b637b53660e5fa37ca91  firmware-htc-flounder-27024f568d1eee70c4a12f3f46aec33f6ee2f225-nvavp_os_f7e00000.bin
ff972014d437d19b71c292436ce283f5853463aced6fdd51f6ae67571a266dd4fb52b182950843f30f63e9bcadfdce64c263913465f2d15a6b70ab0a9b6e56d9  firmware-htc-flounder-27024f568d1eee70c4a12f3f46aec33f6ee2f225-nvavp_vid_ucode_alt.bin
b0404fd81ecde5ed67dabb72790956b04cae836ac53b3059e24cd1a0af610430e355739bf8b9977e3af711556efea44e6b1cbea57849e3e96765fb121174c971  firmware-htc-flounder-27024f568d1eee70c4a12f3f46aec33f6ee2f225-rt5677_elf_vad
df41978f1ed7e016ba4a8040791a1e90312d287bf471de7095175799b7a393b46b0fa3fa57c965b122c2993c5bafb9aa7945dec561cb7d2c2c8644d2c91922d7  firmware-htc-flounder-27024f568d1eee70c4a12f3f46aec33f6ee2f225-sar0_CY8C.img
8c5dae7faed05de2ad604e58a08732a313dffbdf007b7214c497db63a16ba8b9f50edc35d537c85376df21c00cd71b51c76f2f4cc2688044d020e5efe80b87ed  firmware-htc-flounder-27024f568d1eee70c4a12f3f46aec33f6ee2f225-sar1_CY8C.img
be590c9330af0792115855e630dd7a518c2cb048ad7b9ac0f40913c6de1d6704dc11ed32b8f122f60ec35d3fd52e592a116527ac40d0f33eb6308556d772921e  firmware-htc-flounder-27024f568d1eee70c4a12f3f46aec33f6ee2f225-sensor_hub.img
6bbe26aaae4a1ba91cef34a29548dfab4be1c4a17ae8c80ab18b02ddf01c6b31a988a8787cc66c404cc7fa89dde55bb14eafed0c9f4a6a54c2516bc10db34237  firmware-htc-flounder-27024f568d1eee70c4a12f3f46aec33f6ee2f225-synaptics.img
c68ea2cd48959162cfc9f8b33cbe5b67e360ceede122bba9e353ea3918176d51c75b1b4fc942b21efa8485fd609e21c40f5be982e15e0cbe2994d568796c5ce6  firmware-htc-flounder-27024f568d1eee70c4a12f3f46aec33f6ee2f225-touch_fusion.cfg
ad9dc955eea76c7fe0e4a94db27c6cdced89705e7908752a0720b3c76f31d0b4f3596d1ae26e57d88ab8d85f1fa9c9017c430e8c75f59b9af3dddcb67370e7fa  firmware-htc-flounder-27024f568d1eee70c4a12f3f46aec33f6ee2f225-NETB_img.bin
dc976598dd1d6053efc98fd858f1208b9ef95447ff8dac415c5e7b024954288d96a26bbca42ca594aad0ddaa7113a6fe671b7346ff32dd81c2748998fc2c39af  firmware-htc-flounder-27024f568d1eee70c4a12f3f46aec33f6ee2f225-fecs.bin
bf1979bd878185a137d3fdf79e30cdcd9ed0b753e81de0dfb225271d9318c28333d425990c00ef79b7ad21fe587c1260b57762f819f4bb86d3d882a6cca51fae  firmware-htc-flounder-27024f568d1eee70c4a12f3f46aec33f6ee2f225-gpccs.bin
abde15cfedb81fc585fbb0ab6449bea871a83461df6d46ada90ea146ced0ff8fdd5857e4e309df38db41a0c706cb7867a75b9433a1dd1facb7b64956ce1868a2  firmware-htc-flounder-27024f568d1eee70c4a12f3f46aec33f6ee2f225-gpmu_ucode.bin
fdde81ce53cf4325be9e80b5196fe79ad0081b7f9253cb89b511eb4a9db05fb7a65d26c04a6fdf814e1fd29a70faf5f0772b42bfc570c36817b0c92ec62cc10c  firmware-htc-flounder-27024f568d1eee70c4a12f3f46aec33f6ee2f225-nvhost_msenc031.fw
f30374332b2b5fc1c12e58759d5f9e1b9550b1c07b4386ea757a298b0f2688638db404aeeda396f77b188057cf2a377eecd2daa4200a2c562a7ea7a81cb3ff3e  firmware-htc-flounder-27024f568d1eee70c4a12f3f46aec33f6ee2f225-nvhost_tsec.fw
bd5861310fb0e37fc88bb8f5831b4188b53b193139cd4fed6dbdb194b962b7953fb5b83e4435ec0d657b10bf75713422f0ee2af43b50f79203ce975d058cdf40  firmware-htc-flounder-27024f568d1eee70c4a12f3f46aec33f6ee2f225-vic03_ucode.bin"
