2013-03-24 12:45:00 +01:00
|
|
|
{ stdenv, fetchurl, kernelDev }:
|
2010-12-09 20:05:19 +01:00
|
|
|
|
2012-02-03 21:51:06 +01:00
|
|
|
let version = "5_100_82_112";
|
2010-12-09 20:05:19 +01:00
|
|
|
bits = if stdenv.system == "i686-linux" then "32" else
|
|
|
|
assert stdenv.system == "x86_64-linux"; "64";
|
|
|
|
in
|
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
2013-03-24 12:45:00 +01:00
|
|
|
name = "broadcom-sta-${version}-${kernelDev.version}";
|
2012-07-19 11:42:40 +02:00
|
|
|
|
2010-12-09 20:05:19 +01:00
|
|
|
src = fetchurl {
|
2011-01-02 12:05:02 +01:00
|
|
|
url = "http://www.broadcom.com/docs/linux_sta/hybrid-portsrc_x86_${bits}-v${version}.tar.gz";
|
2010-12-09 20:05:19 +01:00
|
|
|
sha256 = if bits == "32"
|
2012-02-03 21:51:06 +01:00
|
|
|
then "1rvhw9ngw0djxyyjx5m01c0js89zs3xiwmra03al6f9q7cbf7d45"
|
|
|
|
else "1qsarnry10f5m8a73wbr9cg2ifs00sqg6x0ay59l72vl9hb2zlww";
|
2010-12-09 20:05:19 +01:00
|
|
|
};
|
|
|
|
|
2013-03-24 12:45:00 +01:00
|
|
|
buildInputs = [ kernelDev ];
|
2012-07-19 11:42:40 +02:00
|
|
|
patches =
|
|
|
|
[ ./makefile.patch ./linux-2.6.39.patch ./linux-3.2.patch
|
|
|
|
./linux-3.4.patch ./license.patch
|
|
|
|
];
|
2012-03-20 01:02:24 +01:00
|
|
|
|
2013-03-24 12:45:00 +01:00
|
|
|
makeFlags = "KDIR=${kernelDev}/lib/modules/${kernelDev.modDirVersion}/build";
|
2010-12-09 20:05:19 +01:00
|
|
|
|
|
|
|
unpackPhase =
|
|
|
|
''
|
|
|
|
sourceRoot=broadcom-sta
|
|
|
|
mkdir "$sourceRoot"
|
|
|
|
tar xvf "$src" -C "$sourceRoot"
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase =
|
|
|
|
''
|
2013-03-24 12:45:00 +01:00
|
|
|
binDir="$out/lib/modules/${kernelDev.modDirVersion}/kernel/net/wireless/"
|
2010-12-09 20:05:19 +01:00
|
|
|
docDir="$out/share/doc/broadcom-sta/"
|
2012-01-18 21:16:00 +01:00
|
|
|
mkdir -p "$binDir" "$docDir"
|
2010-12-09 20:05:19 +01:00
|
|
|
cp wl.ko "$binDir"
|
|
|
|
cp lib/LICENSE.txt "$docDir"
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Kernel module driver for some Broadcom's wireless cards";
|
|
|
|
homepage = http://www.broadcom.com/support/802.11/linux_sta.php;
|
|
|
|
license = "unfree-redistributable";
|
|
|
|
maintainers = [ stdenv.lib.maintainers.neznalek ];
|
|
|
|
platforms = stdenv.lib.platforms.linux;
|
|
|
|
};
|
|
|
|
}
|