WIP
This commit is contained in:
parent
77da5efc78
commit
3ec413cece
|
@ -2,7 +2,7 @@
|
|||
# $out/share/man to $man/share/man; and moves $out/share/doc to
|
||||
# $man/share/doc.
|
||||
|
||||
preFixupHooks+=(_moveDocs)
|
||||
preFixupHooks+=(_moveToShare)
|
||||
|
||||
_moveToShare() {
|
||||
forceShare=${forceShare:=man doc info}
|
||||
|
@ -21,30 +21,3 @@ _moveToShare() {
|
|||
done
|
||||
}
|
||||
|
||||
_moveToOutput() {
|
||||
local d="$1"
|
||||
local dst="$2"
|
||||
if [ -z "$dst" -a ! -e $dst/$d ]; then return; fi
|
||||
local output
|
||||
for output in $outputs; do
|
||||
if [ "${!output}" = "$dst" ]; then continue; fi
|
||||
if [ -d "${!output}/$d" ]; then
|
||||
echo "moving ${!output}/$d to $dst/$d"
|
||||
mkdir -p $dst/share
|
||||
mv ${!output}/$d $dst/$d
|
||||
break
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
_moveDocs() {
|
||||
_moveToShare
|
||||
_moveToOutput share/man "$man"
|
||||
_moveToOutput share/info "$info"
|
||||
_moveToOutput share/doc "$doc"
|
||||
|
||||
# Remove empty share directory.
|
||||
if [ -d "$out/share" ]; then
|
||||
rmdir $out/share 2> /dev/null || true
|
||||
fi
|
||||
}
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
preConfigureHooks+=(_multioutConfig)
|
||||
preFixupHooks+=(_multioutDocs)
|
||||
postFixupHooks+=(_multioutPropagateDev)
|
||||
|
||||
|
||||
# Assign the first nonempty string to variable named $1
|
||||
_assignFirst() {
|
||||
|
@ -28,14 +31,17 @@ _assignFirst outputDoc "$outputDoc" "$doc" "$out"
|
|||
_assignFirst outputMan "$outputMan" "$man" "$outputBin"
|
||||
_assignFirst outputInfo "$outputInfo" "$info" "$outputMan"
|
||||
|
||||
# put propagated*BuildInputs into $outputDev instead of $out
|
||||
propagateIntoOutput="$outputDev"
|
||||
|
||||
# Add standard flags to put files into the desired outputs.
|
||||
_multioutConfig() {
|
||||
if [ -n "${setOutputFlags-1}" ]; then
|
||||
configureFlags="\
|
||||
--bindir=$outputBin/bin --sbindir=$outputBin/sbin --libexecdir=$outputBin/libexec \
|
||||
--bindir=$outputBin/bin --sbindir=$outputBin/sbin \
|
||||
--includedir=$outputInclude/include --oldincludedir=$outputInclude/include \
|
||||
--mandir=$outputMan/share/man --infodir=$outputInfo/share/info --docdir=$outputDoc/share/doc \
|
||||
--libdir=$outputLib/lib \
|
||||
--libdir=$outputLib/lib --libexecdir=$outputLib/libexec \
|
||||
$configureFlags"
|
||||
|
||||
installFlags="\
|
||||
|
@ -49,3 +55,40 @@ _multioutConfig() {
|
|||
_addRpathPrefix "$outputLib"
|
||||
NIX_NO_SELF_RPATH=1
|
||||
|
||||
_multioutDocs() {
|
||||
_moveToOutput share/man "$outputMan"
|
||||
_moveToOutput share/info "$outputInfo"
|
||||
_moveToOutput share/doc "$outputDoc"
|
||||
|
||||
# Remove empty share directory.
|
||||
if [ -d "$out/share" ]; then
|
||||
rmdir "$out/share" 2> /dev/null || true
|
||||
fi
|
||||
}
|
||||
_moveToOutput() {
|
||||
local d="$1"
|
||||
local dst="$2"
|
||||
if [ -z "$dst" -a ! -e $dst/$d ]; then return; fi
|
||||
local output
|
||||
for output in $outputs; do
|
||||
if [ "${!output}" = "$dst" ]; then continue; fi
|
||||
if [ -d "${!output}/$d" ]; then
|
||||
echo "moving ${!output}/$d to $dst/$d"
|
||||
mkdir -p $dst/share
|
||||
mv ${!output}/$d $dst/$d
|
||||
break
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
_multioutPropagateDev() {
|
||||
if [ "$outputInclude" != "$outputDev" ]; then
|
||||
mkdir -p "$outputDev"/nix-support
|
||||
echo "$outputInclude" >> "$outputDev"/nix-support/propagated-build-inputs
|
||||
fi
|
||||
if [ "$outputLib" != "$outputDev" ]; then
|
||||
mkdir -p "$outputDev"/nix-support
|
||||
echo "$outputLib" >> "$outputDev"/nix-support/propagated-build-inputs
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
|
@ -262,7 +262,7 @@ stdenv.mkDerivation ({
|
|||
++ (optional (perl != null) perl)
|
||||
++ (optional javaAwtGtk pkgconfig);
|
||||
|
||||
buildInputs = [ gmp mpfr mpc libelf ]
|
||||
buildInputs = [ stdenv.hookLib.multiout gmp mpfr mpc libelf ]
|
||||
++ (optional (ppl != null) ppl)
|
||||
++ (optional (cloog != null) cloog)
|
||||
++ (optional (zlib != null) zlib)
|
||||
|
|
|
@ -282,7 +282,7 @@ stdenv.mkDerivation ({
|
|||
++ (optional (perl != null) perl)
|
||||
++ (optional javaAwtGtk pkgconfig);
|
||||
|
||||
buildInputs = [ gmp mpfr mpc libelf ]
|
||||
buildInputs = [ stdenv.hookLib.multiout gmp mpfr mpc libelf ]
|
||||
++ (optional (ppl != null) ppl)
|
||||
++ (optional (cloog != null) cloog)
|
||||
++ (optional (isl != null) isl)
|
||||
|
|
|
@ -20,6 +20,8 @@ stdenv.mkDerivation rec {
|
|||
|
||||
# TODO: Add a "dev" output containing the header files.
|
||||
outputs = [ "out" "man" ];
|
||||
buildInputs = [ stdenv.hookLib.multiout ];
|
||||
setOutputFlags = false;
|
||||
|
||||
setOutputConfigureFlags = false;
|
||||
|
||||
|
|
|
@ -106,7 +106,10 @@ stdenv.mkDerivation ({
|
|||
|
||||
installFlags = [ "sysconfdir=$(out)/etc" ];
|
||||
|
||||
buildInputs = stdenv.lib.optionals (cross != null) [ gccCross ]
|
||||
outputs = [ "out" "dev" "bin" "static" ];
|
||||
|
||||
buildInputs = [ stdenv.hookLib.multiout ]
|
||||
++ stdenv.lib.optionals (cross != null) [ gccCross ]
|
||||
++ stdenv.lib.optional (mig != null) mig
|
||||
++ stdenv.lib.optionals withGd [ gd libpng ];
|
||||
|
||||
|
|
|
@ -25,8 +25,6 @@ in
|
|||
|
||||
builder = ./builder.sh;
|
||||
|
||||
outputs = [ "out" "dev" "bin" "static" ];
|
||||
|
||||
# When building glibc from bootstrap-tools, we need libgcc_s at RPATH for
|
||||
# any program we run, because the gcc will have been placed at a new
|
||||
# store path than that determined when built (as a source for the
|
||||
|
|
|
@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
|
|||
|
||||
setupHook = [ ./setup-hook.sh ];
|
||||
|
||||
doCheck = true;
|
||||
#doCheck = true; # problems when loading libc.so.6
|
||||
|
||||
meta = {
|
||||
homepage = http://nixos.org/patchelf.html;
|
||||
|
|
|
@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
|
|||
sha256 = "1njfwh2z34r2c4r0iqa7v24wmjzvsfyz4vplzry8ln3479lfywal";
|
||||
};
|
||||
|
||||
buildInputs = [ perl xz ]
|
||||
buildInputs = [ perl xz.bin ]
|
||||
++ stdenv.lib.optional interactive ncurses;
|
||||
|
||||
preInstall = ''
|
||||
|
|
|
@ -144,6 +144,20 @@ ensureDir() {
|
|||
}
|
||||
|
||||
|
||||
# Add $1/lib* into rpaths.
|
||||
# The function is used in multiple-outputs.sh hook,
|
||||
# so it is defined here but tried after the hook.
|
||||
_addRpathPrefix() {
|
||||
if [ "$NIX_NO_SELF_RPATH" != 1 ]; then
|
||||
export NIX_LDFLAGS="-rpath $1/lib $NIX_LDFLAGS"
|
||||
if [ -n "$NIX_LIB64_IN_SELF_RPATH" ]; then
|
||||
export NIX_LDFLAGS="-rpath $1/lib64 $NIX_LDFLAGS"
|
||||
fi
|
||||
if [ -n "$NIX_LIB32_IN_SELF_RPATH" ]; then
|
||||
export NIX_LDFLAGS="-rpath $1/lib32 $NIX_LDFLAGS"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
######################################################################
|
||||
# Initialisation.
|
||||
|
@ -259,18 +273,6 @@ for i in $crossPkgs; do
|
|||
done
|
||||
|
||||
|
||||
# Add $1/lib* into rpaths.
|
||||
_addRpathPrefix() {
|
||||
if [ "$NIX_NO_SELF_RPATH" != 1 ]; then
|
||||
export NIX_LDFLAGS="-rpath $1/lib $NIX_LDFLAGS"
|
||||
if [ -n "$NIX_LIB64_IN_SELF_RPATH" ]; then
|
||||
export NIX_LDFLAGS="-rpath $1/lib64 $NIX_LDFLAGS"
|
||||
fi
|
||||
if [ -n "$NIX_LIB32_IN_SELF_RPATH" ]; then
|
||||
export NIX_LDFLAGS="-rpath $1/lib32 $NIX_LDFLAGS"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
_addRpathPrefix "$out"
|
||||
|
||||
|
||||
|
@ -614,7 +616,7 @@ configurePhase() {
|
|||
done
|
||||
fi
|
||||
|
||||
if [ -z "$dontAddPrefix" ]; then
|
||||
if [ -z "$dontAddPrefix" -a -n "$prefix" ]; then
|
||||
configureFlags="${prefixKey:---prefix=}$prefix $configureFlags"
|
||||
fi
|
||||
|
||||
|
@ -676,7 +678,9 @@ checkPhase() {
|
|||
installPhase() {
|
||||
runHook preInstall
|
||||
|
||||
if [ -n "$prefix" ]; then
|
||||
mkdir -p "$prefix"
|
||||
fi
|
||||
|
||||
installTargets=${installTargets:-install}
|
||||
echo "install flags: $installTargets $makeFlags ${makeFlagsArray[@]} $installFlags ${installFlagsArray[@]}"
|
||||
|
@ -780,8 +784,6 @@ showPhaseHeader() {
|
|||
|
||||
|
||||
genericBuild() {
|
||||
header "building $out"
|
||||
|
||||
if [ -n "$buildCommand" ]; then
|
||||
eval "$buildCommand"
|
||||
return
|
||||
|
@ -825,8 +827,6 @@ genericBuild() {
|
|||
|
||||
stopNest
|
||||
done
|
||||
|
||||
stopNest
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -8,7 +8,8 @@ stdenv.mkDerivation rec {
|
|||
sha256 = "1404i59bp6rzxya0br1q9njdv32z4sggyfrkjr7vq695hk94hv0n";
|
||||
};
|
||||
|
||||
outputs = [ "out" "dev" "man" "doc" ];
|
||||
outputs = [ "dev" "out" "bin" "man" "doc" ];
|
||||
buildInputs = [ stdenv.hookLib.multiout ];
|
||||
|
||||
doCheck = true;
|
||||
|
||||
|
|
Loading…
Reference in a new issue