Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)

libtool: drop unused auto* dependencies

Autoreconf was initially added in e44dd84664f ("libtool2: macOS 11
support") for configure patches. The patches were removed since 2.4.7
release. Let's drop these dependencies to make boostrap tree leaner.

The diff of bootstrap tree before and after the change:

$ nix-store --query --graph $(nix-instantiate -A stdenv) |
fgrep ' -> ' | awk '{print $3}' | sort -u |
sed 's/"[0-9a-z]\{32\}-/"/g' | sort > before

$ nix-store --query --graph $(nix-instantiate -A stdenv) |
fgrep ' -> ' | awk '{print $3}' | sort -u |
sed 's/"[0-9a-z]\{32\}-/"/g' | sort > after

$ diff -U0 before after

--- before
+++ after
@@ -64,2 +63,0 @@
-"help2man-1.49.2.drv"
-"help2man-1.49.2.drv"
@@ -77 +74,0 @@
-"libxcrypt-4.4.33.drv"
@@ -88,4 +84,0 @@
-"perl-5.36.0.drv"
-"perl-5.36.0.drv"
-"perl5.36.0-gettext-1.07.drv"
-"perl5.36.0-gettext-1.07.drv"

This removes 2 of 3 builds of `perl` and `help2man` dependencies.

Co-authored-by: Adam Joseph <54836058+amjoseph-nixpkgs@users.noreply.github.com>

+8 -14
+8 -14
pkgs/development/tools/misc/libtool/libtool2.nix
··· 1 - { lib, stdenv, fetchurl, fetchpatch, autoconf, automake, m4, perl, help2man 1 + { lib, stdenv, fetchurl, fetchpatch, m4 2 2 , runtimeShell 3 3 , file 4 4 }: ··· 23 23 # https://lists.gnu.org/archive/html/autotools-announce/2022-03/msg00000.html 24 24 FILECMD = "${file}/bin/file"; 25 25 26 - # Normally we'd use autoreconfHook, but that includes libtoolize. 27 - postPatch = '' 28 - aclocal -I m4 29 - automake 30 - autoconf 31 - 32 - pushd libltdl 33 - aclocal -I ../m4 34 - automake 35 - autoconf 36 - popd 37 - '' + 26 + postPatch = 38 27 # libtool commit da2e352735722917bf0786284411262195a6a3f6 changed 39 28 # the shebang from `/bin/sh` (which is a special sandbox exception) 40 29 # to `/usr/bin/env sh`, meaning that we now need to patch shebangs 41 30 # in libtoolize.in: 42 31 '' 43 32 substituteInPlace libtoolize.in --replace '#! /usr/bin/env sh' '#!${runtimeShell}' 33 + # avoid help2man run after 'libtoolize.in' update 34 + touch doc/libtoolize.1 44 35 ''; 45 36 46 37 strictDeps = true; 47 - nativeBuildInputs = [ autoconf automake help2man m4 perl ]; 38 + # As libtool is an early bootstrap dependency try hard not to 39 + # add autoconf and automake or help2man dependencies here. That way we can 40 + # avoid pulling in perl and get away with just an `m4` depend. 41 + nativeBuildInputs = [ m4 file ]; 48 42 propagatedBuildInputs = [ m4 file ]; 49 43 50 44 # Don't fixup "#! /bin/sh" in Libtool, otherwise it will use the