nixpkgs/pkgs/os-specific/linux/crda/default.nix

79 lines
2.4 KiB
Nix
Raw Normal View History

{ lib, stdenv, fetchurl, fetchpatch, libgcrypt, libnl, pkg-config, python3Packages, wireless-regdb }:
2015-12-27 17:53:01 +00:00
stdenv.mkDerivation rec {
pname = "crda";
version = "3.18";
2015-12-27 17:53:01 +00:00
src = fetchurl {
sha256 = "1gydiqgb08d9gbx4l6gv98zg3pljc984m50hmn3ysxcbkxkvkz23";
url = "http://kernel.org/pub/software/network/crda/crda-${version}.tar.xz";
};
2019-12-25 15:08:06 +00:00
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";
})
];
2015-12-27 17:53:01 +00:00
buildInputs = [ libgcrypt libnl ];
nativeBuildInputs = [
pkg-config
2020-08-12 22:46:28 +00:00
python3Packages.pycrypto
2015-12-27 17:53:01 +00:00
];
postPatch = ''
patchShebangs utils/
2020-06-25 00:36:24 +00:00
substituteInPlace Makefile \
--replace ldconfig true \
--replace pkg-config $PKG_CONFIG
2015-12-27 17:53:01 +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/"
2015-12-27 17:53:01 +00:00
"REG_BIN=${wireless-regdb}/lib/crda/regulatory.bin"
];
2017-09-01 12:37:50 +00:00
NIX_CFLAGS_COMPILE = "-Wno-error=unused-const-variable";
2015-12-27 17:53:01 +00:00
buildFlags = [ "all_noverify" ];
enableParallelBuilding = true;
doCheck = true;
checkTarget = "verify";
2019-12-25 15:08:06 +00:00
postInstall = ''
# The patch installs build header
rm $out/include/reglib/keys-gcrypt.h
'';
meta = with lib; {
2015-12-27 17:53:01 +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.
2015-12-27 17:53:01 +00:00
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.
2015-12-27 17:53:01 +00:00
'';
homepage = "http://drvbp1.linux-foundation.org/~mcgrof/rel-html/crda/";
2015-12-27 17:53:01 +00:00
license = licenses.free; # "copyleft-next 0.3.0", as yet without a web site
platforms = platforms.linux;
};
}