about summary refs log tree commit diff
path: root/pkgs/development/gnuradio-modules/mkDerivation.nix
blob: 11ac506260ad03c3df4002fa8b6ba5d506b38b00 (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
24
25
26
27
28
29
30
31
{ lib
, unwrapped
}:

mkDerivation:

args:

# Check if it's supposed to not get built for the current gnuradio version
if (builtins.hasAttr "disabled" args) && args.disabled then
let name = args.name or "${args.pname}"; in
throw "Package ${name} is incompatible with GNURadio ${unwrapped.versionAttr.major}"
else

if builtins.hasAttr "disabledForGRafter" args then
throw ''
  `disabledForGRafter` is superseded by `disabled`.
  Use `disabled = gnuradioAtLeast "${args.disabledForGRafter}";` instead.
''
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_)