From 68f3004020cbce11a102e367d79578297dbd2783 Mon Sep 17 00:00:00 2001 From: Audrey Dutcher Date: Sat, 16 Nov 2024 11:08:09 -0700 Subject: [PATCH 1/4] libmpc: use updateAutotoolsGnuConfigScriptsHook for FreeBSD native --- pkgs/by-name/li/libmpc/package.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/by-name/li/libmpc/package.nix b/pkgs/by-name/li/libmpc/package.nix index 053f0113b444..eaa5943ffe14 100644 --- a/pkgs/by-name/li/libmpc/package.nix +++ b/pkgs/by-name/li/libmpc/package.nix @@ -1,5 +1,6 @@ { lib, stdenv, fetchurl , gmp, mpfr +, updateAutotoolsGnuConfigScriptsHook }: # Note: this package is used for bootstrapping fetchurl, and thus @@ -20,6 +21,10 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; buildInputs = [ gmp mpfr ]; + nativeBuildInputs = [ + # needed until config scripts are updated to not use /usr/bin/uname on FreeBSD native + updateAutotoolsGnuConfigScriptsHook + ]; doCheck = true; # not cross; From d77191f776ca1809609c98cf968b8e4ef2f8e0d3 Mon Sep 17 00:00:00 2001 From: Audrey Dutcher Date: Sat, 16 Nov 2024 11:09:15 -0700 Subject: [PATCH 2/4] libiberty: fix references to /usr/bin/uname for FreeBSD build system --- pkgs/by-name/li/libiberty/package.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkgs/by-name/li/libiberty/package.nix b/pkgs/by-name/li/libiberty/package.nix index 2040ef3bee08..fc7584e484df 100644 --- a/pkgs/by-name/li/libiberty/package.nix +++ b/pkgs/by-name/li/libiberty/package.nix @@ -14,6 +14,12 @@ stdenv.mkDerivation { postUnpack = "sourceRoot=\${sourceRoot}/libiberty"; + # needed until config scripts are updated to not use /usr/bin/uname on FreeBSD native + # updateAutotoolsGnuConfigScriptsHook doesn't seem to work here + postPatch = '' + substituteInPlace ../config.guess --replace-fail /usr/bin/uname uname + ''; + configureFlags = [ "--enable-install-libiberty" ] ++ lib.optional (!staticBuild) "--enable-shared"; From 59c5439ea8f18a2c6fe37de3932e09d00af380ee Mon Sep 17 00:00:00 2001 From: Audrey Dutcher Date: Sat, 16 Nov 2024 11:10:23 -0700 Subject: [PATCH 3/4] isl: use updateAutotoolsGnuConfigScriptsHook to fix build on FreeBSD native --- pkgs/development/libraries/isl/generic.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pkgs/development/libraries/isl/generic.nix b/pkgs/development/libraries/isl/generic.nix index 8974839dca26..e8612a916532 100644 --- a/pkgs/development/libraries/isl/generic.nix +++ b/pkgs/development/libraries/isl/generic.nix @@ -11,6 +11,7 @@ , gmp , autoreconfHook , buildPackages +, updateAutotoolsGnuConfigScriptsHook }: stdenv.mkDerivation { @@ -25,7 +26,12 @@ stdenv.mkDerivation { strictDeps = true; depsBuildBuild = lib.optionals (lib.versionAtLeast version "0.24") [ buildPackages.stdenv.cc ]; - nativeBuildInputs = lib.optionals (stdenv.hostPlatform.isRiscV && lib.versionOlder version "0.24") [ autoreconfHook ]; + nativeBuildInputs = lib.optionals (stdenv.hostPlatform.isRiscV && lib.versionOlder version "0.24") [ + autoreconfHook + ] ++ [ + # needed until config scripts are updated to not use /usr/bin/uname on FreeBSD native + updateAutotoolsGnuConfigScriptsHook + ]; buildInputs = [ gmp ]; inherit configureFlags; From 05dc4b5ac8bb35cb2451075a0ba03df992fed6fe Mon Sep 17 00:00:00 2001 From: Audrey Dutcher Date: Sat, 16 Nov 2024 11:14:25 -0700 Subject: [PATCH 4/4] libllvm: use updateAutotoolsGnuConfigScriptsHook to fix FreeBSD->other cross build --- pkgs/development/compilers/llvm/common/llvm/default.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pkgs/development/compilers/llvm/common/llvm/default.nix b/pkgs/development/compilers/llvm/common/llvm/default.nix index ce35c039fc8c..c696b001aa31 100644 --- a/pkgs/development/compilers/llvm/common/llvm/default.nix +++ b/pkgs/development/compilers/llvm/common/llvm/default.nix @@ -24,6 +24,7 @@ , which , sysctl , buildLlvmTools +, updateAutotoolsGnuConfigScriptsHook , debugVersion ? false , doCheck ? !stdenv.hostPlatform.isAarch32 && (if lib.versionOlder release_version "15" then stdenv.hostPlatform.isLinux else true) && (!stdenv.hostPlatform.isx86_32 /* TODO: why */) && (!stdenv.hostPlatform.isMusl) @@ -112,7 +113,12 @@ stdenv.mkDerivation (finalAttrs: { "shadowstack" ]; - nativeBuildInputs = [ cmake ] + nativeBuildInputs = [ + cmake + # while this is not an autotools build, it still includes a config.guess + # this is needed until scripts are updated to not use /usr/bin/uname on FreeBSD native + updateAutotoolsGnuConfigScriptsHook + ] ++ (lib.optional (lib.versionAtLeast release_version "15") ninja) ++ [ python ] ++ optionals enableManpages [