From cca66b9ec4e494c1d919bff0f71a820d8afab1fa Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 20:24:48 +0200 Subject: Adding upstream version 1.2.2. Signed-off-by: Daniel Baumann --- packaging/macos/jhb/etc/jhb.conf/sdkroot.sh | 41 +++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 packaging/macos/jhb/etc/jhb.conf/sdkroot.sh (limited to 'packaging/macos/jhb/etc/jhb.conf/sdkroot.sh') diff --git a/packaging/macos/jhb/etc/jhb.conf/sdkroot.sh b/packaging/macos/jhb/etc/jhb.conf/sdkroot.sh new file mode 100644 index 0000000..deda692 --- /dev/null +++ b/packaging/macos/jhb/etc/jhb.conf/sdkroot.sh @@ -0,0 +1,41 @@ +# SPDX-FileCopyrightText: 2021 René de Hesselle +# +# SPDX-License-Identifier: GPL-2.0-or-later + +### description ################################################################ + +# If SDKROOT is set, use that. If it is not set, use whatever SDK is available. +# This might still end up being invalid if neither Xcode nor CLT have been +# installed, and that's what sdkroot_exists is for. + +### shellcheck ################################################################# + +# shellcheck shell=bash # no shebang as this file is intended to be sourced +# shellcheck disable=SC2034 # we only use exports if we really need them + +### variables ################################################################## + +if [ -z "$SDKROOT" ]; then + if xcodebuild --help 2>/dev/null; then + SDKROOT=$(xcodebuild -version -sdk macosx Path) + else + SDKROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk + fi +fi +export SDKROOT + +### functions ################################################################## + +function sdkroot_exists +{ + if [ -d "$SDKROOT" ]; then + return 0 # SDK found + else + echo_e "SDK not found: $SDKROOT" + return 1 + fi +} + +### main ####################################################################### + +# Nothing here. -- cgit v1.2.3