From 0a4c46a0938e790e062e8bf355f3672306ce9aa2 Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Tue, 20 Jan 2026 12:27:17 +0200 Subject: [PATCH] uhd: fix build on Darwin by using llvm 20 Co-Authored-By: fmeef --- pkgs/by-name/uh/uhd/package.nix | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/pkgs/by-name/uh/uhd/package.nix b/pkgs/by-name/uh/uhd/package.nix index 09368516d564..75275f5b3cc9 100644 --- a/pkgs/by-name/uh/uhd/package.nix +++ b/pkgs/by-name/uh/uhd/package.nix @@ -1,6 +1,7 @@ { lib, stdenv, + llvmPackages_20, fetchurl, fetchFromGitHub, cmake, @@ -34,9 +35,17 @@ let inherit (lib) optionals cmakeBool; + stdenv' = ( + # Fix a compilation issue on Darwin, that upstream is aware of: + # https://github.com/EttusResearch/uhd/issues/881 + if stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64 then + llvmPackages_20.stdenv + else + stdenv + ); in -stdenv.mkDerivation (finalAttrs: { +stdenv'.mkDerivation (finalAttrs: { pname = "uhd"; # NOTE: Use the following command to update the package, and the uhdImageSrc attribute: # @@ -147,7 +156,7 @@ stdenv.mkDerivation (finalAttrs: { # ABI differences GCC 7.1 # /nix/store/wd6r25miqbk9ia53pp669gn4wrg9n9cj-gcc-7.3.0/include/c++/7.3.0/bits/vector.tcc:394:7: note: parameter passing for argument of type 'std::vector::iterator {aka __gnu_cxx::__normal_iterator >}' changed in GCC 7.1 ] - ++ optionals stdenv.hostPlatform.isAarch32 [ + ++ optionals stdenv'.hostPlatform.isAarch32 [ "-DCMAKE_CXX_FLAGS=-Wno-psabi" ]; @@ -180,7 +189,7 @@ stdenv.mkDerivation (finalAttrs: { ]; # many tests fails on darwin, according to ofborg - doCheck = !stdenv.hostPlatform.isDarwin; + doCheck = !stdenv'.hostPlatform.isDarwin; doInstallCheck = true; @@ -191,7 +200,7 @@ stdenv.mkDerivation (finalAttrs: { "installFirmware" "removeInstalledTests" ] - ++ optionals (enableUtils && stdenv.hostPlatform.isLinux) [ + ++ optionals (enableUtils && stdenv'.hostPlatform.isLinux) [ "moveUdevRules" ];