diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 18:24:48 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 18:24:48 +0000 |
commit | cca66b9ec4e494c1d919bff0f71a820d8afab1fa (patch) | |
tree | 146f39ded1c938019e1ed42d30923c2ac9e86789 /packaging/macos/jhb/etc/jhb.conf/sdkroot.sh | |
parent | Initial commit. (diff) | |
download | inkscape-upstream/1.2.2.tar.xz inkscape-upstream/1.2.2.zip |
Adding upstream version 1.2.2.upstream/1.2.2upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'packaging/macos/jhb/etc/jhb.conf/sdkroot.sh')
-rw-r--r-- | packaging/macos/jhb/etc/jhb.conf/sdkroot.sh | 41 |
1 files changed, 41 insertions, 0 deletions
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 <dehesselle@web.de> +# +# 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. |