3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/development/gnuradio-modules/mkDerivation.nix
Doron Behar 650ee258fd gnuradio3_{7,8}: Use external volk
Now that volk is packaged, we can use our build and save some closure
space for those that have more then 1 version of gnuradio installed.
Also, simplify a bit how attributes are inherited in the expression.
2021-03-13 19:07:20 +02:00

26 lines
812 B
Nix

{ lib
, unwrapped
}:
mkDerivation:
args:
# Check if it's supposed to not get built for the current gnuradio version
if (builtins.hasAttr "disabledForGRafter" args) &&
(lib.versionAtLeast unwrapped.versionAttr.major args.disabledForGRafter) then
let name = args.name or "${args.pname}"; in
throw "Package ${name} is incompatible with GNURadio ${unwrapped.versionAttr.major}"
else
let
args_ = {
enableParallelBuilding = args.enableParallelBuilding or true;
nativeBuildInputs = (args.nativeBuildInputs or []);
# We add gnuradio and volk itself by default - most gnuradio based packages
# will not consider it a depenency worth mentioning and it will almost
# always be needed
buildInputs = (args.buildInputs or []) ++ [ unwrapped unwrapped.volk ];
};
in mkDerivation (args // args_)