bintools-wrapper: allow building without documentation

This commit is contained in:
Jan Malakhovski 2018-02-01 00:00:00 +00:00
parent 0586da4b37
commit 0ab1067d12

View File

@ -5,7 +5,8 @@
# script that sets up the right environment variables so that the # script that sets up the right environment variables so that the
# compiler and the linker just "work". # compiler and the linker just "work".
{ name ? "", stdenvNoCC, nativeTools, noLibc ? false, nativeLibc, nativePrefix ? "" { name ? ""
, stdenvNoCC, nativeTools, propagateDoc ? !nativeTools, noLibc ? false, nativeLibc, nativePrefix ? ""
, bintools ? null, libc ? null , bintools ? null, libc ? null
, coreutils ? null, shell ? stdenvNoCC.shell, gnugrep ? null , coreutils ? null, shell ? stdenvNoCC.shell, gnugrep ? null
, extraPackages ? [], extraBuildCommands ? "" , extraPackages ? [], extraBuildCommands ? ""
@ -15,7 +16,7 @@
with stdenvNoCC.lib; with stdenvNoCC.lib;
assert nativeTools -> nativePrefix != ""; assert nativeTools -> !propagateDoc && nativePrefix != "";
assert !nativeTools -> assert !nativeTools ->
bintools != null && coreutils != null && gnugrep != null; bintools != null && coreutils != null && gnugrep != null;
assert !(nativeLibc && noLibc); assert !(nativeLibc && noLibc);
@ -83,7 +84,7 @@ stdenv.mkDerivation {
inherit targetPrefix infixSalt; inherit targetPrefix infixSalt;
outputs = [ "out" "info" "man" ]; outputs = [ "out" ] ++ optionals propagateDoc [ "man" "info" ];
passthru = { passthru = {
inherit bintools libc nativeTools nativeLibc nativePrefix; inherit bintools libc nativeTools nativeLibc nativePrefix;
@ -111,7 +112,7 @@ stdenv.mkDerivation {
'' ''
set -u set -u
mkdir -p $out/bin {$out,$info,$man}/nix-support mkdir -p $out/bin $out/nix-support
wrap() { wrap() {
local dst="$1" local dst="$1"
@ -237,28 +238,27 @@ stdenv.mkDerivation {
'') '')
+ optionalString (!nativeTools) '' + optionalString (!nativeTools) ''
## ##
## User env support ## User env support
## ##
# Propagate the underling unwrapped bintools so that if you # Propagate the underling unwrapped bintools so that if you
# install the wrapper, you get tools like objdump, the manpages, # install the wrapper, you get tools like objdump (same for any
# etc. as well (same for any binaries of libc). # binaries of libc).
printWords ${bintools_bin} ${if libc == null then "" else libc_bin} > $out/nix-support/propagated-user-env-packages printWords ${bintools_bin} ${if libc == null then "" else libc_bin} > $out/nix-support/propagated-user-env-packages
''
+ optionalString propagateDoc ''
## ##
## Man page and info support ## Man page and info support
## ##
printWords ${bintools.info or ""} \ mkdir -p $man/nix-support $info/nix-support
>> $info/nix-support/propagated-build-inputs printWords ${bintools.man or ""} >> $man/nix-support/propagated-build-inputs
printWords ${bintools.man or ""} \ printWords ${bintools.info or ""} >> $info/nix-support/propagated-build-inputs
>> $man/nix-support/propagated-build-inputs
'' ''
+ '' + ''
## ##
## Hardening support ## Hardening support
## ##
@ -286,8 +286,8 @@ stdenv.mkDerivation {
## ##
## Extra custom steps ## Extra custom steps
## ##
'' ''
+ extraBuildCommands; + extraBuildCommands;
inherit dynamicLinker expand-response-params; inherit dynamicLinker expand-response-params;