Skip to content

Commit 3bcc4b5

Browse files
authored
MGARD: Build for BSD (#12552)
* MGARD: Build for BSD * MGARD: Use newer MacOS SDK * MGARD: Use `require_macos_sdk`
1 parent ff1079a commit 3bcc4b5

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

M/MGARD/build_tarballs.jl

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
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

46
name = "MGARD"
57
version = v"1.6.0"
@@ -12,10 +14,17 @@ sources = [
1214
# Bash recipe for building across all platforms
1315
script = raw"""
1416
cd 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.
1720
rm ${bindir}/protoc${exeext}
1821
ls -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+
1928
cmake -B build \
2029
-DBUILD_TESTING=OFF \
2130
-DCMAKE_BUILD_TYPE=Release \
@@ -27,17 +36,16 @@ cmake -B build \
2736
-DMGARD_ENABLE_SERIAL=ON
2837
cmake --build build --parallel ${nproc}
2938
cmake --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
3347
platforms = 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.
4351
filter!(!Sys.iswindows, platforms)

0 commit comments

Comments
 (0)