summaryrefslogtreecommitdiff
path: root/aports/broadcom-wl/APKBUILD
blob: 9acbd5213e298bcbb2dc935fb31abb61617a80fd (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
# Maintainer: Gabor Pali <pali.gabor@gmail.com>

pkgname=broadcom-wl
pkgver=6.30.223.271
pkgrel=7
pkgdesc='Broadcom 802.11 Linux STA wireless driver'
arch="x86_64"
url='https://www.broadcom.com/support/download-search/?pf=Wireless+LAN+Infrastructure'
license="custom"
makedepends="linux-lts-dev xz"
depends="linux-lts"
install=
options="!check !strip"
source="broadcom-wl.conf
        Makefile.patch
        001-null-pointer-fix.patch
        002-rdtscl.patch
        003-linux47.patch
        004-linux48.patch
        005-debian-fix-kernel-warnings.patch
        006-linux411.patch
        007-linux412.patch
        008-linux415.patch
        009-fix_mac_profile_discrepancy.patch
        010-linux56.patch
        011-linux59.patch
        https://docs.broadcom.com/docs-and-downloads/docs/linux_sta/hybrid-v35_64-nodebug-pcoem-${pkgver//./_}.tar.gz
	"

_kernver=$(cd /usr/src/ && find . -mindepth 1 -maxdepth 1 -type d | sed 's!./linux-headers-!!')
_kbase="/lib/modules/${_kernver}"

prepare() {
  local _patch_failed=

  for i in $source; do
    case $i in
      *.patch)
        msg "Applying $i..."
        if ! patch -s -p1 -N -i "$srcdir"/$i; then
          echo $i >>failed
          _patch_failed=1
        fi
        ;;
    esac
  done

  if ! [ -z "$_patch_failed" ]; then
    error "The following patches failed:"
    cat failed
    return 1
  fi

  rm -f localversion*

  sed -i -e '/BRCM_WLAN_IFNAME/s/eth/wlan/' src/wl/sys/wl_linux.c
  sed -i '/GE_49 :=/s|:= .*|:= 1|' Makefile
}

build() {
  make KBASE="$_kbase"
}

package() {
  make install -C "$srcdir" KBASE="$pkgdir$_kbase"
  find "$pkgdir" -name "*.ko" -exec xz {} +
  install -Dm644 "$srcdir"/broadcom-wl.conf \
    "$pkgdir"/etc/modprobe.d/broadcom-wl.conf
  install -Dm644 "$srcdir"/lib/LICENSE.txt \
    "$pkgdir"/usr/share/licenses/"$pkgname"/LICENSE.txt
}

sha512sums="
98d0ed53e9fabba0b9ebd36ad7c67b1c50233de857759328bed7b790cdc5db675d5c23739384dd8c4e05f5969bf1c633f5028901508e596665d9ab028b42aebb  broadcom-wl.conf
9ac01eb67bd29573007e878a33207f9f335b85dd7ffa995020157228adfe4234e3febb6582cb25e315392933b3e2d53fd137032db7bda46c265740190d1c49c7  Makefile.patch
4403cad0360b01f8e88faccb77e6239865e9cc2b68dac62896153ab37957f1e73e5e4c95d3e81dac334106a2cd4ef0784955a5fefd8abc6e793a68f182bbffe4  001-null-pointer-fix.patch
b483a4fd5fbb5a4697365b6ddcd8034b4d90ddee9bf2aecf003b0fd6838a708d3e84be33b08acdbe165d440480da25fdf0dfff0d2fe12fa2c5271c51d6ac74c0  002-rdtscl.patch
f61ecfb6b8c5a377c7a4da7549c9ec75677782fa2f97e64de0df1259e0ec3b993cfa3eaa4ff50331703ee18ef28f2af0d09839dd3b63ed994e6b29cbfe8ed73f  003-linux47.patch
e5959921b6f0cd5d61d7ed568f549b0920f394458c28257c05064b89d7067ce11c8e44ed0e5a48a65bd041c6193d9ae2d02fca2f5efbfb787d3f9001786a4578  004-linux48.patch
6209a0a5a46a3efcede3cb1e263467173153d779b6267ba4c20f46421a9abd8743a7068527ace350a3da3ef3046b0399e09b37aba917fabe020c8c2600b60fdf  005-debian-fix-kernel-warnings.patch
b7db17e30731a9cbc940b83f7b62f059529cff6c134e47e2176cd7c6fcd8d028334ed4fe1fdce7cf1aef87590f9664b463383ae3302a6e2aabe1baa79fbc5c95  006-linux411.patch
3b73136488daa2d59586bb7ce704fcb73b7a719bf150517beab1f13f7fb9626281e03dd7ffd3557aa894ce806b6ceef678f3f979b11e762890f20e04d19d2e04  007-linux412.patch
2fb5c3eebd48b6099fb87a9fd92545c17b2abf318b040a434c1b0bdd75a7a682b6e7ec9f80245c198f1c306bbaef35a2488123c5ba8764d5a83eb18132c0857b  008-linux415.patch
4d88a6fbd8266f34b69ad3ab5cfb988d9057743116db5b3bab9ac197eabdf12a1f0cac4fbda815225f48911d62ea3490a0365f864c6686fd1364a406a765034b  009-fix_mac_profile_discrepancy.patch
8fb320c1272246c91fdd99cade2fb67a6ecd924a132c1b9432fa1ff0338444700451ffc6a1cb35e07188c58c5bd1ccaf59ebf014c49f44cb6ba33d1ec732859d  010-linux56.patch
b9a0193ab604da92c99051e2a4fd91e43c3b6aeea7dbda15635b43eabd35b414e197bf5f25ac0d4ec905a1cb75abc15f165428470bc788dbefd73f178d165099  011-linux59.patch
6855781f7c69a9aecb9461932423688964879d5a4df571f01ae7adaa7bf21a410bef839605d555afb6c8f4eec92fe8510af6cb120930095617ff6cdcccedaf17  hybrid-v35_64-nodebug-pcoem-6_30_223_271.tar.gz
"