# Maintainer: Svyatoslav Ryhel <clamor95@gmail.com>
# Co-Maintainer: Ion Agorria

pkgname=firmware-asus-transformer
pkgver=1
pkgrel=1
pkgdesc="Firmware files for Asus Transformers"
url="https://github.com/clamor95/linux-firmware"
arch="armv7"
license="proprietary"
options="!check !strip !archcheck"

# source
_commit="f95c265a48fbe59c24be634b80ab8fe7c4cbcd57"
source="BCM4329B1_002.002.023.0797.0879.hcd::https://github.com/clamor95/linux-firmware/raw/$_commit/brcm/BCM4329B1_002.002.023.0797.0879.hcd
	BCM4330B1_002.001.003.0967.0970.hcd::https://github.com/clamor95/linux-firmware/raw/$_commit/brcm/BCM4330B1_002.001.003.0967.0970.hcd
	brcmfmac4329-sdio.asus,tf201.txt::https://github.com/clamor95/linux-firmware/raw/$_commit/brcm/brcmfmac4329-sdio.asus%2Ctf201.txt
	brcmfmac4329-sdio.asus,tf300t.txt::https://github.com/clamor95/linux-firmware/raw/$_commit/brcm/brcmfmac4329-sdio.asus%2Ctf300t.txt
	brcmfmac4330-sdio.asus,tf700t.txt::https://github.com/clamor95/linux-firmware/raw/$_commit/brcm/brcmfmac4330-sdio.asus%2Ctf700t.txt
"

package() {
	# Bluetooth
	install -D -m644 "$srcdir"/BCM4329B1_002.002.023.0797.0879.hcd \
		"$pkgdir"/lib/firmware/postmarketos/brcm/BCM4329B1.hcd
	install -D -m644 "$srcdir"/BCM4330B1_002.001.003.0967.0970.hcd \
		"$pkgdir"/lib/firmware/postmarketos/brcm/BCM4330B1.hcd

	# Wi-Fi
	install -D -m644 "$srcdir"/brcmfmac4329-sdio.asus,tf201.txt \
		"$pkgdir"/lib/firmware/postmarketos/brcm/brcmfmac4329-sdio.asus,tf201.txt
	install -D -m644 "$srcdir"/brcmfmac4329-sdio.asus,tf300t.txt \
		"$pkgdir"/lib/firmware/postmarketos/brcm/brcmfmac4329-sdio.asus,tf300t.txt
	install -D -m644 "$srcdir"/brcmfmac4330-sdio.asus,tf700t.txt \
		"$pkgdir"/lib/firmware/postmarketos/brcm/brcmfmac4330-sdio.asus,tf700t.txt

	cd "$pkgdir"/lib/firmware/postmarketos/brcm
	ln -s brcmfmac4329-sdio.asus,tf201.txt brcmfmac4329-sdio.asus,tf101.txt
	ln -s brcmfmac4329-sdio.asus,tf300t.txt brcmfmac4329-sdio.asus,tf300tg.txt
	ln -s brcmfmac4329-sdio.asus,tf300t.txt brcmfmac4329-sdio.asus,tf300tl.txt
}

sha512sums="26534cbef298d7594ed6d8a58380ed3b1593a195aaa2c9e5108dce82dbaec4da922f49217342397d405131d827873dca1c78ab2e73c4bae0901b2c77ff56f9b2  BCM4329B1_002.002.023.0797.0879.hcd
b61cc86466a028e9160d1f2c7a3303fbb3a7dbcb2a6766b0afd9ef1fc9e25410d75f1e315638d0de8306ce23f3561c084542ad1c9e5eb11e9d07a3ba85dfec3d  BCM4330B1_002.001.003.0967.0970.hcd
4037e1af433a4805b2cb24c770f3b3009fe5fe224de11174ed1075dd3dc527b108e5d20cd9a3527b7b981c32c52e07027b15c53eb9bf8e37e82b66126081b665  brcmfmac4329-sdio.asus,tf201.txt
655f2bda94ca1c9ff26fba4c2eb69121fed461325dfd14342262240d5833d063839311bd0b8e2efffbab9b19a0852c5ab57b267c97e8a0205f810a2259840159  brcmfmac4329-sdio.asus,tf300t.txt
907654b7dbeec809c23635374f6a19afca1b125091fec7ae1ec00b90a3758a5023fbc0ad60981975fe55a826b9252887c0d8b4067c4c3d68c07774d31da9f69e  brcmfmac4330-sdio.asus,tf700t.txt"
