summary refs log tree commit diff
path: root/pkgs/development/interpreters/perl
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2021-09-19 17:26:41 +0000
committerAlyssa Ross <hi@alyssa.is>2021-10-05 11:59:14 +0000
commit881ba67f837a1939dba3c35a526346c7a12aa004 (patch)
tree8267eb181ca89c3a684c1da23753b6bf2061f915 /pkgs/development/interpreters/perl
parent2384362ca765da34e4089b0dbb738d2ae0340cf3 (diff)
downloadnixpkgs-881ba67f837a1939dba3c35a526346c7a12aa004.tar
nixpkgs-881ba67f837a1939dba3c35a526346c7a12aa004.tar.gz
nixpkgs-881ba67f837a1939dba3c35a526346c7a12aa004.tar.bz2
nixpkgs-881ba67f837a1939dba3c35a526346c7a12aa004.tar.lz
nixpkgs-881ba67f837a1939dba3c35a526346c7a12aa004.tar.xz
nixpkgs-881ba67f837a1939dba3c35a526346c7a12aa004.tar.zst
nixpkgs-881ba67f837a1939dba3c35a526346c7a12aa004.zip
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.
Diffstat (limited to 'pkgs/development/interpreters/perl')
-rw-r--r--pkgs/development/interpreters/perl/default.nix16
1 files changed, 12 insertions, 4 deletions
diff --git a/pkgs/development/interpreters/perl/default.nix b/pkgs/development/interpreters/perl/default.nix
index 7bc067c92c7..45c12b9720c 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"