diff --git a/G/GibbsSeaWater/build_tarballs.jl b/G/GibbsSeaWater/build_tarballs.jl index 482d3591488..160d903d8d9 100644 --- a/G/GibbsSeaWater/build_tarballs.jl +++ b/G/GibbsSeaWater/build_tarballs.jl @@ -1,21 +1,28 @@ # Note that this script can accept some limited command-line arguments, run # `julia build_tarballs.jl --help` to see a usage message. -using BinaryBuilder +using BinaryBuilder, Pkg name = "GibbsSeaWater" -version = v"3.5.0" +version = v"3.5.1" # Collection of sources required to build GibbsSeaWater # note 3.05.0-4 is too old to be cross-compiled on FreeBSD sources = [ - "https://github.com/TEOS-10/GSW-C/archive/d392e91cb63341f543ed1609c4eff613055ab3cb.zip" => - "454c46ec00468aeba048fa4f3cee095f927925ab699b1d1b3a25a838cef2d22c", + ArchiveSource( + "https://github.com/TEOS-10/GSW-C/archive/d392e91cb63341f543ed1609c4eff613055ab3cb.zip", "454c46ec00468aeba048fa4f3cee095f927925ab699b1d1b3a25a838cef2d22c"), ] + + # Bash recipe for building across all platforms script = raw""" +if [[ "${target}" == aarch64-apple-* ]]; then + # Linking libomp requires the function `__divdc3`, which is implemented in + # `libclang_rt.osx.a` from LLVM compiler-rt. + LDFLAGS="-L${libdir}/darwin -lclang_rt.osx" +fi cd $WORKSPACE/srcdir/GSW-C-* -cc $CFLAGS -fPIC -c -O3 -Wall gsw_oceanographic_toolbox.c gsw_saar.c +cc -fPIC -c -O3 -Wall gsw_oceanographic_toolbox.c gsw_saar.c cc $LDFLAGS -fPIC -shared -o libgswteos.$dlext gsw_oceanographic_toolbox.o gsw_saar.o -lm mkdir -p ${libdir} cp libgswteos.$dlext ${libdir} @@ -30,9 +37,13 @@ products = [ LibraryProduct("libgswteos", :libgswteos) ] +llvm_version = v"13.0.1" # Dependencies that must be installed before this package can be built dependencies = [ + # We need libclang_rt.osx.a, because this library provides the + # implementation of `__divdc3`. + BuildDependency(PackageSpec(name="LLVMCompilerRT_jll", uuid="4e17d02c-6bf5-513e-be62-445f41c75a11", version=llvm_version); platforms=[Platform("aarch64", "macos")]), ] # Build the tarballs, and possibly a `build.jl` as well. -build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies) +build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies; julia_compat="1.6", preferred_llvm_version=llvm_version)