Remove trailing whitespace
This commit is contained in:
parent
cf8daf6312
commit
f4ed8a3b91
|
@ -1,7 +1,7 @@
|
||||||
# Run the named hook, either by calling the function with that name or
|
# Run the named hook, either by calling the function with that name or
|
||||||
# by evaluating the variable with that name. This allows convenient
|
# by evaluating the variable with that name. This allows convenient
|
||||||
# setting of hooks both from Nix expressions (as attributes /
|
# setting of hooks both from Nix expressions (as attributes /
|
||||||
# environment variables) and from shell scripts (as functions).
|
# environment variables) and from shell scripts (as functions).
|
||||||
runHook() {
|
runHook() {
|
||||||
local hookName="$1"
|
local hookName="$1"
|
||||||
case "$(type -t $hookName)" in
|
case "$(type -t $hookName)" in
|
||||||
|
@ -29,10 +29,10 @@ exitHandler() {
|
||||||
# - system time for all child processes
|
# - system time for all child processes
|
||||||
echo "build time elapsed: " ${times[*]}
|
echo "build time elapsed: " ${times[*]}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $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
|
||||||
|
@ -43,11 +43,11 @@ exitHandler() {
|
||||||
echo -n $exitCode > "$out/nix-support/failed"
|
echo -n $exitCode > "$out/nix-support/failed"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
else
|
else
|
||||||
runHook exitHook
|
runHook exitHook
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exit $exitCode
|
exit $exitCode
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -462,7 +462,7 @@ unpackFile() {
|
||||||
|
|
||||||
unpackPhase() {
|
unpackPhase() {
|
||||||
runHook preUnpack
|
runHook preUnpack
|
||||||
|
|
||||||
if [ -z "$srcs" ]; then
|
if [ -z "$srcs" ]; then
|
||||||
if [ -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'
|
||||||
|
@ -529,9 +529,9 @@ unpackPhase() {
|
||||||
|
|
||||||
patchPhase() {
|
patchPhase() {
|
||||||
runHook prePatch
|
runHook prePatch
|
||||||
|
|
||||||
if [ -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
|
||||||
local uncompress=cat
|
local uncompress=cat
|
||||||
|
@ -728,7 +728,7 @@ fixupPhase() {
|
||||||
if [ -n "$stripDebugList" ]; then
|
if [ -n "$stripDebugList" ]; then
|
||||||
stripDirs "$stripDebugList" "${stripDebugFlags:--S}"
|
stripDirs "$stripDebugList" "${stripDebugFlags:--S}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
stripAllList=${stripAllList:-}
|
stripAllList=${stripAllList:-}
|
||||||
if [ -n "$stripAllList" ]; then
|
if [ -n "$stripAllList" ]; then
|
||||||
stripDirs "$stripAllList" "${stripAllFlags:--s}"
|
stripDirs "$stripAllList" "${stripAllFlags:--s}"
|
||||||
|
@ -844,7 +844,7 @@ genericBuild() {
|
||||||
|
|
||||||
showPhaseHeader "$curPhase"
|
showPhaseHeader "$curPhase"
|
||||||
dumpVars
|
dumpVars
|
||||||
|
|
||||||
# Evaluate the variable named $curPhase if it exists, otherwise the
|
# Evaluate the variable named $curPhase if it exists, otherwise the
|
||||||
# function named $curPhase.
|
# function named $curPhase.
|
||||||
eval "${!curPhase:-$curPhase}"
|
eval "${!curPhase:-$curPhase}"
|
||||||
|
@ -852,7 +852,7 @@ genericBuild() {
|
||||||
if [ "$curPhase" = unpackPhase ]; then
|
if [ "$curPhase" = unpackPhase ]; then
|
||||||
cd "${sourceRoot:-.}"
|
cd "${sourceRoot:-.}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "$tracePhases" ]; then
|
if [ -n "$tracePhases" ]; then
|
||||||
echo
|
echo
|
||||||
echo "@ phase-succeeded $out $curPhase"
|
echo "@ phase-succeeded $out $curPhase"
|
||||||
|
|
|
@ -32,11 +32,11 @@ rec {
|
||||||
|
|
||||||
# The bootstrap process proceeds in several steps.
|
# The bootstrap process proceeds in several steps.
|
||||||
|
|
||||||
|
|
||||||
# 1) Create a standard environment by downloading pre-built binaries
|
# 1) Create a standard environment by downloading pre-built binaries
|
||||||
# of coreutils, GCC, etc.
|
# of coreutils, GCC, etc.
|
||||||
|
|
||||||
|
|
||||||
# This function downloads a file.
|
# This function downloads a file.
|
||||||
download = {url, sha256}: derivation {
|
download = {url, sha256}: derivation {
|
||||||
name = baseNameOf (toString url);
|
name = baseNameOf (toString url);
|
||||||
|
@ -49,31 +49,31 @@ rec {
|
||||||
impureEnvVars = [ "http_proxy" "https_proxy" "ftp_proxy" "all_proxy" "no_proxy" ];
|
impureEnvVars = [ "http_proxy" "https_proxy" "ftp_proxy" "all_proxy" "no_proxy" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
# Download and unpack the bootstrap tools (coreutils, GCC, Glibc, ...).
|
# Download and unpack the bootstrap tools (coreutils, GCC, Glibc, ...).
|
||||||
bootstrapTools = derivation {
|
bootstrapTools = derivation {
|
||||||
name = "bootstrap-tools";
|
name = "bootstrap-tools";
|
||||||
|
|
||||||
builder = bootstrapFiles.sh;
|
builder = bootstrapFiles.sh;
|
||||||
|
|
||||||
args =
|
args =
|
||||||
if system == "armv5tel-linux"
|
if system == "armv5tel-linux"
|
||||||
then [ ./scripts/unpack-bootstrap-tools-arm.sh ]
|
then [ ./scripts/unpack-bootstrap-tools-arm.sh ]
|
||||||
else [ ./scripts/unpack-bootstrap-tools.sh ];
|
else [ ./scripts/unpack-bootstrap-tools.sh ];
|
||||||
|
|
||||||
inherit (bootstrapFiles) bzip2 mkdir curl cpio;
|
inherit (bootstrapFiles) bzip2 mkdir curl cpio;
|
||||||
|
|
||||||
tarball = download {
|
tarball = download {
|
||||||
inherit (bootstrapFiles.bootstrapTools) url sha256;
|
inherit (bootstrapFiles.bootstrapTools) url sha256;
|
||||||
};
|
};
|
||||||
|
|
||||||
inherit system;
|
inherit system;
|
||||||
|
|
||||||
# Needed by the GCC wrapper.
|
# Needed by the GCC wrapper.
|
||||||
langC = true;
|
langC = true;
|
||||||
langCC = true;
|
langCC = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
# This function builds the various standard environments used during
|
# This function builds the various standard environments used during
|
||||||
# the bootstrap.
|
# the bootstrap.
|
||||||
|
@ -109,7 +109,7 @@ rec {
|
||||||
fetchurl = null;
|
fetchurl = null;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
fetchurl = import ../../build-support/fetchurl {
|
fetchurl = import ../../build-support/fetchurl {
|
||||||
stdenv = stdenvLinuxBoot0;
|
stdenv = stdenvLinuxBoot0;
|
||||||
curl = bootstrapTools;
|
curl = bootstrapTools;
|
||||||
|
@ -133,7 +133,7 @@ rec {
|
||||||
# A helper function to call gcc-wrapper.
|
# A helper function to call gcc-wrapper.
|
||||||
wrapGCC =
|
wrapGCC =
|
||||||
{gcc ? bootstrapTools, libc, binutils, coreutils, shell ? "", name ? "bootstrap-gcc-wrapper"}:
|
{gcc ? bootstrapTools, libc, binutils, coreutils, shell ? "", name ? "bootstrap-gcc-wrapper"}:
|
||||||
|
|
||||||
import ../../build-support/gcc-wrapper {
|
import ../../build-support/gcc-wrapper {
|
||||||
nativeTools = false;
|
nativeTools = false;
|
||||||
nativeLibc = false;
|
nativeLibc = false;
|
||||||
|
@ -153,7 +153,7 @@ rec {
|
||||||
};
|
};
|
||||||
inherit fetchurl;
|
inherit fetchurl;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
# 2) These are the packages that we can build with the first
|
# 2) These are the packages that we can build with the first
|
||||||
# stdenv. We only need binutils, because recent Glibcs
|
# stdenv. We only need binutils, because recent Glibcs
|
||||||
|
@ -164,7 +164,7 @@ rec {
|
||||||
bootStdenv = stdenvLinuxBoot1;
|
bootStdenv = stdenvLinuxBoot1;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
# 3) 2nd stdenv that we will use to build only the glibc.
|
# 3) 2nd stdenv that we will use to build only the glibc.
|
||||||
stdenvLinuxBoot2 = stdenvBootFun {
|
stdenvLinuxBoot2 = stdenvBootFun {
|
||||||
gcc = wrapGCC {
|
gcc = wrapGCC {
|
||||||
|
@ -186,12 +186,12 @@ rec {
|
||||||
bootStdenv = stdenvLinuxBoot2;
|
bootStdenv = stdenvLinuxBoot2;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
# 5) Build Glibc with the bootstrap tools. The result is the full,
|
# 5) Build Glibc with the bootstrap tools. The result is the full,
|
||||||
# dynamically linked, final Glibc.
|
# dynamically linked, final Glibc.
|
||||||
stdenvLinuxGlibc = stdenvLinuxBoot2Pkgs.glibc;
|
stdenvLinuxGlibc = stdenvLinuxBoot2Pkgs.glibc;
|
||||||
|
|
||||||
|
|
||||||
# 6) Construct a third stdenv identical to the 2nd, except that
|
# 6) Construct a third stdenv identical to the 2nd, except that
|
||||||
# this one uses the Glibc built in step 3. It still uses
|
# this one uses the Glibc built in step 3. It still uses
|
||||||
# the recent binutils and rest of the bootstrap tools, including GCC.
|
# the recent binutils and rest of the bootstrap tools, including GCC.
|
||||||
|
@ -217,14 +217,14 @@ rec {
|
||||||
inherit fetchurl;
|
inherit fetchurl;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
# 7) The packages that can be built using the third stdenv.
|
# 7) The packages that can be built using the third stdenv.
|
||||||
stdenvLinuxBoot3Pkgs = allPackages {
|
stdenvLinuxBoot3Pkgs = allPackages {
|
||||||
inherit system platform;
|
inherit system platform;
|
||||||
bootStdenv = stdenvLinuxBoot3;
|
bootStdenv = stdenvLinuxBoot3;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
# 8) Construct a fourth stdenv identical to the second, except that
|
# 8) Construct a fourth stdenv identical to the second, except that
|
||||||
# this one uses the dynamically linked GCC and Binutils from step
|
# this one uses the dynamically linked GCC and Binutils from step
|
||||||
# 5. The other tools (e.g. coreutils) are still from the
|
# 5. The other tools (e.g. coreutils) are still from the
|
||||||
|
@ -245,14 +245,14 @@ rec {
|
||||||
inherit fetchurl;
|
inherit fetchurl;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
# 9) The packages that can be built using the fourth stdenv.
|
# 9) The packages that can be built using the fourth stdenv.
|
||||||
stdenvLinuxBoot4Pkgs = allPackages {
|
stdenvLinuxBoot4Pkgs = allPackages {
|
||||||
inherit system platform;
|
inherit system platform;
|
||||||
bootStdenv = stdenvLinuxBoot4;
|
bootStdenv = stdenvLinuxBoot4;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
# 10) Construct the final stdenv. It uses the Glibc, GCC and
|
# 10) Construct the final stdenv. It uses the Glibc, GCC and
|
||||||
# Binutils built above, and adds in dynamically linked versions
|
# Binutils built above, and adds in dynamically linked versions
|
||||||
# of all other tools.
|
# of all other tools.
|
||||||
|
@ -262,10 +262,10 @@ rec {
|
||||||
# first binutils built.
|
# first binutils built.
|
||||||
stdenvLinux = import ../generic rec {
|
stdenvLinux = import ../generic rec {
|
||||||
inherit system config;
|
inherit system config;
|
||||||
|
|
||||||
preHook = commonPreHook;
|
preHook = commonPreHook;
|
||||||
|
|
||||||
initialPath =
|
initialPath =
|
||||||
((import ../common-path.nix) {pkgs = stdenvLinuxBoot4Pkgs;})
|
((import ../common-path.nix) {pkgs = stdenvLinuxBoot4Pkgs;})
|
||||||
++ [stdenvLinuxBoot4Pkgs.patchelf];
|
++ [stdenvLinuxBoot4Pkgs.patchelf];
|
||||||
|
|
||||||
|
@ -279,9 +279,9 @@ rec {
|
||||||
};
|
};
|
||||||
|
|
||||||
shell = stdenvLinuxBoot4Pkgs.bash + "/bin/bash";
|
shell = stdenvLinuxBoot4Pkgs.bash + "/bin/bash";
|
||||||
|
|
||||||
fetchurlBoot = fetchurl;
|
fetchurlBoot = fetchurl;
|
||||||
|
|
||||||
extraAttrs = {
|
extraAttrs = {
|
||||||
inherit (stdenvLinuxBoot3Pkgs) glibc;
|
inherit (stdenvLinuxBoot3Pkgs) glibc;
|
||||||
inherit platform;
|
inherit platform;
|
||||||
|
|
|
@ -12,7 +12,7 @@ import ../generic rec {
|
||||||
export NIX_DONT_SET_RPATH=1
|
export NIX_DONT_SET_RPATH=1
|
||||||
export NIX_NO_SELF_RPATH=1
|
export NIX_NO_SELF_RPATH=1
|
||||||
dontFixLibtool=1
|
dontFixLibtool=1
|
||||||
stripAllFlags=" " # the Darwin "strip" command doesn't know "-s"
|
stripAllFlags=" " # the Darwin "strip" command doesn't know "-s"
|
||||||
xargsFlags=" "
|
xargsFlags=" "
|
||||||
fi
|
fi
|
||||||
'';
|
'';
|
||||||
|
@ -25,7 +25,7 @@ import ../generic rec {
|
||||||
nativeTools = false;
|
nativeTools = false;
|
||||||
nativeLibc = true;
|
nativeLibc = true;
|
||||||
inherit stdenv;
|
inherit stdenv;
|
||||||
binutils =
|
binutils =
|
||||||
if stdenv.isDarwin then
|
if stdenv.isDarwin then
|
||||||
import ../../build-support/native-darwin-cctools-wrapper {inherit stdenv;}
|
import ../../build-support/native-darwin-cctools-wrapper {inherit stdenv;}
|
||||||
else
|
else
|
||||||
|
@ -42,7 +42,7 @@ import ../generic rec {
|
||||||
overrides = pkgs_: {
|
overrides = pkgs_: {
|
||||||
inherit gcc;
|
inherit gcc;
|
||||||
inherit (gcc) binutils;
|
inherit (gcc) binutils;
|
||||||
inherit (pkgs)
|
inherit (pkgs)
|
||||||
gzip bzip2 xz bash coreutils diffutils findutils gawk
|
gzip bzip2 xz bash coreutils diffutils findutils gawk
|
||||||
gnumake gnused gnutar gnugrep gnupatch perl;
|
gnumake gnused gnutar gnugrep gnupatch perl;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue