git.iko.soy/typeable/nixpkgs
on master help sign in
rustc: fix build on darwin

The OS is identified as "10.4" rather than "osx". This commit removes the 'rt' build script's hard coding of the "osx" suffix when building on darwin since the cmake configuration falls back to building a 10.4 compatible libclang_rt.

commit3989b8da4341237d4a4c3334fc11d98c3c0f7ae2 authorAnthony Cowley <acowley@gmail.com> dateSun 2 Oct 2016, 16:01 (10 years ago) parent63393b2
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