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