1- using BinaryBuilder
2- using Pkg
1+ using BinaryBuilder, Pkg
2+
3+ const YGGDRASIL_DIR = " ../.."
4+ include (joinpath (YGGDRASIL_DIR, " platforms" , " macos_sdks.jl" ))
35
46name = " MGARD"
57version = v " 1.6.0"
@@ -12,10 +14,17 @@ sources = [
1214# Bash recipe for building across all platforms
1315script = raw """
1416cd MGARD
17+
1518# We installed a `protoc` executable both as a build- and a host-build-dependency.
1619# Delete the non-host-build `protoc` executable so that cmake won't try to run it.
1720rm ${bindir}/protoc${exeext}
1821ls -l ${host_bindir}/protoc
22+
23+ # pkg-config is very slow because `abseil_cpp` installed about 200 `*.pc` files.
24+ # Pretend that `protobuf` does not require `abseil_cpp`.
25+ mv /workspace/destdir/lib/pkgconfig/protobuf.pc /workspace/destdir/lib/pkgconfig/protobuf.pc.orig
26+ sed -e 's/Requires/# Requires/' /workspace/destdir/lib/pkgconfig/protobuf.pc.orig >/workspace/destdir/lib/pkgconfig/protobuf.pc
27+
1928cmake -B build \
2029 -DBUILD_TESTING=OFF \
2130 -DCMAKE_BUILD_TYPE=Release \
@@ -27,17 +36,16 @@ cmake -B build \
2736 -DMGARD_ENABLE_SERIAL=ON
2837cmake --build build --parallel ${nproc}
2938cmake --install build
39+
40+ # Restore files
41+ mv /workspace/destdir/lib/pkgconfig/protobuf.pc.orig /workspace/destdir/lib/pkgconfig/protobuf.pc
3042"""
3143
44+ sources, script = require_macos_sdk (" 10.13" , sources, script)
45+
3246# We enable all platforms
3347platforms = expand_cxxstring_abis (supported_platforms ())
3448
35- # All BSD (FreeBSD and Apple) builds fail in the cmake stage:
36- # Finding `protobuf` via pkg-config takes a very long time and times
37- # out on CI after 4 hours. This might be a bug in pkg-config, its
38- # executable is running for a very long time.
39- filter! (! Sys. isbsd, platforms)
40-
4149# Windows build fail because `CLOCK_REALTIME` is not declared.
4250# See `N/Notcurses/bundled/headers/pthread_time.h` for a possible fix.
4351filter! (! Sys. iswindows, platforms)
0 commit comments