diff options
author | Rick van Schijndel <Mindavi@users.noreply.github.com> | 2022-05-28 17:53:43 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-28 17:53:43 +0200 |
commit | f174277eed83df78b86f94d52d3687ffb12d6e05 (patch) | |
tree | 96e290d0e63854038e867902f1f04da7633dacea /pkgs/stdenv | |
parent | daf4bee22beb9b6fc8850dcdea5795bf39b3f093 (diff) | |
parent | 97c43828fb7e016b4ee8fe434bc4d5e0b8a8b4be (diff) |
Merge pull request #168413 from a-m-joseph/libtool-purity-fix-put-file-in-bootstrap
fixLibtool(): replace /usr/bin/file in ./configure, add file to common-path.nix
Diffstat (limited to 'pkgs/stdenv')
-rw-r--r-- | pkgs/stdenv/common-path.nix | 8 | ||||
-rw-r--r-- | pkgs/stdenv/darwin/default.nix | 3 | ||||
-rw-r--r-- | pkgs/stdenv/generic/setup.sh | 15 | ||||
-rw-r--r-- | pkgs/stdenv/linux/default.nix | 2 |
4 files changed, 27 insertions, 1 deletions
diff --git a/pkgs/stdenv/common-path.nix b/pkgs/stdenv/common-path.nix index da468d56a2cda..8c1acfb50dd68 100644 --- a/pkgs/stdenv/common-path.nix +++ b/pkgs/stdenv/common-path.nix @@ -12,4 +12,12 @@ pkgs.bash pkgs.patch pkgs.xz.bin + + # The `file` command is added here because an enormous number of + # packages have a vendored dependency upon `file` in their + # `./configure` script, due to libtool<=2.4.6, or due to + # libtool>=2.4.7 in which the package author decided to set FILECMD + # when running libtoolize. In fact, file-5.4.6 *depends on itself* + # and tries to invoke `file` from its own ./configure script. + pkgs.file ] diff --git a/pkgs/stdenv/darwin/default.nix b/pkgs/stdenv/darwin/default.nix index 32e4fe9749ab3..bbc15bad26203 100644 --- a/pkgs/stdenv/darwin/default.nix +++ b/pkgs/stdenv/darwin/default.nix @@ -486,6 +486,7 @@ rec { gmp libiconv brotli.lib + file ] ++ lib.optional haveKRB5 libkrb5) ++ (with pkgs."${finalLlvmPackages}"; [ libcxx @@ -561,6 +562,7 @@ rec { gmp libiconv brotli.lib + file ] ++ lib.optional haveKRB5 libkrb5) ++ (with pkgs."${finalLlvmPackages}"; [ libcxx @@ -737,6 +739,7 @@ rec { brotli.lib cc.expand-response-params libxml2.out + file ] ++ lib.optional haveKRB5 libkrb5 ++ lib.optionals localSystem.isAarch64 [ pkgs.updateAutotoolsGnuConfigScriptsHook diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh index 6d30e6c01ffbf..40ffd9344e34d 100644 --- a/pkgs/stdenv/generic/setup.sh +++ b/pkgs/stdenv/generic/setup.sh @@ -1021,6 +1021,21 @@ configurePhase() { echo "fixing libtool script $i" fixLibtool "$i" done + + # replace `/usr/bin/file` with `file` in any `configure` + # scripts with vendored libtool code. Preserve mtimes to + # prevent some packages (e.g. libidn2) from spontaneously + # autoreconf'ing themselves + CONFIGURE_MTIME_REFERENCE=$(mktemp configure.mtime.reference.XXX) + find . \ + -executable \ + -type f \ + -name configure \ + -execdir grep -l 'GNU Libtool is free software; you can redistribute it and/or modify' {} \; \ + -execdir touch -r {} "$CONFIGURE_MTIME_REFERENCE" \; \ + -execdir sed -i s_/usr/bin/file_file_g {} \; \ + -execdir touch -r "$CONFIGURE_MTIME_REFERENCE" {} \; + rm -f "$CONFIGURE_MTIME_REFERENCE" fi if [[ -z "${dontAddPrefix:-}" && -n "$prefix" ]]; then diff --git a/pkgs/stdenv/linux/default.nix b/pkgs/stdenv/linux/default.nix index 712d1b001c1ae..d625ab5b30132 100644 --- a/pkgs/stdenv/linux/default.nix +++ b/pkgs/stdenv/linux/default.nix @@ -417,7 +417,7 @@ in # Simple executable tools concatMap (p: [ (getBin p) (getLib p) ]) [ gzip bzip2 xz bash binutils.bintools coreutils diffutils findutils - gawk gnumake gnused gnutar gnugrep gnupatch patchelf ed + gawk gnumake gnused gnutar gnugrep gnupatch patchelf ed file ] # Library dependencies ++ map getLib ( |