summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorJörg Thalheim <joerg@higgsboson.tk>2016-10-03 18:42:20 +0200
committerGitHub <noreply@github.com>2016-10-03 18:42:20 +0200
commit008344b29a9dceb35b3ef78fe759875aba6cab9b (patch)
tree0036e725c7ecd5e1006cb051f5c7eba441767cde /pkgs
parentbeca8946eedc76ad679b32150413920ed490535c (diff)
parent3989b8da4341237d4a4c3334fc11d98c3c0f7ae2 (diff)
downloadnixlib-008344b29a9dceb35b3ef78fe759875aba6cab9b.tar
nixlib-008344b29a9dceb35b3ef78fe759875aba6cab9b.tar.gz
nixlib-008344b29a9dceb35b3ef78fe759875aba6cab9b.tar.bz2
nixlib-008344b29a9dceb35b3ef78fe759875aba6cab9b.tar.lz
nixlib-008344b29a9dceb35b3ef78fe759875aba6cab9b.tar.xz
nixlib-008344b29a9dceb35b3ef78fe759875aba6cab9b.tar.zst
nixlib-008344b29a9dceb35b3ef78fe759875aba6cab9b.zip
Merge pull request #19198 from acowley/rustc-darwin
rustc: fix build on darwin
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/development/compilers/rust/rustc.nix15
1 files changed, 14 insertions, 1 deletions
diff --git a/pkgs/development/compilers/rust/rustc.nix b/pkgs/development/compilers/rust/rustc.nix
index f8f0e6df0d84..44964f53a44c 100644
--- a/pkgs/development/compilers/rust/rustc.nix
+++ b/pkgs/development/compilers/rust/rustc.nix
@@ -92,6 +92,13 @@ stdenv.mkDerivation {
 
     # Useful debugging parameter
     # export VERBOSE=1
+  '' +
+  # In src/compiler-rt/cmake/config-ix.cmake, the cmake build falls
+  # back to darwin 10.4. This causes the OS name to be recorded as
+  # "10.4" rather than the expected "osx". But mk/rt.mk expects the
+  # built library name to have an "_osx" suffix on darwin.
+  optionalString stdenv.isDarwin ''
+    substituteInPlace mk/rt.mk --replace "_osx" "_10.4"
   '';
 
   preConfigure = ''
@@ -118,7 +125,13 @@ stdenv.mkDerivation {
 
   preCheck = ''
     export TZDIR=${tzdata}/share/zoneinfo
-    ${optionalString stdenv.isDarwin "export TMPDIR=/tmp"}
+  '' +
+  # Ensure TMPDIR is set, and disable a test that removing the HOME
+  # variable from the environment falls back to another home
+  # directory.
+  optionalString stdenv.isDarwin ''
+    export TMPDIR=/tmp
+    sed -i '28s/home_dir().is_some()/true/' ./src/test/run-pass/env-home-dir.rs
   '';
 
   # Disable doCheck on Darwin to work around upstream issue