2018-07-21 01:44:44 +01:00
|
|
|
{ stdenv, fetchurl, kernel }:
|
2016-08-01 19:26:02 +01:00
|
|
|
|
2014-01-05 01:57:21 +00:00
|
|
|
let
|
2016-08-01 19:26:02 +01:00
|
|
|
version = "6.30.223.271";
|
|
|
|
hashes = {
|
|
|
|
i686-linux = "1kaqa2dw3nb8k23ffvx46g8jj3wdhz8xa6jp1v3wb35cjfr712sg";
|
|
|
|
x86_64-linux = "1gj485qqr190idilacpxwgqyw21il03zph2rddizgj7fbd6pfyaz";
|
|
|
|
};
|
|
|
|
|
2018-08-20 20:11:29 +01:00
|
|
|
arch = stdenv.lib.optionalString (stdenv.hostPlatform.system == "x86_64-linux") "_64";
|
2016-08-01 19:26:02 +01:00
|
|
|
tarballVersion = stdenv.lib.replaceStrings ["."] ["_"] version;
|
|
|
|
tarball = "hybrid-v35${arch}-nodebug-pcoem-${tarballVersion}.tar.gz";
|
2010-12-09 19:05:19 +00:00
|
|
|
in
|
|
|
|
stdenv.mkDerivation {
|
2014-01-05 01:57:21 +00:00
|
|
|
name = "broadcom-sta-${version}-${kernel.version}";
|
|
|
|
|
2016-08-01 19:26:02 +01:00
|
|
|
src = fetchurl {
|
2016-12-08 09:50:31 +00:00
|
|
|
url = "https://docs.broadcom.com/docs-and-downloads/docs/linux_sta/${tarball}";
|
2018-08-20 20:11:29 +01:00
|
|
|
sha256 = hashes.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
|
2016-08-01 19:26:02 +01:00
|
|
|
};
|
2014-01-05 01:57:21 +00:00
|
|
|
|
2016-08-13 15:02:02 +01:00
|
|
|
hardeningDisable = [ "pic" ];
|
|
|
|
|
2018-01-05 03:51:03 +00:00
|
|
|
nativeBuildInputs = kernel.moduleBuildDependencies;
|
|
|
|
|
2014-01-05 01:57:21 +00:00
|
|
|
patches = [
|
2016-08-01 19:26:02 +01:00
|
|
|
./i686-build-failure.patch
|
2014-01-05 01:57:21 +00:00
|
|
|
./license.patch
|
2016-08-01 19:45:47 +01:00
|
|
|
./linux-4.7.patch
|
2017-04-20 06:03:17 +01:00
|
|
|
# source: https://git.archlinux.org/svntogit/community.git/tree/trunk/004-linux48.patch?h=packages/broadcom-wl-dkms
|
|
|
|
./linux-4.8.patch
|
2017-06-02 14:19:04 +01:00
|
|
|
# source: https://aur.archlinux.org/cgit/aur.git/tree/linux411.patch?h=broadcom-wl
|
|
|
|
./linux-4.11.patch
|
2017-07-18 20:32:13 +01:00
|
|
|
# source: https://aur.archlinux.org/cgit/aur.git/tree/linux412.patch?h=broadcom-wl
|
|
|
|
./linux-4.12.patch
|
2018-01-31 22:59:09 +00:00
|
|
|
./linux-4.15.patch
|
2019-05-18 21:36:26 +01:00
|
|
|
./linux-5.1.patch
|
2016-08-01 20:00:02 +01:00
|
|
|
./null-pointer-fix.patch
|
2015-05-05 20:09:51 +01:00
|
|
|
./gcc.patch
|
2014-01-05 01:57:21 +00:00
|
|
|
];
|
|
|
|
|
2019-10-27 13:03:25 +00:00
|
|
|
makeFlags = [ "KBASE=${kernel.dev}/lib/modules/${kernel.modDirVersion}" ];
|
2014-01-05 01:57:21 +00:00
|
|
|
|
|
|
|
unpackPhase = ''
|
2016-08-01 19:57:18 +01:00
|
|
|
sourceRoot=broadcom-sta
|
|
|
|
mkdir "$sourceRoot"
|
|
|
|
tar xvf "$src" -C "$sourceRoot"
|
2014-01-05 01:57:21 +00:00
|
|
|
'';
|
2010-12-09 19:05:19 +00:00
|
|
|
|
2016-08-01 19:57:18 +01:00
|
|
|
installPhase = ''
|
|
|
|
binDir="$out/lib/modules/${kernel.modDirVersion}/kernel/net/wireless/"
|
|
|
|
docDir="$out/share/doc/broadcom-sta/"
|
|
|
|
mkdir -p "$binDir" "$docDir"
|
|
|
|
cp wl.ko "$binDir"
|
|
|
|
cp lib/LICENSE.txt "$docDir"
|
|
|
|
'';
|
2010-12-09 19:05:19 +00:00
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Kernel module driver for some Broadcom's wireless cards";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "http://www.broadcom.com/support/802.11/linux_sta.php";
|
2014-11-06 00:44:33 +00:00
|
|
|
license = stdenv.lib.licenses.unfreeRedistributable;
|
2016-09-10 09:57:48 +01:00
|
|
|
maintainers = with stdenv.lib.maintainers; [ phreedom ];
|
2010-12-09 19:05:19 +00:00
|
|
|
platforms = stdenv.lib.platforms.linux;
|
|
|
|
};
|
|
|
|
}
|