pkgname=firmware-samsung-matissevewifi
pkgver=1
pkgrel=0
pkgdesc="Firmware for Samsung Galaxy Tab 4 10.1 WiFi (SM-T533)"
url="https://github.com/rvlander/glowing-journey"
subpackages="$pkgname-modem $pkgname-venus $pkgname-wcnss"
arch="aarch64"
license="proprietary"
options="!check !strip !archcheck"
source="https://github.com/rvlander/glowing-journey/files/4313897/stm533-blobs.tar.gz"

_fwdir="/lib/firmware/postmarketos"

package() {
	# parent package is empty
	mkdir -p "$pkgdir"
}

modem() {
	pkgdesc="Samsung Galaxy Tab 4 10.1 (SM-T533) modem firmware"
	install -Dm644 "$srcdir"/blobs/mba.mbn -t "$subpkgdir/$_fwdir"
	install -Dm644 "$srcdir"/blobs/modem.* -t "$subpkgdir/$_fwdir"
}

venus() {
	pkgdesc="Samsung Galaxy Tab 4 10.1 (SM-T533) video firmware"
	install -Dm644 "$srcdir"/blobs/venus.* -t "$subpkgdir/$_fwdir"/qcom/venus-1.8
}

wcnss() {
	pkgdesc="Samsung Galaxy Tab 4 10.1 WiFi (SM-T533) WiFi/BT firmware"
	cd "$srcdir/blobs"
	install -Dm644 wcnss.* -t "$subpkgdir/$_fwdir"
	install -Dm644 WCNSS_* -t "$subpkgdir/$_fwdir"/wlan/prima
}


sha512sums="9ab5c22904adfad8032c4f9c3abefdfc34ccbd8f26d9fa1d69c57bf76dcb0c054eb82f110cbc5f4431e2fb1d002312cc6ec3a15991f526c13d0edc85dc598e14  stm533-blobs.tar.gz"
