Merge pull request #138553 from alyssais/perl-static

pkgsStatic.perl: fix build

authored by

Stig and committed by
GitHub
807370df d05d3218

+12 -4
+12 -4
pkgs/development/interpreters/perl/default.nix
··· 1 - { config, lib, stdenv, fetchurl, fetchFromGitHub, pkgs, buildPackages 1 + { config, lib, stdenv, fetchurl, fetchpatch, fetchFromGitHub, pkgs, buildPackages 2 2 , callPackage 3 3 , enableThreading ? true, coreutils, makeWrapper 4 4 }: ··· 41 41 ] 42 42 ++ optional stdenv.isSunOS ./ld-shared.patch 43 43 ++ 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 + ]; 45 52 46 53 # This is not done for native builds because pwd may need to come from 47 54 # bootstrap tools when building bootstrap perl. ··· 59 66 unset src 60 67 ''; 61 68 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 63 70 # "installstyle" option to ensure that modules are put under 64 71 # $out/lib/perl5 - this is the general default, but because $out 65 72 # contains the string "perl", Configure would select $out/lib. ··· 71 78 ++ [ 72 79 "-Uinstallusrbinperl" 73 80 "-Dinstallstyle=lib/perl5" 74 - "-Duseshrplib" 81 + ] ++ lib.optional (!crossCompiling) "-Duseshrplib" ++ [ 75 82 "-Dlocincpth=${libcInc}/include" 76 83 "-Dloclibpth=${libcLib}/lib" 77 84 ] 78 85 ++ optionals ((builtins.match ''5\.[0-9]*[13579]\..+'' version) != null) [ "-Dusedevel" "-Uversiononly" ] 79 86 ++ optional stdenv.isSunOS "-Dcc=gcc" 80 87 ++ optional enableThreading "-Dusethreads" 88 + ++ optional stdenv.hostPlatform.isStatic "--all-static" 81 89 ++ optionals (!crossCompiling) [ 82 90 "-Dprefix=${placeholder "out"}" 83 91 "-Dman1dir=${placeholder "out"}/share/man/man1"