about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/tools/misc/libtool
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2022-12-06 19:57:55 +0000
committerAlyssa Ross <hi@alyssa.is>2023-02-08 13:48:30 +0000
commitbf3aadfdd39aa197e18bade671fab6726349ffa4 (patch)
tree698567af766ed441d757b57a7b21e68d4a342a2b /nixpkgs/pkgs/development/tools/misc/libtool
parentf4afc5a01d9539ce09e47494e679c51f80723d07 (diff)
parent99665eb45f58d959d2cb9e49ddb960c79d596f33 (diff)
downloadnixlib-bf3aadfdd39aa197e18bade671fab6726349ffa4.tar
nixlib-bf3aadfdd39aa197e18bade671fab6726349ffa4.tar.gz
nixlib-bf3aadfdd39aa197e18bade671fab6726349ffa4.tar.bz2
nixlib-bf3aadfdd39aa197e18bade671fab6726349ffa4.tar.lz
nixlib-bf3aadfdd39aa197e18bade671fab6726349ffa4.tar.xz
nixlib-bf3aadfdd39aa197e18bade671fab6726349ffa4.tar.zst
nixlib-bf3aadfdd39aa197e18bade671fab6726349ffa4.zip
Merge commit '99665eb45f58d959d2cb9e49ddb960c79d596f33'
Diffstat (limited to 'nixpkgs/pkgs/development/tools/misc/libtool')
-rw-r--r--nixpkgs/pkgs/development/tools/misc/libtool/default.nix6
-rw-r--r--nixpkgs/pkgs/development/tools/misc/libtool/libtool2-macos11.patch32
-rw-r--r--nixpkgs/pkgs/development/tools/misc/libtool/libtool2.nix28
3 files changed, 20 insertions, 46 deletions
diff --git a/nixpkgs/pkgs/development/tools/misc/libtool/default.nix b/nixpkgs/pkgs/development/tools/misc/libtool/default.nix
index 1cd195a3132d..b9e32372922f 100644
--- a/nixpkgs/pkgs/development/tools/misc/libtool/default.nix
+++ b/nixpkgs/pkgs/development/tools/misc/libtool/default.nix
@@ -1,10 +1,5 @@
 {lib, stdenv, fetchurl, m4, perl}:
 
-# Note: this package is used for bootstrapping fetchurl, and thus
-# cannot use fetchpatch! All mutable patches (generated by GitHub or
-# cgit) that are needed here should be included directly in Nixpkgs as
-# files.
-
 stdenv.mkDerivation rec {
   pname = "libtool";
   version = "1.5.26";
@@ -20,6 +15,7 @@ stdenv.mkDerivation rec {
   # Don't fixup "#! /bin/sh" in Libtool, otherwise it will use the
   # "fixed" path in generated files!
   dontPatchShebangs = true;
+  dontFixLibtool = true;
 
   meta = {
     description = "Generic library support script";
diff --git a/nixpkgs/pkgs/development/tools/misc/libtool/libtool2-macos11.patch b/nixpkgs/pkgs/development/tools/misc/libtool/libtool2-macos11.patch
deleted file mode 100644
index 1552ae7a949f..000000000000
--- a/nixpkgs/pkgs/development/tools/misc/libtool/libtool2-macos11.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
----
- m4/libtool.m4 | 13 ++++---------
- 1 file changed, 4 insertions(+), 9 deletions(-)
-
-diff --git a/m4/libtool.m4 b/m4/libtool.m4
-index f2d1f398..b971e8e7 100644
---- a/m4/libtool.m4
-+++ b/m4/libtool.m4
-@@ -1067,16 +1067,11 @@ _LT_EOF
-       _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;;
-     darwin1.*)
-       _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
--    darwin*) # darwin 5.x on
--      # if running on 10.5 or later, the deployment target defaults
--      # to the OS version, if on x86, and 10.4, the deployment
--      # target defaults to 10.4. Don't you love it?
--      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
--	10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
--	  _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
--	10.[[012]][[,.]]*)
-+    darwin*)
-+      case ${MACOSX_DEPLOYMENT_TARGET},$host in
-+	10.[[012]],*|,*powerpc*)
- 	  _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
--	10.*)
-+	*)
- 	  _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
-       esac
-     ;;
--- 
-2.24.3 (Apple Git-128)
diff --git a/nixpkgs/pkgs/development/tools/misc/libtool/libtool2.nix b/nixpkgs/pkgs/development/tools/misc/libtool/libtool2.nix
index 44e4c8665c83..92a230374df6 100644
--- a/nixpkgs/pkgs/development/tools/misc/libtool/libtool2.nix
+++ b/nixpkgs/pkgs/development/tools/misc/libtool/libtool2.nix
@@ -1,4 +1,6 @@
 { lib, stdenv, fetchurl, fetchpatch, autoconf, automake, m4, perl, help2man
+, runtimeShell
+, file
 }:
 
 # Note: this package is used for bootstrapping fetchurl, and thus
@@ -8,20 +10,18 @@
 
 stdenv.mkDerivation rec {
   pname = "libtool";
-  version = "2.4.6";
+  version = "2.4.7";
 
   src = fetchurl {
     url = "mirror://gnu/libtool/${pname}-${version}.tar.gz";
-    sha256 = "1qq61k6lp1fp75xs398yzi6wvbx232l7xbyn3p13cnh27mflvgg3";
+    sha256 = "sha256-BOlsJATqcMWQxUbrpCAqThJyLGQAFsErmy8c49SB6ag=";
   };
 
   outputs = [ "out" "lib" ];
 
-  patches = [
-    # Suport macOS version 11.0
-    # https://lists.gnu.org/archive/html/libtool-patches/2020-06/msg00001.html
-    ./libtool2-macos11.patch
-  ];
+  # FILECMD was added in libtool 2.4.7; previous versions hardwired `/usr/bin/file`
+  #   https://lists.gnu.org/archive/html/autotools-announce/2022-03/msg00000.html
+  FILECMD = "${file}/bin/file";
 
   # Normally we'd use autoreconfHook, but that includes libtoolize.
   postPatch = ''
@@ -34,14 +34,24 @@ stdenv.mkDerivation rec {
     automake
     autoconf
     popd
+  '' +
+  # libtool commit da2e352735722917bf0786284411262195a6a3f6 changed
+  # the shebang from `/bin/sh` (which is a special sandbox exception)
+  # to `/usr/bin/env sh`, meaning that we now need to patch shebangs
+  # in libtoolize and ltmain.sh since `dontPatchShebangs` is set:
+  ''
+    substituteInPlace libtoolize.in       --replace '#! /usr/bin/env sh' '#!${runtimeShell}'
+    substituteInPlace build-aux/ltmain.in --replace '#! /usr/bin/env sh' '#!${runtimeShell}'
   '';
 
-  nativeBuildInputs = [ perl help2man m4 ] ++ [ autoconf automake ];
-  propagatedBuildInputs = [ m4 ];
+  strictDeps = true;
+  nativeBuildInputs = [ autoconf automake help2man m4 perl ];
+  propagatedBuildInputs = [ m4 file ];
 
   # Don't fixup "#! /bin/sh" in Libtool, otherwise it will use the
   # "fixed" path in generated files!
   dontPatchShebangs = true;
+  dontFixLibtool = true;
 
   # XXX: The GNU ld wrapper does all sorts of nasty things wrt. RPATH, which
   # leads to the failure of a number of tests.