at 18.03-beta 64 lines 2.1 kB view raw
1{ stdenv, fetchurl, fetchpatch, kernel }: 2 3let 4 version = "6.30.223.271"; 5 hashes = { 6 i686-linux = "1kaqa2dw3nb8k23ffvx46g8jj3wdhz8xa6jp1v3wb35cjfr712sg"; 7 x86_64-linux = "1gj485qqr190idilacpxwgqyw21il03zph2rddizgj7fbd6pfyaz"; 8 }; 9 10 arch = stdenv.lib.optionalString (stdenv.system == "x86_64-linux") "_64"; 11 tarballVersion = stdenv.lib.replaceStrings ["."] ["_"] version; 12 tarball = "hybrid-v35${arch}-nodebug-pcoem-${tarballVersion}.tar.gz"; 13in 14stdenv.mkDerivation { 15 name = "broadcom-sta-${version}-${kernel.version}"; 16 17 src = fetchurl { 18 url = "https://docs.broadcom.com/docs-and-downloads/docs/linux_sta/${tarball}"; 19 sha256 = hashes.${stdenv.system} or (throw "Unsupported system: ${stdenv.system}"); 20 }; 21 22 hardeningDisable = [ "pic" ]; 23 24 nativeBuildInputs = kernel.moduleBuildDependencies; 25 26 patches = [ 27 ./i686-build-failure.patch 28 ./license.patch 29 ./linux-4.7.patch 30 # source: https://git.archlinux.org/svntogit/community.git/tree/trunk/004-linux48.patch?h=packages/broadcom-wl-dkms 31 ./linux-4.8.patch 32 # source: https://aur.archlinux.org/cgit/aur.git/tree/linux411.patch?h=broadcom-wl 33 ./linux-4.11.patch 34 # source: https://aur.archlinux.org/cgit/aur.git/tree/linux412.patch?h=broadcom-wl 35 ./linux-4.12.patch 36 ./linux-4.15.patch 37 ./null-pointer-fix.patch 38 ./gcc.patch 39 ]; 40 41 makeFlags = "KBASE=${kernel.dev}/lib/modules/${kernel.modDirVersion}"; 42 43 unpackPhase = '' 44 sourceRoot=broadcom-sta 45 mkdir "$sourceRoot" 46 tar xvf "$src" -C "$sourceRoot" 47 ''; 48 49 installPhase = '' 50 binDir="$out/lib/modules/${kernel.modDirVersion}/kernel/net/wireless/" 51 docDir="$out/share/doc/broadcom-sta/" 52 mkdir -p "$binDir" "$docDir" 53 cp wl.ko "$binDir" 54 cp lib/LICENSE.txt "$docDir" 55 ''; 56 57 meta = { 58 description = "Kernel module driver for some Broadcom's wireless cards"; 59 homepage = http://www.broadcom.com/support/802.11/linux_sta.php; 60 license = stdenv.lib.licenses.unfreeRedistributable; 61 maintainers = with stdenv.lib.maintainers; [ phreedom ]; 62 platforms = stdenv.lib.platforms.linux; 63 }; 64}