diff options
author | Alyssa Ross <hi@alyssa.is> | 2023-10-20 22:09:03 +0000 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2023-10-20 22:09:03 +0000 |
commit | 50c21d167f7114fa1dbd95e5c4fb30eeb1a2d02e (patch) | |
tree | f2556b911180125ccbb7ed0e78a54e92da89adce /nixpkgs/pkgs/applications/radio/gnuradio/shared.nix | |
parent | 4c16d4548a98563c9d9ad76f4e5b2202864ccd54 (diff) | |
parent | cfc75eec4603c06503ae750f88cf397e00796ea8 (diff) | |
download | nixlib-50c21d167f7114fa1dbd95e5c4fb30eeb1a2d02e.tar nixlib-50c21d167f7114fa1dbd95e5c4fb30eeb1a2d02e.tar.gz nixlib-50c21d167f7114fa1dbd95e5c4fb30eeb1a2d02e.tar.bz2 nixlib-50c21d167f7114fa1dbd95e5c4fb30eeb1a2d02e.tar.lz nixlib-50c21d167f7114fa1dbd95e5c4fb30eeb1a2d02e.tar.xz nixlib-50c21d167f7114fa1dbd95e5c4fb30eeb1a2d02e.tar.zst nixlib-50c21d167f7114fa1dbd95e5c4fb30eeb1a2d02e.zip |
Merge commit 'cfc75eec4603c06503ae750f88cf397e00796ea8'
Conflicts: nixpkgs/pkgs/build-support/rust/build-rust-package/default.nix
Diffstat (limited to 'nixpkgs/pkgs/applications/radio/gnuradio/shared.nix')
-rw-r--r-- | nixpkgs/pkgs/applications/radio/gnuradio/shared.nix | 38 |
1 files changed, 23 insertions, 15 deletions
diff --git a/nixpkgs/pkgs/applications/radio/gnuradio/shared.nix b/nixpkgs/pkgs/applications/radio/gnuradio/shared.nix index bdbc22cb787d..fbb4960dc8fa 100644 --- a/nixpkgs/pkgs/applications/radio/gnuradio/shared.nix +++ b/nixpkgs/pkgs/applications/radio/gnuradio/shared.nix @@ -5,7 +5,7 @@ , removeReferencesTo , featuresInfo , features -, versionAttr +, version , sourceSha256 # If overridden. No need to set default values, as they are given defaults in # the main expressions @@ -13,10 +13,21 @@ , fetchFromGitHub }: -rec { - version = builtins.concatStringsSep "." ( - lib.attrVals [ "major" "minor" "patch" ] versionAttr +let + # Check if a feature is enabled, while defaulting to true if feat is not + # specified. + hasFeature = feat: ( + if builtins.hasAttr feat features then + features.${feat} + else + true ); + versionAttr = { + major = builtins.concatStringsSep "." (lib.take 2 (lib.splitVersion version)); + minor = builtins.elemAt (lib.splitVersion version) 2; + patch = builtins.elemAt (lib.splitVersion version) 3; + }; +in { src = if overrideSrc != {} then overrideSrc else @@ -27,14 +38,6 @@ rec { sha256 = sourceSha256; } ; - # Check if a feature is enabled, while defaulting to true if feat is not - # specified. - hasFeature = feat: ( - if builtins.hasAttr feat features then - features.${feat} - else - true - ); nativeBuildInputs = lib.flatten (lib.mapAttrsToList ( feat: info: ( lib.optionals (hasFeature feat) ( @@ -109,9 +112,14 @@ rec { # Wrapping is done with an external wrapper dontWrapPythonPrograms = true; dontWrapQtApps = true; - # Tests should succeed, but it's hard to get LD_LIBRARY_PATH right in order - # for it to happen. - doCheck = false; + # On darwin, it requires playing with DYLD_FALLBACK_LIBRARY_PATH to make if + # find libgnuradio-runtim.3.*.dylib . + doCheck = !stdenv.isDarwin; + preCheck = '' + export HOME=$(mktemp -d) + export QT_QPA_PLATFORM=offscreen + export QT_PLUGIN_PATH="${qt.qtbase.bin}/${qt.qtbase.qtPluginPrefix}" + ''; meta = with lib; { description = "Software Defined Radio (SDR) software"; |