summary refs log tree commit diff
path: root/pkgs/build-support/cc-wrapper
diff options
context:
space:
mode:
authorJohn Ericson <Ericson2314@yahoo.com>2018-02-26 18:06:11 -0500
committerGitHub <noreply@github.com>2018-02-26 18:06:11 -0500
commit4a29081a941bdd30ad7882805e8124aa59d87e81 (patch)
treeb9601367f3b641fe99cfae3324139b7b4b048b1f /pkgs/build-support/cc-wrapper
parentb4cf3f79092475a332136eab55d48ce613b3e043 (diff)
parentd45e39c9a9961544933bfd5b3b59ea47b1c7efb3 (diff)
downloadnixpkgs-4a29081a941bdd30ad7882805e8124aa59d87e81.tar
nixpkgs-4a29081a941bdd30ad7882805e8124aa59d87e81.tar.gz
nixpkgs-4a29081a941bdd30ad7882805e8124aa59d87e81.tar.bz2
nixpkgs-4a29081a941bdd30ad7882805e8124aa59d87e81.tar.lz
nixpkgs-4a29081a941bdd30ad7882805e8124aa59d87e81.tar.xz
nixpkgs-4a29081a941bdd30ad7882805e8124aa59d87e81.tar.zst
nixpkgs-4a29081a941bdd30ad7882805e8124aa59d87e81.zip
Merge pull request #35071 from oxij/stdenv/infopages
stdenv, bash: fixing info pages and stuff
Diffstat (limited to 'pkgs/build-support/cc-wrapper')
-rw-r--r--pkgs/build-support/cc-wrapper/default.nix22
1 files changed, 11 insertions, 11 deletions
diff --git a/pkgs/build-support/cc-wrapper/default.nix b/pkgs/build-support/cc-wrapper/default.nix
index 8de2366ff5f..ba8aca87c72 100644
--- a/pkgs/build-support/cc-wrapper/default.nix
+++ b/pkgs/build-support/cc-wrapper/default.nix
@@ -5,7 +5,8 @@
 # script that sets up the right environment variables so that the
 # compiler and the linker just "work".
 
-{ name ? "", stdenvNoCC, nativeTools, noLibc ? false, nativeLibc, nativePrefix ? ""
+{ name ? ""
+, stdenvNoCC, nativeTools, propagateDoc ? !nativeTools, noLibc ? false, nativeLibc, nativePrefix ? ""
 , cc ? null, libc ? null, bintools, coreutils ? null, shell ? stdenvNoCC.shell
 , zlib ? null, extraPackages ? [], extraBuildCommands ? ""
 , isGNU ? false, isClang ? cc.isClang or false, gnugrep ? null
@@ -14,7 +15,7 @@
 
 with stdenvNoCC.lib;
 
-assert nativeTools -> nativePrefix != "";
+assert nativeTools -> !propagateDoc && nativePrefix != "";
 assert !nativeTools ->
   cc != null && coreutils != null && gnugrep != null;
 assert !(nativeLibc && noLibc);
@@ -84,7 +85,7 @@ stdenv.mkDerivation {
 
   inherit targetPrefix infixSalt;
 
-  outputs = [ "out" "man" ];
+  outputs = [ "out" ] ++ optionals propagateDoc [ "man" "info" ];
 
   passthru = {
     # "cc" is the generic name for a C compiler, but there is no one for package
@@ -115,7 +116,7 @@ stdenv.mkDerivation {
     ''
       set -u
 
-      mkdir -p $out/bin $out/nix-support $man/nix-support
+      mkdir -p $out/bin $out/nix-support
 
       wrap() {
         local dst="$1"
@@ -246,7 +247,6 @@ stdenv.mkDerivation {
     ''
 
     + optionalString (!nativeTools) ''
-
       ##
       ## Initial CFLAGS
       ##
@@ -276,19 +276,19 @@ stdenv.mkDerivation {
 
       echo "$ccLDFlags" > $out/nix-support/cc-ldflags
       echo "$ccCFlags" > $out/nix-support/cc-cflags
+    ''
 
+    + optionalString propagateDoc ''
       ##
-      ## User env support
+      ## Man page and info support
       ##
 
-      # Propagate the wrapped cc so that if you install the wrapper,
-      # you get tools like gcov, the manpages, etc. as well (including
-      # for binutils and Glibc).
+      mkdir -p $man/nix-support $info/nix-support
       printWords ${cc.man or ""}  > $man/nix-support/propagated-user-env-packages
+      printWords ${cc.info or ""}  > $info/nix-support/propagated-user-env-packages
     ''
 
     + ''
-
       ##
       ## Hardening support
       ##
@@ -308,8 +308,8 @@ stdenv.mkDerivation {
       ##
       ## Extra custom steps
       ##
-
     ''
+
     + extraBuildCommands;
 
   inherit expand-response-params;