summary refs log tree commit diff
path: root/pkgs/applications/radio/uhd/default.nix
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2023-09-27 18:40:33 +0000
committerAlyssa Ross <hi@alyssa.is>2023-09-27 18:40:41 +0000
commit030c5028b07afcedce7c5956015c629486cc79d9 (patch)
tree4c3cb9c6cff0e30919a97fc0c1d3203446696f4e /pkgs/applications/radio/uhd/default.nix
parent4b852f7ef3cb92277f212ba7dc168da1073e65cc (diff)
parent04c0744afbab2369baf4f134c544db3f24164d80 (diff)
downloadnixpkgs-030c5028b07afcedce7c5956015c629486cc79d9.tar
nixpkgs-030c5028b07afcedce7c5956015c629486cc79d9.tar.gz
nixpkgs-030c5028b07afcedce7c5956015c629486cc79d9.tar.bz2
nixpkgs-030c5028b07afcedce7c5956015c629486cc79d9.tar.lz
nixpkgs-030c5028b07afcedce7c5956015c629486cc79d9.tar.xz
nixpkgs-030c5028b07afcedce7c5956015c629486cc79d9.tar.zst
nixpkgs-030c5028b07afcedce7c5956015c629486cc79d9.zip
Rebase onto c1a53897ad4290a1cbfa02fbe6f3869577b93744
Signed-off-by: Alyssa Ross <hi@alyssa.is>
Diffstat (limited to 'pkgs/applications/radio/uhd/default.nix')
-rw-r--r--pkgs/applications/radio/uhd/default.nix13
1 files changed, 7 insertions, 6 deletions
diff --git a/pkgs/applications/radio/uhd/default.nix b/pkgs/applications/radio/uhd/default.nix
index 873c49dd9a7..23c0a728586 100644
--- a/pkgs/applications/radio/uhd/default.nix
+++ b/pkgs/applications/radio/uhd/default.nix
@@ -41,7 +41,7 @@ let
   );
 in
 
-stdenv.mkDerivation rec {
+stdenv.mkDerivation (finalAttrs: {
   pname = "uhd";
   # UHD seems to use three different version number styles: x.y.z, xxx_yyy_zzz
   # and xxx.yyy.zzz. Hrmpf... style keeps changing
@@ -52,14 +52,15 @@ stdenv.mkDerivation rec {
   src = fetchFromGitHub {
     owner = "EttusResearch";
     repo = "uhd";
-    rev = "v${version}";
+    rev = "v${finalAttrs.version}";
     sha256 = "sha256-khVOHlvacZc4EMg4m55rxEqPvLY1xURpAfOW905/3jg=";
   };
   # Firmware images are downloaded (pre-built) from the respective release on Github
   uhdImagesSrc = fetchurl {
-    url = "https://github.com/EttusResearch/uhd/releases/download/v${version}/uhd-images_${version}.tar.xz";
+    url = "https://github.com/EttusResearch/uhd/releases/download/v${finalAttrs.version}/uhd-images_${finalAttrs.version}.tar.xz";
     sha256 = "V8ldW8bvYWbrDAvpWpHcMeLf9YvF8PIruDAyNK/bru4=";
   };
+  # TODO: Add passthru.updateScript that will update both of the above hashes...
 
   cmakeFlags = [
     "-DENABLE_LIBUHD=ON"
@@ -105,7 +106,7 @@ stdenv.mkDerivation rec {
     # pythonEnv for runtime as well. The utilities' runtime dependencies are
     # handled at the environment
     ++ optionals (enableExamples) [ ncurses ncurses.dev ]
-    ++ optionals (enablePythonApi || enableUtils) [ pythonEnv ]
+    ++ optionals (enablePythonApi || enableUtils) [ finalAttrs.pythonEnv ]
     ++ optionals (enableDpdk) [ dpdk ]
   ;
 
@@ -128,7 +129,7 @@ stdenv.mkDerivation rec {
   # UHD expects images in `$CMAKE_INSTALL_PREFIX/share/uhd/images`
   installFirmware = ''
     mkdir -p "$out/share/uhd/images"
-    tar --strip-components=1 -xvf "${uhdImagesSrc}" -C "$out/share/uhd/images"
+    tar --strip-components=1 -xvf "${finalAttrs.uhdImagesSrc}" -C "$out/share/uhd/images"
   '';
 
   # -DENABLE_TESTS=ON installs the tests, we don't need them in the output
@@ -157,4 +158,4 @@ stdenv.mkDerivation rec {
     platforms = platforms.linux ++ platforms.darwin;
     maintainers = with maintainers; [ bjornfor fpletz tomberek doronbehar ];
   };
-}
+})