summary refs log tree commit diff
path: root/pkgs/development/gnuradio-modules/mkDerivation.nix
blob: 235eff25cdbd020438eec80098a5442b8dbf1622 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
{ 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 itself by default
    buildInputs = (args.buildInputs or []) ++ [ unwrapped ];
  };
in mkDerivation (args // args_)