Skip to content

Commit

Permalink
scripts/bootstrap-prefix: emulate readlink -f behaviour for older macOS
Browse files Browse the repository at this point in the history
Avoid some ugly warning and fallback to (likely) wrong SDK with failures
as result due to not expanding the MacOSX.sdk symlink properly.

Signed-off-by: Fabian Groffen <grobian@gentoo.org>
  • Loading branch information
grobian committed Jul 23, 2024
1 parent a114199 commit 0378ad8
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions scripts/bootstrap-prefix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ bootstrap_tree() {
# retain this comment and the line below to
# keep this snapshot around in the snapshots
# MKSNAPSHOT-ANCHOR -- directory of rsync slaves
local PV="20240718"
local PV="20240721"

# RAP uses the latest gentoo main repo snapshot to bootstrap.
is-rap && LATEST_TREE_YES=1
Expand Down Expand Up @@ -1503,7 +1503,14 @@ bootstrap_stage1() {
local fsdk
local osvers
# try and find a matching OS SDK
fsdk="$(readlink -f "${SDKPATH}")"
fsdk="$(readlink "${SDKPATH}")"
# note readlink -f is not supported on older versions of
# macOS so need to emulate it
if [[ ${fsdk} != /* ]] ; then
# this is not proper, but Apple does not use ../
# constructs here, as far as we know
fsdk="${SDKPATH%/*}/${fsdk}"
fi
osvers="$(sw_vers -productVersion)"
if [[ ${osvers%%.*} -le 10 ]] ; then
osvers=$(echo "${osvers}" | cut -d'.' -f1-2)
Expand Down

0 comments on commit 0378ad8

Please sign in to comment.