diff options
author | github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> | 2021-07-18 00:02:06 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-18 00:02:06 +0000 |
commit | 08a8809bfe1688df8419f41fd31c2f794c4debdf (patch) | |
tree | 02c532b4ebeac226362c3723c8b9cfa1ef7e4c5c /pkgs/build-support | |
parent | 11332e9137fbbab82b10312da9dad67e3607f553 (diff) | |
parent | 382fdc7ad3184c7d47f54feb535a970fe64a0f35 (diff) | |
download | nixpkgs-08a8809bfe1688df8419f41fd31c2f794c4debdf.tar nixpkgs-08a8809bfe1688df8419f41fd31c2f794c4debdf.tar.gz nixpkgs-08a8809bfe1688df8419f41fd31c2f794c4debdf.tar.bz2 nixpkgs-08a8809bfe1688df8419f41fd31c2f794c4debdf.tar.lz nixpkgs-08a8809bfe1688df8419f41fd31c2f794c4debdf.tar.xz nixpkgs-08a8809bfe1688df8419f41fd31c2f794c4debdf.tar.zst nixpkgs-08a8809bfe1688df8419f41fd31c2f794c4debdf.zip |
Merge staging-next into staging
Diffstat (limited to 'pkgs/build-support')
7 files changed, 15 insertions, 30 deletions
diff --git a/pkgs/build-support/bintools-wrapper/setup-hook.sh b/pkgs/build-support/bintools-wrapper/setup-hook.sh index ba09d19b1f2..7e9547b96c2 100644 --- a/pkgs/build-support/bintools-wrapper/setup-hook.sh +++ b/pkgs/build-support/bintools-wrapper/setup-hook.sh @@ -1,4 +1,3 @@ -# shellcheck shell=bash # Binutils Wrapper hygiene # # See comments in cc-wrapper's setup hook. This works exactly the same way. @@ -15,9 +14,7 @@ bintoolsWrapper_addLDVars () { getHostRoleEnvHook if [[ -d "$1/lib64" && ! -L "$1/lib64" ]]; then - varName=NIX_LDFLAGS${role_post} - eval "$varName=\"${!varName:-} -L$1/lib64\"" - export "${varName?}" + export NIX_LDFLAGS${role_post}+=" -L$1/lib64" fi if [[ -d "$1/lib" ]]; then @@ -27,9 +24,7 @@ bintoolsWrapper_addLDVars () { # directories and bloats the size of the environment variable space. local -a glob=( $1/lib/lib* ) if [ "${#glob[*]}" -gt 0 ]; then - varName=NIX_LDFLAGS${role_post} - eval "$varName=\"${!varName:-} -L$1/lib\"" - export "${varName?}" + export NIX_LDFLAGS${role_post}+=" -L$1/lib" fi fi } diff --git a/pkgs/build-support/setup-hooks/auto-patchelf.sh b/pkgs/build-support/setup-hooks/auto-patchelf.sh index 70b1fc802b5..511371931de 100644 --- a/pkgs/build-support/setup-hooks/auto-patchelf.sh +++ b/pkgs/build-support/setup-hooks/auto-patchelf.sh @@ -29,7 +29,6 @@ isExecutable() { isExeResult="$(LANG=C $READELF -h -l "$1" 2> /dev/null \ | grep '^ *Type: *EXEC\>\|^ *INTERP\>')" # not using grep -q, because it can cause Broken pipe - # https://unix.stackexchange.com/questions/305547/broken-pipe-when-grepping-output-but-only-with-i-flag [ -n "$isExeResult" ] } diff --git a/pkgs/build-support/setup-hooks/autoreconf.sh b/pkgs/build-support/setup-hooks/autoreconf.sh index 4ba4025a02e..c08cab15868 100644 --- a/pkgs/build-support/setup-hooks/autoreconf.sh +++ b/pkgs/build-support/setup-hooks/autoreconf.sh @@ -1,5 +1,4 @@ -# shellcheck shell=bash -preConfigurePhases="${preConfigurePhases:-} autoreconfPhase" +preConfigurePhases+=" autoreconfPhase" autoreconfPhase() { runHook preAutoreconf diff --git a/pkgs/build-support/setup-hooks/make-symlinks-relative.sh b/pkgs/build-support/setup-hooks/make-symlinks-relative.sh index fd65f2e8e13..0608d3ca81c 100644 --- a/pkgs/build-support/setup-hooks/make-symlinks-relative.sh +++ b/pkgs/build-support/setup-hooks/make-symlinks-relative.sh @@ -1,4 +1,3 @@ -# shellcheck shell=bash fixupOutputHooks+=(_makeSymlinksRelative) # For every symlink in $output that refers to another file in $output diff --git a/pkgs/build-support/setup-hooks/move-docs.sh b/pkgs/build-support/setup-hooks/move-docs.sh index 965c16be2f6..ef31dcdce27 100644 --- a/pkgs/build-support/setup-hooks/move-docs.sh +++ b/pkgs/build-support/setup-hooks/move-docs.sh @@ -6,7 +6,7 @@ preFixupHooks+=(_moveToShare) _moveToShare() { forceShare=${forceShare:=man doc info} - if [[ -z $forceShare || -z $out ]]; then return; fi + if [ -z "$forceShare" -o -z "$out" ]; then return; fi for d in $forceShare; do if [ -d "$out/$d" ]; then @@ -14,9 +14,10 @@ _moveToShare() { echo "both $d/ and share/$d/ exist!" else echo "moving $out/$d to $out/share/$d" - mkdir -p "$out/share" - mv "$out/$d" "$out/share/" + mkdir -p $out/share + mv $out/$d $out/share/ fi fi done } + diff --git a/pkgs/build-support/setup-hooks/multiple-outputs.sh b/pkgs/build-support/setup-hooks/multiple-outputs.sh index 91f056cc89b..bfa47e3b20e 100644 --- a/pkgs/build-support/setup-hooks/multiple-outputs.sh +++ b/pkgs/build-support/setup-hooks/multiple-outputs.sh @@ -1,4 +1,3 @@ -# shellcheck shell=bash # The base package for automatic multiple-output splitting. Used in stdenv as well. preConfigureHooks+=(_multioutConfig) preFixupHooks+=(_multioutDocs) @@ -48,25 +47,22 @@ _overrideFirst outputInfo "info" "$outputBin" # Add standard flags to put files into the desired outputs. _multioutConfig() { - if [[ "$outputs" = "out" || -z "${setOutputFlags-1}" ]]; then - return - fi + if [ "$outputs" = "out" ] || [ -z "${setOutputFlags-1}" ]; then return; fi; # try to detect share/doc/${shareDocName} # Note: sadly, $configureScript detection comes later in configurePhase, # and reordering would cause more trouble than worth. if [ -z "$shareDocName" ]; then local confScript="$configureScript" - if [[ -z "$confScript" && -x ./configure ]]; then + if [ -z "$confScript" ] && [ -x ./configure ]; then confScript=./configure fi if [ -f "$confScript" ]; then local shareDocName="$(sed -n "s/^PACKAGE_TARNAME='\(.*\)'$/\1/p" < "$confScript")" - # PACKAGE_TARNAME sometimes contains garbage. - # verify that shareDocName contains only valid characters - if ! [[ $shareDocName =~ ^[a-zA-Z0f9_-]+$ ]]; then - shareDocName="$(echo "$name" | sed 's/-[^a-zA-Z].*//')" - fi + fi + # PACKAGE_TARNAME sometimes contains garbage. + if [ -z "$shareDocName" ] || echo "$shareDocName" | grep -q '[^a-zA-Z0-9_-]'; then + shareDocName="$(echo "$name" | sed 's/-[^a-zA-Z].*//')" fi fi diff --git a/pkgs/build-support/setup-hooks/reproducible-builds.sh b/pkgs/build-support/setup-hooks/reproducible-builds.sh index 29efd22d905..5b01c213fe4 100644 --- a/pkgs/build-support/setup-hooks/reproducible-builds.sh +++ b/pkgs/build-support/setup-hooks/reproducible-builds.sh @@ -1,13 +1,9 @@ -# shellcheck disable=SC2148 # Use the last part of the out path as hash input for the build. # This should ensure that it is deterministic across rebuilds of the same # derivation and not easily collide with other builds. # We also truncate the hash so that it cannot cause reference cycles. -# NIX_CFLAGS_COMPILE might not have been defined before -NIX_CFLAGS_COMPILE="${NIX_CFLAGS_COMPILE:-} -frandom-seed=$( - # shellcheck disable=SC2154 +export NIX_CFLAGS_COMPILE+=" -frandom-seed=$( outbase="${out##*/}" randomseed="${outbase:0:10}" - echo "$randomseed" + echo $randomseed )" -export NIX_CFLAGS_COMPILE |