about summary refs log tree commit diff
path: root/pkgs/development/compilers/llvm/5/clang
diff options
context:
space:
mode:
authorWill Dietz <w@wdtz.org>2018-01-03 09:51:31 -0600
committerWill Dietz <w@wdtz.org>2018-01-16 14:08:58 -0600
commit33c132e9b37aa4086537f474d4dffe70ea1e831e (patch)
treeada766c785cbc9f9ad7da1576f14b338c9b4318d /pkgs/development/compilers/llvm/5/clang
parent4dff3ee959035fadc77b0c2ac949a006b4249b20 (diff)
downloadnixlib-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/5/clang')
-rw-r--r--pkgs/development/compilers/llvm/5/clang/default.nix36
1 files changed, 21 insertions, 15 deletions
diff --git a/pkgs/development/compilers/llvm/5/clang/default.nix b/pkgs/development/compilers/llvm/5/clang/default.nix
index b003d2f334ac..fdcfbfc3f3ed 100644
--- a/pkgs/development/compilers/llvm/5/clang/default.nix
+++ b/pkgs/development/compilers/llvm/5/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/DriverArgs.hasArg(options::OPT_nostdlibinc)/true/' \
              -e 's/Args.hasArg(options::OPT_nostdlibinc)/true/' \
@@ -50,8 +46,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
@@ -68,13 +63,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;
@@ -93,5 +81,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