forked from mirrors/nixpkgs
4fa4ab3a6e
First, pass in `self' again so that overriding works properly (thanks for pointing that out, @edolstra) Second, instead of having linuxPackages*.kernel mean something different inside the set and out, add a new attribute linuxPackages*.kernelDev, which for the generic kernel is simply linuxPackages*.kernel but for the manual-config kernel is the `dev' output (which has the build tree, source tree, etc.) The second change required trivial modifications in a bunch of expressions, I verified that all of the linuxPackages* sets defined in all-packages.nix have the same drv paths before and after the change. Signed-off-by: Shea Levy <shea@shealevy.com>
50 lines
1.4 KiB
Nix
50 lines
1.4 KiB
Nix
{ stdenv, fetchurl, kernelDev }:
|
|
|
|
let version = "5_100_82_112";
|
|
bits = if stdenv.system == "i686-linux" then "32" else
|
|
assert stdenv.system == "x86_64-linux"; "64";
|
|
in
|
|
|
|
stdenv.mkDerivation {
|
|
name = "broadcom-sta-${version}-${kernelDev.version}";
|
|
|
|
src = fetchurl {
|
|
url = "http://www.broadcom.com/docs/linux_sta/hybrid-portsrc_x86_${bits}-v${version}.tar.gz";
|
|
sha256 = if bits == "32"
|
|
then "1rvhw9ngw0djxyyjx5m01c0js89zs3xiwmra03al6f9q7cbf7d45"
|
|
else "1qsarnry10f5m8a73wbr9cg2ifs00sqg6x0ay59l72vl9hb2zlww";
|
|
};
|
|
|
|
buildInputs = [ kernelDev ];
|
|
patches =
|
|
[ ./makefile.patch ./linux-2.6.39.patch ./linux-3.2.patch
|
|
./linux-3.4.patch ./license.patch
|
|
];
|
|
|
|
makeFlags = "KDIR=${kernelDev}/lib/modules/${kernelDev.modDirVersion}/build";
|
|
|
|
unpackPhase =
|
|
''
|
|
sourceRoot=broadcom-sta
|
|
mkdir "$sourceRoot"
|
|
tar xvf "$src" -C "$sourceRoot"
|
|
'';
|
|
|
|
installPhase =
|
|
''
|
|
binDir="$out/lib/modules/${kernelDev.modDirVersion}/kernel/net/wireless/"
|
|
docDir="$out/share/doc/broadcom-sta/"
|
|
mkdir -p "$binDir" "$docDir"
|
|
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;
|
|
};
|
|
}
|