nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib, stdenv, fetchurl, fetchpatch, autoconf, automake, m4, perl, help2man
2, runtimeShell
3, file
4}:
5
6# Note: this package is used for bootstrapping fetchurl, and thus
7# cannot use fetchpatch! All mutable patches (generated by GitHub or
8# cgit) that are needed here should be included directly in Nixpkgs as
9# files.
10
11stdenv.mkDerivation rec {
12 pname = "libtool";
13 version = "2.4.7";
14
15 src = fetchurl {
16 url = "mirror://gnu/libtool/${pname}-${version}.tar.gz";
17 sha256 = "sha256-BOlsJATqcMWQxUbrpCAqThJyLGQAFsErmy8c49SB6ag=";
18 };
19
20 outputs = [ "out" "lib" ];
21
22 # FILECMD was added in libtool 2.4.7; previous versions hardwired `/usr/bin/file`
23 # https://lists.gnu.org/archive/html/autotools-announce/2022-03/msg00000.html
24 FILECMD = "${file}/bin/file";
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 '' +
38 # libtool commit da2e352735722917bf0786284411262195a6a3f6 changed
39 # the shebang from `/bin/sh` (which is a special sandbox exception)
40 # to `/usr/bin/env sh`, meaning that we now need to patch shebangs
41 # in libtoolize and ltmain.sh since `dontPatchShebangs` is set:
42 ''
43 substituteInPlace libtoolize.in --replace '#! /usr/bin/env sh' '#!${runtimeShell}'
44 substituteInPlace build-aux/ltmain.in --replace '#! /usr/bin/env sh' '#!${runtimeShell}'
45 '';
46
47 nativeBuildInputs = [ autoconf automake help2man m4 perl ];
48 propagatedBuildInputs = [ m4 file ];
49
50 # Don't fixup "#! /bin/sh" in Libtool, otherwise it will use the
51 # "fixed" path in generated files!
52 dontPatchShebangs = true;
53
54 # XXX: The GNU ld wrapper does all sorts of nasty things wrt. RPATH, which
55 # leads to the failure of a number of tests.
56 doCheck = false;
57 doInstallCheck = false;
58
59 enableParallelBuilding = true;
60
61 meta = with lib; {
62 description = "GNU Libtool, a generic library support script";
63 longDescription = ''
64 GNU libtool is a generic library support script. Libtool hides
65 the complexity of using shared libraries behind a consistent,
66 portable interface.
67
68 To use libtool, add the new generic library building commands to
69 your Makefile, Makefile.in, or Makefile.am. See the
70 documentation for details.
71 '';
72 homepage = "https://www.gnu.org/software/libtool/";
73 license = licenses.gpl2Plus;
74 maintainers = [ ];
75 platforms = platforms.unix;
76 };
77}