···524 fi
525526 # Extract the debug info.
527- header "separating debug info from $i (build ID $id)"
528 mkdir -p "$dst/''${id:0:2}"
529 $OBJCOPY --only-keep-debug "$i" "$dst/''${id:0:2}/''${id:2}.debug"
530
···524 fi
525526 # Extract the debug info.
527+ echo "separating debug info from $i (build ID $id)"
528 mkdir -p "$dst/''${id:0:2}"
529 $OBJCOPY --only-keep-debug "$i" "$dst/''${id:0:2}/''${id:2}.debug"
530
+1-3
pkgs/build-support/fetchbzr/builder.sh
···1if [ -e .attrs.sh ]; then source .attrs.sh; fi
2source "$stdenv/setup"
34-header "exporting \`$url' (revision $rev) into \`$out'"
56# Perform a lightweight checkout so that we don't end up importing
7# all the repository's history.
8BZR_LOG=/dev/null bzr -Ossl.cert_reqs=none export -r "$rev" --format=dir "$out" "$url"
9-10-stopNest
···1if [ -e .attrs.sh ]; then source .attrs.sh; fi
2source "$stdenv/setup"
34+echo "exporting \`$url' (revision $rev) into \`$out'"
56# Perform a lightweight checkout so that we don't end up importing
7# all the repository's history.
8BZR_LOG=/dev/null bzr -Ossl.cert_reqs=none export -r "$rev" --format=dir "$out" "$url"
00
···1if [ -e .attrs.sh ]; then source .attrs.sh; fi
2source $stdenv/setup
3-header "Cloning Fossil $url [$rev] into $out"
45# Fossil, bless its adorable little heart, wants to write global configuration
6# to $HOME/.fossil. AFAICT, there is no way to disable this functionality.
···1920# Just nuke the checkout file.
21rm $out/.fslckout
22-23-stopNest
···1if [ -e .attrs.sh ]; then source .attrs.sh; fi
2source $stdenv/setup
3+echo "Cloning Fossil $url [$rev] into $out"
45# Fossil, bless its adorable little heart, wants to write global configuration
6# to $HOME/.fossil. AFAICT, there is no way to disable this functionality.
···1920# Just nuke the checkout file.
21rm $out/.fslckout
00
···8 mtn --db "$cacheDB" db init
9fi
1011-header "getting revision $selector";
1213done=;
14for source in $dbs; do
···32 fi;
33done;
3435-stopNest;
36-37-header "checking out the revision $revision";
3839if test -n "$done"; then
40 mtn checkout --db "$cacheDB" -r "$revision" "$out" -b "${branch}"
···43 exit 1;
44fi;
4546-stopNest
47-48-header "clearing _MTN in the output"
4950rm -rf "$out/_MTN"
51-52-stopNest
···8 mtn --db "$cacheDB" db init
9fi
1011+echo "getting revision $selector";
1213done=;
14for source in $dbs; do
···32 fi;
33done;
3435+echo "checking out the revision $revision";
003637if test -n "$done"; then
38 mtn checkout --db "$cacheDB" -r "$revision" "$out" -b "${branch}"
···41 exit 1;
42fi;
4344+echo "clearing _MTN in the output"
004546rm -rf "$out/_MTN"
00
+1-3
pkgs/build-support/fetchsvn/builder.sh
···1if [ -e .attrs.sh ]; then source .attrs.sh; fi
2source $stdenv/setup
34-header "exporting $url (r$rev) into $out"
56if test -n "$http_proxy"; then
7 # Configure proxy
···22svn export --trust-server-cert --non-interactive \
23 ${ignoreExternals:+--ignore-externals} ${ignoreKeywords:+--ignore-keywords} \
24 -r "$rev" "$url" "$out"
25-26-stopNest
···1if [ -e .attrs.sh ]; then source .attrs.sh; fi
2source $stdenv/setup
34+echo "exporting $url (r$rev) into $out"
56if test -n "$http_proxy"; then
7 # Configure proxy
···22svn export --trust-server-cert --non-interactive \
23 ${ignoreExternals:+--ignore-externals} ${ignoreKeywords:+--ignore-keywords} \
24 -r "$rev" "$url" "$out"
00
+1-3
pkgs/build-support/fetchsvnssh/builder.sh
···1if [ -e .attrs.sh ]; then source .attrs.sh; fi
2source $stdenv/setup
34-header "exporting $url (r$rev) into $out"
56if test "$sshSupport"; then
7 export SVN_SSH="$openssh/bin/ssh"
···12# whether the server is being spoofed --- only the cryptographic
13# hash of the output matters.
14expect -f $sshSubversion "$username" "$password" "$rev" "$url" $out
15-16-stopNest
···1if [ -e .attrs.sh ]; then source .attrs.sh; fi
2source $stdenv/setup
34+echo "exporting $url (r$rev) into $out"
56if test "$sshSupport"; then
7 export SVN_SSH="$openssh/bin/ssh"
···12# whether the server is being spoofed --- only the cryptographic
13# hash of the output matters.
14expect -f $sshSubversion "$username" "$password" "$rev" "$url" $out
00
+1-1
pkgs/build-support/fetchurl/builder.sh
···37tryDownload() {
38 local url="$1"
39 echo
40- header "trying $url"
41 local curlexit=18;
4243 success=
···37tryDownload() {
38 local url="$1"
39 echo
40+ echo "trying $url"
41 local curlexit=18;
4243 success=
+2-4
pkgs/build-support/release/debian-build.nix
···43 [ ! -f /etc/lsb-release ] || (source /etc/lsb-release; echo "OS release: $DISTRIB_DESCRIPTION")
44 echo "System/kernel: $(uname -a)"
45 if test -e /etc/debian_version; then echo "Debian release: $(cat /etc/debian_version)"; fi
46- header "installed Debian packages"
47 dpkg-query --list
48- stopNest
49 '';
5051 installPhase = ''
···73 [ "$(echo $out/debs/*.deb)" != "" ]
7475 for i in $out/debs/*.deb; do
76- header "Generated DEB package: $i"
77 dpkg-deb --info "$i"
78 pkgName=$(dpkg-deb -W "$i" | awk '{print $1}')
79 echo "file deb $i" >> $out/nix-support/hydra-build-products
80- stopNest
81 done
82 dpkg -i $out/debs/*.deb
83
···43 [ ! -f /etc/lsb-release ] || (source /etc/lsb-release; echo "OS release: $DISTRIB_DESCRIPTION")
44 echo "System/kernel: $(uname -a)"
45 if test -e /etc/debian_version; then echo "Debian release: $(cat /etc/debian_version)"; fi
46+ echo "installed Debian packages"
47 dpkg-query --list
048 '';
4950 installPhase = ''
···72 [ "$(echo $out/debs/*.deb)" != "" ]
7374 for i in $out/debs/*.deb; do
75+ echo "Generated DEB package: $i"
76 dpkg-deb --info "$i"
77 pkgName=$(dpkg-deb -W "$i" | awk '{print $1}')
78 echo "file deb $i" >> $out/nix-support/hydra-build-products
079 done
80 dpkg -i $out/debs/*.deb
81
+1-2
pkgs/build-support/release/nix-build.nix
···74 if test -n "$succeedOnFailure"; then
75 if test -n "$keepBuildDirectory"; then
76 KEEPBUILDDIR="$out/`basename $TMPDIR`"
77- header "Copying build directory to $KEEPBUILDDIR"
78 mkdir -p $KEEPBUILDDIR
79 cp -R "$TMPDIR/"* $KEEPBUILDDIR
80- stopNest
81 fi
82 fi
83 '';
···74 if test -n "$succeedOnFailure"; then
75 if test -n "$keepBuildDirectory"; then
76 KEEPBUILDDIR="$out/`basename $TMPDIR`"
77+ echo "Copying build directory to $KEEPBUILDDIR"
78 mkdir -p $KEEPBUILDDIR
79 cp -R "$TMPDIR/"* $KEEPBUILDDIR
080 fi
81 fi
82 '';
+1-2
pkgs/build-support/release/source-tarball.nix
···64 if test -n "$succeedOnFailure"; then
65 if test -n "$keepBuildDirectory"; then
66 KEEPBUILDDIR="$out/`basename $TMPDIR`"
67- header "Copying build directory to $KEEPBUILDDIR"
68 mkdir -p $KEEPBUILDDIR
69 cp -R "$TMPDIR/"* $KEEPBUILDDIR
70- stopNest
71 fi
72 fi
73 '';
···64 if test -n "$succeedOnFailure"; then
65 if test -n "$keepBuildDirectory"; then
66 KEEPBUILDDIR="$out/`basename $TMPDIR`"
67+ echo "Copying build directory to $KEEPBUILDDIR"
68 mkdir -p $KEEPBUILDDIR
69 cp -R "$TMPDIR/"* $KEEPBUILDDIR
070 fi
71 fi
72 '';
+1-3
pkgs/build-support/setup-hooks/audit-tmpdir.sh
···13 local dir="$1"
14 [ -e "$dir" ] || return 0
1516- header "checking for references to $TMPDIR/ in $dir..."
1718 local i
19 find "$dir" -type f -print0 | while IFS= read -r -d $'\0' i; do
···36 fi
3738 done
39-40- stopNest
41}
···13 local dir="$1"
14 [ -e "$dir" ] || return 0
1516+ echo "checking for references to $TMPDIR/ in $dir..."
1718 local i
19 find "$dir" -type f -print0 | while IFS= read -r -d $'\0' i; do
···36 fi
3738 done
0039}
···26 fi
2728 # Extract the debug info.
29- header "separating debug info from $i (build ID $id)"
30 mkdir -p "$dst/${id:0:2}"
3132 # This may fail, e.g. if the binary is for a different
···26 fi
2728 # Extract the debug info.
29+ echo "separating debug info from $i (build ID $id)"
30 mkdir -p "$dst/${id:0:2}"
3132 # This may fail, e.g. if the binary is for a different
+2-4
pkgs/build-support/vm/default.nix
···527 echo "System/kernel: $(uname -a)"
528 if test -e /etc/fedora-release; then echo "Fedora release: $(cat /etc/fedora-release)"; fi
529 if test -e /etc/SuSE-release; then echo "SUSE release: $(cat /etc/SuSE-release)"; fi
530- header "installed RPM packages"
531 rpm -qa --qf "%{Name}-%{Version}-%{Release} (%{Arch}; %{Distribution}; %{Vendor})\n"
532- stopNest
533 '';
534535 buildPhase = ''
···559 find $rpmout -name "*.rpm" -exec cp {} $out/$outDir \;
560561 for i in $out/$outDir/*.rpm; do
562- header "Generated RPM/SRPM: $i"
563 rpm -qip $i
564- stopNest
565 done
566567 eval "$postInstall"
···527 echo "System/kernel: $(uname -a)"
528 if test -e /etc/fedora-release; then echo "Fedora release: $(cat /etc/fedora-release)"; fi
529 if test -e /etc/SuSE-release; then echo "SUSE release: $(cat /etc/SuSE-release)"; fi
530+ echo "installed RPM packages"
531 rpm -qa --qf "%{Name}-%{Version}-%{Release} (%{Arch}; %{Distribution}; %{Vendor})\n"
0532 '';
533534 buildPhase = ''
···558 find $rpmout -name "*.rpm" -exec cp {} $out/$outDir \;
559560 for i in $out/$outDir/*.rpm; do
561+ echo "Generated RPM/SRPM: $i"
562 rpm -qip $i
0563 done
564565 eval "$postInstall"
···1617 patches = [ ./help2man-SOURCE_DATE_EPOCH-support.patch ];
1819- # Disable indented log output from Make, otherwise "make.test" will
20- # fail.
21- preCheck = "unset NIX_INDENT_MAKE";
22 doCheck = false; # takes _a lot_ of time, fails 3 out of 2698 tests, all seem to be related to paths
23 doInstallCheck = false; # runs the same thing, fails the same tests
24
···1617 patches = [ ./help2man-SOURCE_DATE_EPOCH-support.patch ];
1800019 doCheck = false; # takes _a lot_ of time, fails 3 out of 2698 tests, all seem to be related to paths
20 doInstallCheck = false; # runs the same thing, fails the same tests
21
···1516 setupHook = ./setup-hook.sh;
1718- # Disable indented log output from Make, otherwise "make.test" will
19- # fail.
20- preCheck = "unset NIX_INDENT_MAKE";
21 doCheck = false; # takes _a lot_ of time, fails 3 out of 2698 tests, all seem to be related to paths
22 doInstallCheck = false; # runs the same thing, fails the same tests
23
···1516 setupHook = ./setup-hook.sh;
1700018 doCheck = false; # takes _a lot_ of time, fails 3 out of 2698 tests, all seem to be related to paths
19 doInstallCheck = false; # runs the same thing, fails the same tests
20
···8 local dir="$1"
9 [ -e "$dir" ] || return 0
1011- header "shrinking RPATHs of ELF executables and libraries in $dir"
1213 local i
14 while IFS= read -r -d $'\0' i; do
···17 echo "shrinking $i"
18 patchelf --shrink-rpath "$i" || true
19 done < <(find "$dir" -type f -print0)
20-21- stopNest
22}
···8 local dir="$1"
9 [ -e "$dir" ] || return 0
1011+ echo "shrinking RPATHs of ELF executables and libraries in $dir"
1213 local i
14 while IFS= read -r -d $'\0' i; do
···17 echo "shrinking $i"
18 patchelf --shrink-rpath "$i" || true
19 done < <(find "$dir" -type f -print0)
0020}
+2-2
pkgs/os-specific/linux/sgx/psw/default.nix
···132 # NixOS module which is based on those files without relying on them. Still, it
133 # is helpful to have properly patched versions for non-NixOS distributions.
134 postFixup = ''
135- header "Fixing aesmd.service"
136 substituteInPlace $out/lib/systemd/system/aesmd.service \
137 --replace '@aesm_folder@' \
138 "$out/aesm" \
···149 --replace "/bin/kill" \
150 "${coreutils}/bin/kill"
151152- header "Fixing remount-dev-exec.service"
153 substituteInPlace $out/lib/systemd/system/remount-dev-exec.service \
154 --replace '/bin/mount' \
155 "${util-linux}/bin/mount"
···132 # NixOS module which is based on those files without relying on them. Still, it
133 # is helpful to have properly patched versions for non-NixOS distributions.
134 postFixup = ''
135+ echo "Fixing aesmd.service"
136 substituteInPlace $out/lib/systemd/system/aesmd.service \
137 --replace '@aesm_folder@' \
138 "$out/aesm" \
···149 --replace "/bin/kill" \
150 "${coreutils}/bin/kill"
151152+ echo "Fixing remount-dev-exec.service"
153 substituteInPlace $out/lib/systemd/system/remount-dev-exec.service \
154 --replace '/bin/mount' \
155 "${util-linux}/bin/mount"
+7-7
pkgs/os-specific/linux/sgx/sdk/default.nix
···109 };
110 in
111 ''
112- header "Setting up IPP crypto build artifacts"
113114 pushd 'external/ippcp_internal'
115···149 ./linux/installer/bin/sgx_linux_x64_sdk_${version}.bin -prefix $installDir
150 installDir=$installDir/sgxsdk
151152- header "Move files created by installer"
153154 mkdir -p $out/bin
155 pushd $out
···206207208 preFixup = ''
209- header "Strip sgxsdk prefix"
210 for path in "$out/share/bin/environment" "$out/bin/sgx-gdb"; do
211 substituteInPlace $path --replace "$TMPDIR/sgxsdk" "$out"
212 done
213214- header "Fixing pkg-config files"
215 sed -i "s|prefix=.*|prefix=$out|g" $out/lib/pkgconfig/*.pc
216217- header "Fixing SGX_SDK default in samples"
218 substituteInPlace $out/share/SampleCode/LocalAttestation/buildenv.mk \
219 --replace '/opt/intel/sgxsdk' "$out"
220 for file in $out/share/SampleCode/*/Makefile; do
···222 --replace '/opt/intel/sgxsdk' "$out"
223 done
224225- header "Fixing BINUTILS_DIR in buildenv.mk"
226 substituteInPlace $out/share/bin/buildenv.mk \
227 --replace 'BINUTILS_DIR ?= /usr/local/bin' \
228 'BINUTILS_DIR ?= ${BINUTILS_DIR}'
229230- header "Fixing GDB path in bin/sgx-gdb"
231 substituteInPlace $out/bin/sgx-gdb --replace '/usr/local/bin/gdb' '${gdb}/bin/gdb'
232 '';
233
···109 };
110 in
111 ''
112+ echo "Setting up IPP crypto build artifacts"
113114 pushd 'external/ippcp_internal'
115···149 ./linux/installer/bin/sgx_linux_x64_sdk_${version}.bin -prefix $installDir
150 installDir=$installDir/sgxsdk
151152+ echo "Move files created by installer"
153154 mkdir -p $out/bin
155 pushd $out
···206207208 preFixup = ''
209+ echo "Strip sgxsdk prefix"
210 for path in "$out/share/bin/environment" "$out/bin/sgx-gdb"; do
211 substituteInPlace $path --replace "$TMPDIR/sgxsdk" "$out"
212 done
213214+ echo "Fixing pkg-config files"
215 sed -i "s|prefix=.*|prefix=$out|g" $out/lib/pkgconfig/*.pc
216217+ echo "Fixing SGX_SDK default in samples"
218 substituteInPlace $out/share/SampleCode/LocalAttestation/buildenv.mk \
219 --replace '/opt/intel/sgxsdk' "$out"
220 for file in $out/share/SampleCode/*/Makefile; do
···222 --replace '/opt/intel/sgxsdk' "$out"
223 done
224225+ echo "Fixing BINUTILS_DIR in buildenv.mk"
226 substituteInPlace $out/share/bin/buildenv.mk \
227 --replace 'BINUTILS_DIR ?= /usr/local/bin' \
228 'BINUTILS_DIR ?= ${BINUTILS_DIR}'
229230+ echo "Fixing GDB path in bin/sgx-gdb"
231 substituteInPlace $out/bin/sgx-gdb --replace '/usr/local/bin/gdb' '${gdb}/bin/gdb'
232 '';
233
+28-38
pkgs/stdenv/generic/setup.sh
···1# shellcheck shell=bash
02__nixpkgs_setup_set_original=$-
3set -eu
4set -o pipefail
···32 export NIX_ATTRS_JSON_FILE="$NIX_BUILD_TOP/.attrs.json"
33 export NIX_ATTRS_SH_FILE="$NIX_BUILD_TOP/.attrs.sh"
34else
35- : ${outputs:=out}
36fi
3738getAllOutputNames() {
···124125######################################################################
126# Logging.
127-128-# Obsolete.
129-stopNest() { true; }
130-header() { echo "$1"; }
131-closeNest() { true; }
132133# Prints a command such that all word splits are unambiguous. We need
134# to split the command in three parts because the middle format string
···398# implementation uses zip archive and zip does not support dates going back to
399# 1970.
400export SOURCE_DATE_EPOCH
401-: ${SOURCE_DATE_EPOCH:=315532800}
402403404# Wildcard expansions that don't match should expand to an empty list.
···448449# Package accumulators
450451-# shellcheck disable=SC2034
452declare -a pkgsBuildBuild pkgsBuildHost pkgsBuildTarget
453declare -a pkgsHostHost pkgsHostTarget
454declare -a pkgsTargetTarget
···473declare -a pkgHookVarVars=(pkgBuildHookVars pkgHostHookVars pkgTargetHookVars)
474475# those variables are declared here, since where and if they are used varies
476-# shellcheck disable=SC2034
477declare -a preFixupHooks fixupOutputHooks preConfigureHooks postFixupHooks postUnpackHooks unpackCmdHooks
478479# Add env hooks for all sorts of deps with the specified host offset.
···610# in each list must be store paths, and therefore space-free.
611612# Make sure all are at least defined as empty
613-: ${depsBuildBuild=} ${depsBuildBuildPropagated=}
614-: ${nativeBuildInputs=} ${propagatedNativeBuildInputs=} ${defaultNativeBuildInputs=}
615-: ${depsBuildTarget=} ${depsBuildTargetPropagated=}
616-: ${depsHostHost=} ${depsHostHostPropagated=}
617-: ${buildInputs=} ${propagatedBuildInputs=} ${defaultBuildInputs=}
618-: ${depsTargetTarget=} ${depsTargetTargetPropagated=}
619620for pkg in ${depsBuildBuild[@]} ${depsBuildBuildPropagated[@]}; do
621 findInputs "$pkg" -1 -1
···798unset _XDG_DATA_DIRS
799800801-# Make GNU Make produce nested output.
802-export NIX_INDENT_MAKE=1
803-804-805# Normalize the NIX_BUILD_CORES variable. The value might be 0, which
806# means that we're supposed to try and auto-detect the number of
807# available CPU cores at run-time.
···888# fail loudly if provided with a binary (containing null bytes)
889consumeEntire() {
890 # read returns non-0 on EOF, so we want read to fail
891- if IFS='' read -r -d '' $1 ; then
892 echo "consumeEntire(): ERROR: Input null bytes, won't process" >&2
893 return 1
894 fi
···10331034unpackFile() {
1035 curSrc="$1"
1036- header "unpacking source archive $curSrc" 3
1037 if ! runOneHook unpackCmd "$curSrc"; then
1038 echo "do not know how to unpack source archive $curSrc"
1039 exit 1
···1079 # Find the source directory.
10801081 # set to empty if unset
1082- : ${sourceRoot=}
10831084 if [ -n "${setSourceRoot:-}" ]; then
1085 runOneHook setSourceRoot
···1130 fi
11311132 for i in "${patchesArray[@]}"; do
1133- header "applying patch $i" 3
1134 local uncompress=cat
1135 case "$i" in
1136 *.gz)
···1183 runHook preConfigure
11841185 # set to empty if unset
1186- : ${configureScript=}
11871188 if [[ -z "$configureScript" && -x ./configure ]]; then
1189 configureScript=./configure
···1445 echo "no Makefile or custom installCheckPhase, doing nothing"
1446 #TODO(@oxij): should flagsArray influence make -n?
1447 elif [[ -z "${installCheckTarget:-}" ]] \
1448- && ! make -n ${makefile:+-f $makefile} ${installCheckTarget:-installcheck} >/dev/null 2>&1; then
1449 echo "no installcheck target in ${makefile:-Makefile}, doing nothing"
1450 else
1451 # Old bash empty array hack
···1494showPhaseHeader() {
1495 local phase="$1"
1496 case "$phase" in
1497- unpackPhase) header "unpacking sources";;
1498- patchPhase) header "patching sources";;
1499- configurePhase) header "configuring";;
1500- buildPhase) header "building";;
1501- checkPhase) header "running tests";;
1502- installPhase) header "installing";;
1503- fixupPhase) header "post-installation fixup";;
1504- installCheckPhase) header "running install tests";;
1505- *) header "$phase";;
1506 esac
1507}
1508···1512 local startTime="$2"
1513 local endTime="$3"
1514 local delta=$(( endTime - startTime ))
1515- (( $delta < 30 )) && return
15161517 local H=$((delta/3600))
1518 local M=$((delta%3600/60))
1519 local S=$((delta%60))
1520 echo -n "$phase completed in "
1521- (( $H > 0 )) && echo -n "$H hours "
1522- (( $M > 0 )) && echo -n "$M minutes "
1523 echo "$S seconds"
1524}
1525···1561 if [[ "$curPhase" = distPhase && -z "${doDist:-}" ]]; then continue; fi
15621563 if [[ -n $NIX_LOG_FD ]]; then
1564- echo "@nix { \"action\": \"setPhase\", \"phase\": \"$curPhase\" }" >&$NIX_LOG_FD
1565 fi
15661567 showPhaseHeader "$curPhase"
···1# shellcheck shell=bash
2+# shellcheck disable=1090,2154,2123,2034,2178,2048
3__nixpkgs_setup_set_original=$-
4set -eu
5set -o pipefail
···33 export NIX_ATTRS_JSON_FILE="$NIX_BUILD_TOP/.attrs.json"
34 export NIX_ATTRS_SH_FILE="$NIX_BUILD_TOP/.attrs.sh"
35else
36+ : "${outputs:=out}"
37fi
3839getAllOutputNames() {
···125126######################################################################
127# Logging.
00000128129# Prints a command such that all word splits are unambiguous. We need
130# to split the command in three parts because the middle format string
···394# implementation uses zip archive and zip does not support dates going back to
395# 1970.
396export SOURCE_DATE_EPOCH
397+: "${SOURCE_DATE_EPOCH:=315532800}"
398399400# Wildcard expansions that don't match should expand to an empty list.
···444445# Package accumulators
4460447declare -a pkgsBuildBuild pkgsBuildHost pkgsBuildTarget
448declare -a pkgsHostHost pkgsHostTarget
449declare -a pkgsTargetTarget
···468declare -a pkgHookVarVars=(pkgBuildHookVars pkgHostHookVars pkgTargetHookVars)
469470# those variables are declared here, since where and if they are used varies
0471declare -a preFixupHooks fixupOutputHooks preConfigureHooks postFixupHooks postUnpackHooks unpackCmdHooks
472473# Add env hooks for all sorts of deps with the specified host offset.
···604# in each list must be store paths, and therefore space-free.
605606# Make sure all are at least defined as empty
607+: "${depsBuildBuild=}" "${depsBuildBuildPropagated=}"
608+: "${nativeBuildInputs=}" "${propagatedNativeBuildInputs=}" "${defaultNativeBuildInputs=}"
609+: "${depsBuildTarget=}" "${depsBuildTargetPropagated=}"
610+: "${depsHostHost=}" "${depsHostHostPropagated=}"
611+: "${buildInputs=}" "${propagatedBuildInputs=}" "${defaultBuildInputs=}"
612+: "${depsTargetTarget=}" "${depsTargetTargetPropagated=}"
613614for pkg in ${depsBuildBuild[@]} ${depsBuildBuildPropagated[@]}; do
615 findInputs "$pkg" -1 -1
···792unset _XDG_DATA_DIRS
7937940000795# Normalize the NIX_BUILD_CORES variable. The value might be 0, which
796# means that we're supposed to try and auto-detect the number of
797# available CPU cores at run-time.
···878# fail loudly if provided with a binary (containing null bytes)
879consumeEntire() {
880 # read returns non-0 on EOF, so we want read to fail
881+ if IFS='' read -r -d '' "$1" ; then
882 echo "consumeEntire(): ERROR: Input null bytes, won't process" >&2
883 return 1
884 fi
···10231024unpackFile() {
1025 curSrc="$1"
1026+ echo "unpacking source archive $curSrc"
1027 if ! runOneHook unpackCmd "$curSrc"; then
1028 echo "do not know how to unpack source archive $curSrc"
1029 exit 1
···1069 # Find the source directory.
10701071 # set to empty if unset
1072+ : "${sourceRoot=}"
10731074 if [ -n "${setSourceRoot:-}" ]; then
1075 runOneHook setSourceRoot
···1120 fi
11211122 for i in "${patchesArray[@]}"; do
1123+ echo "applying patch $i"
1124 local uncompress=cat
1125 case "$i" in
1126 *.gz)
···1173 runHook preConfigure
11741175 # set to empty if unset
1176+ : "${configureScript=}"
11771178 if [[ -z "$configureScript" && -x ./configure ]]; then
1179 configureScript=./configure
···1435 echo "no Makefile or custom installCheckPhase, doing nothing"
1436 #TODO(@oxij): should flagsArray influence make -n?
1437 elif [[ -z "${installCheckTarget:-}" ]] \
1438+ && ! make -n ${makefile:+-f $makefile} "${installCheckTarget:-installcheck}" >/dev/null 2>&1; then
1439 echo "no installcheck target in ${makefile:-Makefile}, doing nothing"
1440 else
1441 # Old bash empty array hack
···1484showPhaseHeader() {
1485 local phase="$1"
1486 case "$phase" in
1487+ unpackPhase) echo "unpacking sources";;
1488+ patchPhase) echo "patching sources";;
1489+ configurePhase) echo "configuring";;
1490+ buildPhase) echo "building";;
1491+ checkPhase) echo "running tests";;
1492+ installPhase) echo "installing";;
1493+ fixupPhase) echo "post-installation fixup";;
1494+ installCheckPhase) echo "running install tests";;
1495+ *) echo "$phase";;
1496 esac
1497}
1498···1502 local startTime="$2"
1503 local endTime="$3"
1504 local delta=$(( endTime - startTime ))
1505+ (( delta < 30 )) && return
15061507 local H=$((delta/3600))
1508 local M=$((delta%3600/60))
1509 local S=$((delta%60))
1510 echo -n "$phase completed in "
1511+ (( H > 0 )) && echo -n "$H hours "
1512+ (( M > 0 )) && echo -n "$M minutes "
1513 echo "$S seconds"
1514}
1515···1551 if [[ "$curPhase" = distPhase && -z "${doDist:-}" ]]; then continue; fi
15521553 if [[ -n $NIX_LOG_FD ]]; then
1554+ echo "@nix { \"action\": \"setPhase\", \"phase\": \"$curPhase\" }" >&"$NIX_LOG_FD"
1555 fi
15561557 showPhaseHeader "$curPhase"
···3233 # Check that all-packages.nix evaluates on a number of platforms without any warnings.
34 for platform in ${pkgs.lib.concatStringsSep " " supportedSystems}; do
35- header "checking Nixpkgs on $platform"
3637 # To get a call trace; see https://nixos.org/manual/nixpkgs/stable/#function-library-lib.trivial.warn
38 # Relies on impure eval
···3233 # Check that all-packages.nix evaluates on a number of platforms without any warnings.
34 for platform in ${pkgs.lib.concatStringsSep " " supportedSystems}; do
35+ echo "checking Nixpkgs on $platform"
3637 # To get a call trace; see https://nixos.org/manual/nixpkgs/stable/#function-library-lib.trivial.warn
38 # Relies on impure eval