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.
This commit is contained in:
Audrey Dutcher 2024-05-21 14:50:29 -07:00 committed by John Ericson
parent 9e21798e8f
commit 846de80d1c
36 changed files with 114 additions and 33 deletions

View File

@ -1,6 +1,7 @@
{ lib { lib
, stdenv , stdenv
, fetchurl , fetchurl
, updateAutotoolsGnuConfigScriptsHook
, perl , perl
, libiconv , libiconv
, zlib , zlib
@ -28,7 +29,7 @@ stdenv.mkDerivation rec {
hash = "sha256-c5nppnCMMtZ4pypjIZ6W8jvgviM25Q/RNISY0HBB35A="; hash = "sha256-c5nppnCMMtZ4pypjIZ6W8jvgviM25Q/RNISY0HBB35A=";
}; };
nativeBuildInputs = [ perl ]; nativeBuildInputs = [ updateAutotoolsGnuConfigScriptsHook perl ];
buildInputs = [ libiconv zlib popt ] buildInputs = [ libiconv zlib popt ]
++ lib.optional enableACLs acl ++ lib.optional enableACLs acl

View File

@ -1,4 +1,4 @@
{ lib, stdenv, fetchurl, writeTextDir { lib, stdenv, fetchurl, updateAutotoolsGnuConfigScriptsHook
, withCMake ? true, cmake , withCMake ? true, cmake
# sensitive downstream packages # sensitive downstream packages
@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
outputs = [ "out" "dev" "man" ]; outputs = [ "out" "dev" "man" ];
nativeBuildInputs = lib.optionals withCMake [ cmake ]; nativeBuildInputs = [ updateAutotoolsGnuConfigScriptsHook ] ++ lib.optionals withCMake [ cmake ];
cmakeFlags = [] ++ lib.optionals stdenv.hostPlatform.isStatic [ cmakeFlags = [] ++ lib.optionals stdenv.hostPlatform.isStatic [
"-DCARES_SHARED=OFF" "-DCARES_SHARED=OFF"

View File

@ -1,6 +1,7 @@
{ lib { lib
, stdenv , stdenv
, fetchurl , fetchurl
, updateAutotoolsGnuConfigScriptsHook
# for passthru.tests # for passthru.tests
, python3 , python3
, perlPackages , perlPackages
@ -29,6 +30,7 @@ stdenv.mkDerivation (finalAttrs: {
}; };
strictDeps = true; strictDeps = true;
nativeBuildInputs = [ updateAutotoolsGnuConfigScriptsHook ];
outputs = [ "out" "dev" ]; # TODO: fix referrers outputs = [ "out" "dev" ]; # TODO: fix referrers
outputBin = "dev"; outputBin = "dev";

View File

@ -1,4 +1,4 @@
{ stdenv, lib, fetchurl }: { stdenv, lib, fetchurl, updateAutotoolsGnuConfigScriptsHook }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "gdbm"; pname = "gdbm";
@ -9,6 +9,8 @@ stdenv.mkDerivation rec {
sha256 = "sha256-dLEIHSH/8TrkvXwW5dblBKTCb3zeHcoNljpIQXS7ys0="; sha256 = "sha256-dLEIHSH/8TrkvXwW5dblBKTCb3zeHcoNljpIQXS7ys0=";
}; };
nativeBuildInputs = [ updateAutotoolsGnuConfigScriptsHook ];
doCheck = true; # not cross; doCheck = true; # not cross;
# Linking static stubs on cygwin requires correct ordering. # Linking static stubs on cygwin requires correct ordering.

View File

@ -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 # Note: this package is used for bootstrapping fetchurl, and thus
@ -50,6 +50,9 @@ stdenv.mkDerivation rec {
''; '';
strictDeps = true; strictDeps = true;
nativeBuildInputs = [
updateAutotoolsGnuConfigScriptsHook
];
buildInputs = lib.optionals (!stdenv.hostPlatform.isMinGW) [ buildInputs = lib.optionals (!stdenv.hostPlatform.isMinGW) [
bash bash
] ]

View File

@ -74,6 +74,11 @@ stdenv.mkDerivation rec {
postPatch = '' postPatch = ''
substituteInPlace config/shlib.conf \ substituteInPlace config/shlib.conf \
--replace "'ld " "'${stdenv.cc.targetPrefix}ld " --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" ]; libFolders = [ "util" "include" "lib" "build-tools" ];

View File

@ -1,4 +1,4 @@
{ lib, stdenv, fetchurl { lib, stdenv, fetchurl, updateAutotoolsGnuConfigScriptsHook
, # Note: -static hasnt work on darwin , # Note: -static hasnt work on darwin
static ? with stdenv.hostPlatform; isStatic && !isDarwin static ? with stdenv.hostPlatform; isStatic && !isDarwin
}: }:
@ -17,6 +17,8 @@ stdenv.mkDerivation rec {
sha256 = "1sjs4324is7fp21an4aas2z4dwsvs6z4xwrmp72vwpq1s6wbfzjh"; sha256 = "1sjs4324is7fp21an4aas2z4dwsvs6z4xwrmp72vwpq1s6wbfzjh";
}; };
nativeBuildInputs = [ updateAutotoolsGnuConfigScriptsHook ];
configureFlags = lib.optional (static) "LDFLAGS=-static"; configureFlags = lib.optional (static) "LDFLAGS=-static";
meta = { meta = {

View File

@ -15,6 +15,12 @@ stdenv.mkDerivation rec {
./CVE-2023-48795.patch ./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" ]; outputs = [ "out" "dev" "devdoc" ];
propagatedBuildInputs = [ openssl ]; # see Libs: in libssh2.pc propagatedBuildInputs = [ openssl ]; # see Libs: in libssh2.pc

View File

@ -15,6 +15,12 @@ stdenv.mkDerivation (finalAttrs: {
hash = "sha256-5eH0yu4KAd4q7ibjE4gH1tPKK45nKHlm0f79ZeH9iUM="; 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 = [ outputs = [
"out" "out"
"man" "man"

View File

@ -1,4 +1,4 @@
{lib, stdenv, fetchurl}: { lib, stdenv, fetchurl, updateAutotoolsGnuConfigScriptsHook }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "lzo"; pname = "lzo";
@ -9,6 +9,8 @@ stdenv.mkDerivation rec {
sha256 = "0wm04519pd3g8hqpjqhfr72q8qmbiwqaxcs3cndny9h86aa95y60"; sha256 = "0wm04519pd3g8hqpjqhfr72q8qmbiwqaxcs3cndny9h86aa95y60";
}; };
nativeBuildInputs = [ updateAutotoolsGnuConfigScriptsHook ];
configureFlags = lib.optional (!stdenv.hostPlatform.isStatic) "--enable-shared" ; configureFlags = lib.optional (!stdenv.hostPlatform.isStatic) "--enable-shared" ;
enableParallelBuilding = true; enableParallelBuilding = true;

View File

@ -1,4 +1,4 @@
{ lib, stdenv, fetchurl }: { lib, stdenv, fetchurl, updateAutotoolsGnuConfigScriptsHook }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "mpdecimal"; pname = "mpdecimal";
@ -10,6 +10,8 @@ stdenv.mkDerivation rec {
hash = "sha256-lCRFwyRbInMP1Bpnp8XCMdEcsbmTa5wPdjNPt9C0Row="; hash = "sha256-lCRFwyRbInMP1Bpnp8XCMdEcsbmTa5wPdjNPt9C0Row=";
}; };
nativeBuildInputs = [ updateAutotoolsGnuConfigScriptsHook ];
configureFlags = [ "LD=${stdenv.cc.targetPrefix}cc" ]; configureFlags = [ "LD=${stdenv.cc.targetPrefix}cc" ];
postInstall = '' postInstall = ''

View File

@ -2,6 +2,7 @@
, stdenv , stdenv
, fetchurl , fetchurl
, buildPackages , buildPackages
, updateAutotoolsGnuConfigScriptsHook
, ncurses , ncurses
, pkg-config , pkg-config
, abiVersion ? "6" , abiVersion ? "6"
@ -68,6 +69,7 @@ stdenv.mkDerivation (finalAttrs: {
strictDeps = true; strictDeps = true;
nativeBuildInputs = [ nativeBuildInputs = [
updateAutotoolsGnuConfigScriptsHook
pkg-config pkg-config
] ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ ] ++ 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`. # for `tic`, build already depends on for build `cc` so it's weird the build doesn't just build `tic`.

View File

@ -67,6 +67,12 @@ stdenv.mkDerivation rec {
export TZDIR=${tzdata}/share/zoneinfo 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) '' postInstall = lib.optionalString (enableApp) ''
installShellCompletion --bash doc/bash_completion/{h2load,nghttp,nghttpd,nghttpx} installShellCompletion --bash doc/bash_completion/{h2load,nghttp,nghttpd,nghttpx}
'' + lib.optionalString (!enableApp) '' '' + lib.optionalString (!enableApp) ''

View File

@ -1,6 +1,7 @@
{ lib { lib
, stdenv , stdenv
, fetchurl , fetchurl
, updateAutotoolsGnuConfigScriptsHook
, withJitSealloc ? true , withJitSealloc ? true
}: }:
@ -13,6 +14,8 @@ stdenv.mkDerivation rec {
hash = "sha256-4qU5hP8LB9/bWuRIa7ubIcyo598kNAlsyb8bcow1C8s="; hash = "sha256-4qU5hP8LB9/bWuRIa7ubIcyo598kNAlsyb8bcow1C8s=";
}; };
nativeBuildInputs = [ updateAutotoolsGnuConfigScriptsHook ];
postPatch = '' postPatch = ''
# Fix jit autodetection: # Fix jit autodetection:
# https://github.com/PCRE2Project/pcre2/pull/396 # https://github.com/PCRE2Project/pcre2/pull/396

View File

@ -2,6 +2,7 @@
, stdenv , stdenv
, fetchurl , fetchurl
, fetchpatch2 , fetchpatch2
, updateAutotoolsGnuConfigScriptsHook
}: }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
@ -13,6 +14,8 @@ stdenv.mkDerivation rec {
sha256 = "sha256-wlpIOPyOTByKrLi9Yg7bMISj1jv4mH/a08onWMYyQPk="; sha256 = "sha256-wlpIOPyOTByKrLi9Yg7bMISj1jv4mH/a08onWMYyQPk=";
}; };
nativeBuildInputs = [ updateAutotoolsGnuConfigScriptsHook ];
patches = lib.optionals stdenv.isCygwin [ patches = lib.optionals stdenv.isCygwin [
./1.16-cygwin.patch ./1.16-cygwin.patch
./1.16-vpath.patch ./1.16-vpath.patch

View File

@ -1,5 +1,6 @@
{ lib, stdenv { lib, stdenv
, fetchpatch, fetchurl , fetchpatch, fetchurl
, updateAutotoolsGnuConfigScriptsHook
, ncurses, termcap , ncurses, termcap
, curses-library ? , curses-library ?
if stdenv.hostPlatform.isWindows if stdenv.hostPlatform.isWindows
@ -20,6 +21,7 @@ stdenv.mkDerivation rec {
strictDeps = true; strictDeps = true;
propagatedBuildInputs = [ curses-library ]; propagatedBuildInputs = [ curses-library ];
nativeBuildInputs = [ updateAutotoolsGnuConfigScriptsHook ];
patchFlags = [ "-p0" ]; patchFlags = [ "-p0" ];

View File

@ -1,4 +1,5 @@
{ lib, stdenv, fetchurl, zlib, readline, ncurses { lib, stdenv, fetchurl, zlib, readline, ncurses
, updateAutotoolsGnuConfigScriptsHook
# for tests # for tests
, python3Packages, sqldiff, sqlite-analyzer, tracker , python3Packages, sqldiff, sqlite-analyzer, tracker
@ -27,6 +28,7 @@ stdenv.mkDerivation rec {
outputs = [ "bin" "dev" "out" ]; outputs = [ "bin" "dev" "out" ];
separateDebugInfo = stdenv.isLinux; separateDebugInfo = stdenv.isLinux;
nativeBuildInputs = [ updateAutotoolsGnuConfigScriptsHook ];
buildInputs = [ zlib ] ++ lib.optionals interactive [ readline ncurses ]; buildInputs = [ zlib ] ++ lib.optionals interactive [ readline ncurses ];
# required for aarch64 but applied for all arches for simplicity # required for aarch64 but applied for all arches for simplicity

View File

@ -1,6 +1,7 @@
{ lib { lib
, stdenv , stdenv
, fetchurl , fetchurl
, updateAutotoolsGnuConfigScriptsHook
, guileSupport ? false, guile , guileSupport ? false, guile
# avoid guile depend on bootstrap to prevent dependency cycles # avoid guile depend on bootstrap to prevent dependency cycles
, inBootstrap ? false , inBootstrap ? false
@ -31,7 +32,7 @@ stdenv.mkDerivation rec {
./0002-remove-impure-dirs.patch ./0002-remove-impure-dirs.patch
]; ];
nativeBuildInputs = lib.optionals guileEnabled [ pkg-config ]; nativeBuildInputs = [ updateAutotoolsGnuConfigScriptsHook ] ++ lib.optionals guileEnabled [ pkg-config ];
buildInputs = lib.optionals guileEnabled [ guile ]; buildInputs = lib.optionals guileEnabled [ guile ];
configureFlags = lib.optional guileEnabled "--with-guile" configureFlags = lib.optional guileEnabled "--with-guile"

View File

@ -1,4 +1,4 @@
{ lib, stdenv, fetchurl, perl, autoconf }: { lib, stdenv, fetchurl, perl, autoconf, updateAutotoolsGnuConfigScriptsHook }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "automake"; pname = "automake";
@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
}; };
strictDeps = true; strictDeps = true;
nativeBuildInputs = [ autoconf perl ]; nativeBuildInputs = [ updateAutotoolsGnuConfigScriptsHook autoconf perl ];
buildInputs = [ autoconf ]; buildInputs = [ autoconf ];
setupHook = ./setup-hook.sh; setupHook = ./setup-hook.sh;

View File

@ -1,4 +1,4 @@
{ fetchurl, lib, stdenv, expect, makeWrapper }: { fetchurl, lib, stdenv, expect, makeWrapper, updateAutotoolsGnuConfigScriptsHook }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "dejagnu"; pname = "dejagnu";
@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
sha256 = "1qx2cv6qkxbiqg87jh217jb62hk3s7dmcs4cz1llm2wmsynfznl7"; sha256 = "1qx2cv6qkxbiqg87jh217jb62hk3s7dmcs4cz1llm2wmsynfznl7";
}; };
nativeBuildInputs = [ makeWrapper ]; nativeBuildInputs = [ updateAutotoolsGnuConfigScriptsHook makeWrapper ];
buildInputs = [ expect ]; buildInputs = [ expect ];
# dejagnu-1.6.3 can't successfully run tests in source tree: # dejagnu-1.6.3 can't successfully run tests in source tree:

View File

@ -16,12 +16,17 @@ stdenv.mkDerivation rec {
# https://gitweb.gentoo.org/repo/gentoo.git/tree/sys-devel/m4/m4-1.4.19-r1.ebuild # 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; 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 touch ./aclocal.m4 ./lib/config.hin ./configure ./doc/stamp-vti || die
find . -name Makefile.in -exec touch {} + || die find . -name Makefile.in -exec touch {} + || die
'' else null; '';
strictDeps = true; strictDeps = true;
enableParallelBuilding = true; enableParallelBuilding = true;
doCheck = false; doCheck = false;

View File

@ -1,5 +1,6 @@
{ lib, stdenv, fetchurl, m4 { lib, stdenv, fetchurl, m4
, runtimeShell , runtimeShell
, updateAutotoolsGnuConfigScriptsHook
, file , file
}: }:
@ -38,7 +39,7 @@ stdenv.mkDerivation rec {
# As libtool is an early bootstrap dependency try hard not to # As libtool is an early bootstrap dependency try hard not to
# add autoconf and automake or help2man dependencies here. That way we can # add autoconf and automake or help2man dependencies here. That way we can
# avoid pulling in perl and get away with just an `m4` depend. # avoid pulling in perl and get away with just an `m4` depend.
nativeBuildInputs = [ m4 file ]; nativeBuildInputs = [ updateAutotoolsGnuConfigScriptsHook m4 file ];
propagatedBuildInputs = [ m4 file ]; propagatedBuildInputs = [ m4 file ];
# Don't fixup "#! /bin/sh" in Libtool, otherwise it will use the # Don't fixup "#! /bin/sh" in Libtool, otherwise it will use the

View File

@ -19,9 +19,14 @@ stdenv.mkDerivation rec {
++ lib.optional stdenv.isCygwin ./2.36.3-not-win32.patch; ++ 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 # These three tests fail due to a (desired) behavior change from our ./requires-private.patch
postPatch = if vanilla then null else '' postPatch =
rm -f check/check-requires-private check/check-gtk check/missing # 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 ]; buildInputs = [ libiconv ];

View File

@ -1,7 +1,7 @@
{ version, sha256, patches ? [] }: { version, sha256, patches ? [] }:
{ lib, stdenv, buildPackages, fetchurl, perl, libintl, bash { 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 # we are a dependency of gcc, this simplifies bootstraping
, interactive ? false, ncurses, procps , interactive ? false, ncurses, procps
@ -49,6 +49,7 @@ stdenv.mkDerivation {
# A native compiler is needed to build tools needed at build time # A native compiler is needed to build tools needed at build time
depsBuildBuild = [ buildPackages.stdenv.cc perl ]; depsBuildBuild = [ buildPackages.stdenv.cc perl ];
nativeBuildInputs = [ updateAutotoolsGnuConfigScriptsHook ];
buildInputs = [ bash libintl ] buildInputs = [ bash libintl ]
++ optionals stdenv.isSunOS [ libiconv gawk ] ++ optionals stdenv.isSunOS [ libiconv gawk ]
++ optional interactive ncurses; ++ optional interactive ncurses;

View File

@ -3,7 +3,7 @@
automake, autoconf, libiconv, libtool, intltool, gettext, python3, perl, automake, autoconf, libiconv, libtool, intltool, gettext, python3, perl,
freetype, tradcpp, fontconfig, meson, ninja, ed, fontforge, freetype, tradcpp, fontconfig, meson, ninja, ed, fontforge,
libGL, spice-protocol, zlib, libGLU, dbus, libunwind, libdrm, netbsd, libGL, spice-protocol, zlib, libGLU, dbus, libunwind, libdrm, netbsd,
ncompress, ncompress, updateAutotoolsGnuConfigScriptsHook,
mesa, udev, bootstrap_cmds, bison, flex, clangStdenv, autoreconfHook, mesa, udev, bootstrap_cmds, bison, flex, clangStdenv, autoreconfHook,
mcpp, libepoxy, openssl, pkg-config, llvm, libxslt, libxcrypt, hwdata, mcpp, libepoxy, openssl, pkg-config, llvm, libxslt, libxcrypt, hwdata,
ApplicationServices, Carbon, Cocoa, Xplugin, ApplicationServices, Carbon, Cocoa, Xplugin,
@ -906,6 +906,7 @@ self: super:
lndir = super.lndir.overrideAttrs (attrs: { lndir = super.lndir.overrideAttrs (attrs: {
buildInputs = []; buildInputs = [];
nativeBuildInputs = [ updateAutotoolsGnuConfigScriptsHook ];
preConfigure = '' preConfigure = ''
export XPROTO_CFLAGS=" " export XPROTO_CFLAGS=" "
export XPROTO_LIBS=" " export XPROTO_LIBS=" "

View File

@ -2,6 +2,7 @@
, stdenv , stdenv
, buildPackages , buildPackages
, fetchurl , fetchurl
, updateAutotoolsGnuConfigScriptsHook
, bison , bison
, util-linux , util-linux
@ -97,7 +98,7 @@ stdenv.mkDerivation rec {
strictDeps = true; strictDeps = true;
# Note: Bison is needed because the patches above modify parse.y. # Note: Bison is needed because the patches above modify parse.y.
depsBuildBuild = [ buildPackages.stdenv.cc ]; depsBuildBuild = [ buildPackages.stdenv.cc ];
nativeBuildInputs = [ bison ] nativeBuildInputs = [ updateAutotoolsGnuConfigScriptsHook bison ]
++ lib.optional withDocs texinfo ++ lib.optional withDocs texinfo
++ lib.optional stdenv.hostPlatform.isDarwin stdenv.cc.bintools; ++ lib.optional stdenv.hostPlatform.isDarwin stdenv.cc.bintools;

View File

@ -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 # Note: this package is used for bootstrapping fetchurl, and thus
# cannot use fetchpatch! All mutable patches (generated by GitHub or # cannot use fetchpatch! All mutable patches (generated by GitHub or
@ -30,7 +30,8 @@ stdenv.mkDerivation rec {
outputs = [ "out" "info" ]; 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) # Add libintl on Darwin specifically as it fails to link (or skip)
# NLS on it's own: # NLS on it's own:
# "_libintl_textdomain", referenced from: # "_libintl_textdomain", referenced from:

View File

@ -1,4 +1,4 @@
{ lib, stdenv, fetchurl, fetchpatch, gettext, coreutils }: { lib, stdenv, fetchurl, fetchpatch, gettext, coreutils, updateAutotoolsGnuConfigScriptsHook }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "sharutils"; pname = "sharutils";
@ -13,6 +13,7 @@ stdenv.mkDerivation rec {
# GNU Gettext is needed on non-GNU platforms. # GNU Gettext is needed on non-GNU platforms.
buildInputs = [ coreutils gettext ]; buildInputs = [ coreutils gettext ];
nativeBuildInputs = [ updateAutotoolsGnuConfigScriptsHook ];
# These tests try to hit /etc/passwd to find out your username if pass in a submitter # 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 # name on the command line. Since we block access to /etc/passwd on the Darwin sandbox

View File

@ -1,6 +1,7 @@
{ lib, stdenv { lib, stdenv
, fetchurl , fetchurl
, makeWrapper , makeWrapper
, updateAutotoolsGnuConfigScriptsHook
, xz , xz
, runtimeShellPackage , runtimeShellPackage
}: }:
@ -23,8 +24,8 @@ stdenv.mkDerivation rec {
enableParallelBuilding = true; enableParallelBuilding = true;
buildInputs = [ runtimeShellPackage]; nativeBuildInputs = [ updateAutotoolsGnuConfigScriptsHook makeWrapper ];
nativeBuildInputs = [ xz.bin makeWrapper ]; buildInputs = [ runtimeShellPackage ];
makeFlags = [ makeFlags = [
"SHELL=/bin/sh" "SHELL=/bin/sh"

View File

@ -29,6 +29,12 @@ stdenv.mkDerivation (finalAttrs: {
enableParallelBuilding = true; enableParallelBuilding = true;
doCheck = 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 = '' preCheck = ''
# Tests have a /bin/sh dependency... # Tests have a /bin/sh dependency...
patchShebangs tests patchShebangs tests

View File

@ -1,4 +1,5 @@
{ lib, stdenv, fetchurl, file, zlib, libgnurx { lib, stdenv, fetchurl, file, zlib, libgnurx
, updateAutotoolsGnuConfigScriptsHook
, testers , testers
}: }:
@ -30,7 +31,8 @@ stdenv.mkDerivation (finalAttrs: {
strictDeps = true; strictDeps = true;
enableParallelBuilding = true; enableParallelBuilding = true;
nativeBuildInputs = lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) file; nativeBuildInputs = [ updateAutotoolsGnuConfigScriptsHook ]
++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) file;
buildInputs = [ zlib ] buildInputs = [ zlib ]
++ lib.optional stdenv.hostPlatform.isWindows libgnurx; ++ lib.optional stdenv.hostPlatform.isWindows libgnurx;

View File

@ -1,4 +1,5 @@
{ lib, stdenv, fetchurl { lib, stdenv, fetchurl
, updateAutotoolsGnuConfigScriptsHook
, coreutils , coreutils
}: }:
@ -22,6 +23,7 @@ stdenv.mkDerivation rec {
patches = [ ./no-install-statedir.patch ]; patches = [ ./no-install-statedir.patch ];
nativeBuildInputs = [ updateAutotoolsGnuConfigScriptsHook ];
buildInputs = [ coreutils ]; # bin/updatedb script needs to call sort buildInputs = [ coreutils ]; # bin/updatedb script needs to call sort
# Since glibc-2.25 the i686 tests hang reliably right after test-sleep. # Since glibc-2.25 the i686 tests hang reliably right after test-sleep.

View File

@ -65,7 +65,10 @@ stdenv.mkDerivation (finalAttrs: {
./8.7.1-compression-fix.patch ./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 = '' postPatch = ''
substituteInPlace ./config.guess --replace-fail /usr/bin/uname uname
patchShebangs scripts patchShebangs scripts
''; '';

View File

@ -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 # Note: this package is used for bootstrapping fetchurl, and thus
# cannot use fetchpatch! All mutable patches (generated by GitHub or # cannot use fetchpatch! All mutable patches (generated by GitHub or
@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
outputs = [ "out" "info" ]; outputs = [ "out" "info" ];
nativeBuildInputs = [ (lib.getBin xz) ]; nativeBuildInputs = [ updateAutotoolsGnuConfigScriptsHook (lib.getBin xz) ];
/* If no explicit coreutils is given, use the one from stdenv. */ /* If no explicit coreutils is given, use the one from stdenv. */
buildInputs = [ coreutils ]; buildInputs = [ coreutils ];

View File

@ -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 # Note: this package is used for bootstrapping fetchurl, and thus
# cannot use fetchpatch! All mutable patches (generated by GitHub or # cannot use fetchpatch! All mutable patches (generated by GitHub or
@ -26,6 +26,7 @@ stdenv.mkDerivation {
nativeCheckInputs = [ perl glibcLocales ]; nativeCheckInputs = [ perl glibcLocales ];
outputs = [ "out" "info" ]; # the man pages are rather small outputs = [ "out" "info" ]; # the man pages are rather small
nativeBuildInputs = [ updateAutotoolsGnuConfigScriptsHook ];
buildInputs = [ pcre2 libiconv runtimeShellPackage ]; buildInputs = [ pcre2 libiconv runtimeShellPackage ];
# cygwin: FAIL: multibyte-white-space # cygwin: FAIL: multibyte-white-space

View File

@ -1,4 +1,4 @@
{ lib, stdenv, fetchurl, perl }: { lib, stdenv, fetchurl, updateAutotoolsGnuConfigScriptsHook, perl }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "gnused"; pname = "gnused";
@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
outputs = [ "out" "info" ]; outputs = [ "out" "info" ];
nativeBuildInputs = [ perl ]; nativeBuildInputs = [ updateAutotoolsGnuConfigScriptsHook perl ];
preConfigure = "patchShebangs ./build-aux/help2man"; preConfigure = "patchShebangs ./build-aux/help2man";
# Prevents attempts of running 'help2man' on cross-built binaries. # Prevents attempts of running 'help2man' on cross-built binaries.