From 69ce8a09493860112ed0447023418a82132977f0 Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Thu, 18 Aug 2022 11:12:44 +0100 Subject: [PATCH] mc, pkgsCross.ppc64.mc: fixx cross-build by adding PERL_FOR_BUILD Without the change build system tries to execute perl for host (instead of build) and fails as: install: cannot stat './mc.hlp.es': No such file or directory The change pulls patch pending upstream inclusion where `PERL_FOR_BUILD` is introduced to complement `PERL` for such cases. --- pkgs/applications/file-managers/mc/default.nix | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/file-managers/mc/default.nix b/pkgs/applications/file-managers/mc/default.nix index 6f80c2c5e928..0153b8fe93c6 100644 --- a/pkgs/applications/file-managers/mc/default.nix +++ b/pkgs/applications/file-managers/mc/default.nix @@ -1,5 +1,6 @@ { lib, stdenv , fetchurl +, buildPackages , pkg-config , glib , gpm @@ -31,6 +32,15 @@ stdenv.mkDerivation rec { sha256 = "sha256-6ZTZvppxcumsSkrWIQeSH2qjEuZosFbf5bi867r1OAM="; }; + patches = [ + # Add support for PERL_FOR_BUILD to fix cross-compilation: + # https://midnight-commander.org/ticket/4399 + (fetchurl { + url = "https://midnight-commander.org/raw-attachment/ticket/4399/0001-configure.ac-introduce-PERL_FOR_BUILD.patch"; + hash = "sha256-i4cbg/pner+yPfgmP04DEIvpNDlM9YDca1TNBdhWhwI="; + }) + ]; + nativeBuildInputs = [ pkg-config autoreconfHook unzip ] # The preFixup hook rewrites the binary, which invaliates the code # signature. Add the fixup hook to sign the output. @@ -52,7 +62,12 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; - configureFlags = [ "PERL=${perl}/bin/perl" ]; + configureFlags = [ + # used for vfs helpers at run time: + "PERL=${perl}/bin/perl" + # used for .hlp generation at build time: + "PERL_FOR_BUILD=${buildPackages.perl}/bin/perl" + ]; postPatch = '' substituteInPlace src/filemanager/ext.c \