diff options
author | Daiderd Jordan <daiderd@gmail.com> | 2017-06-05 12:44:07 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-05 12:44:07 +0200 |
commit | 30f329e74b73644e16d49746cc4bbae93f42ae4b (patch) | |
tree | 21baea9d9d127521eae981e9c76b7d988e77cb22 /pkgs/development/compilers | |
parent | e2b0896cf6214a43613ba921b04148e7d8e86bac (diff) | |
parent | 9e2aba35728de7012a0692f75a3f24685f0fc28b (diff) | |
download | nixpkgs-30f329e74b73644e16d49746cc4bbae93f42ae4b.tar nixpkgs-30f329e74b73644e16d49746cc4bbae93f42ae4b.tar.gz nixpkgs-30f329e74b73644e16d49746cc4bbae93f42ae4b.tar.bz2 nixpkgs-30f329e74b73644e16d49746cc4bbae93f42ae4b.tar.lz nixpkgs-30f329e74b73644e16d49746cc4bbae93f42ae4b.tar.xz nixpkgs-30f329e74b73644e16d49746cc4bbae93f42ae4b.tar.zst nixpkgs-30f329e74b73644e16d49746cc4bbae93f42ae4b.zip |
Merge pull request #26310 from LnL7/darwin-stdenv-no-sphinx
darwin-stdenv: remove python dependencies
Diffstat (limited to 'pkgs/development/compilers')
-rw-r--r-- | pkgs/development/compilers/llvm/4/clang/default.nix | 20 | ||||
-rw-r--r-- | pkgs/development/compilers/llvm/4/llvm.nix | 24 |
2 files changed, 29 insertions, 15 deletions
diff --git a/pkgs/development/compilers/llvm/4/clang/default.nix b/pkgs/development/compilers/llvm/4/clang/default.nix index bc286eaf05e..64dbaa21dd4 100644 --- a/pkgs/development/compilers/llvm/4/clang/default.nix +++ b/pkgs/development/compilers/llvm/4/clang/default.nix @@ -1,5 +1,6 @@ { stdenv, fetch, cmake, libxml2, libedit, llvm, version, release_version, clang-tools-extra_src, python , fixDarwinDylibNames +, enableManpages ? true }: let @@ -15,25 +16,28 @@ let mv clang-tools-extra-* $sourceRoot/tools/extra ''; - nativeBuildInputs = [ cmake python python.pkgs.sphinx ]; + nativeBuildInputs = [ cmake python ] + ++ stdenv.lib.optional enableManpages python.pkgs.sphinx; + buildInputs = [ libedit libxml2 llvm ] ++ stdenv.lib.optional stdenv.isDarwin fixDarwinDylibNames; cmakeFlags = [ "-DCMAKE_CXX_FLAGS=-std=c++11" + ] ++ stdenv.lib.optionals enableManpages [ "-DCLANG_INCLUDE_DOCS=ON" "-DLLVM_ENABLE_SPHINX=ON" "-DSPHINX_OUTPUT_MAN=ON" "-DSPHINX_OUTPUT_HTML=OFF" "-DSPHINX_WARNINGS_AS_ERRORS=OFF" - ] ++ + ] # Maybe with compiler-rt this won't be needed? - (stdenv.lib.optional stdenv.isLinux "-DGCC_INSTALL_PREFIX=${gcc}") ++ - (stdenv.lib.optional (stdenv.cc.libc != null) "-DC_INCLUDE_DIRS=${stdenv.cc.libc}/include"); + ++ stdenv.lib.optional stdenv.isLinux "-DGCC_INSTALL_PREFIX=${gcc}" + ++ stdenv.lib.optional (stdenv.cc.libc != null) "-DC_INCLUDE_DIRS=${stdenv.cc.libc}/include"; patches = [ ./purity.patch ]; - postBuild = '' + postBuild = stdenv.lib.optionalString enableManpages '' cmake --build . --target docs-clang-man ''; @@ -45,7 +49,8 @@ let sed -i '1s,^,find_package(Sphinx REQUIRED)\n,' docs/CMakeLists.txt ''; - outputs = [ "out" "man" "python" ]; + outputs = [ "out" "python" ] + ++ stdenv.lib.optional enableManpages "man"; # Clang expects to find LLVMgold in its own prefix # Clang expects to find sanitizer libraries in its own prefix @@ -62,7 +67,8 @@ let mv $out/share/clang/*.py $python/share/clang rm $out/bin/c-index-test - + '' + + stdenv.lib.optionalString enableManpages '' # Manually install clang manpage cp docs/man/*.1 $out/share/man/man1/ diff --git a/pkgs/development/compilers/llvm/4/llvm.nix b/pkgs/development/compilers/llvm/4/llvm.nix index 1a78d672bfe..98c24495355 100644 --- a/pkgs/development/compilers/llvm/4/llvm.nix +++ b/pkgs/development/compilers/llvm/4/llvm.nix @@ -16,6 +16,7 @@ , compiler-rt_src , libcxxabi , debugVersion ? false +, enableManpages ? true , enableSharedLibraries ? true , darwin }: @@ -38,9 +39,13 @@ in stdenv.mkDerivation rec { mv compiler-rt-* $sourceRoot/projects/compiler-rt ''; - outputs = [ "out" "man" ] ++ stdenv.lib.optional enableSharedLibraries "lib"; + outputs = [ "out" ] + ++ stdenv.lib.optional enableSharedLibraries "lib" + ++ stdenv.lib.optional enableManpages "man"; + + nativeBuildInputs = [ perl groff cmake python ] + ++ stdenv.lib.optional enableManpages python.pkgs.sphinx; - nativeBuildInputs = [ perl groff cmake python python.pkgs.sphinx ]; buildInputs = [ libxml2 libffi ] ++ stdenv.lib.optionals stdenv.isDarwin [ libcxxabi ]; @@ -81,16 +86,19 @@ in stdenv.mkDerivation rec { "-DLLVM_ENABLE_FFI=ON" "-DLLVM_ENABLE_RTTI=ON" "-DCOMPILER_RT_INCLUDE_TESTS=OFF" # FIXME: requires clang source code + ] + ++ stdenv.lib.optional enableSharedLibraries + "-DLLVM_LINK_LLVM_DYLIB=ON" + ++ stdenv.lib.optionals enableManpages [ "-DLLVM_BUILD_DOCS=ON" "-DLLVM_ENABLE_SPHINX=ON" "-DSPHINX_OUTPUT_MAN=ON" "-DSPHINX_OUTPUT_HTML=OFF" "-DSPHINX_WARNINGS_AS_ERRORS=OFF" - ] ++ stdenv.lib.optional enableSharedLibraries [ - "-DLLVM_LINK_LLVM_DYLIB=ON" - ] ++ stdenv.lib.optional (!isDarwin) + ] + ++ stdenv.lib.optional (!isDarwin) "-DLLVM_BINUTILS_INCDIR=${binutils.dev}/include" - ++ stdenv.lib.optionals (isDarwin) [ + ++ stdenv.lib.optionals (isDarwin) [ "-DLLVM_ENABLE_LIBCXX=ON" "-DCAN_TARGET_i386=false" ]; @@ -109,10 +117,10 @@ in stdenv.mkDerivation rec { export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/lib ''; - postInstall = '' + postInstall = stdenv.lib.optionalString enableManpages '' moveToOutput "share/man" "$man" '' - + stdenv.lib.optionalString (enableSharedLibraries) '' + + stdenv.lib.optionalString enableSharedLibraries '' moveToOutput "lib/libLLVM-*" "$lib" moveToOutput "lib/libLLVM.${shlib}" "$lib" substituteInPlace "$out/lib/cmake/llvm/LLVMExports-release.cmake" \ |