2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv, fetchurl, fetchpatch, libgcrypt, libnl, pkg-config, python3Packages, wireless-regdb }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "crda";
|
|
|
|
version = "3.18";
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
sha256 = "1gydiqgb08d9gbx4l6gv98zg3pljc984m50hmn3ysxcbkxkvkz23";
|
|
|
|
url = "http://kernel.org/pub/software/network/crda/crda-${version}.tar.xz";
|
|
|
|
};
|
|
|
|
|
|
|
|
patches = [
|
|
|
|
# Switch to Python 3
|
|
|
|
# https://lore.kernel.org/linux-wireless/1437542484-23409-1-git-send-email-ahmed.taahir@gmail.com/
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://lore.kernel.org/linux-wireless/1437542484-23409-2-git-send-email-ahmed.taahir@gmail.com/raw";
|
|
|
|
sha256 = "0s2n340cgaasvg1k8g9v8xjrbh4y2mcgrhdmv97ja2fs8xjcjbf1";
|
|
|
|
})
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://lore.kernel.org/linux-wireless/1437542484-23409-3-git-send-email-ahmed.taahir@gmail.com/raw";
|
|
|
|
sha256 = "01dlfw7kqhyx025jxq2l75950b181p9r7i9zkflcwvbzzdmx59md";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [ libgcrypt libnl ];
|
|
|
|
nativeBuildInputs = [
|
2021-02-05 17:12:51 +00:00
|
|
|
pkg-config
|
2020-08-20 17:08:02 +00:00
|
|
|
python3Packages.pycrypto
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
patchShebangs utils/
|
2020-07-18 16:06:22 +00:00
|
|
|
substituteInPlace Makefile \
|
|
|
|
--replace ldconfig true \
|
|
|
|
--replace pkg-config $PKG_CONFIG
|
2020-04-24 23:36:52 +00:00
|
|
|
sed -i crda.c \
|
|
|
|
-e "/\/usr\/.*\/regulatory.bin/d" \
|
|
|
|
-e "s|/lib/crda|${wireless-regdb}/lib/crda|g"
|
|
|
|
'';
|
|
|
|
|
|
|
|
makeFlags = [
|
|
|
|
"PREFIX=$(out)"
|
|
|
|
"SBINDIR=$(out)/bin/"
|
|
|
|
"UDEV_RULE_DIR=$(out)/lib/udev/rules.d/"
|
|
|
|
"REG_BIN=${wireless-regdb}/lib/crda/regulatory.bin"
|
|
|
|
];
|
|
|
|
|
|
|
|
NIX_CFLAGS_COMPILE = "-Wno-error=unused-const-variable";
|
|
|
|
|
|
|
|
buildFlags = [ "all_noverify" ];
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
checkTarget = "verify";
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
# The patch installs build header
|
|
|
|
rm $out/include/reglib/keys-gcrypt.h
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Linux wireless Central Regulatory Domain Agent";
|
|
|
|
longDescription = ''
|
|
|
|
CRDA acts as the udev helper for communication between the kernel and
|
|
|
|
userspace for regulatory compliance. It relies on nl80211 for communication.
|
|
|
|
|
|
|
|
CRDA is intended to be run only through udev communication from the kernel.
|
|
|
|
To use it under NixOS, add
|
|
|
|
|
|
|
|
services.udev.packages = [ pkgs.crda ];
|
|
|
|
|
|
|
|
to the system configuration.
|
|
|
|
'';
|
|
|
|
homepage = "http://drvbp1.linux-foundation.org/~mcgrof/rel-html/crda/";
|
|
|
|
license = licenses.free; # "copyleft-next 0.3.0", as yet without a web site
|
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|