blob: bde178aec51464c0b06583761777390d8d0e7b60 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
|
# Maintainer: David P. <megver83@parabola.nu>
pkgbase=linux-libre-firmware
pkgname=(
linux-libre-firmware
linux-libre-firmware-whence
linux-libre-firmware-other
# Splits
linux-libre-firmware-atheros
linux-libre-firmware-broadcom
linux-libre-firmware-intel
)
pkgver=1.5
pkgrel=1
epoch=1
pkgdesc='Firmware files for Linux-libre'
url='https://jxself.org/firmware'
license=(LicenseRef-WHENCE)
arch=(any)
provides=(linux-firmware)
conflicts=(linux-firmware)
replaces=(linux-firmware)
makedepends=(
cmake # ath9k_htc and carl9170fw
arm-linux-gnueabi-binutils # av7110
arm-none-eabi-gcc # aica
avr-libc dfu-util # atusb
sh-elf-gcc sh-elf-newlib # carl9170fw
xtensa-elf-gcc # ath9k_htc
)
options=(!buildflags !makeflags)
source=("$url/$pkgbase-$pkgver.tar.lz"{,.asc}
0001-av7110-Build-Boot.S-with-arm-linux-gnueabi-as-instea.patch
0002-ath9k_htc-bump-CMAKE_MINIMUM_REQUIRED-to-version-3.5.patch)
sha256sums=('77858e842ee249d32b8b950cdfd12824d63f515f9317dd030fb89ee9e0bc889f'
'SKIP'
'2b1f6ca72e8b71096c9375cf2276914677bb6c3bd8c055d1895d8790882999cc'
'7029edeb4c25fe45ba448d7950ca61fba1e9b55c0508dd3ff79226de07d89a3a')
validpgpkeys=('F611A908FFA165C699584ED49D0DB31B545A3198') # Jason Self <j@jxself.org>
prepare() {
cd "$pkgbase-$pkgver/src"
patch -Np1 -i "$srcdir"/0001-av7110-Build-Boot.S-with-arm-linux-gnueabi-as-instea.patch
patch -Np1 -i "$srcdir"/0002-ath9k_htc-bump-CMAKE_MINIMUM_REQUIRED-to-version-3.5.patch
# Use the system sh-elf toolchain
sed -e 's|${CMAKE_SOURCE_DIR}/toolchain/inst/bin/||g' \
-e '/CMAKE_FIND_ROOT_PATH/d' \
-i carl9170fw/extra/sh-elf-linux.cmake
# Set dummy Makefiles to skip building the toolchains
cat <<EOF | tee ath9k_htc/Makefile carl9170fw/toolchain/Makefile >/dev/null
.DEFAULT_GOAL := all
all:
@:
%:
@:
EOF
}
build() {
cd "$pkgbase-$pkgver/src"
# a56 uses legacy K&R C code and requires GNU89 compatibility
make CPPFLAGS="-std=gnu89" a56
# Build carl9170fw with the default config
pushd carl9170fw
./autogen.sh --alldefconfig
popd
# ath9k_htc firmware uses old Xtensa code that triggers
# incompatible-pointer-types errors with modern GCC versions.
# The firmware build system sets the compiler through CROSS_COMPILE.
CFLAGS="$CFLAGS -Wno-error=incompatible-pointer-types" \
CROSS_COMPILE=xtensa-elf- \
make ath9k_htc
# Build the rest of the firmware
make
}
_pick() {
local p="$1" f d; shift
for f; do
d="$srcdir/$p/${f#${pkgdir}/}"
mkdir -p "$(dirname "$d")"
mv "$f" "$d"
rmdir -p --ignore-fail-on-non-empty "$(dirname "$f")"
done
}
package_linux-libre-firmware() {
pkgdesc+=" - Default set"
license=(CC0-1.0)
depends=(
linux-libre-firmware-atheros
linux-libre-firmware-broadcom
linux-libre-firmware-intel
linux-libre-firmware-other
)
provides=(${provides[@]/%/${pkgname#${pkgbase}}})
conflicts=(${conflicts[@]/%/${pkgname#${pkgbase}}})
replaces=(${replaces[@]/%/${pkgname#${pkgbase}}})
}
package_linux-libre-firmware-whence() {
pkgdesc+=" - WHENCE file (vendor licenses)"
provides=(${provides[@]/%/${pkgname#${pkgbase}}})
conflicts=(${conflicts[@]/%/${pkgname#${pkgbase}}})
replaces=(${replaces[@]/%/${pkgname#${pkgbase}}})
cd "$pkgbase-$pkgver/src"
install -Dm644 WHENCE -t "$pkgdir/usr/share/licenses/$pkgname"
}
package_linux-libre-firmware-other() {
pkgdesc+=" - Unsorted firmware for various devices"
provides=(${provides[@]/%/${pkgname#${pkgbase}}})
conflicts=(${conflicts[@]/%/${pkgname#${pkgbase}}})
replaces=(${replaces[@]/%/${pkgname#${pkgbase}}})
local fwdir="${pkgdir}/usr/lib/firmware"
make -C "$pkgbase-$pkgver/src" prefix="$pkgdir/usr/lib/firmware" install
# split
_pick atheros "${fwdir}"/{ath*,carl9170*,htc_*}
_pick broadcom "${fwdir}"/b43-open
_pick intel "${fwdir}"/isci
}
package_linux-libre-firmware-atheros() {
pkgdesc+=" - Firmware for Qualcomm Atheros WiFi adapters"
license+=('BSD-3-Clause AND MIT AND GPL-2.0-or-later')
depends=(linux-firmware-whence)
provides=(${provides[@]/%/${pkgname#${pkgbase}}})
conflicts=(${conflicts[@]/%/${pkgname#${pkgbase}}})
replaces=(${replaces[@]/%/${pkgname#${pkgbase}}})
mv -v ${pkgname#linux-libre-firmware-}/* "${pkgdir}"
install -Dm644 \
$pkgbase-$pkgver/src/ath9k_htc/LICENCE.TXT \
$pkgbase-$pkgver/src/ath9k_htc/NOTICE.TXT \
-t "${pkgdir}/usr/share/licenses/${pkgname}"
}
package_linux-libre-firmware-broadcom() {
pkgdesc+=" - Firmware for supported Broadcom 43xx network adapters"
license+=(GPL-2.0-only)
depends=(linux-firmware-whence)
provides=(${provides[@]/%/${pkgname#${pkgbase}}})
conflicts=(${conflicts[@]/%/${pkgname#${pkgbase}}})
replaces=(${replaces[@]/%/${pkgname#${pkgbase}}})
mv -v ${pkgname#linux-libre-firmware-}/* "${pkgdir}"
install -Dm644 $pkgbase-$pkgver/src/openfwwf/LICENSE \
-t "${pkgdir}/usr/share/licenses/${pkgname}"
}
package_linux-libre-firmware-intel() {
pkgdesc+=" - Firmware for Intel devices"
license+=(GPL-2.0-only)
depends=(linux-firmware-whence)
provides=(${provides[@]/%/${pkgname#${pkgbase}}})
conflicts=(${conflicts[@]/%/${pkgname#${pkgbase}}})
replaces=(${replaces[@]/%/${pkgname#${pkgbase}}})
mv -v ${pkgname#linux-libre-firmware-}/* "${pkgdir}"
}
|