/
build_tarballs.jl
67 lines (54 loc) · 2.01 KB
/
build_tarballs.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# Note that this script can accept some limited command-line arguments, run
# `julia build_tarballs.jl --help` to see a usage message.
using BinaryBuilder
import Pkg: PackageSpec
const name = "libcgal_julia"
const version = v"0.10.1"
# Collection of sources required to build CGAL
const sources = [
GitSource("https://github.com/rgcv/libcgal-julia.git",
"631c98fcfb0305d1bb20e4c23bd539bbb85c4145"),
]
# Dependencies that must be installed before this package can be built
const dependencies = [
BuildDependency(PackageSpec(name="Julia_jll", version="v1.4.1")),
Dependency("CGAL_jll"),
Dependency(PackageSpec(name="libcxxwrap_julia_jll", version=v"0.7.1")),
]
# Bash recipe for building across all platforms
const script = raw"""
## pre-build setup
# exit on error
set -eu
## configure build
cmake libcgal-julia*/ -B build \
`# cmake specific` \
-DCMAKE_TOOLCHAIN_FILE="$CMAKE_TARGET_TOOLCHAIN" \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_FIND_ROOT_PATH="$prefix" \
-DCMAKE_INSTALL_PREFIX="$prefix" \
`# tell jlcxx where julia is` \
-DJulia_PREFIX="$prefix"
## and away we go..
VERBOSE=ON cmake --build build --config Release --target install -- -j$nproc
install_license libcgal-julia*/LICENSE
# HACK: Apparently, this isn't a simple build system anymore..
case $target in
*mingw32*) mv "$prefix/lib/"*.dll "$prefix/bin" ;;
esac
"""
# These are the platforms we will build for by default, unless further
# platforms are passed in on the command line
const platforms = [
Linux(:x86_64, libc=:glibc),
MacOS(:x86_64),
Windows(:x86_64),
] |> expand_cxxstring_abis
filter!(p->cxxstring_abi(p) === :cxx11, platforms)
# The products that we will ensure are always built
const products = [
LibraryProduct("libcgal_julia_exact", :libcgal_julia_exact),
LibraryProduct("libcgal_julia_inexact", :libcgal_julia_inexact),
]
# Build the tarballs, and possibly a `build.jl` as well.
build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies; preferred_gcc_version=v"7")