aboutsummaryrefslogtreecommitdiff
path: root/contrib/guix/guix-build.sh
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/guix/guix-build.sh')
-rwxr-xr-xcontrib/guix/guix-build.sh24
1 files changed, 22 insertions, 2 deletions
diff --git a/contrib/guix/guix-build.sh b/contrib/guix/guix-build.sh
index 54cc5793f6..da6bd13f6a 100755
--- a/contrib/guix/guix-build.sh
+++ b/contrib/guix/guix-build.sh
@@ -65,12 +65,13 @@ else
fi
################
-# Check 4: Make sure that build directories do no exist
+# Check 4: Make sure that build directories do not exist
################
# Default to building for all supported HOSTs (overridable by environment)
export HOSTS="${HOSTS:-x86_64-linux-gnu arm-linux-gnueabihf aarch64-linux-gnu riscv64-linux-gnu
- x86_64-w64-mingw32}"
+ x86_64-w64-mingw32
+ x86_64-apple-darwin18}"
DISTSRC_BASE="${DISTSRC_BASE:-${PWD}}"
@@ -105,9 +106,28 @@ for host in $hosts_distsrc_exists; do
done
exit 1
else
+
mkdir -p "$DISTSRC_BASE"
fi
+################
+# Check 5: When building for darwin, make sure that the macOS SDK exists
+################
+
+for host in $HOSTS; do
+ case "$host" in
+ *darwin*)
+ OSX_SDK="$(make -C "${PWD}/depends" --no-print-directory HOST="$host" print-OSX_SDK | sed 's@^[^=]\+=[[:space:]]\+@@g')"
+ if [ -e "$OSX_SDK" ]; then
+ echo "Found macOS SDK at '${OSX_SDK}', using..."
+ else
+ echo "macOS SDK does not exist at '${OSX_SDK}', please place the extracted, untarred SDK there to perform darwin builds, exiting..."
+ exit 1
+ fi
+ ;;
+ esac
+done
+
#########
# Setup #
#########