git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #138553 from alyssais/perl-static

pkgsStatic.perl: fix build

commit807370df9481804598f06c9e17020cdb7f974a18 authorStig <stig@stig.io> dateTue 5 Oct 2021, 21:10 (5 years ago) parentd05d321881ba67
1 file changed+12−4
pkgs/development/interpreters/perl/default.nix+12−4
pkgs/development/interpreters/perl/default.nix+12−4
@@ -1,4 +1,4 @@
1−{ config, lib, stdenv, fetchurl, fetchFromGitHub, pkgs, buildPackages
1+{ config, lib, stdenv, fetchurl, fetchpatch, fetchFromGitHub, pkgs, buildPackages
22, callPackage
33, enableThreading ? true, coreutils, makeWrapper
44}:
@@ -41,7 +41,14 @@ let
4141 ]
4242 ++ optional stdenv.isSunOS ./ld-shared.patch
4343 ++ optionals stdenv.isDarwin [ ./cpp-precomp.patch ./sw_vers.patch ]
44− ++ optional crossCompiling ./MakeMaker-cross.patch;
44+ ++ optionals crossCompiling [
45+ ./MakeMaker-cross.patch
46+ # https://github.com/arsv/perl-cross/pull/120
47+ (fetchpatch {
48+ url = "https://github.com/arsv/perl-cross/commit/3c318ae6572f8b36cb077c8b49c851e2f5fe181e.patch";
49+ sha256 = "0cmcy8bams3c68f6xadl52z2w378wcpdjzi3qi4pcyvcfs011l6g";
50+ })
51+ ];
4552
4653 # This is not done for native builds because pwd may need to come from
4754 # bootstrap tools when building bootstrap perl.
@@ -59,7 +66,7 @@ let
5966 unset src
6067 '';
6168
62− # Build a thread-safe Perl with a dynamic libperls.o. We need the
69+ # Build a thread-safe Perl with a dynamic libperl.so. We need the
6370 # "installstyle" option to ensure that modules are put under
6471 # $out/lib/perl5 - this is the general default, but because $out
6572 # contains the string "perl", Configure would select $out/lib.
@@ -71,13 +78,14 @@ let
7178 ++ [
7279 "-Uinstallusrbinperl"
7380 "-Dinstallstyle=lib/perl5"
74− "-Duseshrplib"
81+ ] ++ lib.optional (!crossCompiling) "-Duseshrplib" ++ [
7582 "-Dlocincpth=${libcInc}/include"
7683 "-Dloclibpth=${libcLib}/lib"
7784 ]
7885 ++ optionals ((builtins.match ''5\.[0-9]*[13579]\..+'' version) != null) [ "-Dusedevel" "-Uversiononly" ]
7986 ++ optional stdenv.isSunOS "-Dcc=gcc"
8087 ++ optional enableThreading "-Dusethreads"
88+ ++ optional stdenv.hostPlatform.isStatic "--all-static"
8189 ++ optionals (!crossCompiling) [
8290 "-Dprefix=${placeholder "out"}"
8391 "-Dman1dir=${placeholder "out"}/share/man/man1"