git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #19198 from acowley/rustc-darwin

rustc: fix build on darwin

commit008344b29a9dceb35b3ef78fe759875aba6cab9b authorJörg Thalheim <joerg@higgsboson.tk> dateMon 3 Oct 2016, 18:42 (10 years ago) parentbeca8943989b8d
1 file changed+14−1
pkgs/development/compilers/rust/rustc.nix+14−1
pkgs/development/compilers/rust/rustc.nix+14−1
@@ -92,6 +92,13 @@ stdenv.mkDerivation {
9292
9393 # Useful debugging parameter
9494 # export VERBOSE=1
95+ '' +
96+ # In src/compiler-rt/cmake/config-ix.cmake, the cmake build falls
97+ # back to darwin 10.4. This causes the OS name to be recorded as
98+ # "10.4" rather than the expected "osx". But mk/rt.mk expects the
99+ # built library name to have an "_osx" suffix on darwin.
100+ optionalString stdenv.isDarwin ''
101+ substituteInPlace mk/rt.mk --replace "_osx" "_10.4"
95102 '';
96103
97104 preConfigure = ''
@@ -118,7 +125,13 @@ stdenv.mkDerivation {
118125
119126 preCheck = ''
120127 export TZDIR=${tzdata}/share/zoneinfo
121− ${optionalString stdenv.isDarwin "export TMPDIR=/tmp"}
128+ '' +
129+ # Ensure TMPDIR is set, and disable a test that removing the HOME
130+ # variable from the environment falls back to another home
131+ # directory.
132+ optionalString stdenv.isDarwin ''
133+ export TMPDIR=/tmp
134+ sed -i '28s/home_dir().is_some()/true/' ./src/test/run-pass/env-home-dir.rs
122135 '';
123136
124137 # Disable doCheck on Darwin to work around upstream issue