From 881ba67f837a1939dba3c35a526346c7a12aa004 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Sun, 19 Sep 2021 17:26:41 +0000 Subject: pkgsStatic.perl: fix build I don't understand how this worked prior to 1dbb306 ("pkgsStatic.perl: Use `dontAddStaticConfigureFlags` instead of overriding"), but what I do know is that it's very broken now, to the point that perl-cross needs a patch. I doubt the -Duseshrplib is actually necessary when native compiling, but removing it would be a mass rebuild, so I've left it in place for now. --- pkgs/development/interpreters/perl/default.nix | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'pkgs/development/interpreters/perl') diff --git a/pkgs/development/interpreters/perl/default.nix b/pkgs/development/interpreters/perl/default.nix index 7bc067c92c73..45c12b9720c4 100644 --- a/pkgs/development/interpreters/perl/default.nix +++ b/pkgs/development/interpreters/perl/default.nix @@ -1,4 +1,4 @@ -{ config, lib, stdenv, fetchurl, fetchFromGitHub, pkgs, buildPackages +{ config, lib, stdenv, fetchurl, fetchpatch, fetchFromGitHub, pkgs, buildPackages , callPackage , enableThreading ? true, coreutils, makeWrapper }: @@ -41,7 +41,14 @@ let ] ++ optional stdenv.isSunOS ./ld-shared.patch ++ optionals stdenv.isDarwin [ ./cpp-precomp.patch ./sw_vers.patch ] - ++ optional crossCompiling ./MakeMaker-cross.patch; + ++ optionals crossCompiling [ + ./MakeMaker-cross.patch + # https://github.com/arsv/perl-cross/pull/120 + (fetchpatch { + url = "https://github.com/arsv/perl-cross/commit/3c318ae6572f8b36cb077c8b49c851e2f5fe181e.patch"; + sha256 = "0cmcy8bams3c68f6xadl52z2w378wcpdjzi3qi4pcyvcfs011l6g"; + }) + ]; # This is not done for native builds because pwd may need to come from # bootstrap tools when building bootstrap perl. @@ -59,7 +66,7 @@ let unset src ''; - # Build a thread-safe Perl with a dynamic libperls.o. We need the + # Build a thread-safe Perl with a dynamic libperl.so. We need the # "installstyle" option to ensure that modules are put under # $out/lib/perl5 - this is the general default, but because $out # contains the string "perl", Configure would select $out/lib. @@ -71,13 +78,14 @@ let ++ [ "-Uinstallusrbinperl" "-Dinstallstyle=lib/perl5" - "-Duseshrplib" + ] ++ lib.optional (!crossCompiling) "-Duseshrplib" ++ [ "-Dlocincpth=${libcInc}/include" "-Dloclibpth=${libcLib}/lib" ] ++ optionals ((builtins.match ''5\.[0-9]*[13579]\..+'' version) != null) [ "-Dusedevel" "-Uversiononly" ] ++ optional stdenv.isSunOS "-Dcc=gcc" ++ optional enableThreading "-Dusethreads" + ++ optional stdenv.hostPlatform.isStatic "--all-static" ++ optionals (!crossCompiling) [ "-Dprefix=${placeholder "out"}" "-Dman1dir=${placeholder "out"}/share/man/man1" -- cgit v1.2.3