Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions pkgs-many/libtool/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{ mkManyVariants, callPackage }:

mkManyVariants {
variants = ./variants.nix;
aliases = { };
defaultSelector = (p: p.v2_5);
genericBuilder = ./generic.nix;
inherit callPackage;
}
54 changes: 37 additions & 17 deletions pkgs/libtool/libtool2.nix → pkgs-many/libtool/generic.nix
Original file line number Diff line number Diff line change
@@ -1,25 +1,37 @@
{
version,
src-hash,
packageOlder,
packageAtLeast,
...
}@variantArgs:

{
lib,
stdenv,
fetchurl,
m4,
perl,
runtimeShell,
updateAutotoolsGnuConfigScriptsHook,
file,
}:

# tests
readline,
}@args:

# 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 {
stdenv.mkDerivation (finalAttrs: {
pname = "libtool";
version = "2.5.4";
inherit version;

src = fetchurl {
url = "mirror://gnu/libtool/${pname}-${version}.tar.gz";
sha256 = "sha256-2o67LOTc9GuQCY2vliz/po9LT2LqYPeY0O8Skp7eat8=";
url = "mirror://gnu/libtool/libtool-${version}.tar.gz";
hash = src-hash;
};

outputs = [
Expand All @@ -29,9 +41,9 @@ stdenv.mkDerivation rec {

# 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";
FILECMD = lib.optionalString (packageAtLeast "2") "${file}/bin/file";

postPatch =
postPatch = lib.optionalString (packageAtLeast "2") (
# 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
Expand All @@ -40,18 +52,24 @@ stdenv.mkDerivation rec {
substituteInPlace libtoolize.in --replace '#! /usr/bin/env sh' '#!${runtimeShell}'
# avoid help2man run after 'libtoolize.in' update
touch doc/libtoolize.1
'';
'');

strictDeps = true;

# As libtool is an early bootstrap dependency try hard not to
# add autoconf and automake or help2man dependencies here. That way we can
# avoid pulling in perl and get away with just an `m4` depend.
nativeBuildInputs = [
updateAutotoolsGnuConfigScriptsHook
m4
file
];
propagatedBuildInputs = [
nativeBuildInputs =
lib.optionals (packageAtLeast "2") [
updateAutotoolsGnuConfigScriptsHook
m4
file
]
++ lib.optionals (packageOlder "2") [ m4 ];

buildInputs = lib.optionals (packageOlder "2") [ perl ];

propagatedBuildInputs = lib.optionals (packageAtLeast "2") [
m4
file
];
Expand All @@ -61,15 +79,17 @@ stdenv.mkDerivation rec {
dontPatchShebangs = true;
dontFixLibtool = true;

enableParallelBuilding = true;

# XXX: The GNU ld wrapper does all sorts of nasty things wrt. RPATH, which
# leads to the failure of a number of tests.
doCheck = false;
doInstallCheck = false;

enableParallelBuilding = true;
passthru.tests = { inherit readline; };

meta = {
description = "GNU Libtool, a generic library support script";
description = "Generic library support script";
longDescription = ''
GNU libtool is a generic library support script. Libtool hides
the complexity of using shared libraries behind a consistent,
Expand All @@ -84,4 +104,4 @@ stdenv.mkDerivation rec {
platforms = lib.platforms.unix;
mainProgram = "libtool";
};
}
})
11 changes: 11 additions & 0 deletions pkgs-many/libtool/variants.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
v1_5 = {
version = "1.5.26";
src-hash = "sha256-HDWuNP6FqhZ716tLyfR3/gGROOGvYmeNlS/EPAt+Lwk=";
};

v2_5 = {
version = "2.5.4";
src-hash = "sha256-2o67LOTc9GuQCY2vliz/po9LT2LqYPeY0O8Skp7eat8=";
};
}
42 changes: 0 additions & 42 deletions pkgs/libtool/default.nix

This file was deleted.

2 changes: 2 additions & 0 deletions stdenv/aliases.nix
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ mapAliases {
guile_2_0 = guile.v2_0;
guile_2_2 = guile.v2_2;
guile_3_0 = guile.v3_0;
libtool2 = libtool.v2_5;
libtool_1_5 = libtool.v1_5;
ncurses5 = ncurses.v5;
ncurses6 = ncurses.v6;
openssl_oqs = openssl.oqs;
Expand Down
5 changes: 0 additions & 5 deletions top-level.nix
Original file line number Diff line number Diff line change
Expand Up @@ -681,11 +681,6 @@ with final;
# TODO: Remove alias
libjpeg = libjpeg_turbo;

# TODO(corepkgs): gross
libtool = libtool2;
libtool2 = callPackage ./pkgs/libtool/libtool2.nix { };
libtool_1_5 = callPackage ./pkgs/libtool { };

# Less secure variant of lowdown for use inside Nix builds.
lowdown-unsandboxed = lowdown.override {
enableDarwinSandbox = false;
Expand Down