2024-09-19 14:19:46 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
fetchurl,
|
|
|
|
fetchFromGitHub,
|
|
|
|
kernel,
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
let
|
|
|
|
version = "6.30.223.271";
|
|
|
|
hashes = {
|
2024-09-19 14:19:46 +00:00
|
|
|
i686-linux = "sha256-T4twspOsjMXHDlca1dGHjQ8p0TOkb+eGmGjZwZtQWM0=";
|
|
|
|
x86_64-linux = "sha256-X3l3TVvuyPdja1nA+wegMQju8eP9MkVjiyCFjHFBRL4=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
arch = lib.optionalString (stdenv.hostPlatform.system == "x86_64-linux") "_64";
|
2024-09-19 14:19:46 +00:00
|
|
|
tarballVersion = lib.replaceStrings [ "." ] [ "_" ] version;
|
2020-04-24 23:36:52 +00:00
|
|
|
tarball = "hybrid-v35${arch}-nodebug-pcoem-${tarballVersion}.tar.gz";
|
2024-09-19 14:19:46 +00:00
|
|
|
|
|
|
|
rpmFusionPatches = fetchFromGitHub {
|
|
|
|
owner = "rpmfusion";
|
|
|
|
repo = "wl-kmod";
|
|
|
|
rev = "a04330284bfc38fd91eade6f8b28fa63cfcdc95e";
|
|
|
|
hash = "sha256-c72Pr/v+nxZPLEeNKbWnSpbH3gqYZaTgzMO9PlYQkf0=";
|
|
|
|
};
|
|
|
|
patchset = [
|
|
|
|
"wl-kmod-001_wext_workaround.patch"
|
|
|
|
"wl-kmod-002_kernel_3.18_null_pointer.patch"
|
|
|
|
"wl-kmod-003_gcc_4.9_remove_TIME_DATE_macros.patch"
|
|
|
|
"wl-kmod-004_kernel_4.3_rdtscl_to_rdtsc.patch"
|
|
|
|
"wl-kmod-005_kernel_4.7_IEEE80211_BAND_to_NL80211_BAND.patch"
|
|
|
|
"wl-kmod-006_gcc_6_fix_indentation_warnings.patch"
|
|
|
|
"wl-kmod-007_kernel_4.8_add_cfg80211_scan_info_struct.patch"
|
|
|
|
"wl-kmod-008_fix_kernel_warnings.patch"
|
|
|
|
"wl-kmod-009_kernel_4.11_remove_last_rx_in_net_device_struct.patch"
|
|
|
|
"wl-kmod-010_kernel_4.12_add_cfg80211_roam_info_struct.patch"
|
|
|
|
"wl-kmod-011_kernel_4.14_new_kernel_read_function_prototype.patch"
|
|
|
|
"wl-kmod-012_kernel_4.15_new_timer.patch"
|
|
|
|
"wl-kmod-013_gcc8_fix_bounds_check_warnings.patch"
|
|
|
|
"wl-kmod-014_kernel_read_pos_increment_fix.patch"
|
|
|
|
"wl-kmod-015_kernel_5.1_get_ds_removed.patch"
|
|
|
|
"wl-kmod-016_fix_unsupported_mesh_point.patch"
|
|
|
|
"wl-kmod-017_fix_gcc_fallthrough_warning.patch"
|
|
|
|
"wl-kmod-018_kernel_5.6_adaptations.patch"
|
|
|
|
"wl-kmod-019_kernel_5.9_segment_eq_removed.patch"
|
|
|
|
"wl-kmod-020_kernel_5.10_get_set_fs_removed.patch"
|
|
|
|
"wl-kmod-021_kernel_5.17_adaptation.patch"
|
|
|
|
"wl-kmod-022_kernel_5.18_adaptation.patch"
|
|
|
|
"wl-kmod-023_kernel_6.0_adaptation.patch"
|
|
|
|
"wl-kmod-024_kernel_6.1_adaptation.patch"
|
|
|
|
"wl-kmod-025_kernel_6.5_adaptation.patch"
|
|
|
|
"wl-kmod-026_kernel_6.10_fix_empty_body_in_if_warning.patch"
|
|
|
|
"wl-kmod-027_wpa_supplicant-2.11_add_max_scan_ie_len.patch"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
in
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
name = "broadcom-sta-${version}-${kernel.version}";
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://docs.broadcom.com/docs-and-downloads/docs/linux_sta/${tarball}";
|
2024-09-19 14:19:46 +00:00
|
|
|
hash =
|
|
|
|
hashes.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
hardeningDisable = [ "pic" ];
|
|
|
|
|
|
|
|
nativeBuildInputs = kernel.moduleBuildDependencies;
|
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
patches = map (patch: "${rpmFusionPatches}/${patch}") patchset;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
makeFlags = [ "KBASE=${kernel.dev}/lib/modules/${kernel.modDirVersion}" ];
|
|
|
|
|
|
|
|
unpackPhase = ''
|
2024-09-19 14:19:46 +00:00
|
|
|
runHook preUnpack
|
2020-04-24 23:36:52 +00:00
|
|
|
sourceRoot=broadcom-sta
|
|
|
|
mkdir "$sourceRoot"
|
|
|
|
tar xvf "$src" -C "$sourceRoot"
|
2024-09-19 14:19:46 +00:00
|
|
|
runHook postUnpack
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
2024-09-19 14:19:46 +00:00
|
|
|
runHook preInstall
|
2020-04-24 23:36:52 +00:00
|
|
|
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"
|
2024-09-19 14:19:46 +00:00
|
|
|
runHook postInstall
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Kernel module driver for some Broadcom's wireless cards";
|
|
|
|
homepage = "http://www.broadcom.com/support/802.11/linux_sta.php";
|
2021-02-05 17:12:51 +00:00
|
|
|
license = lib.licenses.unfreeRedistributable;
|
2024-07-31 10:19:44 +00:00
|
|
|
maintainers = [ ];
|
2021-02-05 17:12:51 +00:00
|
|
|
platforms = lib.platforms.linux;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|