summary refs log tree commit diff
path: root/pkgs/applications/file-managers/mc/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/applications/file-managers/mc/default.nix')
-rw-r--r--pkgs/applications/file-managers/mc/default.nix17
1 files changed, 16 insertions, 1 deletions
diff --git a/pkgs/applications/file-managers/mc/default.nix b/pkgs/applications/file-managers/mc/default.nix
index 6f80c2c5e928d..0153b8fe93c6d 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 \