about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/gnuradio-modules/mkDerivation.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/gnuradio-modules/mkDerivation.nix')
-rw-r--r--nixpkgs/pkgs/development/gnuradio-modules/mkDerivation.nix25
1 files changed, 25 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/gnuradio-modules/mkDerivation.nix b/nixpkgs/pkgs/development/gnuradio-modules/mkDerivation.nix
new file mode 100644
index 000000000000..014968f82cc6
--- /dev/null
+++ b/nixpkgs/pkgs/development/gnuradio-modules/mkDerivation.nix
@@ -0,0 +1,25 @@
+{ 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_)