From d32f51c618471104e3363a2e99c12334d8ed6691 Mon Sep 17 00:00:00 2001 From: Jan Malakhovski Date: Wed, 5 Sep 2018 18:35:16 +0000 Subject: [PATCH] cc-wrapper, bintools-wrapper: simply symlink man and info outputs With the previous commit `propagateDoc` is now always given the correct value (i.e. it is never set to `true` when there are no `man` and `info` outputs). Hence, we can simply symlink the original outputs to the wrapper outputs. Pros: - simpler, less indirection compared to `propagated-user-env-packages`, - uses less inodes (1 symlink, which nix then simply automatically resolves and removes, vs. two directories and a file), - makes direct references like "export MANPATH=${stdenv.cc.man}/share/man" simply work. Cons: - I'm not aware of any. This and the previous commit together almost completely revert commits fde7296a4749efadbeb8b608b7b4cc01c3a6e6d7, fa412972091538376d1d4ffd446803b5d9385cbb, and c981787db951afb11c1328461df82d4277ebec07. --- pkgs/build-support/bintools-wrapper/default.nix | 5 ++--- pkgs/build-support/cc-wrapper/default.nix | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/pkgs/build-support/bintools-wrapper/default.nix b/pkgs/build-support/bintools-wrapper/default.nix index f9ca245beea6..813ef620e3ed 100644 --- a/pkgs/build-support/bintools-wrapper/default.nix +++ b/pkgs/build-support/bintools-wrapper/default.nix @@ -268,9 +268,8 @@ stdenv.mkDerivation { ## Man page and info support ## - mkdir -p $man/nix-support $info/nix-support - echo ${bintools.man or ""} >> $man/nix-support/propagated-user-env-packages - echo ${bintools.info or ""} >> $info/nix-support/propagated-user-env-packages + ln -s ${bintools.man} $man + ln -s ${bintools.info} $info '' + '' diff --git a/pkgs/build-support/cc-wrapper/default.nix b/pkgs/build-support/cc-wrapper/default.nix index e59758371a38..4a8c95175bee 100644 --- a/pkgs/build-support/cc-wrapper/default.nix +++ b/pkgs/build-support/cc-wrapper/default.nix @@ -263,9 +263,8 @@ stdenv.mkDerivation { ## Man page and info support ## - 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 + ln -s ${cc.man} $man + ln -s ${cc.info} $info '' + ''