diff options
author | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2024-12-14 14:58:10 -0600 |
---|---|---|
committer | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2024-12-14 14:58:10 -0600 |
commit | f5b1cdbdf446c57c97925c151745bdc8bafa464f (patch) | |
tree | 7cdb7e9b58547ddb1793731824fce30ec10ef7e8 | |
parent | 225465cf693d26a6f3472cecbd22ce6f05151dc9 (diff) | |
download | packages-f5b1cdbdf446c57c97925c151745bdc8bafa464f.tar.gz packages-f5b1cdbdf446c57c97925c151745bdc8bafa464f.tar.bz2 packages-f5b1cdbdf446c57c97925c151745bdc8bafa464f.tar.xz packages-f5b1cdbdf446c57c97925c151745bdc8bafa464f.zip |
user/linux-firmware: New package
-rw-r--r-- | user/linux-firmware/APKBUILD | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/user/linux-firmware/APKBUILD b/user/linux-firmware/APKBUILD new file mode 100644 index 000000000..2042843ec --- /dev/null +++ b/user/linux-firmware/APKBUILD @@ -0,0 +1,72 @@ +# Contributor: Ariadne Conill <nenolod@dereferenced.org> +# Contributor: Oliver Smith <ollieparanoid@bitmessage.ch> +# Contributor: Natanael Copa <ncopa@alpinelinux.org> +# Maintainer: Síle Ekaterin Liszka <sheila@vulpine.house> +pkgname=linux-firmware +pkgver=20241210 +pkgrel=0 +pkgdesc="firmware files for linux" +url="http://git.kernel.org/?p=linux/kernel/git/firmware/linux-firmware.git;a=summary" +arch="all" +options="!strip !check !dbg" +license="custom:multiple" +depends="" +makedepends="rdfind" +source="https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/snapshot/$pkgname-$pkgver.tar.gz" +# Put /lib/firmware/* folders in subpackages +_folders="3com acenic adaptec advansys airoha amd amd-ucode amdgpu amdnpu +amdtee amlogic amphion ar3k arm ath10k ath11k ath12k ath6k ath9k_htc atmel +atusb av7110 bnx2 bnx2x brcm cadence cavium cirrus cis cnm cpia2 cxgb3 cxgb4 +cypress dabusb dpaa2 dsp56k e100 edgeport emi26 emi62 ene-ub6250 ess go7007 +i915 imx inside-secure intel isci ixp4xx kaweth keyspan keyspan_pda korg +libertas liquidio matrox mediatek mellanox meson microchip moxa mrvl mwl8k +mwlwifi myricom netronome nvidia nxp ositech powervr qca qcom qed qlogic r128 +radeon realtek rockchip rsi rtl_bt rtl_nic rtlwifi rtw88 rtw89 sb16 slicoss sun +sxg tehuti ti ti-connectivity ti-keystone tigon ttusb-budget ueagle-atm vicam +vxge wfx xe yam yamaha" +subpackages="$pkgname-other" +depends="linux-firmware-other" +for i in $_folders; do + subpackages="$pkgname-$i:folder $subpackages" + depends="$pkgname-$i $depends" +done + +package() { + make DESTDIR="${pkgdir}" FIRMWAREDIR="/lib/firmware" install + make DESTDIR="${pkgdir}" FIRMWAREDIR="/lib/firmware" dedup + rm -f "${pkgdir}/usr/lib/firmware/{Makefile,README,configure,GPL-3}" +} + +folder() { + folder=${subpkgname##linux-firmware-} + pkgdesc="firmware files for linux ($_folder folder)" + depends="" + + # Move /lib/firmware/$folder (case insensitive) + mkdir -p "$subpkgdir/lib/firmware" + mv "$(find "$pkgdir/lib/firmware" -iname "$folder" -type d)" \ + "$subpkgdir/lib/firmware" +} + +other() { + # Requires subfolders to be split in subpackages + leftover="" + for i in "$pkgdir"/lib/firmware/*; do + [ -d "$i" ] && leftover="$leftover $(basename $i)" + done + if [ "$leftover" != "" ]; then + error "Not all subfolders have been moved to subpackages!" + error "Fix this by adjusting _folders as follows:" + fixed="$(echo $_folders$leftover | tr " " "\n" | tr '[A-Z]' '[a-z]' | sort)" + echo "_folders=\"$(printf "$fixed" | tr "\n" " ")\"" | fold -s + return 1 + fi + + # Move /lib/firmware (which doesn't have subfolders now) + pkgdesc="firmware files for linux (uncategorized)" + depends="" + mkdir -p "$subpkgdir"/ + mv "$pkgdir"/lib "$subpkgdir"/ +} + +sha512sums="75e2d7383e209c2f787a4369e171e2d9bd16dc9cc1cd74920874d1dc56a950df95981be942fd7aa95620ef18da3e50d0fd95886c1497c91c4e54f564fe381fc3 linux-firmware-20241210.tar.gz" |