diff options
| author | Matthew Bauer <mjbauer95@gmail.com> | 2019-03-12 16:52:13 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-03-12 16:52:13 -0400 |
| commit | 573a6930a0380b1061ad927705c83e8ccf92a096 (patch) | |
| tree | e5d2b392b0f97fd6ba7adf29c95ba9a45145a01d | |
| parent | db: enable parallel building (diff) | |
| parent | perlPackages.TermReadKey: add workarounds for cross compilation (diff) | |
| download | nixpkgs-573a6930a0380b1061ad927705c83e8ccf92a096.tar.gz | |
Merge pull request #56019 from illegalprime/fix/perlPackages.TermReadKey-cross
perlPackages.TermReadKey: add workarounds for cross compilation
| -rw-r--r-- | pkgs/development/perl-modules/generic/default.nix | 4 | ||||
| -rw-r--r-- | pkgs/top-level/perl-packages.nix | 19 |
2 files changed, 20 insertions, 3 deletions
diff --git a/pkgs/development/perl-modules/generic/default.nix b/pkgs/development/perl-modules/generic/default.nix index a87e0c616fd8..5b4d9ffa15c4 100644 --- a/pkgs/development/perl-modules/generic/default.nix +++ b/pkgs/development/perl-modules/generic/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, perl }: +{ lib, stdenv, perl, buildPackages }: { nativeBuildInputs ? [], name, ... } @ attrs: @@ -37,6 +37,6 @@ stdenv.mkDerivation ( name = "perl${perl.version}-${name}"; builder = ./builder.sh; nativeBuildInputs = nativeBuildInputs ++ [ (perl.dev or perl) ]; - inherit perl; + perl = buildPackages.perl; } ) diff --git a/pkgs/top-level/perl-packages.nix b/pkgs/top-level/perl-packages.nix index e409895e8dad..85ad62cfc005 100644 --- a/pkgs/top-level/perl-packages.nix +++ b/pkgs/top-level/perl-packages.nix @@ -5,7 +5,8 @@ for each package in a separate file: the call to the function would be almost as much code as the function itself. */ -{config, pkgs, fetchurl, fetchFromGitHub, stdenv, gnused, perl, overrides}: +{config, pkgs, fetchurl, fetchFromGitHub, stdenv, gnused, perl, overrides, + buildPackages}: # cpan2nix assumes that perl-packages.nix will be used only with perl 5.28.1 or above assert stdenv.lib.versionAtLeast perl.version "5.28.1"; @@ -14634,6 +14635,22 @@ let url = "mirror://cpan/authors/id/J/JS/JSTOWE/${name}.tar.gz"; sha256 = "143jlibah1g14bym7sj3gphvqkpj1w4vn7sqc4vc62jpviw5hr2s"; }; + cross = stdenv.hostPlatform != stdenv.buildPlatform; + + # use native libraries from the host when running build commands + postConfigure = if cross then let + host_perl = buildPackages.perl; + host_self = buildPackages.perlPackages.TermReadKey; + perl_lib = "${host_perl}/lib/perl5/${host_perl.version}"; + self_lib = "${host_self}/lib/perl5/site_perl/${host_perl.version}"; + in '' + sed -ie 's|"-I$(INST_ARCHLIB)"|"-I${perl_lib}" "-I${self_lib}"|g' Makefile + '' else null; + + # TermReadKey uses itself in the build process + nativeBuildInputs = if cross then [ + buildPackages.perlPackages.TermReadKey + ] else []; }; TermReadLineGnu = buildPerlPackage rec { |
