* "test" -> "[ ... ]" (style cleanup).
svn path=/nixpkgs/branches/stdenv-updates/; revision=31704
This commit is contained in:
parent
ee45e160b1
commit
698c4d296b
@ -19,7 +19,7 @@ exitHandler() {
|
|||||||
|
|
||||||
closeNest
|
closeNest
|
||||||
|
|
||||||
if test -n "$showBuildStats"; then
|
if [ -n "$showBuildStats" ]; then
|
||||||
times > "$NIX_BUILD_TOP/.times"
|
times > "$NIX_BUILD_TOP/.times"
|
||||||
local -a times=($(cat "$NIX_BUILD_TOP/.times"))
|
local -a times=($(cat "$NIX_BUILD_TOP/.times"))
|
||||||
# Print the following statistics:
|
# Print the following statistics:
|
||||||
@ -30,14 +30,14 @@ exitHandler() {
|
|||||||
echo "build time elapsed: " ${times[*]}
|
echo "build time elapsed: " ${times[*]}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test $exitCode != 0; then
|
if [ $exitCode != 0 ]; then
|
||||||
runHook failureHook
|
runHook failureHook
|
||||||
|
|
||||||
# If the builder had a non-zero exit code and
|
# If the builder had a non-zero exit code and
|
||||||
# $succeedOnFailure is set, create the file
|
# $succeedOnFailure is set, create the file
|
||||||
# `$out/nix-support/failed' to signal failure, and exit
|
# `$out/nix-support/failed' to signal failure, and exit
|
||||||
# normally. Otherwise, return the original exit code.
|
# normally. Otherwise, return the original exit code.
|
||||||
if test -n "$succeedOnFailure"; then
|
if [ -n "$succeedOnFailure" ]; then
|
||||||
echo "build failed with exit code $exitCode (ignored)"
|
echo "build failed with exit code $exitCode (ignored)"
|
||||||
mkdir -p "$out/nix-support"
|
mkdir -p "$out/nix-support"
|
||||||
echo -n $exitCode > "$out/nix-support/failed"
|
echo -n $exitCode > "$out/nix-support/failed"
|
||||||
@ -79,7 +79,7 @@ addToSearchPath() {
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
test -z $NIX_GCC && NIX_GCC=@gcc@
|
[ -z $NIX_GCC ] && NIX_GCC=@gcc@
|
||||||
|
|
||||||
|
|
||||||
# Wildcard expansions that don't match should expand to an empty list.
|
# Wildcard expansions that don't match should expand to an empty list.
|
||||||
@ -91,11 +91,11 @@ shopt -s nullglob
|
|||||||
# Set up the initial path.
|
# Set up the initial path.
|
||||||
PATH=
|
PATH=
|
||||||
for i in $NIX_GCC @initialPath@; do
|
for i in $NIX_GCC @initialPath@; do
|
||||||
if test "$i" = /; then i=; fi
|
if [ "$i" = / ]; then i=; fi
|
||||||
addToSearchPath PATH $i/bin
|
addToSearchPath PATH $i/bin
|
||||||
done
|
done
|
||||||
|
|
||||||
if test "$NIX_DEBUG" = "1"; then
|
if [ "$NIX_DEBUG" = 1 ]; then
|
||||||
echo "initial path: $PATH"
|
echo "initial path: $PATH"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -113,7 +113,7 @@ if [ -z "$SHELL" ]; then echo "SHELL not set"; exit 1; fi
|
|||||||
# Hack: run gcc's setup hook.
|
# Hack: run gcc's setup hook.
|
||||||
envHooks=()
|
envHooks=()
|
||||||
crossEnvHooks=()
|
crossEnvHooks=()
|
||||||
if test -f $NIX_GCC/nix-support/setup-hook; then
|
if [ -f $NIX_GCC/nix-support/setup-hook ]; then
|
||||||
source $NIX_GCC/nix-support/setup-hook
|
source $NIX_GCC/nix-support/setup-hook
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -122,7 +122,7 @@ fi
|
|||||||
ensureDir() {
|
ensureDir() {
|
||||||
local dir
|
local dir
|
||||||
for dir in "$@"; do
|
for dir in "$@"; do
|
||||||
if ! test -x "$dir"; then mkdir -p "$dir"; fi
|
if ! [ -x "$dir" ]; then mkdir -p "$dir"; fi
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -152,11 +152,11 @@ findInputs() {
|
|||||||
|
|
||||||
eval $var="'${!var} $pkg '"
|
eval $var="'${!var} $pkg '"
|
||||||
|
|
||||||
if test -f $pkg/nix-support/setup-hook; then
|
if [ -f $pkg/nix-support/setup-hook ]; then
|
||||||
source $pkg/nix-support/setup-hook
|
source $pkg/nix-support/setup-hook
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test -f $pkg/nix-support/$propagatedBuildInputsFile; then
|
if [ -f $pkg/nix-support/$propagatedBuildInputsFile ]; then
|
||||||
for i in $(cat $pkg/nix-support/$propagatedBuildInputsFile); do
|
for i in $(cat $pkg/nix-support/$propagatedBuildInputsFile); do
|
||||||
findInputs $i $var $propagatedBuildInputsFile
|
findInputs $i $var $propagatedBuildInputsFile
|
||||||
done
|
done
|
||||||
@ -179,7 +179,7 @@ done
|
|||||||
addToNativeEnv() {
|
addToNativeEnv() {
|
||||||
local pkg=$1
|
local pkg=$1
|
||||||
|
|
||||||
if test -d $1/bin; then
|
if [ -d $1/bin ]; then
|
||||||
addToSearchPath _PATH $1/bin
|
addToSearchPath _PATH $1/bin
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -199,7 +199,7 @@ addToCrossEnv() {
|
|||||||
# Some programs put important build scripts (freetype-config and similar)
|
# Some programs put important build scripts (freetype-config and similar)
|
||||||
# into their hostDrv bin path. Intentionally these should go after
|
# into their hostDrv bin path. Intentionally these should go after
|
||||||
# the nativePkgs in PATH.
|
# the nativePkgs in PATH.
|
||||||
if test -d $1/bin; then
|
if [ -d $1/bin ]; then
|
||||||
addToSearchPath _PATH $1/bin
|
addToSearchPath _PATH $1/bin
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -215,12 +215,12 @@ done
|
|||||||
|
|
||||||
|
|
||||||
# Add the output as an rpath.
|
# Add the output as an rpath.
|
||||||
if test "$NIX_NO_SELF_RPATH" != "1"; then
|
if [ "$NIX_NO_SELF_RPATH" != 1 ]; then
|
||||||
export NIX_LDFLAGS="-rpath $out/lib $NIX_LDFLAGS"
|
export NIX_LDFLAGS="-rpath $out/lib $NIX_LDFLAGS"
|
||||||
if test -n "$NIX_LIB64_IN_SELF_RPATH"; then
|
if [ -n "$NIX_LIB64_IN_SELF_RPATH" ]; then
|
||||||
export NIX_LDFLAGS="-rpath $out/lib64 $NIX_LDFLAGS"
|
export NIX_LDFLAGS="-rpath $out/lib64 $NIX_LDFLAGS"
|
||||||
fi
|
fi
|
||||||
if test -n "$NIX_LIB32_IN_SELF_RPATH"; then
|
if [ -n "$NIX_LIB32_IN_SELF_RPATH" ]; then
|
||||||
export NIX_LDFLAGS="-rpath $out/lib32 $NIX_LDFLAGS"
|
export NIX_LDFLAGS="-rpath $out/lib32 $NIX_LDFLAGS"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
@ -235,17 +235,17 @@ export TZ=UTC
|
|||||||
# Set the prefix. This is generally $out, but it can be overriden,
|
# Set the prefix. This is generally $out, but it can be overriden,
|
||||||
# for instance if we just want to perform a test build/install to a
|
# for instance if we just want to perform a test build/install to a
|
||||||
# temporary location and write a build report to $out.
|
# temporary location and write a build report to $out.
|
||||||
if test -z "$prefix"; then
|
if [ -z "$prefix" ]; then
|
||||||
prefix="$out";
|
prefix="$out";
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test "$useTempPrefix" = "1"; then
|
if [ "$useTempPrefix" = 1 ]; then
|
||||||
prefix="$NIX_BUILD_TOP/tmp_prefix";
|
prefix="$NIX_BUILD_TOP/tmp_prefix";
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
PATH=$_PATH${_PATH:+:}$PATH
|
PATH=$_PATH${_PATH:+:}$PATH
|
||||||
if test "$NIX_DEBUG" = "1"; then
|
if [ "$NIX_DEBUG" = 1 ]; then
|
||||||
echo "final path: $PATH"
|
echo "final path: $PATH"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -258,9 +258,9 @@ export NIX_INDENT_MAKE=1
|
|||||||
# means that we're supposed to try and auto-detect the number of
|
# means that we're supposed to try and auto-detect the number of
|
||||||
# available CPU cores at run-time.
|
# available CPU cores at run-time.
|
||||||
|
|
||||||
if test -z "${NIX_BUILD_CORES:-}"; then
|
if [ -z "${NIX_BUILD_CORES:-}" ]; then
|
||||||
NIX_BUILD_CORES="1"
|
NIX_BUILD_CORES="1"
|
||||||
elif test "$NIX_BUILD_CORES" -le 0; then
|
elif [ "$NIX_BUILD_CORES" -le 0 ]; then
|
||||||
NIX_BUILD_CORES=$(nproc 2>/dev/null || true)
|
NIX_BUILD_CORES=$(nproc 2>/dev/null || true)
|
||||||
if expr >/dev/null 2>&1 "$NIX_BUILD_CORES" : "^[0-9][0-9]*$"; then
|
if expr >/dev/null 2>&1 "$NIX_BUILD_CORES" : "^[0-9][0-9]*$"; then
|
||||||
:
|
:
|
||||||
@ -281,13 +281,13 @@ stripDirs() {
|
|||||||
local dirsNew=
|
local dirsNew=
|
||||||
|
|
||||||
for d in ${dirs}; do
|
for d in ${dirs}; do
|
||||||
if test -d "$prefix/$d"; then
|
if [ -d "$prefix/$d" ]; then
|
||||||
dirsNew="${dirsNew} $prefix/$d "
|
dirsNew="${dirsNew} $prefix/$d "
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
dirs=${dirsNew}
|
dirs=${dirsNew}
|
||||||
|
|
||||||
if test -n "${dirs}"; then
|
if [ -n "${dirs}" ]; then
|
||||||
header "stripping (with flags $stripFlags) in $dirs"
|
header "stripping (with flags $stripFlags) in $dirs"
|
||||||
find $dirs -type f -print0 | xargs -0 ${xargsFlags:--r} strip $stripFlags || true
|
find $dirs -type f -print0 | xargs -0 ${xargsFlags:--r} strip $stripFlags || true
|
||||||
stopNest
|
stopNest
|
||||||
@ -354,7 +354,7 @@ substituteAll() {
|
|||||||
|
|
||||||
# Select all environment variables that start with a lowercase character.
|
# Select all environment variables that start with a lowercase character.
|
||||||
for envVar in $(env | sed "s/^[^a-z].*//" | sed "s/^\([^=]*\)=.*/\1/"); do
|
for envVar in $(env | sed "s/^[^a-z].*//" | sed "s/^\([^=]*\)=.*/\1/"); do
|
||||||
if test "$NIX_DEBUG" = "1"; then
|
if [ "$NIX_DEBUG" = "1" ]; then
|
||||||
echo "$envVar -> ${!envVar}"
|
echo "$envVar -> ${!envVar}"
|
||||||
fi
|
fi
|
||||||
args="$args --subst-var $envVar"
|
args="$args --subst-var $envVar"
|
||||||
@ -395,7 +395,7 @@ header() {
|
|||||||
# Make sure that even when we exit abnormally, the original nesting
|
# Make sure that even when we exit abnormally, the original nesting
|
||||||
# level is properly restored.
|
# level is properly restored.
|
||||||
closeNest() {
|
closeNest() {
|
||||||
while test $nestingLevel -gt 0; do
|
while [ $nestingLevel -gt 0 ]; do
|
||||||
stopNest
|
stopNest
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
@ -407,7 +407,7 @@ closeNest() {
|
|||||||
# then go to the build directory and source in `env-vars' to reproduce
|
# then go to the build directory and source in `env-vars' to reproduce
|
||||||
# the environment used for building.
|
# the environment used for building.
|
||||||
dumpVars() {
|
dumpVars() {
|
||||||
if test "$noDumpEnvVars" != "1"; then
|
if [ "$noDumpEnvVars" != 1 ]; then
|
||||||
export > "$NIX_BUILD_TOP/env-vars"
|
export > "$NIX_BUILD_TOP/env-vars"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
@ -439,11 +439,11 @@ unpackFile() {
|
|||||||
unzip $curSrc
|
unzip $curSrc
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
if test -d "$curSrc"; then
|
if [ -d "$curSrc" ]; then
|
||||||
stripHash $curSrc
|
stripHash $curSrc
|
||||||
cp -prvd $curSrc $strippedName
|
cp -prvd $curSrc $strippedName
|
||||||
else
|
else
|
||||||
if test -z "$unpackCmd"; then
|
if [ -z "$unpackCmd" ]; then
|
||||||
echo "source archive $curSrc has unknown type"
|
echo "source archive $curSrc has unknown type"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
@ -459,8 +459,8 @@ unpackFile() {
|
|||||||
unpackPhase() {
|
unpackPhase() {
|
||||||
runHook preUnpack
|
runHook preUnpack
|
||||||
|
|
||||||
if test -z "$srcs"; then
|
if [ -z "$srcs" ]; then
|
||||||
if test -z "$src"; then
|
if [ -z "$src" ]; then
|
||||||
echo 'variable $src or $srcs should point to the source'
|
echo 'variable $src or $srcs should point to the source'
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
@ -473,7 +473,7 @@ unpackPhase() {
|
|||||||
# it's rather hacky.
|
# it's rather hacky.
|
||||||
local dirsBefore=""
|
local dirsBefore=""
|
||||||
for i in *; do
|
for i in *; do
|
||||||
if test -d "$i"; then
|
if [ -d "$i" ]; then
|
||||||
dirsBefore="$dirsBefore $i "
|
dirsBefore="$dirsBefore $i "
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
@ -484,17 +484,17 @@ unpackPhase() {
|
|||||||
done
|
done
|
||||||
|
|
||||||
# Find the source directory.
|
# Find the source directory.
|
||||||
if test -n "$setSourceRoot"; then
|
if [ -n "$setSourceRoot" ]; then
|
||||||
runHook setSourceRoot
|
runHook setSourceRoot
|
||||||
elif test -z "$sourceRoot"; then
|
elif [ -z "$sourceRoot" ]; then
|
||||||
sourceRoot=
|
sourceRoot=
|
||||||
for i in *; do
|
for i in *; do
|
||||||
if test -d "$i"; then
|
if [ -d "$i" ]; then
|
||||||
case $dirsBefore in
|
case $dirsBefore in
|
||||||
*\ $i\ *)
|
*\ $i\ *)
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
if test -n "$sourceRoot"; then
|
if [ -n "$sourceRoot" ]; then
|
||||||
echo "unpacker produced multiple directories"
|
echo "unpacker produced multiple directories"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
@ -505,7 +505,7 @@ unpackPhase() {
|
|||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test -z "$sourceRoot"; then
|
if [ -z "$sourceRoot" ]; then
|
||||||
echo "unpacker appears to have produced no directories"
|
echo "unpacker appears to have produced no directories"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
@ -515,7 +515,7 @@ unpackPhase() {
|
|||||||
# By default, add write permission to the sources. This is often
|
# By default, add write permission to the sources. This is often
|
||||||
# necessary when sources have been copied from other store
|
# necessary when sources have been copied from other store
|
||||||
# locations.
|
# locations.
|
||||||
if test "$dontMakeSourcesWritable" != 1; then
|
if [ "$dontMakeSourcesWritable" != 1 ]; then
|
||||||
chmod -R u+w "$sourceRoot"
|
chmod -R u+w "$sourceRoot"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -526,7 +526,7 @@ unpackPhase() {
|
|||||||
patchPhase() {
|
patchPhase() {
|
||||||
runHook prePatch
|
runHook prePatch
|
||||||
|
|
||||||
if test -z "$patchPhase" -a -z "$patches"; then return; fi
|
if [ -z "$patchPhase" -a -z "$patches" ]; then return; fi
|
||||||
|
|
||||||
for i in $patches; do
|
for i in $patches; do
|
||||||
header "applying patch $i" 3
|
header "applying patch $i" 3
|
||||||
@ -558,34 +558,34 @@ fixLibtool() {
|
|||||||
configurePhase() {
|
configurePhase() {
|
||||||
runHook preConfigure
|
runHook preConfigure
|
||||||
|
|
||||||
if test -z "$configureScript"; then
|
if [ -z "$configureScript" ]; then
|
||||||
configureScript=./configure
|
configureScript=./configure
|
||||||
if ! test -x $configureScript; then
|
if ! [ -x $configureScript ]; then
|
||||||
echo "no configure script, doing nothing"
|
echo "no configure script, doing nothing"
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test -z "$dontFixLibtool"; then
|
if [ -z "$dontFixLibtool" ]; then
|
||||||
for i in $(find . -name "ltmain.sh"); do
|
for i in $(find . -name "ltmain.sh"); do
|
||||||
echo "fixing libtool script $i"
|
echo "fixing libtool script $i"
|
||||||
fixLibtool $i
|
fixLibtool $i
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test -z "$dontAddPrefix"; then
|
if [ -z "$dontAddPrefix" ]; then
|
||||||
configureFlags="${prefixKey:---prefix=}$prefix $configureFlags"
|
configureFlags="${prefixKey:---prefix=}$prefix $configureFlags"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Add --disable-dependency-tracking to speed up some builds.
|
# Add --disable-dependency-tracking to speed up some builds.
|
||||||
if test -z "$dontAddDisableDepTrack"; then
|
if [ -z "$dontAddDisableDepTrack" ]; then
|
||||||
if grep -q dependency-tracking $configureScript; then
|
if grep -q dependency-tracking $configureScript; then
|
||||||
configureFlags="--disable-dependency-tracking $configureFlags"
|
configureFlags="--disable-dependency-tracking $configureFlags"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# By default, disable static builds.
|
# By default, disable static builds.
|
||||||
if test -z "$dontDisableStatic"; then
|
if [ -z "$dontDisableStatic" ]; then
|
||||||
if grep -q enable-static $configureScript; then
|
if grep -q enable-static $configureScript; then
|
||||||
configureFlags="--disable-static $configureFlags"
|
configureFlags="--disable-static $configureFlags"
|
||||||
fi
|
fi
|
||||||
@ -601,7 +601,7 @@ configurePhase() {
|
|||||||
buildPhase() {
|
buildPhase() {
|
||||||
runHook preBuild
|
runHook preBuild
|
||||||
|
|
||||||
if test -z "$makeFlags" && ! test -n "$makefile" -o -e "Makefile" -o -e "makefile" -o -e "GNUmakefile"; then
|
if [ -z "$makeFlags" ] && ! [ -n "$makefile" -o -e "Makefile" -o -e "makefile" -o -e "GNUmakefile" ]; then
|
||||||
echo "no Makefile, doing nothing"
|
echo "no Makefile, doing nothing"
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
@ -632,7 +632,7 @@ checkPhase() {
|
|||||||
patchELF() {
|
patchELF() {
|
||||||
# Patch all ELF executables and shared libraries.
|
# Patch all ELF executables and shared libraries.
|
||||||
header "patching ELF executables and libraries"
|
header "patching ELF executables and libraries"
|
||||||
if test -e "$prefix"; then
|
if [ -e "$prefix" ]; then
|
||||||
find "$prefix" \( \
|
find "$prefix" \( \
|
||||||
\( -type f -a -name "*.so*" \) -o \
|
\( -type f -a -name "*.so*" \) -o \
|
||||||
\( -type f -a -perm +0100 \) \
|
\( -type f -a -perm +0100 \) \
|
||||||
@ -652,9 +652,9 @@ patchShebangs() {
|
|||||||
local f
|
local f
|
||||||
for f in $(find "$dir" -type f -perm +0100); do
|
for f in $(find "$dir" -type f -perm +0100); do
|
||||||
local oldPath=$(sed -ne '1 s,^#![ ]*\([^ ]*\).*$,\1,p' "$f")
|
local oldPath=$(sed -ne '1 s,^#![ ]*\([^ ]*\).*$,\1,p' "$f")
|
||||||
if test -n "$oldPath" -a "${oldPath:0:${#NIX_STORE}}" != "$NIX_STORE"; then
|
if [ -n "$oldPath" -a "${oldPath:0:${#NIX_STORE}}" != "$NIX_STORE" ]; then
|
||||||
local newPath=$(type -P $(basename $oldPath) || true)
|
local newPath=$(type -P $(basename $oldPath) || true)
|
||||||
if test -n "$newPath" -a "$newPath" != "$oldPath"; then
|
if [ -n "$newPath" -a "$newPath" != "$oldPath" ]; then
|
||||||
echo "$f: interpreter changed from $oldPath to $newPath"
|
echo "$f: interpreter changed from $oldPath to $newPath"
|
||||||
sed -i -e "1 s,$oldPath,$newPath," "$f"
|
sed -i -e "1 s,$oldPath,$newPath," "$f"
|
||||||
fi
|
fi
|
||||||
@ -687,15 +687,15 @@ fixupPhase() {
|
|||||||
|
|
||||||
# Put man/doc/info under $out/share.
|
# Put man/doc/info under $out/share.
|
||||||
forceShare=${forceShare:=man doc info}
|
forceShare=${forceShare:=man doc info}
|
||||||
if test -n "$forceShare"; then
|
if [ -n "$forceShare" ]; then
|
||||||
for d in $forceShare; do
|
for d in $forceShare; do
|
||||||
if test -d "$prefix/$d"; then
|
if [ -d "$prefix/$d" ]; then
|
||||||
if test -d "$prefix/share/$d"; then
|
if [ -d "$prefix/share/$d" ]; then
|
||||||
echo "both $d/ and share/$d/ exists!"
|
echo "both $d/ and share/$d/ exists!"
|
||||||
else
|
else
|
||||||
echo "fixing location of $d/ subdirectory"
|
echo "fixing location of $d/ subdirectory"
|
||||||
mkdir -p $prefix/share
|
mkdir -p $prefix/share
|
||||||
if test -w $prefix/share; then
|
if [ -w $prefix/share ]; then
|
||||||
mv -v $prefix/$d $prefix/share
|
mv -v $prefix/$d $prefix/share
|
||||||
ln -sv share/$d $prefix
|
ln -sv share/$d $prefix
|
||||||
fi
|
fi
|
||||||
@ -704,10 +704,10 @@ fixupPhase() {
|
|||||||
done;
|
done;
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test -z "$dontGzipMan"; then
|
if [ -z "$dontGzipMan" ]; then
|
||||||
GLOBIGNORE=.:..:*.gz:*.bz2
|
GLOBIGNORE=.:..:*.gz:*.bz2
|
||||||
for f in $out/share/man/*/* $out/share/man/*/*/*; do
|
for f in $out/share/man/*/* $out/share/man/*/*/*; do
|
||||||
if test -f $f; then
|
if [ -f $f ]; then
|
||||||
if gzip -c $f > $f.gz; then
|
if gzip -c $f > $f.gz; then
|
||||||
rm $f
|
rm $f
|
||||||
else
|
else
|
||||||
@ -719,37 +719,37 @@ fixupPhase() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# TODO: strip _only_ ELF executables, and return || fail here...
|
# TODO: strip _only_ ELF executables, and return || fail here...
|
||||||
if test -z "$dontStrip"; then
|
if [ -z "$dontStrip" ]; then
|
||||||
stripDebugList=${stripDebugList:-lib lib64 libexec bin sbin}
|
stripDebugList=${stripDebugList:-lib lib64 libexec bin sbin}
|
||||||
if test -n "$stripDebugList"; then
|
if [ -n "$stripDebugList" ]; then
|
||||||
stripDirs "$stripDebugList" "${stripDebugFlags:--S}"
|
stripDirs "$stripDebugList" "${stripDebugFlags:--S}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
stripAllList=${stripAllList:-}
|
stripAllList=${stripAllList:-}
|
||||||
if test -n "$stripAllList"; then
|
if [ -n "$stripAllList" ]; then
|
||||||
stripDirs "$stripAllList" "${stripAllFlags:--s}"
|
stripDirs "$stripAllList" "${stripAllFlags:--s}"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test "$havePatchELF" = 1 -a -z "$dontPatchELF"; then
|
if [ "$havePatchELF" = 1 -a -z "$dontPatchELF" ]; then
|
||||||
patchELF "$prefix"
|
patchELF "$prefix"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test -z "$dontPatchShebangs"; then
|
if [ -z "$dontPatchShebangs" ]; then
|
||||||
patchShebangs "$prefix"
|
patchShebangs "$prefix"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test -n "$propagatedBuildInputs"; then
|
if [ -n "$propagatedBuildInputs" ]; then
|
||||||
mkdir -p "$out/nix-support"
|
mkdir -p "$out/nix-support"
|
||||||
echo "$propagatedBuildInputs" > "$out/nix-support/propagated-build-inputs"
|
echo "$propagatedBuildInputs" > "$out/nix-support/propagated-build-inputs"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test -n "$propagatedBuildNativeInputs"; then
|
if [ -n "$propagatedBuildNativeInputs" ]; then
|
||||||
mkdir -p "$out/nix-support"
|
mkdir -p "$out/nix-support"
|
||||||
echo "$propagatedBuildNativeInputs" > "$out/nix-support/propagated-build-native-inputs"
|
echo "$propagatedBuildNativeInputs" > "$out/nix-support/propagated-build-native-inputs"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test -n "$setupHook"; then
|
if [ -n "$setupHook" ]; then
|
||||||
mkdir -p "$out/nix-support"
|
mkdir -p "$out/nix-support"
|
||||||
substituteAll "$setupHook" "$out/nix-support/setup-hook"
|
substituteAll "$setupHook" "$out/nix-support/setup-hook"
|
||||||
fi
|
fi
|
||||||
@ -764,7 +764,7 @@ distPhase() {
|
|||||||
echo "dist flags: $distFlags ${distFlagsArray[@]}"
|
echo "dist flags: $distFlags ${distFlagsArray[@]}"
|
||||||
make ${makefile:+-f $makefile} $distFlags "${distFlagsArray[@]}" ${distTarget:-dist}
|
make ${makefile:+-f $makefile} $distFlags "${distFlagsArray[@]}" ${distTarget:-dist}
|
||||||
|
|
||||||
if test "$dontCopyDist" != 1; then
|
if [ "$dontCopyDist" != 1 ]; then
|
||||||
mkdir -p "$out/tarballs"
|
mkdir -p "$out/tarballs"
|
||||||
|
|
||||||
# Note: don't quote $tarballs, since we explicitly permit
|
# Note: don't quote $tarballs, since we explicitly permit
|
||||||
@ -794,12 +794,12 @@ showPhaseHeader() {
|
|||||||
genericBuild() {
|
genericBuild() {
|
||||||
header "building $out"
|
header "building $out"
|
||||||
|
|
||||||
if test -n "$buildCommand"; then
|
if [ -n "$buildCommand" ]; then
|
||||||
eval "$buildCommand"
|
eval "$buildCommand"
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test -z "$phases"; then
|
if [ -z "$phases" ]; then
|
||||||
phases="$prePhases unpackPhase patchPhase $preConfigurePhases \
|
phases="$prePhases unpackPhase patchPhase $preConfigurePhases \
|
||||||
configurePhase $preBuildPhases buildPhase checkPhase \
|
configurePhase $preBuildPhases buildPhase checkPhase \
|
||||||
$preInstallPhases installPhase fixupPhase \
|
$preInstallPhases installPhase fixupPhase \
|
||||||
@ -807,11 +807,11 @@ genericBuild() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
for curPhase in $phases; do
|
for curPhase in $phases; do
|
||||||
if test "$curPhase" = buildPhase -a -n "$dontBuild"; then continue; fi
|
if [ "$curPhase" = buildPhase -a -n "$dontBuild" ]; then continue; fi
|
||||||
if test "$curPhase" = checkPhase -a -z "$doCheck"; then continue; fi
|
if [ "$curPhase" = checkPhase -a -z "$doCheck" ]; then continue; fi
|
||||||
if test "$curPhase" = installPhase -a -n "$dontInstall"; then continue; fi
|
if [ "$curPhase" = installPhase -a -n "$dontInstall" ]; then continue; fi
|
||||||
if test "$curPhase" = fixupPhase -a -n "$dontFixup"; then continue; fi
|
if [ "$curPhase" = fixupPhase -a -n "$dontFixup" ]; then continue; fi
|
||||||
if test "$curPhase" = distPhase -a -z "$doDist"; then continue; fi
|
if [ "$curPhase" = distPhase -a -z "$doDist" ]; then continue; fi
|
||||||
|
|
||||||
if [ -n "$tracePhases" ]; then
|
if [ -n "$tracePhases" ]; then
|
||||||
echo
|
echo
|
||||||
@ -825,7 +825,7 @@ genericBuild() {
|
|||||||
# function named $curPhase.
|
# function named $curPhase.
|
||||||
eval "${!curPhase:-$curPhase}"
|
eval "${!curPhase:-$curPhase}"
|
||||||
|
|
||||||
if test "$curPhase" = unpackPhase; then
|
if [ "$curPhase" = unpackPhase ]; then
|
||||||
cd "${sourceRoot:-.}"
|
cd "${sourceRoot:-.}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user