1{ lib, stdenv, fetchurl, fetchpatch, autoconf, automake, m4, perl, help2man
2}:
3
4# Note: this package is used for bootstrapping fetchurl, and thus
5# cannot use fetchpatch! All mutable patches (generated by GitHub or
6# cgit) that are needed here should be included directly in Nixpkgs as
7# files.
8
9stdenv.mkDerivation rec {
10 pname = "libtool";
11 version = "2.4.6";
12
13 src = fetchurl {
14 url = "mirror://gnu/libtool/${pname}-${version}.tar.gz";
15 sha256 = "1qq61k6lp1fp75xs398yzi6wvbx232l7xbyn3p13cnh27mflvgg3";
16 };
17
18 outputs = [ "out" "lib" ];
19
20 patches = [
21 # Suport macOS version 11.0
22 # https://lists.gnu.org/archive/html/libtool-patches/2020-06/msg00001.html
23 ./libtool2-macos11.patch
24 ];
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
39 nativeBuildInputs = [ perl help2man m4 ] ++ [ autoconf automake ];
40 propagatedBuildInputs = [ m4 ];
41
42 # Don't fixup "#! /bin/sh" in Libtool, otherwise it will use the
43 # "fixed" path in generated files!
44 dontPatchShebangs = true;
45
46 # XXX: The GNU ld wrapper does all sorts of nasty things wrt. RPATH, which
47 # leads to the failure of a number of tests.
48 doCheck = false;
49 doInstallCheck = false;
50
51 enableParallelBuilding = true;
52
53 meta = with lib; {
54 description = "GNU Libtool, a generic library support script";
55 longDescription = ''
56 GNU libtool is a generic library support script. Libtool hides
57 the complexity of using shared libraries behind a consistent,
58 portable interface.
59
60 To use libtool, add the new generic library building commands to
61 your Makefile, Makefile.in, or Makefile.am. See the
62 documentation for details.
63 '';
64 homepage = "https://www.gnu.org/software/libtool/";
65 license = licenses.gpl2Plus;
66 maintainers = [ ];
67 platforms = platforms.unix;
68 };
69}