diff --git a/pkgs/development/compilers/llvm/3.9/clang/default.nix b/pkgs/development/compilers/llvm/3.9/clang/default.nix index 910682271103..ec2ec27df363 100644 --- a/pkgs/development/compilers/llvm/3.9/clang/default.nix +++ b/pkgs/development/compilers/llvm/3.9/clang/default.nix @@ -13,7 +13,9 @@ let mv clang-tools-extra-* $sourceRoot/tools/extra ''; - buildInputs = [ cmake libedit libxml2 llvm python ]; + nativeBuildInputs = [ cmake ]; + + buildInputs = [ libedit libxml2 llvm python ]; cmakeFlags = [ "-DCMAKE_CXX_FLAGS=-std=c++11" diff --git a/pkgs/development/compilers/llvm/3.9/llvm.nix b/pkgs/development/compilers/llvm/3.9/llvm.nix index 2c47ec5127f9..964b6232fb54 100644 --- a/pkgs/development/compilers/llvm/3.9/llvm.nix +++ b/pkgs/development/compilers/llvm/3.9/llvm.nix @@ -15,10 +15,15 @@ , compiler-rt_src , libcxxabi , debugVersion ? false -, enableSharedLibraries ? true +, enableSharedLibraries ? (buildPlatform == hostPlatform) , darwin +, buildPackages +, buildPlatform +, hostPlatform }: +assert (hostPlatform != buildPlatform) -> !enableSharedLibraries; + let src = fetch "llvm" "1vi9sf7rx1q04wj479rsvxayb6z740iaz3qniwp266fgp5a07n8z"; shlib = if stdenv.isDarwin then "dylib" else "so"; @@ -39,8 +44,17 @@ in stdenv.mkDerivation rec { outputs = [ "out" ] ++ stdenv.lib.optional enableSharedLibraries "lib"; - buildInputs = [ perl groff cmake libxml2 python libffi ] - ++ stdenv.lib.optionals stdenv.isDarwin [ libcxxabi ]; + nativeBuildInputs = [ + perl + cmake + python + ]; + + buildInputs = [ + groff + libxml2 + libffi + ] ++ stdenv.lib.optionals stdenv.isDarwin [ libcxxabi ]; propagatedBuildInputs = [ ncurses zlib ]; @@ -88,6 +102,9 @@ in stdenv.mkDerivation rec { ++ stdenv.lib.optionals (isDarwin) [ "-DLLVM_ENABLE_LIBCXX=ON" "-DCAN_TARGET_i386=false" + ] ++ stdenv.lib.optionals (buildPlatform != hostPlatform) [ + "-DCMAKE_CROSSCOMPILING=True" + "-DLLVM_TABLEGEN=${buildPackages.llvmPackages_39.llvm}/bin/llvm-tblgen" ]; postBuild = '' diff --git a/pkgs/tools/text/groff/default.nix b/pkgs/tools/text/groff/default.nix index df6a1119800e..aa9ece8955b4 100644 --- a/pkgs/tools/text/groff/default.nix +++ b/pkgs/tools/text/groff/default.nix @@ -1,6 +1,7 @@ { stdenv, fetchurl, perl, groff , ghostscript #for postscript and html output , psutils, netpbm #for html output +, buildPackages }: stdenv.mkDerivation rec { @@ -49,7 +50,7 @@ stdenv.mkDerivation rec { # Trick to get the build system find the proper 'native' groff # http://www.mail-archive.com/bug-groff@gnu.org/msg01335.html preBuild = '' - makeFlags="GROFF_BIN_PATH=${groff}/bin GROFFBIN=${groff}/bin/groff" + makeFlags="GROFF_BIN_PATH=${buildPackages.groff}/bin GROFFBIN=${buildPackages.groff}/bin/groff" ''; };