Merge pull request #210993 from Artturin/cleanupstdenvsetup1

authored by

Artturi and committed by
GitHub
e09153da 5a504755

+73 -135
+1 -1
pkgs/applications/networking/browsers/firefox/common.nix
··· 524 fi 525 526 # 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 525 526 # 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
··· 1 if [ -e .attrs.sh ]; then source .attrs.sh; fi 2 source "$stdenv/setup" 3 4 - header "exporting \`$url' (revision $rev) into \`$out'" 5 6 # Perform a lightweight checkout so that we don't end up importing 7 # all the repository's history. 8 BZR_LOG=/dev/null bzr -Ossl.cert_reqs=none export -r "$rev" --format=dir "$out" "$url" 9 - 10 - stopNest
··· 1 if [ -e .attrs.sh ]; then source .attrs.sh; fi 2 source "$stdenv/setup" 3 4 + echo "exporting \`$url' (revision $rev) into \`$out'" 5 6 # Perform a lightweight checkout so that we don't end up importing 7 # all the repository's history. 8 BZR_LOG=/dev/null bzr -Ossl.cert_reqs=none export -r "$rev" --format=dir "$out" "$url"
-2
pkgs/build-support/fetchcvs/builder.sh
··· 24 fi 25 (cd export && cvs -f -z0 -d "$cvsRoot" export $tag "$module") 26 mv export/* $out 27 - 28 - stopNest
··· 24 fi 25 (cd export && cvs -f -z0 -d "$cvsRoot" export $tag "$module") 26 mv export/* $out
+1 -3
pkgs/build-support/fetchdarcs/builder.sh
··· 11 tagflags="--context=$context" 12 fi 13 14 - header "getting $url $partial ${tagtext} into $out" 15 16 darcs get --lazy $tagflags "$url" "$out" 17 # remove metadata, because it can change 18 rm -rf "$out/_darcs" 19 - 20 - stopNest
··· 11 tagflags="--context=$context" 12 fi 13 14 + echo "getting $url $partial ${tagtext} into $out" 15 16 darcs get --lazy $tagflags "$url" "$out" 17 # remove metadata, because it can change 18 rm -rf "$out/_darcs"
+1 -2
pkgs/build-support/fetchdocker/fetchdocker-builder.sh
··· 1 if [ -e .attrs.sh ]; then source .attrs.sh; fi 2 source "${stdenv}/setup" 3 - header "exporting ${repository}/${imageName} (tag: ${tag}) into ${out}" 4 mkdir -p "${out}" 5 6 cat <<EOF > "${out}/compositeImage.sh" ··· 26 -c "${manifest}" "${repositories}" -T "${imageFileStorePaths}" 27 EOF 28 chmod +x "${out}/compositeImage.sh" 29 - stopNest
··· 1 if [ -e .attrs.sh ]; then source .attrs.sh; fi 2 source "${stdenv}/setup" 3 + echo "exporting ${repository}/${imageName} (tag: ${tag}) into ${out}" 4 mkdir -p "${out}" 5 6 cat <<EOF > "${out}/compositeImage.sh" ··· 26 -c "${manifest}" "${repositories}" -T "${imageFileStorePaths}" 27 EOF 28 chmod +x "${out}/compositeImage.sh"
+2 -4
pkgs/build-support/fetchdocker/generic-fetcher.nix
··· 36 inherit name; 37 builder = writeText "${fetcher}-builder.sh" '' 38 source "$stdenv/setup" 39 - header "${fetcher} exporting to $out" 40 41 declare -A creds 42 ··· 49 fi 50 51 if [ -f "$dockerCredentialsFile" ]; then 52 - header "using credentials from $dockerCredentialsFile" 53 54 CREDSFILE=$(cat "$dockerCredentialsFile") 55 creds[token]=$(${awk} -F'=' '/DOCKER_TOKEN/ {print $2}' <<< "$CREDSFILE" | head -n1) ··· 77 ${layerDigestFlag} \ 78 "${repository}/${imageName}" \ 79 "${tag}" 80 - 81 - stopNest 82 ''; 83 84 buildInputs = [ haskellPackages.hocker ];
··· 36 inherit name; 37 builder = writeText "${fetcher}-builder.sh" '' 38 source "$stdenv/setup" 39 + echo "${fetcher} exporting to $out" 40 41 declare -A creds 42 ··· 49 fi 50 51 if [ -f "$dockerCredentialsFile" ]; then 52 + echo "using credentials from $dockerCredentialsFile" 53 54 CREDSFILE=$(cat "$dockerCredentialsFile") 55 creds[token]=$(${awk} -F'=' '/DOCKER_TOKEN/ {print $2}' <<< "$CREDSFILE" | head -n1) ··· 77 ${layerDigestFlag} \ 78 "${repository}/${imageName}" \ 79 "${tag}" 80 ''; 81 82 buildInputs = [ haskellPackages.hocker ];
+1 -1
pkgs/build-support/fetchfirefoxaddon/default.nix
··· 29 builder = writeScript "xpibuilder" '' 30 source $stdenv/setup 31 32 - header "firefox addon $name into $out" 33 34 UUID="${extid}" 35 mkdir -p "$out/$UUID"
··· 29 builder = writeScript "xpibuilder" '' 30 source $stdenv/setup 31 32 + echo "firefox addon $name into $out" 33 34 UUID="${extid}" 35 mkdir -p "$out/$UUID"
+1 -3
pkgs/build-support/fetchfossil/builder.sh
··· 1 if [ -e .attrs.sh ]; then source .attrs.sh; fi 2 source $stdenv/setup 3 - header "Cloning Fossil $url [$rev] into $out" 4 5 # Fossil, bless its adorable little heart, wants to write global configuration 6 # to $HOME/.fossil. AFAICT, there is no way to disable this functionality. ··· 19 20 # Just nuke the checkout file. 21 rm $out/.fslckout 22 - 23 - stopNest
··· 1 if [ -e .attrs.sh ]; then source .attrs.sh; fi 2 source $stdenv/setup 3 + echo "Cloning Fossil $url [$rev] into $out" 4 5 # Fossil, bless its adorable little heart, wants to write global configuration 6 # to $HOME/.fossil. AFAICT, there is no way to disable this functionality. ··· 19 20 # Just nuke the checkout file. 21 rm $out/.fslckout
+1 -2
pkgs/build-support/fetchgit/builder.sh
··· 6 if [ -e .attrs.sh ]; then source .attrs.sh; fi 7 source $stdenv/setup 8 9 - header "exporting $url (rev $rev) into $out" 10 11 $SHELL $fetcher --builder --url "$url" --out "$out" --rev "$rev" \ 12 ${leaveDotGit:+--leave-dotGit} \ ··· 18 ${branchName:+--branch-name "$branchName"} 19 20 runHook postFetch 21 - stopNest
··· 6 if [ -e .attrs.sh ]; then source .attrs.sh; fi 7 source $stdenv/setup 8 9 + echo "exporting $url (rev $rev) into $out" 10 11 $SHELL $fetcher --builder --url "$url" --out "$out" --rev "$rev" \ 12 ${leaveDotGit:+--leave-dotGit} \ ··· 18 ${branchName:+--branch-name "$branchName"} 19 20 runHook postFetch
+1 -3
pkgs/build-support/fetchhg/builder.sh
··· 1 if [ -e .attrs.sh ]; then source .attrs.sh; fi 2 source $stdenv/setup 3 - header "getting $url${rev:+ ($rev)} into $out" 4 5 hg clone --insecure "$url" hg-clone 6 7 hg archive -q$subrepoClause -y ${rev:+-r "$rev"} --cwd hg-clone $out 8 rm -f $out/.hg_archival.txt 9 - 10 - stopNest
··· 1 if [ -e .attrs.sh ]; then source .attrs.sh; fi 2 source $stdenv/setup 3 + echo "getting $url${rev:+ ($rev)} into $out" 4 5 hg clone --insecure "$url" hg-clone 6 7 hg archive -q$subrepoClause -y ${rev:+-r "$rev"} --cwd hg-clone $out 8 rm -f $out/.hg_archival.txt
+3 -9
pkgs/build-support/fetchmtn/builder.sh
··· 8 mtn --db "$cacheDB" db init 9 fi 10 11 - header "getting revision $selector"; 12 13 done=; 14 for source in $dbs; do ··· 32 fi; 33 done; 34 35 - stopNest; 36 - 37 - header "checking out the revision $revision"; 38 39 if test -n "$done"; then 40 mtn checkout --db "$cacheDB" -r "$revision" "$out" -b "${branch}" ··· 43 exit 1; 44 fi; 45 46 - stopNest 47 - 48 - header "clearing _MTN in the output" 49 50 rm -rf "$out/_MTN" 51 - 52 - stopNest
··· 8 mtn --db "$cacheDB" db init 9 fi 10 11 + echo "getting revision $selector"; 12 13 done=; 14 for source in $dbs; do ··· 32 fi; 33 done; 34 35 + echo "checking out the revision $revision"; 36 37 if test -n "$done"; then 38 mtn checkout --db "$cacheDB" -r "$revision" "$out" -b "${branch}" ··· 41 exit 1; 42 fi; 43 44 + echo "clearing _MTN in the output" 45 46 rm -rf "$out/_MTN"
+1 -3
pkgs/build-support/fetchsvn/builder.sh
··· 1 if [ -e .attrs.sh ]; then source .attrs.sh; fi 2 source $stdenv/setup 3 4 - header "exporting $url (r$rev) into $out" 5 6 if test -n "$http_proxy"; then 7 # Configure proxy ··· 22 svn export --trust-server-cert --non-interactive \ 23 ${ignoreExternals:+--ignore-externals} ${ignoreKeywords:+--ignore-keywords} \ 24 -r "$rev" "$url" "$out" 25 - 26 - stopNest
··· 1 if [ -e .attrs.sh ]; then source .attrs.sh; fi 2 source $stdenv/setup 3 4 + echo "exporting $url (r$rev) into $out" 5 6 if test -n "$http_proxy"; then 7 # Configure proxy ··· 22 svn export --trust-server-cert --non-interactive \ 23 ${ignoreExternals:+--ignore-externals} ${ignoreKeywords:+--ignore-keywords} \ 24 -r "$rev" "$url" "$out"
+1 -3
pkgs/build-support/fetchsvnssh/builder.sh
··· 1 if [ -e .attrs.sh ]; then source .attrs.sh; fi 2 source $stdenv/setup 3 4 - header "exporting $url (r$rev) into $out" 5 6 if 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. 14 expect -f $sshSubversion "$username" "$password" "$rev" "$url" $out 15 - 16 - stopNest
··· 1 if [ -e .attrs.sh ]; then source .attrs.sh; fi 2 source $stdenv/setup 3 4 + echo "exporting $url (r$rev) into $out" 5 6 if 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. 14 expect -f $sshSubversion "$username" "$password" "$rev" "$url" $out
+1 -1
pkgs/build-support/fetchurl/builder.sh
··· 37 tryDownload() { 38 local url="$1" 39 echo 40 - header "trying $url" 41 local curlexit=18; 42 43 success=
··· 37 tryDownload() { 38 local url="$1" 39 echo 40 + echo "trying $url" 41 local curlexit=18; 42 43 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 ''; 50 51 installPhase = '' ··· 73 [ "$(echo $out/debs/*.deb)" != "" ] 74 75 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 48 ''; 49 50 installPhase = '' ··· 72 [ "$(echo $out/debs/*.deb)" != "" ] 73 74 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 79 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 80 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 70 fi 71 fi 72 '';
+1 -3
pkgs/build-support/setup-hooks/audit-tmpdir.sh
··· 13 local dir="$1" 14 [ -e "$dir" ] || return 0 15 16 - header "checking for references to $TMPDIR/ in $dir..." 17 18 local i 19 find "$dir" -type f -print0 | while IFS= read -r -d $'\0' i; do ··· 36 fi 37 38 done 39 - 40 - stopNest 41 }
··· 13 local dir="$1" 14 [ -e "$dir" ] || return 0 15 16 + echo "checking for references to $TMPDIR/ in $dir..." 17 18 local i 19 find "$dir" -type f -print0 | while IFS= read -r -d $'\0' i; do ··· 36 fi 37 38 done 39 }
+1 -2
pkgs/build-support/setup-hooks/canonicalize-jars.sh
··· 6 7 canonicalizeJarsIn() { 8 local dir="$1" 9 - header "canonicalizing jars in $dir" 10 dir="$(realpath -sm -- "$dir")" 11 while IFS= read -rd '' f; do 12 canonicalizeJar "$f" 13 done < <(find -- "$dir" -type f -name '*.jar' -print0) 14 - stopNest 15 } 16 17 source @canonicalize_jar@
··· 6 7 canonicalizeJarsIn() { 8 local dir="$1" 9 + echo "canonicalizing jars in $dir" 10 dir="$(realpath -sm -- "$dir")" 11 while IFS= read -rd '' f; do 12 canonicalizeJar "$f" 13 done < <(find -- "$dir" -type f -name '*.jar' -print0) 14 } 15 16 source @canonicalize_jar@
-2
pkgs/build-support/setup-hooks/patch-shebangs.sh
··· 100 fi 101 fi 102 done < <(find "$@" -type f -perm -0100 -print0) 103 - 104 - stopNest 105 } 106 107 patchShebangsAuto () {
··· 100 fi 101 fi 102 done < <(find "$@" -type f -perm -0100 -print0) 103 } 104 105 patchShebangsAuto () {
+4 -4
pkgs/build-support/setup-hooks/postgresql-test-hook/postgresql-test-hook.sh
··· 53 echo >&2 'initdb not found. Did you add postgresql to the checkInputs?' 54 false 55 fi 56 - header 'initializing postgresql' 57 initdb -U postgres 58 59 # Move the socket ··· 65 echo "listen_addresses = ''" >>"$PGDATA/postgresql.conf" 66 fi 67 68 - header 'starting postgresql' 69 eval "${postgresqlStartCommands:-pg_ctl start}" 70 71 - header 'setting up postgresql' 72 eval "$postgresqlTestSetupCommands" 73 74 } 75 76 postgresqlStop() { 77 - header 'stopping postgresql' 78 pg_ctl stop 79 }
··· 53 echo >&2 'initdb not found. Did you add postgresql to the checkInputs?' 54 false 55 fi 56 + echo 'initializing postgresql' 57 initdb -U postgres 58 59 # Move the socket ··· 65 echo "listen_addresses = ''" >>"$PGDATA/postgresql.conf" 66 fi 67 68 + echo 'starting postgresql' 69 eval "${postgresqlStartCommands:-pg_ctl start}" 70 71 + echo 'setting up postgresql' 72 eval "$postgresqlTestSetupCommands" 73 74 } 75 76 postgresqlStop() { 77 + echo 'stopping postgresql' 78 pg_ctl stop 79 }
+1 -1
pkgs/build-support/setup-hooks/separate-debug-info.sh
··· 26 fi 27 28 # Extract the debug info. 29 - header "separating debug info from $i (build ID $id)" 30 mkdir -p "$dst/${id:0:2}" 31 32 # This may fail, e.g. if the binary is for a different
··· 26 fi 27 28 # Extract the debug info. 29 + echo "separating debug info from $i (build ID $id)" 30 mkdir -p "$dst/${id:0:2}" 31 32 # 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 ''; 534 535 buildPhase = '' ··· 559 find $rpmout -name "*.rpm" -exec cp {} $out/$outDir \; 560 561 for i in $out/$outDir/*.rpm; do 562 - header "Generated RPM/SRPM: $i" 563 rpm -qip $i 564 - stopNest 565 done 566 567 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" 532 ''; 533 534 buildPhase = '' ··· 558 find $rpmout -name "*.rpm" -exec cp {} $out/$outDir \; 559 560 for i in $out/$outDir/*.rpm; do 561 + echo "Generated RPM/SRPM: $i" 562 rpm -qip $i 563 done 564 565 eval "$postInstall"
+1 -3
pkgs/development/compilers/chicken/4/fetchegg/builder.sh
··· 1 if [ -e .attrs.sh ]; then source .attrs.sh; fi 2 source $stdenv/setup 3 4 - header "exporting egg ${eggName} (version $version) into $out" 5 6 mkdir -p $out 7 chicken-install -r "${eggName}:${version}" 8 cp -r ${eggName}/* $out/ 9 - 10 - stopNest
··· 1 if [ -e .attrs.sh ]; then source .attrs.sh; fi 2 source $stdenv/setup 3 4 + echo "exporting egg ${eggName} (version $version) into $out" 5 6 mkdir -p $out 7 chicken-install -r "${eggName}:${version}" 8 cp -r ${eggName}/* $out/
+1 -3
pkgs/development/compilers/chicken/5/fetchegg/builder.sh
··· 1 if [ -e .attrs.sh ]; then source .attrs.sh; fi 2 source $stdenv/setup 3 4 - header "exporting egg ${eggName} (version $version) into $out" 5 6 mkdir -p $out 7 CHICKEN_EGG_CACHE=. chicken-install -r "${eggName}:${version}" 8 rm ${eggName}/{STATUS,TIMESTAMP} 9 cp -r ${eggName}/* $out/ 10 - 11 - stopNest
··· 1 if [ -e .attrs.sh ]; then source .attrs.sh; fi 2 source $stdenv/setup 3 4 + echo "exporting egg ${eggName} (version $version) into $out" 5 6 mkdir -p $out 7 CHICKEN_EGG_CACHE=. chicken-install -r "${eggName}:${version}" 8 rm ${eggName}/{STATUS,TIMESTAMP} 9 cp -r ${eggName}/* $out/
-3
pkgs/development/tools/misc/automake/automake-1.11.x.nix
··· 22 nativeBuildInputs = [ perl autoconf ]; 23 buildInputs = [ autoconf ]; 24 25 - # Disable indented log output from Make, otherwise "make.test" will 26 - # fail. 27 - preCheck = "unset NIX_INDENT_MAKE"; 28 doCheck = false; # takes _a lot_ of time, fails 11 of 782 tests 29 30 # Don't fixup "#! /bin/sh" in Libtool, otherwise it will use the
··· 22 nativeBuildInputs = [ perl autoconf ]; 23 buildInputs = [ autoconf ]; 24 25 doCheck = false; # takes _a lot_ of time, fails 11 of 782 tests 26 27 # Don't fixup "#! /bin/sh" in Libtool, otherwise it will use the
-3
pkgs/development/tools/misc/automake/automake-1.15.x.nix
··· 16 17 patches = [ ./help2man-SOURCE_DATE_EPOCH-support.patch ]; 18 19 - # 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
··· 16 17 patches = [ ./help2man-SOURCE_DATE_EPOCH-support.patch ]; 18 19 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
-3
pkgs/development/tools/misc/automake/automake-1.16.x.nix
··· 15 16 setupHook = ./setup-hook.sh; 17 18 - # 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
··· 15 16 setupHook = ./setup-hook.sh; 17 18 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
+1 -3
pkgs/development/tools/misc/patchelf/setup-hook.sh
··· 8 local dir="$1" 9 [ -e "$dir" ] || return 0 10 11 - header "shrinking RPATHs of ELF executables and libraries in $dir" 12 13 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 10 11 + echo "shrinking RPATHs of ELF executables and libraries in $dir" 12 13 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 }
+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" 151 152 - 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" 151 152 + 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" 113 114 pushd 'external/ippcp_internal' 115 ··· 149 ./linux/installer/bin/sgx_linux_x64_sdk_${version}.bin -prefix $installDir 150 installDir=$installDir/sgxsdk 151 152 - header "Move files created by installer" 153 154 mkdir -p $out/bin 155 pushd $out ··· 206 207 208 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 213 214 - header "Fixing pkg-config files" 215 sed -i "s|prefix=.*|prefix=$out|g" $out/lib/pkgconfig/*.pc 216 217 - 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 224 225 - 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}' 229 230 - 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" 113 114 pushd 'external/ippcp_internal' 115 ··· 149 ./linux/installer/bin/sgx_linux_x64_sdk_${version}.bin -prefix $installDir 150 installDir=$installDir/sgxsdk 151 152 + echo "Move files created by installer" 153 154 mkdir -p $out/bin 155 pushd $out ··· 206 207 208 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 213 214 + echo "Fixing pkg-config files" 215 sed -i "s|prefix=.*|prefix=$out|g" $out/lib/pkgconfig/*.pc 216 217 + 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 224 225 + 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}' 229 230 + 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 2 __nixpkgs_setup_set_original=$- 3 set -eu 4 set -o pipefail ··· 32 export NIX_ATTRS_JSON_FILE="$NIX_BUILD_TOP/.attrs.json" 33 export NIX_ATTRS_SH_FILE="$NIX_BUILD_TOP/.attrs.sh" 34 else 35 - : ${outputs:=out} 36 fi 37 38 getAllOutputNames() { ··· 124 125 ###################################################################### 126 # Logging. 127 - 128 - # Obsolete. 129 - stopNest() { true; } 130 - header() { echo "$1"; } 131 - closeNest() { true; } 132 133 # 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. 400 export SOURCE_DATE_EPOCH 401 - : ${SOURCE_DATE_EPOCH:=315532800} 402 403 404 # Wildcard expansions that don't match should expand to an empty list. ··· 448 449 # Package accumulators 450 451 - # shellcheck disable=SC2034 452 declare -a pkgsBuildBuild pkgsBuildHost pkgsBuildTarget 453 declare -a pkgsHostHost pkgsHostTarget 454 declare -a pkgsTargetTarget ··· 473 declare -a pkgHookVarVars=(pkgBuildHookVars pkgHostHookVars pkgTargetHookVars) 474 475 # those variables are declared here, since where and if they are used varies 476 - # shellcheck disable=SC2034 477 declare -a preFixupHooks fixupOutputHooks preConfigureHooks postFixupHooks postUnpackHooks unpackCmdHooks 478 479 # 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. 611 612 # 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=} 619 620 for pkg in ${depsBuildBuild[@]} ${depsBuildBuildPropagated[@]}; do 621 findInputs "$pkg" -1 -1 ··· 798 unset _XDG_DATA_DIRS 799 800 801 - # 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) 889 consumeEntire() { 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 ··· 1033 1034 unpackFile() { 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. 1080 1081 # set to empty if unset 1082 - : ${sourceRoot=} 1083 1084 if [ -n "${setSourceRoot:-}" ]; then 1085 runOneHook setSourceRoot ··· 1130 fi 1131 1132 for i in "${patchesArray[@]}"; do 1133 - header "applying patch $i" 3 1134 local uncompress=cat 1135 case "$i" in 1136 *.gz) ··· 1183 runHook preConfigure 1184 1185 # set to empty if unset 1186 - : ${configureScript=} 1187 1188 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 ··· 1494 showPhaseHeader() { 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 1516 1517 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 1562 1563 if [[ -n $NIX_LOG_FD ]]; then 1564 - echo "@nix { \"action\": \"setPhase\", \"phase\": \"$curPhase\" }" >&$NIX_LOG_FD 1565 fi 1566 1567 showPhaseHeader "$curPhase"
··· 1 # shellcheck shell=bash 2 + # shellcheck disable=1090,2154,2123,2034,2178,2048 3 __nixpkgs_setup_set_original=$- 4 set -eu 5 set -o pipefail ··· 33 export NIX_ATTRS_JSON_FILE="$NIX_BUILD_TOP/.attrs.json" 34 export NIX_ATTRS_SH_FILE="$NIX_BUILD_TOP/.attrs.sh" 35 else 36 + : "${outputs:=out}" 37 fi 38 39 getAllOutputNames() { ··· 125 126 ###################################################################### 127 # Logging. 128 129 # 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. 396 export SOURCE_DATE_EPOCH 397 + : "${SOURCE_DATE_EPOCH:=315532800}" 398 399 400 # Wildcard expansions that don't match should expand to an empty list. ··· 444 445 # Package accumulators 446 447 declare -a pkgsBuildBuild pkgsBuildHost pkgsBuildTarget 448 declare -a pkgsHostHost pkgsHostTarget 449 declare -a pkgsTargetTarget ··· 468 declare -a pkgHookVarVars=(pkgBuildHookVars pkgHostHookVars pkgTargetHookVars) 469 470 # those variables are declared here, since where and if they are used varies 471 declare -a preFixupHooks fixupOutputHooks preConfigureHooks postFixupHooks postUnpackHooks unpackCmdHooks 472 473 # 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. 605 606 # 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=}" 613 614 for pkg in ${depsBuildBuild[@]} ${depsBuildBuildPropagated[@]}; do 615 findInputs "$pkg" -1 -1 ··· 792 unset _XDG_DATA_DIRS 793 794 795 # 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) 879 consumeEntire() { 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 ··· 1023 1024 unpackFile() { 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. 1070 1071 # set to empty if unset 1072 + : "${sourceRoot=}" 1073 1074 if [ -n "${setSourceRoot:-}" ]; then 1075 runOneHook setSourceRoot ··· 1120 fi 1121 1122 for i in "${patchesArray[@]}"; do 1123 + echo "applying patch $i" 1124 local uncompress=cat 1125 case "$i" in 1126 *.gz) ··· 1173 runHook preConfigure 1174 1175 # set to empty if unset 1176 + : "${configureScript=}" 1177 1178 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 ··· 1484 showPhaseHeader() { 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 1506 1507 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 1552 1553 if [[ -n $NIX_LOG_FD ]]; then 1554 + echo "@nix { \"action\": \"setPhase\", \"phase\": \"$curPhase\" }" >&"$NIX_LOG_FD" 1555 fi 1556 1557 showPhaseHeader "$curPhase"
-2
pkgs/tools/package-management/nix/nix-perl.nix
··· 40 ]; 41 42 preConfigure = "export NIX_STATE_DIR=$TMPDIR"; 43 - 44 - preBuild = "unset NIX_INDENT_MAKE"; 45 }
··· 40 ]; 41 42 preConfigure = "export NIX_STATE_DIR=$TMPDIR"; 43 }
+3 -3
pkgs/top-level/make-tarball.nix
··· 47 opts=(--option build-users-group "") 48 nix-store --init 49 50 - header "checking eval-release.nix" 51 nix-instantiate --eval --strict --show-trace ./maintainers/scripts/eval-release.nix > /dev/null 52 53 - header "checking find-tarballs.nix" 54 nix-instantiate --readonly-mode --eval --strict --show-trace --json \ 55 ./maintainers/scripts/find-tarballs.nix \ 56 --arg expr 'import ./maintainers/scripts/all-tarballs.nix' > $TMPDIR/tarballs.json ··· 61 exit 1 62 fi 63 64 - header "generating packages.json" 65 mkdir -p $out/nix-support 66 echo -n '{"version":2,"packages":' > tmp 67 nix-env -f . -I nixpkgs=$src -qa --meta --json --arg config 'import ${./packages-config.nix}' "''${opts[@]}" >> tmp
··· 47 opts=(--option build-users-group "") 48 nix-store --init 49 50 + echo "checking eval-release.nix" 51 nix-instantiate --eval --strict --show-trace ./maintainers/scripts/eval-release.nix > /dev/null 52 53 + echo "checking find-tarballs.nix" 54 nix-instantiate --readonly-mode --eval --strict --show-trace --json \ 55 ./maintainers/scripts/find-tarballs.nix \ 56 --arg expr 'import ./maintainers/scripts/all-tarballs.nix' > $TMPDIR/tarballs.json ··· 61 exit 1 62 fi 63 64 + echo "generating packages.json" 65 mkdir -p $out/nix-support 66 echo -n '{"version":2,"packages":' > tmp 67 nix-env -f . -I nixpkgs=$src -qa --meta --json --arg config 'import ${./packages-config.nix}' "''${opts[@]}" >> tmp
+1 -1
pkgs/top-level/nixpkgs-basic-release-checks.nix
··· 32 33 # 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" 36 37 # To get a call trace; see https://nixos.org/manual/nixpkgs/stable/#function-library-lib.trivial.warn 38 # Relies on impure eval
··· 32 33 # 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" 36 37 # To get a call trace; see https://nixos.org/manual/nixpkgs/stable/#function-library-lib.trivial.warn 38 # Relies on impure eval