summary refs log tree commit diff
diff options
context:
space:
mode:
authorDoron Behar <doron.behar@gmail.com>2023-10-03 15:23:48 +0300
committerDoron Behar <doron.behar@gmail.com>2023-10-03 15:24:52 +0300
commit441f8ee17f3e6c5ecab2b303c1d0bc19464ece90 (patch)
tree95751c981433bd60d0d6ac54879de42544a7790a
parentc6e3bbc55046c7cea4b3fde2f80512d7fe6b79fc (diff)
downloadnixpkgs-441f8ee17f3e6c5ecab2b303c1d0bc19464ece90.tar
nixpkgs-441f8ee17f3e6c5ecab2b303c1d0bc19464ece90.tar.gz
nixpkgs-441f8ee17f3e6c5ecab2b303c1d0bc19464ece90.tar.bz2
nixpkgs-441f8ee17f3e6c5ecab2b303c1d0bc19464ece90.tar.lz
nixpkgs-441f8ee17f3e6c5ecab2b303c1d0bc19464ece90.tar.xz
nixpkgs-441f8ee17f3e6c5ecab2b303c1d0bc19464ece90.tar.zst
nixpkgs-441f8ee17f3e6c5ecab2b303c1d0bc19464ece90.zip
gnuradio: help nix-update find version string
-rw-r--r--pkgs/applications/radio/gnuradio/3.8.nix13
-rw-r--r--pkgs/applications/radio/gnuradio/3.9.nix13
-rw-r--r--pkgs/applications/radio/gnuradio/default.nix13
-rw-r--r--pkgs/applications/radio/gnuradio/shared.nix27
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 e10d3df374e..a38d8cc542a 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 a393cd5528d..7a1b6829a90 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 a443aec5367..45cf6e09586 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 bdbc22cb787..0a905d8a5c5 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) (