pkgname=firmware-fairphone-fp4 pkgver=20231122 pkgrel=0 pkgdesc="Firmware for Fairphone 4" subpackages=" $pkgname-adreno $pkgname-adsp $pkgname-bluetooth $pkgname-cdsp $pkgname-ipa $pkgname-modem $pkgname-venus $pkgname-wlan " url="https://github.com/FairBlobs/FP4-firmware" arch="aarch64" license="proprietary" makedepends="pil-squasher" options="!check !strip !archcheck !tracedeps pmb:cross-native" _commit="9bcb18012b18756e5f7adc4fcd41396e7f28199b" source="https://github.com/FairBlobs/FP4-firmware/archive/$_commit/FP4-firmware-$_commit.tar.gz" builddir="$srcdir/FP4-firmware-$_commit" build() { for i in *.mdt; do pil-squasher "$(basename "$i" .mdt)".mbn "$i" done } package() { # parent package is empty mkdir -p "$pkgdir" } adreno() { pkgdesc="Fairphone 4 adreno firmware" install -Dm644 "$builddir"/a619_gmu.bin -t \ "$subpkgdir/lib/firmware/qcom/" install -Dm644 "$builddir"/a615_zap.mbn -t \ "$subpkgdir/lib/firmware/qcom/sm7225/fairphone4/" ln -s a615_zap.mbn "$subpkgdir/lib/firmware/qcom/sm7225/fairphone4/a615_zap.mdt" ln -s sm7225/fairphone4/a615_zap.mbn "$subpkgdir/lib/firmware/qcom/a615_zap.mdt" } adsp() { pkgdesc="Fairphone 4 adsp firmware" install -Dm644 "$builddir"/adsp.mbn -t \ "$subpkgdir/lib/firmware/qcom/sm7225/fairphone4/" ln -s adsp.mbn "$subpkgdir/lib/firmware/qcom/sm7225/fairphone4/adsp.mdt" install -Dm644 "$builddir"/adsp*.jsn -t \ "$subpkgdir/lib/firmware/qcom/sm7225/fairphone4/" } bluetooth() { pkgdesc="Fairphone 4 bluetooth firmware" install -Dm644 "$builddir"/apbtfw11.tlv -t \ "$subpkgdir/lib/firmware/qca/" install -Dm644 "$builddir"/apnv11.bin -t \ "$subpkgdir/lib/firmware/qca/" } cdsp() { pkgdesc="Fairphone 4 cdsp firmware" install -Dm644 "$builddir"/cdsp.mbn -t \ "$subpkgdir/lib/firmware/qcom/sm7225/fairphone4/" ln -s cdsp.mbn "$subpkgdir/lib/firmware/qcom/sm7225/fairphone4/cdsp.mdt" install -Dm644 "$builddir"/cdsp*.jsn -t \ "$subpkgdir/lib/firmware/qcom/sm7225/fairphone4/" } ipa() { pkgdesc="Fairphone 4 ipa firmware" cd "$builddir" install -Dm644 "$builddir"/lagoon_ipa_fws.mbn \ "$subpkgdir/lib/firmware/qcom/sm7225/fairphone4/ipa_fws.mbn" ln -s ipa_fws.mbn "$subpkgdir/lib/firmware/qcom/sm7225/fairphone4/ipa_fws.mdt" } modem() { pkgdesc="Fairphone 4 modem firmware" install -Dm644 "$builddir"/modem.mbn -t \ "$subpkgdir/lib/firmware/qcom/sm7225/fairphone4/" ln -s modem.mbn "$subpkgdir/lib/firmware/qcom/sm7225/fairphone4/modem.mdt" install -Dm644 "$builddir"/modem*.jsn -t \ "$subpkgdir/lib/firmware/qcom/sm7225/fairphone4/" cp -r "$builddir"/modem_pr/ \ "$subpkgdir/lib/firmware/qcom/sm7225/fairphone4/" find "$subpkgdir/lib/firmware/qcom/sm7225/fairphone4/" \ -type f -exec chmod 0644 {} \; } venus() { pkgdesc="Fairphone 4 venus firmware" install -Dm644 "$builddir"/venus.mbn -t \ "$subpkgdir/lib/firmware/qcom/sm7225/fairphone4/" } wlan() { pkgdesc="Fairphone 4 wlan firmware" install -Dm644 "$builddir"/wlanmdsp.mbn -t \ "$subpkgdir/lib/firmware/qcom/sm7225/fairphone4/" } sha512sums=" c579b1893a61e09f532e0858ddb90b83e663bf1489707ba8b0e524771504db73764233c2dfe3a4b97b40eab4ef88d50adbea33ab25c28c289d1890d7b0addd70 FP4-firmware-9bcb18012b18756e5f7adc4fcd41396e7f28199b.tar.gz "