about summary refs log tree commit diff
diff options
context:
space:
mode:
authorvolth <volth@webmaster.ms>2018-10-12 12:36:48 +0000
committerGitHub <noreply@github.com>2018-10-12 12:36:48 +0000
commitfbeeed1c5c81dec0823ca12691a6cd66d5c7599f (patch)
treedc96e676ae5f5cc2fc642d316ce9cb7d008d3158
parentc4afb45af52ab976e2ee18fb1cf06531e0fd35e1 (diff)
downloadnixlib-fbeeed1c5c81dec0823ca12691a6cd66d5c7599f.tar
nixlib-fbeeed1c5c81dec0823ca12691a6cd66d5c7599f.tar.gz
nixlib-fbeeed1c5c81dec0823ca12691a6cd66d5c7599f.tar.bz2
nixlib-fbeeed1c5c81dec0823ca12691a6cd66d5c7599f.tar.lz
nixlib-fbeeed1c5c81dec0823ca12691a6cd66d5c7599f.tar.xz
nixlib-fbeeed1c5c81dec0823ca12691a6cd66d5c7599f.tar.zst
nixlib-fbeeed1c5c81dec0823ca12691a6cd66d5c7599f.zip
p7zip: fix cross-compilation
-rw-r--r--pkgs/tools/archivers/p7zip/default.nix4
1 files changed, 4 insertions, 0 deletions
diff --git a/pkgs/tools/archivers/p7zip/default.nix b/pkgs/tools/archivers/p7zip/default.nix
index 4886217211df..5430c2cb73e7 100644
--- a/pkgs/tools/archivers/p7zip/default.nix
+++ b/pkgs/tools/archivers/p7zip/default.nix
@@ -20,6 +20,10 @@ stdenv.mkDerivation rec {
 
     # I think this is a typo and should be CXX? Either way let's kill it
     sed -i '/XX=\/usr/d' makefile.macosx_llvm_64bits
+  '' + stdenv.lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform) ''
+    substituteInPlace makefile.machine \
+      --replace 'CC=gcc'  'CC=${stdenv.cc.targetPrefix}gcc' \
+      --replace 'CXX=g++' 'CXX=${stdenv.cc.targetPrefix}g++'
   '';
 
   preConfigure = ''