diff options
author | Alyssa Ross <hi@alyssa.is> | 2022-01-03 23:55:00 +0000 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2022-02-19 11:03:39 +0000 |
commit | f4cf97a04cd5d0b86aa46baec9fb228a8f671c03 (patch) | |
tree | 28192415ff39a661d0001563bf81cc93fa25d16d /nixpkgs/pkgs/stdenv/generic | |
parent | f8422837c9bde058e8f2de37702e7e94b2226040 (diff) | |
parent | 18c84ea816348e2a098390101b92d1e39a9dbd45 (diff) | |
download | nixlib-f4cf97a04cd5d0b86aa46baec9fb228a8f671c03.tar nixlib-f4cf97a04cd5d0b86aa46baec9fb228a8f671c03.tar.gz nixlib-f4cf97a04cd5d0b86aa46baec9fb228a8f671c03.tar.bz2 nixlib-f4cf97a04cd5d0b86aa46baec9fb228a8f671c03.tar.lz nixlib-f4cf97a04cd5d0b86aa46baec9fb228a8f671c03.tar.xz nixlib-f4cf97a04cd5d0b86aa46baec9fb228a8f671c03.tar.zst nixlib-f4cf97a04cd5d0b86aa46baec9fb228a8f671c03.zip |
Merge commit '18c84ea816348e2a098390101b92d1e39a9dbd45'
Conflicts: nixpkgs/nixos/modules/misc/documentation.nix nixpkgs/pkgs/applications/networking/browsers/firefox/packages.nix nixpkgs/pkgs/applications/window-managers/sway/default.nix nixpkgs/pkgs/build-support/rust/build-rust-package/default.nix nixpkgs/pkgs/development/go-modules/generic/default.nix nixpkgs/pkgs/development/interpreters/ruby/default.nix nixpkgs/pkgs/development/interpreters/ruby/patchsets.nix nixpkgs/pkgs/development/libraries/boehm-gc/7.6.6.nix nixpkgs/pkgs/development/python-modules/django-mailman3/default.nix nixpkgs/pkgs/servers/mail/mailman/web.nix nixpkgs/pkgs/top-level/aliases.nix nixpkgs/pkgs/top-level/all-packages.nix nixpkgs/pkgs/top-level/impure.nix
Diffstat (limited to 'nixpkgs/pkgs/stdenv/generic')
-rw-r--r-- | nixpkgs/pkgs/stdenv/generic/default.nix | 13 | ||||
-rw-r--r-- | nixpkgs/pkgs/stdenv/generic/make-derivation.nix | 5 | ||||
-rw-r--r-- | nixpkgs/pkgs/stdenv/generic/setup.sh | 39 |
3 files changed, 36 insertions, 21 deletions
diff --git a/nixpkgs/pkgs/stdenv/generic/default.nix b/nixpkgs/pkgs/stdenv/generic/default.nix index d7fb1b0ba063..49ebc67f854e 100644 --- a/nixpkgs/pkgs/stdenv/generic/default.nix +++ b/nixpkgs/pkgs/stdenv/generic/default.nix @@ -1,6 +1,6 @@ -let lib = import ../../../lib; in lib.makeOverridable ( +let lib = import ../../../lib; stdenv-overridable = lib.makeOverridable ( -{ name ? "stdenv", preHook ? "", initialPath +argsStdenv@{ name ? "stdenv", preHook ? "", initialPath , # If we don't have a C compiler, we might either have `cc = null` or `cc = # throw ...`, but if we do have a C compiler we should definiely have `cc != @@ -81,8 +81,10 @@ let defaultBuildInputs = extraBuildInputs; + stdenv = (stdenv-overridable argsStdenv); + # The stdenv that we are producing. - stdenv = + in derivation ( lib.optionalAttrs (allowedRequisites != null) { allowedRequisites = allowedRequisites @@ -172,6 +174,5 @@ let # "lift" packages like curl from the final stdenv for Linux to # all-packages.nix for that platform (meaning that it has a line # like curl = if stdenv ? curl then stdenv.curl else ...). - // extraAttrs; - -in stdenv) + // extraAttrs +); in stdenv-overridable diff --git a/nixpkgs/pkgs/stdenv/generic/make-derivation.nix b/nixpkgs/pkgs/stdenv/generic/make-derivation.nix index 56cfa0c503f8..2465449867cb 100644 --- a/nixpkgs/pkgs/stdenv/generic/make-derivation.nix +++ b/nixpkgs/pkgs/stdenv/generic/make-derivation.nix @@ -282,7 +282,7 @@ else let ++ [ "-DCMAKE_SYSTEM_NAME=${lib.findFirst lib.isString "Generic" ( lib.optional (!stdenv.hostPlatform.isRedox) stdenv.hostPlatform.uname.system)}"] ++ lib.optional (stdenv.hostPlatform.uname.processor != null) "-DCMAKE_SYSTEM_PROCESSOR=${stdenv.hostPlatform.uname.processor}" - ++ lib.optional (stdenv.hostPlatform.uname.release != null) "-DCMAKE_SYSTEM_VERSION=${stdenv.hostPlatform.release}" + ++ lib.optional (stdenv.hostPlatform.uname.release != null) "-DCMAKE_SYSTEM_VERSION=${stdenv.hostPlatform.uname.release}" ++ lib.optional (stdenv.hostPlatform.isDarwin) "-DCMAKE_OSX_ARCHITECTURES=${stdenv.hostPlatform.darwinArch}" ++ lib.optional (stdenv.buildPlatform.uname.system != null) "-DCMAKE_HOST_SYSTEM_NAME=${stdenv.buildPlatform.uname.system}" ++ lib.optional (stdenv.buildPlatform.uname.processor != null) "-DCMAKE_HOST_SYSTEM_PROCESSOR=${stdenv.buildPlatform.uname.processor}" @@ -305,6 +305,9 @@ else let cpu_family = '${cpuFamily stdenv.targetPlatform}' cpu = '${stdenv.targetPlatform.parsed.cpu.name}' endian = ${if stdenv.targetPlatform.isLittleEndian then "'little'" else "'big'"} + + [binaries] + llvm-config = 'llvm-config-native' ''; in [ "--cross-file=${crossFile}" ] ++ mesonFlags; } // lib.optionalAttrs (attrs.enableParallelBuilding or false) { diff --git a/nixpkgs/pkgs/stdenv/generic/setup.sh b/nixpkgs/pkgs/stdenv/generic/setup.sh index f90d9020f89f..2951813c0f71 100644 --- a/nixpkgs/pkgs/stdenv/generic/setup.sh +++ b/nixpkgs/pkgs/stdenv/generic/setup.sh @@ -1,5 +1,6 @@ set -eu set -o pipefail +shopt -s inherit_errexit if [[ -n "${BASH_VERSINFO-}" && "${BASH_VERSINFO-}" -lt 4 ]]; then echo "Detected Bash version that isn't supported by Nixpkgs (${BASH_VERSION})" @@ -409,15 +410,14 @@ findInputs() { # The current package's host and target offset together # provide a <=-preserving homomorphism from the relative # offsets to current offset - local -i mapOffsetResult function mapOffset() { local -r inputOffset="$1" + local -n outputOffset="$2" if (( inputOffset <= 0 )); then - local -r outputOffset=$((inputOffset + hostOffset)) + outputOffset=$((inputOffset + hostOffset)) else - local -r outputOffset=$((inputOffset - 1 + targetOffset)) + outputOffset=$((inputOffset - 1 + targetOffset)) fi - mapOffsetResult="$outputOffset" } # Host offset relative to that of the package whose immediate @@ -429,16 +429,16 @@ findInputs() { # Host offset relative to the package currently being # built---as absolute an offset as will be used. - mapOffset relHostOffset - local -i hostOffsetNext="$mapOffsetResult" + local hostOffsetNext + mapOffset "$relHostOffset" hostOffsetNext # Ensure we're in bounds relative to the package currently # being built. - [[ "${allPlatOffsets[*]}" = *"$hostOffsetNext"* ]] || continue + (( -1 <= hostOffsetNext && hostOffsetNext <= 1 )) || continue # Target offset relative to the *host* offset of the package # whose immediate dependencies we are currently exploring. - local -i relTargetOffset + local relTargetOffset for relTargetOffset in "${allPlatOffsets[@]}"; do (( "$relHostOffset" <= "$relTargetOffset" )) || continue @@ -448,12 +448,12 @@ findInputs() { # Target offset relative to the package currently being # built. - mapOffset relTargetOffset - local -i targetOffsetNext="$mapOffsetResult" + local targetOffsetNext + mapOffset "$relTargetOffset" targetOffsetNext # Once again, ensure we're in bounds relative to the # package currently being built. - [[ "${allPlatOffsets[*]}" = *"$targetOffsetNext"* ]] || continue + (( -1 <= hostOffsetNext && hostOffsetNext <= 1 )) || continue [[ -f "$pkg/nix-support/$file" ]] || continue @@ -859,12 +859,12 @@ _defaultUnpack() { case "$fn" in *.tar.xz | *.tar.lzma | *.txz) # Don't rely on tar knowing about .xz. - xz -d < "$fn" | tar xf - + xz -d < "$fn" | tar xf - --warning=no-timestamp ;; *.tar | *.tar.* | *.tgz | *.tbz2 | *.tbz) # GNU tar can automatically select the decompression method # (info "(tar) gzip"). - tar xf "$fn" + tar xf "$fn" --warning=no-timestamp ;; *) return 1 @@ -986,7 +986,18 @@ patchPhase() { fixLibtool() { - sed -i -e 's^eval sys_lib_.*search_path=.*^^' "$1" + local search_path + for flag in $NIX_LDFLAGS; do + case $flag in + -L*) + search_path+=" ${flag#-L}" + ;; + esac + done + + sed -i "$1" \ + -e "s^eval \(sys_lib_search_path=\).*^\1'$search_path'^" \ + -e 's^eval sys_lib_.+search_path=.*^^' } |