From 846de80d1cc8afab75283f4b4251a6281d6c0295 Mon Sep 17 00:00:00 2001 From: Audrey Dutcher Date: Tue, 21 May 2024 14:50:29 -0700 Subject: [PATCH] various: Enable updateAutotoolsGnuConfigScriptsHook Prior to August 2023, any config.guess generated by autoconf will include a hardcoded /usr/bin/uname invocation for FreeBSD on any architecture other than arm. This clearly doesn't work under nix. We must then update or otherwise patch each old config.guess. --- pkgs/applications/networking/sync/rsync/default.nix | 3 ++- pkgs/development/libraries/c-ares/default.nix | 4 ++-- pkgs/development/libraries/expat/default.nix | 2 ++ pkgs/development/libraries/gdbm/default.nix | 4 +++- pkgs/development/libraries/gettext/default.nix | 5 ++++- pkgs/development/libraries/kerberos/krb5.nix | 5 +++++ pkgs/development/libraries/libev/default.nix | 4 +++- pkgs/development/libraries/libssh2/default.nix | 6 ++++++ pkgs/development/libraries/libxcrypt/default.nix | 6 ++++++ pkgs/development/libraries/lzo/default.nix | 4 +++- pkgs/development/libraries/mpdecimal/default.nix | 4 +++- pkgs/development/libraries/ncurses/default.nix | 2 ++ pkgs/development/libraries/nghttp2/default.nix | 6 ++++++ pkgs/development/libraries/pcre2/default.nix | 3 +++ pkgs/development/libraries/popt/default.nix | 3 +++ pkgs/development/libraries/readline/8.2.nix | 2 ++ pkgs/development/libraries/sqlite/default.nix | 2 ++ .../tools/build-managers/gnumake/default.nix | 3 ++- .../tools/misc/automake/automake-1.16.x.nix | 4 ++-- pkgs/development/tools/misc/dejagnu/default.nix | 4 ++-- pkgs/development/tools/misc/gnum4/default.nix | 9 +++++++-- pkgs/development/tools/misc/libtool/libtool2.nix | 3 ++- pkgs/development/tools/misc/pkg-config/default.nix | 11 ++++++++--- pkgs/development/tools/misc/texinfo/common.nix | 3 ++- pkgs/servers/x11/xorg/overrides.nix | 3 ++- pkgs/shells/bash/5.nix | 3 ++- pkgs/tools/archivers/gnutar/default.nix | 5 +++-- pkgs/tools/archivers/sharutils/default.nix | 3 ++- pkgs/tools/compression/gzip/default.nix | 5 +++-- pkgs/tools/compression/xz/default.nix | 6 ++++++ pkgs/tools/misc/file/default.nix | 4 +++- pkgs/tools/misc/findutils/default.nix | 2 ++ pkgs/tools/networking/curl/default.nix | 3 +++ pkgs/tools/text/diffutils/default.nix | 4 ++-- pkgs/tools/text/gnugrep/default.nix | 3 ++- pkgs/tools/text/gnused/default.nix | 4 ++-- 36 files changed, 114 insertions(+), 33 deletions(-) diff --git a/pkgs/applications/networking/sync/rsync/default.nix b/pkgs/applications/networking/sync/rsync/default.nix index 5216617bf4d1..555fb68416b8 100644 --- a/pkgs/applications/networking/sync/rsync/default.nix +++ b/pkgs/applications/networking/sync/rsync/default.nix @@ -1,6 +1,7 @@ { lib , stdenv , fetchurl +, updateAutotoolsGnuConfigScriptsHook , perl , libiconv , zlib @@ -28,7 +29,7 @@ stdenv.mkDerivation rec { hash = "sha256-c5nppnCMMtZ4pypjIZ6W8jvgviM25Q/RNISY0HBB35A="; }; - nativeBuildInputs = [ perl ]; + nativeBuildInputs = [ updateAutotoolsGnuConfigScriptsHook perl ]; buildInputs = [ libiconv zlib popt ] ++ lib.optional enableACLs acl diff --git a/pkgs/development/libraries/c-ares/default.nix b/pkgs/development/libraries/c-ares/default.nix index 87b86036cff2..e0bc7941b39e 100644 --- a/pkgs/development/libraries/c-ares/default.nix +++ b/pkgs/development/libraries/c-ares/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchurl, writeTextDir +{ lib, stdenv, fetchurl, updateAutotoolsGnuConfigScriptsHook , withCMake ? true, cmake # sensitive downstream packages @@ -22,7 +22,7 @@ stdenv.mkDerivation rec { outputs = [ "out" "dev" "man" ]; - nativeBuildInputs = lib.optionals withCMake [ cmake ]; + nativeBuildInputs = [ updateAutotoolsGnuConfigScriptsHook ] ++ lib.optionals withCMake [ cmake ]; cmakeFlags = [] ++ lib.optionals stdenv.hostPlatform.isStatic [ "-DCARES_SHARED=OFF" diff --git a/pkgs/development/libraries/expat/default.nix b/pkgs/development/libraries/expat/default.nix index 9944277e946b..a26fd46abfde 100644 --- a/pkgs/development/libraries/expat/default.nix +++ b/pkgs/development/libraries/expat/default.nix @@ -1,6 +1,7 @@ { lib , stdenv , fetchurl +, updateAutotoolsGnuConfigScriptsHook # for passthru.tests , python3 , perlPackages @@ -29,6 +30,7 @@ stdenv.mkDerivation (finalAttrs: { }; strictDeps = true; + nativeBuildInputs = [ updateAutotoolsGnuConfigScriptsHook ]; outputs = [ "out" "dev" ]; # TODO: fix referrers outputBin = "dev"; diff --git a/pkgs/development/libraries/gdbm/default.nix b/pkgs/development/libraries/gdbm/default.nix index e1a3def0ba42..d6ed7d32e701 100644 --- a/pkgs/development/libraries/gdbm/default.nix +++ b/pkgs/development/libraries/gdbm/default.nix @@ -1,4 +1,4 @@ -{ stdenv, lib, fetchurl }: +{ stdenv, lib, fetchurl, updateAutotoolsGnuConfigScriptsHook }: stdenv.mkDerivation rec { pname = "gdbm"; @@ -9,6 +9,8 @@ stdenv.mkDerivation rec { sha256 = "sha256-dLEIHSH/8TrkvXwW5dblBKTCb3zeHcoNljpIQXS7ys0="; }; + nativeBuildInputs = [ updateAutotoolsGnuConfigScriptsHook ]; + doCheck = true; # not cross; # Linking static stubs on cygwin requires correct ordering. diff --git a/pkgs/development/libraries/gettext/default.nix b/pkgs/development/libraries/gettext/default.nix index 29c20d37ecf8..7a0d7a3ee667 100644 --- a/pkgs/development/libraries/gettext/default.nix +++ b/pkgs/development/libraries/gettext/default.nix @@ -1,4 +1,4 @@ -{ stdenv, lib, fetchurl, libiconv, bash +{ stdenv, lib, fetchurl, libiconv, bash, updateAutotoolsGnuConfigScriptsHook }: # Note: this package is used for bootstrapping fetchurl, and thus @@ -50,6 +50,9 @@ stdenv.mkDerivation rec { ''; strictDeps = true; + nativeBuildInputs = [ + updateAutotoolsGnuConfigScriptsHook + ]; buildInputs = lib.optionals (!stdenv.hostPlatform.isMinGW) [ bash ] diff --git a/pkgs/development/libraries/kerberos/krb5.nix b/pkgs/development/libraries/kerberos/krb5.nix index 9f3fbdbf7eb0..8dd68af4fd1d 100644 --- a/pkgs/development/libraries/kerberos/krb5.nix +++ b/pkgs/development/libraries/kerberos/krb5.nix @@ -74,6 +74,11 @@ stdenv.mkDerivation rec { postPatch = '' substituteInPlace config/shlib.conf \ --replace "'ld " "'${stdenv.cc.targetPrefix}ld " + '' + # this could be accomplished by updateAutotoolsGnuConfigScriptsHook, but that causes infinite recursion + # necessary for FreeBSD code path in configure + + '' + substituteInPlace ./config/config.guess --replace-fail /usr/bin/uname uname ''; libFolders = [ "util" "include" "lib" "build-tools" ]; diff --git a/pkgs/development/libraries/libev/default.nix b/pkgs/development/libraries/libev/default.nix index 750cb3974cf7..aa9f078d42b0 100644 --- a/pkgs/development/libraries/libev/default.nix +++ b/pkgs/development/libraries/libev/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchurl +{ lib, stdenv, fetchurl, updateAutotoolsGnuConfigScriptsHook , # Note: -static hasn’t work on darwin static ? with stdenv.hostPlatform; isStatic && !isDarwin }: @@ -17,6 +17,8 @@ stdenv.mkDerivation rec { sha256 = "1sjs4324is7fp21an4aas2z4dwsvs6z4xwrmp72vwpq1s6wbfzjh"; }; + nativeBuildInputs = [ updateAutotoolsGnuConfigScriptsHook ]; + configureFlags = lib.optional (static) "LDFLAGS=-static"; meta = { diff --git a/pkgs/development/libraries/libssh2/default.nix b/pkgs/development/libraries/libssh2/default.nix index f7a51da9fa67..653575c5563b 100644 --- a/pkgs/development/libraries/libssh2/default.nix +++ b/pkgs/development/libraries/libssh2/default.nix @@ -15,6 +15,12 @@ stdenv.mkDerivation rec { ./CVE-2023-48795.patch ]; + # this could be accomplished by updateAutotoolsGnuConfigScriptsHook, but that causes infinite recursion + # necessary for FreeBSD code path in configure + postPatch = '' + substituteInPlace ./config.guess --replace-fail /usr/bin/uname uname + ''; + outputs = [ "out" "dev" "devdoc" ]; propagatedBuildInputs = [ openssl ]; # see Libs: in libssh2.pc diff --git a/pkgs/development/libraries/libxcrypt/default.nix b/pkgs/development/libraries/libxcrypt/default.nix index d71cb7027570..efd3acb643fb 100644 --- a/pkgs/development/libraries/libxcrypt/default.nix +++ b/pkgs/development/libraries/libxcrypt/default.nix @@ -15,6 +15,12 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-5eH0yu4KAd4q7ibjE4gH1tPKK45nKHlm0f79ZeH9iUM="; }; + # this could be accomplished by updateAutotoolsGnuConfigScriptsHook, but that causes infinite recursion + # necessary for FreeBSD code path in configure + postPatch = '' + substituteInPlace ./build-aux/m4-autogen/config.guess --replace-fail /usr/bin/uname uname + ''; + outputs = [ "out" "man" diff --git a/pkgs/development/libraries/lzo/default.nix b/pkgs/development/libraries/lzo/default.nix index 480e2bb909cd..43d551819a65 100644 --- a/pkgs/development/libraries/lzo/default.nix +++ b/pkgs/development/libraries/lzo/default.nix @@ -1,4 +1,4 @@ -{lib, stdenv, fetchurl}: +{ lib, stdenv, fetchurl, updateAutotoolsGnuConfigScriptsHook }: stdenv.mkDerivation rec { pname = "lzo"; @@ -9,6 +9,8 @@ stdenv.mkDerivation rec { sha256 = "0wm04519pd3g8hqpjqhfr72q8qmbiwqaxcs3cndny9h86aa95y60"; }; + nativeBuildInputs = [ updateAutotoolsGnuConfigScriptsHook ]; + configureFlags = lib.optional (!stdenv.hostPlatform.isStatic) "--enable-shared" ; enableParallelBuilding = true; diff --git a/pkgs/development/libraries/mpdecimal/default.nix b/pkgs/development/libraries/mpdecimal/default.nix index 514c61ffcb0c..687abab7d45b 100644 --- a/pkgs/development/libraries/mpdecimal/default.nix +++ b/pkgs/development/libraries/mpdecimal/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchurl }: +{ lib, stdenv, fetchurl, updateAutotoolsGnuConfigScriptsHook }: stdenv.mkDerivation rec { pname = "mpdecimal"; @@ -10,6 +10,8 @@ stdenv.mkDerivation rec { hash = "sha256-lCRFwyRbInMP1Bpnp8XCMdEcsbmTa5wPdjNPt9C0Row="; }; + nativeBuildInputs = [ updateAutotoolsGnuConfigScriptsHook ]; + configureFlags = [ "LD=${stdenv.cc.targetPrefix}cc" ]; postInstall = '' diff --git a/pkgs/development/libraries/ncurses/default.nix b/pkgs/development/libraries/ncurses/default.nix index 141ebc857130..2a160c0abbca 100644 --- a/pkgs/development/libraries/ncurses/default.nix +++ b/pkgs/development/libraries/ncurses/default.nix @@ -2,6 +2,7 @@ , stdenv , fetchurl , buildPackages +, updateAutotoolsGnuConfigScriptsHook , ncurses , pkg-config , abiVersion ? "6" @@ -68,6 +69,7 @@ stdenv.mkDerivation (finalAttrs: { strictDeps = true; nativeBuildInputs = [ + updateAutotoolsGnuConfigScriptsHook pkg-config ] ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ # for `tic`, build already depends on for build `cc` so it's weird the build doesn't just build `tic`. diff --git a/pkgs/development/libraries/nghttp2/default.nix b/pkgs/development/libraries/nghttp2/default.nix index 5566b0c8f67d..0fe8f1d88d51 100644 --- a/pkgs/development/libraries/nghttp2/default.nix +++ b/pkgs/development/libraries/nghttp2/default.nix @@ -67,6 +67,12 @@ stdenv.mkDerivation rec { export TZDIR=${tzdata}/share/zoneinfo ''; + # this could be accomplished by updateAutotoolsGnuConfigScriptsHook, but that causes infinite recursion + # necessary for FreeBSD code path in configure + postPatch = '' + substituteInPlace ./config.guess --replace-fail /usr/bin/uname uname + ''; + postInstall = lib.optionalString (enableApp) '' installShellCompletion --bash doc/bash_completion/{h2load,nghttp,nghttpd,nghttpx} '' + lib.optionalString (!enableApp) '' diff --git a/pkgs/development/libraries/pcre2/default.nix b/pkgs/development/libraries/pcre2/default.nix index c30a3c379d1d..3450f910effe 100644 --- a/pkgs/development/libraries/pcre2/default.nix +++ b/pkgs/development/libraries/pcre2/default.nix @@ -1,6 +1,7 @@ { lib , stdenv , fetchurl +, updateAutotoolsGnuConfigScriptsHook , withJitSealloc ? true }: @@ -13,6 +14,8 @@ stdenv.mkDerivation rec { hash = "sha256-4qU5hP8LB9/bWuRIa7ubIcyo598kNAlsyb8bcow1C8s="; }; + nativeBuildInputs = [ updateAutotoolsGnuConfigScriptsHook ]; + postPatch = '' # Fix jit autodetection: # https://github.com/PCRE2Project/pcre2/pull/396 diff --git a/pkgs/development/libraries/popt/default.nix b/pkgs/development/libraries/popt/default.nix index fdccb4d09336..e97629b0dfd0 100644 --- a/pkgs/development/libraries/popt/default.nix +++ b/pkgs/development/libraries/popt/default.nix @@ -2,6 +2,7 @@ , stdenv , fetchurl , fetchpatch2 +, updateAutotoolsGnuConfigScriptsHook }: stdenv.mkDerivation rec { @@ -13,6 +14,8 @@ stdenv.mkDerivation rec { sha256 = "sha256-wlpIOPyOTByKrLi9Yg7bMISj1jv4mH/a08onWMYyQPk="; }; + nativeBuildInputs = [ updateAutotoolsGnuConfigScriptsHook ]; + patches = lib.optionals stdenv.isCygwin [ ./1.16-cygwin.patch ./1.16-vpath.patch diff --git a/pkgs/development/libraries/readline/8.2.nix b/pkgs/development/libraries/readline/8.2.nix index 72e3370576e7..7bf5caf4060f 100644 --- a/pkgs/development/libraries/readline/8.2.nix +++ b/pkgs/development/libraries/readline/8.2.nix @@ -1,5 +1,6 @@ { lib, stdenv , fetchpatch, fetchurl +, updateAutotoolsGnuConfigScriptsHook , ncurses, termcap , curses-library ? if stdenv.hostPlatform.isWindows @@ -20,6 +21,7 @@ stdenv.mkDerivation rec { strictDeps = true; propagatedBuildInputs = [ curses-library ]; + nativeBuildInputs = [ updateAutotoolsGnuConfigScriptsHook ]; patchFlags = [ "-p0" ]; diff --git a/pkgs/development/libraries/sqlite/default.nix b/pkgs/development/libraries/sqlite/default.nix index fe39cac8a25f..1932d659d180 100644 --- a/pkgs/development/libraries/sqlite/default.nix +++ b/pkgs/development/libraries/sqlite/default.nix @@ -1,4 +1,5 @@ { lib, stdenv, fetchurl, zlib, readline, ncurses +, updateAutotoolsGnuConfigScriptsHook # for tests , python3Packages, sqldiff, sqlite-analyzer, tracker @@ -27,6 +28,7 @@ stdenv.mkDerivation rec { outputs = [ "bin" "dev" "out" ]; separateDebugInfo = stdenv.isLinux; + nativeBuildInputs = [ updateAutotoolsGnuConfigScriptsHook ]; buildInputs = [ zlib ] ++ lib.optionals interactive [ readline ncurses ]; # required for aarch64 but applied for all arches for simplicity diff --git a/pkgs/development/tools/build-managers/gnumake/default.nix b/pkgs/development/tools/build-managers/gnumake/default.nix index 774ea50f8623..7c075b7d8b8b 100644 --- a/pkgs/development/tools/build-managers/gnumake/default.nix +++ b/pkgs/development/tools/build-managers/gnumake/default.nix @@ -1,6 +1,7 @@ { lib , stdenv , fetchurl +, updateAutotoolsGnuConfigScriptsHook , guileSupport ? false, guile # avoid guile depend on bootstrap to prevent dependency cycles , inBootstrap ? false @@ -31,7 +32,7 @@ stdenv.mkDerivation rec { ./0002-remove-impure-dirs.patch ]; - nativeBuildInputs = lib.optionals guileEnabled [ pkg-config ]; + nativeBuildInputs = [ updateAutotoolsGnuConfigScriptsHook ] ++ lib.optionals guileEnabled [ pkg-config ]; buildInputs = lib.optionals guileEnabled [ guile ]; configureFlags = lib.optional guileEnabled "--with-guile" diff --git a/pkgs/development/tools/misc/automake/automake-1.16.x.nix b/pkgs/development/tools/misc/automake/automake-1.16.x.nix index 0d9572c6f314..20fe31ef6cd7 100644 --- a/pkgs/development/tools/misc/automake/automake-1.16.x.nix +++ b/pkgs/development/tools/misc/automake/automake-1.16.x.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchurl, perl, autoconf }: +{ lib, stdenv, fetchurl, perl, autoconf, updateAutotoolsGnuConfigScriptsHook }: stdenv.mkDerivation rec { pname = "automake"; @@ -10,7 +10,7 @@ stdenv.mkDerivation rec { }; strictDeps = true; - nativeBuildInputs = [ autoconf perl ]; + nativeBuildInputs = [ updateAutotoolsGnuConfigScriptsHook autoconf perl ]; buildInputs = [ autoconf ]; setupHook = ./setup-hook.sh; diff --git a/pkgs/development/tools/misc/dejagnu/default.nix b/pkgs/development/tools/misc/dejagnu/default.nix index 5c7720a2024b..55581aedce60 100644 --- a/pkgs/development/tools/misc/dejagnu/default.nix +++ b/pkgs/development/tools/misc/dejagnu/default.nix @@ -1,4 +1,4 @@ -{ fetchurl, lib, stdenv, expect, makeWrapper }: +{ fetchurl, lib, stdenv, expect, makeWrapper, updateAutotoolsGnuConfigScriptsHook }: stdenv.mkDerivation rec { pname = "dejagnu"; @@ -9,7 +9,7 @@ stdenv.mkDerivation rec { sha256 = "1qx2cv6qkxbiqg87jh217jb62hk3s7dmcs4cz1llm2wmsynfznl7"; }; - nativeBuildInputs = [ makeWrapper ]; + nativeBuildInputs = [ updateAutotoolsGnuConfigScriptsHook makeWrapper ]; buildInputs = [ expect ]; # dejagnu-1.6.3 can't successfully run tests in source tree: diff --git a/pkgs/development/tools/misc/gnum4/default.nix b/pkgs/development/tools/misc/gnum4/default.nix index 66de4ebf8b02..5dea7f059557 100644 --- a/pkgs/development/tools/misc/gnum4/default.nix +++ b/pkgs/development/tools/misc/gnum4/default.nix @@ -16,12 +16,17 @@ stdenv.mkDerivation rec { # https://gitweb.gentoo.org/repo/gentoo.git/tree/sys-devel/m4/m4-1.4.19-r1.ebuild patches = lib.optional stdenv.hostPlatform.isLoongArch64 ./loong-fix-build.patch; - postPatch = if stdenv.hostPlatform.isLoongArch64 then '' + # this could be accomplished by updateAutotoolsGnuConfigScriptsHook, but that causes infinite recursion + # necessary for FreeBSD code path in configure + postPatch = '' + substituteInPlace ./build-aux/config.guess --replace-fail /usr/bin/uname uname + '' + lib.optionalString stdenv.hostPlatform.isLoongArch64 '' touch ./aclocal.m4 ./lib/config.hin ./configure ./doc/stamp-vti || die find . -name Makefile.in -exec touch {} + || die - '' else null; + ''; strictDeps = true; + enableParallelBuilding = true; doCheck = false; diff --git a/pkgs/development/tools/misc/libtool/libtool2.nix b/pkgs/development/tools/misc/libtool/libtool2.nix index 259fb2b113c7..df07a2f6a5bf 100644 --- a/pkgs/development/tools/misc/libtool/libtool2.nix +++ b/pkgs/development/tools/misc/libtool/libtool2.nix @@ -1,5 +1,6 @@ { lib, stdenv, fetchurl, m4 , runtimeShell +, updateAutotoolsGnuConfigScriptsHook , file }: @@ -38,7 +39,7 @@ stdenv.mkDerivation rec { # As libtool is an early bootstrap dependency try hard not to # add autoconf and automake or help2man dependencies here. That way we can # avoid pulling in perl and get away with just an `m4` depend. - nativeBuildInputs = [ m4 file ]; + nativeBuildInputs = [ updateAutotoolsGnuConfigScriptsHook m4 file ]; propagatedBuildInputs = [ m4 file ]; # Don't fixup "#! /bin/sh" in Libtool, otherwise it will use the diff --git a/pkgs/development/tools/misc/pkg-config/default.nix b/pkgs/development/tools/misc/pkg-config/default.nix index 663f3184b221..599d28285809 100644 --- a/pkgs/development/tools/misc/pkg-config/default.nix +++ b/pkgs/development/tools/misc/pkg-config/default.nix @@ -19,9 +19,14 @@ stdenv.mkDerivation rec { ++ lib.optional stdenv.isCygwin ./2.36.3-not-win32.patch; # These three tests fail due to a (desired) behavior change from our ./requires-private.patch - postPatch = if vanilla then null else '' - rm -f check/check-requires-private check/check-gtk check/missing - ''; + postPatch = + # this could be accomplished by updateAutotoolsGnuConfigScriptsHook, but that causes infinite recursion + # necessary for FreeBSD code path in configure + '' + substituteInPlace ./config.guess ./glib/config.guess --replace-fail /usr/bin/uname uname + '' + lib.optionalString (!vanilla) '' + rm -f check/check-requires-private check/check-gtk check/missing + ''; buildInputs = [ libiconv ]; diff --git a/pkgs/development/tools/misc/texinfo/common.nix b/pkgs/development/tools/misc/texinfo/common.nix index d1f8cc582543..11144d7581a5 100644 --- a/pkgs/development/tools/misc/texinfo/common.nix +++ b/pkgs/development/tools/misc/texinfo/common.nix @@ -1,7 +1,7 @@ { version, sha256, patches ? [] }: { lib, stdenv, buildPackages, fetchurl, perl, libintl, bash -, gnulib, gawk, freebsd, libiconv +, updateAutotoolsGnuConfigScriptsHook, gnulib, gawk, freebsd, libiconv # we are a dependency of gcc, this simplifies bootstraping , interactive ? false, ncurses, procps @@ -49,6 +49,7 @@ stdenv.mkDerivation { # A native compiler is needed to build tools needed at build time depsBuildBuild = [ buildPackages.stdenv.cc perl ]; + nativeBuildInputs = [ updateAutotoolsGnuConfigScriptsHook ]; buildInputs = [ bash libintl ] ++ optionals stdenv.isSunOS [ libiconv gawk ] ++ optional interactive ncurses; diff --git a/pkgs/servers/x11/xorg/overrides.nix b/pkgs/servers/x11/xorg/overrides.nix index a6d7d7e6a7f0..cd7e116c17d5 100644 --- a/pkgs/servers/x11/xorg/overrides.nix +++ b/pkgs/servers/x11/xorg/overrides.nix @@ -3,7 +3,7 @@ automake, autoconf, libiconv, libtool, intltool, gettext, python3, perl, freetype, tradcpp, fontconfig, meson, ninja, ed, fontforge, libGL, spice-protocol, zlib, libGLU, dbus, libunwind, libdrm, netbsd, - ncompress, + ncompress, updateAutotoolsGnuConfigScriptsHook, mesa, udev, bootstrap_cmds, bison, flex, clangStdenv, autoreconfHook, mcpp, libepoxy, openssl, pkg-config, llvm, libxslt, libxcrypt, hwdata, ApplicationServices, Carbon, Cocoa, Xplugin, @@ -906,6 +906,7 @@ self: super: lndir = super.lndir.overrideAttrs (attrs: { buildInputs = []; + nativeBuildInputs = [ updateAutotoolsGnuConfigScriptsHook ]; preConfigure = '' export XPROTO_CFLAGS=" " export XPROTO_LIBS=" " diff --git a/pkgs/shells/bash/5.nix b/pkgs/shells/bash/5.nix index cdce3667c5cd..25798533113c 100644 --- a/pkgs/shells/bash/5.nix +++ b/pkgs/shells/bash/5.nix @@ -2,6 +2,7 @@ , stdenv , buildPackages , fetchurl +, updateAutotoolsGnuConfigScriptsHook , bison , util-linux @@ -97,7 +98,7 @@ stdenv.mkDerivation rec { strictDeps = true; # Note: Bison is needed because the patches above modify parse.y. depsBuildBuild = [ buildPackages.stdenv.cc ]; - nativeBuildInputs = [ bison ] + nativeBuildInputs = [ updateAutotoolsGnuConfigScriptsHook bison ] ++ lib.optional withDocs texinfo ++ lib.optional stdenv.hostPlatform.isDarwin stdenv.cc.bintools; diff --git a/pkgs/tools/archivers/gnutar/default.nix b/pkgs/tools/archivers/gnutar/default.nix index 34615d7e8bed..98f0b54e73fc 100644 --- a/pkgs/tools/archivers/gnutar/default.nix +++ b/pkgs/tools/archivers/gnutar/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchurl, autoreconfHook, acl, libintl }: +{ lib, stdenv, fetchurl, autoreconfHook, updateAutotoolsGnuConfigScriptsHook, acl, libintl }: # Note: this package is used for bootstrapping fetchurl, and thus # cannot use fetchpatch! All mutable patches (generated by GitHub or @@ -30,7 +30,8 @@ stdenv.mkDerivation rec { outputs = [ "out" "info" ]; - nativeBuildInputs = lib.optional stdenv.isDarwin autoreconfHook; + nativeBuildInputs = lib.optional stdenv.isDarwin autoreconfHook + ++ lib.optional (!stdenv.isDarwin) updateAutotoolsGnuConfigScriptsHook; # Add libintl on Darwin specifically as it fails to link (or skip) # NLS on it's own: # "_libintl_textdomain", referenced from: diff --git a/pkgs/tools/archivers/sharutils/default.nix b/pkgs/tools/archivers/sharutils/default.nix index 5c84e596531c..2a656a9dd327 100644 --- a/pkgs/tools/archivers/sharutils/default.nix +++ b/pkgs/tools/archivers/sharutils/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchurl, fetchpatch, gettext, coreutils }: +{ lib, stdenv, fetchurl, fetchpatch, gettext, coreutils, updateAutotoolsGnuConfigScriptsHook }: stdenv.mkDerivation rec { pname = "sharutils"; @@ -13,6 +13,7 @@ stdenv.mkDerivation rec { # GNU Gettext is needed on non-GNU platforms. buildInputs = [ coreutils gettext ]; + nativeBuildInputs = [ updateAutotoolsGnuConfigScriptsHook ]; # These tests try to hit /etc/passwd to find out your username if pass in a submitter # name on the command line. Since we block access to /etc/passwd on the Darwin sandbox diff --git a/pkgs/tools/compression/gzip/default.nix b/pkgs/tools/compression/gzip/default.nix index 56803742d605..05539050861f 100644 --- a/pkgs/tools/compression/gzip/default.nix +++ b/pkgs/tools/compression/gzip/default.nix @@ -1,6 +1,7 @@ { lib, stdenv , fetchurl , makeWrapper +, updateAutotoolsGnuConfigScriptsHook , xz , runtimeShellPackage }: @@ -23,8 +24,8 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; - buildInputs = [ runtimeShellPackage]; - nativeBuildInputs = [ xz.bin makeWrapper ]; + nativeBuildInputs = [ updateAutotoolsGnuConfigScriptsHook makeWrapper ]; + buildInputs = [ runtimeShellPackage ]; makeFlags = [ "SHELL=/bin/sh" diff --git a/pkgs/tools/compression/xz/default.nix b/pkgs/tools/compression/xz/default.nix index 4431a178ac02..2a7ca487bcfd 100644 --- a/pkgs/tools/compression/xz/default.nix +++ b/pkgs/tools/compression/xz/default.nix @@ -29,6 +29,12 @@ stdenv.mkDerivation (finalAttrs: { enableParallelBuilding = true; doCheck = true; + # this could be accomplished by updateAutotoolsGnuConfigScriptsHook, but that causes infinite recursion + # necessary for FreeBSD code path in configure + postPatch = '' + substituteInPlace ./build-aux/config.guess --replace-fail /usr/bin/uname uname + ''; + preCheck = '' # Tests have a /bin/sh dependency... patchShebangs tests diff --git a/pkgs/tools/misc/file/default.nix b/pkgs/tools/misc/file/default.nix index 8cff5ccd70af..4aab839a8a56 100644 --- a/pkgs/tools/misc/file/default.nix +++ b/pkgs/tools/misc/file/default.nix @@ -1,4 +1,5 @@ { lib, stdenv, fetchurl, file, zlib, libgnurx +, updateAutotoolsGnuConfigScriptsHook , testers }: @@ -30,7 +31,8 @@ stdenv.mkDerivation (finalAttrs: { strictDeps = true; enableParallelBuilding = true; - nativeBuildInputs = lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) file; + nativeBuildInputs = [ updateAutotoolsGnuConfigScriptsHook ] + ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) file; buildInputs = [ zlib ] ++ lib.optional stdenv.hostPlatform.isWindows libgnurx; diff --git a/pkgs/tools/misc/findutils/default.nix b/pkgs/tools/misc/findutils/default.nix index b3810892ce03..cfa4105cda0d 100644 --- a/pkgs/tools/misc/findutils/default.nix +++ b/pkgs/tools/misc/findutils/default.nix @@ -1,4 +1,5 @@ { lib, stdenv, fetchurl +, updateAutotoolsGnuConfigScriptsHook , coreutils }: @@ -22,6 +23,7 @@ stdenv.mkDerivation rec { patches = [ ./no-install-statedir.patch ]; + nativeBuildInputs = [ updateAutotoolsGnuConfigScriptsHook ]; buildInputs = [ coreutils ]; # bin/updatedb script needs to call sort # Since glibc-2.25 the i686 tests hang reliably right after test-sleep. diff --git a/pkgs/tools/networking/curl/default.nix b/pkgs/tools/networking/curl/default.nix index 0bd65a307b0b..918cb60848fb 100644 --- a/pkgs/tools/networking/curl/default.nix +++ b/pkgs/tools/networking/curl/default.nix @@ -65,7 +65,10 @@ stdenv.mkDerivation (finalAttrs: { ./8.7.1-compression-fix.patch ]; + # this could be accomplished by updateAutotoolsGnuConfigScriptsHook, but that causes infinite recursion + # necessary for FreeBSD code path in configure postPatch = '' + substituteInPlace ./config.guess --replace-fail /usr/bin/uname uname patchShebangs scripts ''; diff --git a/pkgs/tools/text/diffutils/default.nix b/pkgs/tools/text/diffutils/default.nix index 8c4a160d4b1e..6c1bc8bf01f1 100644 --- a/pkgs/tools/text/diffutils/default.nix +++ b/pkgs/tools/text/diffutils/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchurl, xz, coreutils ? null }: +{ lib, stdenv, fetchurl, updateAutotoolsGnuConfigScriptsHook, xz, coreutils ? null }: # Note: this package is used for bootstrapping fetchurl, and thus # cannot use fetchpatch! All mutable patches (generated by GitHub or @@ -16,7 +16,7 @@ stdenv.mkDerivation rec { outputs = [ "out" "info" ]; - nativeBuildInputs = [ (lib.getBin xz) ]; + nativeBuildInputs = [ updateAutotoolsGnuConfigScriptsHook (lib.getBin xz) ]; /* If no explicit coreutils is given, use the one from stdenv. */ buildInputs = [ coreutils ]; diff --git a/pkgs/tools/text/gnugrep/default.nix b/pkgs/tools/text/gnugrep/default.nix index 55e0a97f3594..7298fe881bea 100644 --- a/pkgs/tools/text/gnugrep/default.nix +++ b/pkgs/tools/text/gnugrep/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, glibcLocales, fetchurl, pcre2, libiconv, perl, runtimeShellPackage }: +{ lib, stdenv, updateAutotoolsGnuConfigScriptsHook, glibcLocales, fetchurl, pcre2, libiconv, perl, runtimeShellPackage }: # Note: this package is used for bootstrapping fetchurl, and thus # cannot use fetchpatch! All mutable patches (generated by GitHub or @@ -26,6 +26,7 @@ stdenv.mkDerivation { nativeCheckInputs = [ perl glibcLocales ]; outputs = [ "out" "info" ]; # the man pages are rather small + nativeBuildInputs = [ updateAutotoolsGnuConfigScriptsHook ]; buildInputs = [ pcre2 libiconv runtimeShellPackage ]; # cygwin: FAIL: multibyte-white-space diff --git a/pkgs/tools/text/gnused/default.nix b/pkgs/tools/text/gnused/default.nix index f493e4f358d6..bc736f418725 100644 --- a/pkgs/tools/text/gnused/default.nix +++ b/pkgs/tools/text/gnused/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchurl, perl }: +{ lib, stdenv, fetchurl, updateAutotoolsGnuConfigScriptsHook, perl }: stdenv.mkDerivation rec { pname = "gnused"; @@ -11,7 +11,7 @@ stdenv.mkDerivation rec { outputs = [ "out" "info" ]; - nativeBuildInputs = [ perl ]; + nativeBuildInputs = [ updateAutotoolsGnuConfigScriptsHook perl ]; preConfigure = "patchShebangs ./build-aux/help2man"; # Prevents attempts of running 'help2man' on cross-built binaries.