diff options
author | Will Dietz <w@wdtz.org> | 2018-01-03 09:51:31 -0600 |
---|---|---|
committer | Will Dietz <w@wdtz.org> | 2018-01-16 14:08:58 -0600 |
commit | 33c132e9b37aa4086537f474d4dffe70ea1e831e (patch) | |
tree | ada766c785cbc9f9ad7da1576f14b338c9b4318d /pkgs/development/compilers/llvm/4 | |
parent | 4dff3ee959035fadc77b0c2ac949a006b4249b20 (diff) | |
download | nixlib-33c132e9b37aa4086537f474d4dffe70ea1e831e.tar nixlib-33c132e9b37aa4086537f474d4dffe70ea1e831e.tar.gz nixlib-33c132e9b37aa4086537f474d4dffe70ea1e831e.tar.bz2 nixlib-33c132e9b37aa4086537f474d4dffe70ea1e831e.tar.lz nixlib-33c132e9b37aa4086537f474d4dffe70ea1e831e.tar.xz nixlib-33c132e9b37aa4086537f474d4dffe70ea1e831e.tar.zst nixlib-33c132e9b37aa4086537f474d4dffe70ea1e831e.zip |
llvm-{4,5}: don't build entire project to get the manpages
Much cheaper to build this way. Also this gives them a different name to avoid confusion and clutter when using `nix-env -qaP` or similar.
Diffstat (limited to 'pkgs/development/compilers/llvm/4')
-rw-r--r-- | pkgs/development/compilers/llvm/4/clang/default.nix | 36 | ||||
-rw-r--r-- | pkgs/development/compilers/llvm/4/default.nix | 2 | ||||
-rw-r--r-- | pkgs/development/compilers/llvm/4/llvm.nix | 30 |
3 files changed, 44 insertions, 24 deletions
diff --git a/pkgs/development/compilers/llvm/4/clang/default.nix b/pkgs/development/compilers/llvm/4/clang/default.nix index 8d40ee3c8aa2..81819f72c417 100644 --- a/pkgs/development/compilers/llvm/4/clang/default.nix +++ b/pkgs/development/compilers/llvm/4/clang/default.nix @@ -5,7 +5,7 @@ let gcc = if stdenv.cc.isGNU then stdenv.cc.cc else stdenv.cc.cc.gcc; - self = stdenv.mkDerivation { + self = stdenv.mkDerivation ({ name = "clang-${version}"; unpackPhase = '' @@ -37,10 +37,6 @@ let patches = [ ./purity.patch ]; - postBuild = stdenv.lib.optionalString enableManpages '' - cmake --build . --target docs-clang-man - ''; - postPatch = '' sed -i -e 's/Args.hasArg(options::OPT_nostdlibinc)/true/' lib/Driver/Tools.cpp sed -i -e 's/DriverArgs.hasArg(options::OPT_nostdlibinc)/true/' lib/Driver/ToolChains.cpp @@ -49,8 +45,7 @@ let sed -i '1s,^,find_package(Sphinx REQUIRED)\n,' docs/CMakeLists.txt ''; - outputs = [ "out" "python" ] - ++ stdenv.lib.optional enableManpages "man"; + outputs = [ "out" "python" ]; # Clang expects to find LLVMgold in its own prefix # Clang expects to find sanitizer libraries in its own prefix @@ -67,13 +62,6 @@ 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/ - - # Move it and other man pages to 'man' output - moveToOutput "share/man" "$man" ''; enableParallelBuilding = true; @@ -92,5 +80,23 @@ let license = stdenv.lib.licenses.ncsa; platforms = stdenv.lib.platforms.all; }; - }; + } // stdenv.lib.optionalAttrs enableManpages { + name = "clang-manpages-${version}"; + + buildPhase = '' + make docs-clang-man + ''; + + installPhase = '' + mkdir -p $out/share/man/man1 + # Manually install clang manpage + cp docs/man/*.1 $out/share/man/man1/ + ''; + + outputs = [ "out" ]; + + doCheck = false; + + meta.description = "man page for Clang ${version}"; + }); in self diff --git a/pkgs/development/compilers/llvm/4/default.nix b/pkgs/development/compilers/llvm/4/default.nix index 5a44cb868253..40b33a308da8 100644 --- a/pkgs/development/compilers/llvm/4/default.nix +++ b/pkgs/development/compilers/llvm/4/default.nix @@ -20,7 +20,7 @@ let # Add man output without introducing extra dependencies. overrideManOutput = drv: let drv-manpages = drv.override { enableManpages = true; }; in - drv // { man = drv-manpages.man; /*outputs = drv.outputs ++ ["man"];*/ }; + drv // { man = drv-manpages.out; /*outputs = drv.outputs ++ ["man"];*/ }; llvm = callPackage ./llvm.nix { inherit compiler-rt_src stdenv; diff --git a/pkgs/development/compilers/llvm/4/llvm.nix b/pkgs/development/compilers/llvm/4/llvm.nix index 33147b07599c..711024c7d3ca 100644 --- a/pkgs/development/compilers/llvm/4/llvm.nix +++ b/pkgs/development/compilers/llvm/4/llvm.nix @@ -27,7 +27,7 @@ let # Used when creating a version-suffixed symlink of libLLVM.dylib shortVersion = with stdenv.lib; concatStringsSep "." (take 2 (splitString "." release_version)); -in stdenv.mkDerivation rec { +in stdenv.mkDerivation (rec { name = "llvm-${version}"; unpackPhase = '' @@ -39,8 +39,7 @@ in stdenv.mkDerivation rec { ''; outputs = [ "out" ] - ++ stdenv.lib.optional enableSharedLibraries "lib" - ++ stdenv.lib.optional enableManpages "man"; + ++ stdenv.lib.optional enableSharedLibraries "lib"; nativeBuildInputs = [ perl groff cmake python ] ++ stdenv.lib.optional enableManpages python.pkgs.sphinx; @@ -129,10 +128,7 @@ in stdenv.mkDerivation rec { export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/lib ''; - postInstall = stdenv.lib.optionalString enableManpages '' - moveToOutput "share/man" "$man" - '' - + stdenv.lib.optionalString enableSharedLibraries '' + postInstall = stdenv.lib.optionalString enableSharedLibraries '' moveToOutput "lib/libLLVM-*" "$lib" moveToOutput "lib/libLLVM${stdenv.hostPlatform.extensions.sharedLibrary}" "$lib" substituteInPlace "$out/lib/cmake/llvm/LLVMExports-${if debugVersion then "debug" else "release"}.cmake" \ @@ -160,4 +156,22 @@ in stdenv.mkDerivation rec { maintainers = with stdenv.lib.maintainers; [ lovek323 raskin viric dtzWill ]; platforms = stdenv.lib.platforms.all; }; -} +} // stdenv.lib.optionalAttrs enableManpages { + name = "llvm-manpages-${version}"; + + buildPhase = '' + make docs-llvm-man + ''; + + propagatedBuildInputs = [ ]; + + installPhase = '' + make -C docs install + ''; + + outputs = [ "out" ]; + + doCheck = false; + + meta.description = "man pages for LLVM ${version}"; +}) |