diff options
author | Doron Behar <doron.behar@gmail.com> | 2023-10-03 15:23:48 +0300 |
---|---|---|
committer | Doron Behar <doron.behar@gmail.com> | 2023-10-03 15:24:52 +0300 |
commit | 441f8ee17f3e6c5ecab2b303c1d0bc19464ece90 (patch) | |
tree | 95751c981433bd60d0d6ac54879de42544a7790a /pkgs/applications/radio | |
parent | c6e3bbc55046c7cea4b3fde2f80512d7fe6b79fc (diff) | |
download | nixlib-441f8ee17f3e6c5ecab2b303c1d0bc19464ece90.tar nixlib-441f8ee17f3e6c5ecab2b303c1d0bc19464ece90.tar.gz nixlib-441f8ee17f3e6c5ecab2b303c1d0bc19464ece90.tar.bz2 nixlib-441f8ee17f3e6c5ecab2b303c1d0bc19464ece90.tar.lz nixlib-441f8ee17f3e6c5ecab2b303c1d0bc19464ece90.tar.xz nixlib-441f8ee17f3e6c5ecab2b303c1d0bc19464ece90.tar.zst nixlib-441f8ee17f3e6c5ecab2b303c1d0bc19464ece90.zip |
gnuradio: help nix-update find version string
Diffstat (limited to 'pkgs/applications/radio')
-rw-r--r-- | pkgs/applications/radio/gnuradio/3.8.nix | 13 | ||||
-rw-r--r-- | pkgs/applications/radio/gnuradio/3.9.nix | 13 | ||||
-rw-r--r-- | pkgs/applications/radio/gnuradio/default.nix | 13 | ||||
-rw-r--r-- | pkgs/applications/radio/gnuradio/shared.nix | 27 |
4 files changed, 27 insertions, 39 deletions
diff --git a/pkgs/applications/radio/gnuradio/3.8.nix b/pkgs/applications/radio/gnuradio/3.8.nix index e10d3df374e2..a38d8cc542a0 100644 --- a/pkgs/applications/radio/gnuradio/3.8.nix +++ b/pkgs/applications/radio/gnuradio/3.8.nix @@ -40,11 +40,7 @@ # If one wishes to use a different src or name for a very custom build , overrideSrc ? {} , pname ? "gnuradio" -, versionAttr ? { - major = "3.8"; - minor = "5"; - patch = "0"; -} +, version ? "3.8.5.0" }: let @@ -214,7 +210,7 @@ let removeReferencesTo featuresInfo features - versionAttr + version sourceSha256 overrideSrc fetchFromGitHub @@ -222,13 +218,12 @@ let qt = qt5; gtk = gtk3; }); - inherit (shared) hasFeature; # function + inherit (shared.passthru) hasFeature; # function in stdenv.mkDerivation { - inherit pname; + inherit pname version; inherit (shared) - version src nativeBuildInputs buildInputs diff --git a/pkgs/applications/radio/gnuradio/3.9.nix b/pkgs/applications/radio/gnuradio/3.9.nix index a393cd5528d5..7a1b6829a90e 100644 --- a/pkgs/applications/radio/gnuradio/3.9.nix +++ b/pkgs/applications/radio/gnuradio/3.9.nix @@ -42,11 +42,7 @@ # If one wishes to use a different src or name for a very custom build , overrideSrc ? {} , pname ? "gnuradio" -, versionAttr ? { - major = "3.9"; - minor = "8"; - patch = "0"; -} +, version ? "3.9.8.0" }: let @@ -250,7 +246,7 @@ let removeReferencesTo featuresInfo features - versionAttr + version sourceSha256 overrideSrc fetchFromGitHub @@ -258,13 +254,12 @@ let qt = qt5; gtk = gtk3; }); - inherit (shared) hasFeature; # function + inherit (shared.passthru) hasFeature; # function in stdenv.mkDerivation { - inherit pname; + inherit pname version; inherit (shared) - version src nativeBuildInputs buildInputs diff --git a/pkgs/applications/radio/gnuradio/default.nix b/pkgs/applications/radio/gnuradio/default.nix index a443aec53678..45cf6e09586b 100644 --- a/pkgs/applications/radio/gnuradio/default.nix +++ b/pkgs/applications/radio/gnuradio/default.nix @@ -45,11 +45,7 @@ # If one wishes to use a different src or name for a very custom build , overrideSrc ? {} , pname ? "gnuradio" -, versionAttr ? { - major = "3.10"; - minor = "7"; - patch = "0"; -} +, version ? "3.10.7.0" }: let @@ -271,7 +267,7 @@ let removeReferencesTo featuresInfo features - versionAttr + version sourceSha256 overrideSrc fetchFromGitHub @@ -279,13 +275,12 @@ let qt = qt5; gtk = gtk3; }); - inherit (shared) hasFeature; # function + inherit (shared.passthru) hasFeature; # function in stdenv.mkDerivation { - inherit pname; + inherit pname version; inherit (shared) - version src nativeBuildInputs buildInputs diff --git a/pkgs/applications/radio/gnuradio/shared.nix b/pkgs/applications/radio/gnuradio/shared.nix index bdbc22cb787d..0a905d8a5c5f 100644 --- a/pkgs/applications/radio/gnuradio/shared.nix +++ b/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) ( |