-
Notifications
You must be signed in to change notification settings - Fork 558
/
build_tarballs.jl
102 lines (90 loc) · 4.62 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# Note that this script can accept some limited command-line arguments, run
# `julia build_tarballs.jl --help` to see a usage message.
using BinaryBuilder, Pkg
name = "boost"
version = v"1.79.0"
# Collection of sources required to build boost
sources = [
ArchiveSource(
"https://boostorg.jfrog.io/artifactory/main/release/$(version)/source/boost_$(version.major)_$(version.minor)_$(version.patch).tar.bz2",
"475d589d51a7f8b3ba2ba4eda022b170e562ca3b760ee922c146b6c65856ef39"),
]
# Bash recipe for building across all platforms
script = raw"""
cd $WORKSPACE/srcdir/boost*/
./bootstrap.sh --prefix=$prefix --without-libraries=python --with-toolset="--cxx=${CXX_FOR_BUILD}"
rm project-config.jam
toolset=gcc
targetos=linux
extraargs=
# BinaryBuilderBase compiler wrappers don't like it when we use -march=ANYTHING.
# So we patch that out. However, we cannot just insert an empty string; so we instead
# add another "harmless" option; we choose `-Wall` which is already passed anyway
sed -i "s/-march=i686/-Wall/g" tools/build/src/tools/gcc.*
if [[ $target == *apple* ]]; then
targetos=darwin
toolset=darwin-6.0
extraargs="binary-format=mach-o link=shared"
echo "using darwin : 6.0 : $CXX : <cxxflags>-stdlib=libc++ <linkflags>-stdlib=libc++ ;" > project-config.jam
if [[ "${target}" == aarch64-* ]]; then
# Fix error
# Undefined symbols for architecture arm64:
# "_jump_fcontext", referenced from:
# See https://github.com/boostorg/context/issues/170#issuecomment-863669877
extraargs="abi=aapcs ${extraargs}"
fi
elif [[ $target == x86_64*mingw* ]]; then
targetos=windows
extraargs="address-model=64 binary-format=pe abi=ms link=shared"
elif [[ $target == i686*mingw* ]]; then
targetos=windows
extraargs="address-model=32 binary-format=pe abi=ms link=shared"
elif [[ $target == *freebsd* ]]; then
targetos=freebsd
toolset=clang-6.0
extraargs="address-model=64 link=shared"
echo "using clang : 6.0 : $CXX : <linkflags>\\"$LDFLAGS\\" ;" > project-config.jam
fi
./b2 -j${nproc} toolset=$toolset target-os=$targetos $extraargs variant=release --prefix=$prefix --without-python --layout=system --debug-configuration install
install_license LICENSE_1_0.txt
"""
# These are the platforms we will build for by default, unless further
# platforms are passed in on the command line
platforms = expand_cxxstring_abis(supported_platforms(; experimental=true))
# The products that we will ensure are always built
products = [
LibraryProduct("libboost_atomic", :libboost_atomic),
LibraryProduct("libboost_chrono", :libboost_chrono),
LibraryProduct("libboost_container", :libboost_container),
LibraryProduct("libboost_context", :libboost_context),
LibraryProduct("libboost_contract", :libboost_contract),
LibraryProduct("libboost_coroutine", :libboost_coroutine),
LibraryProduct("libboost_date_time", :libboost_date_time),
LibraryProduct("libboost_filesystem", :libboost_filesystem),
LibraryProduct("libboost_graph", :libboost_graph),
LibraryProduct("libboost_iostreams", :libboost_iostreams),
# boost_locale segfaults on windows, see https://github.com/benlorenz/boostBuilder/issues/2
#LibraryProduct("libboost_locale", :libboost_locale),
LibraryProduct("libboost_log", :libboost_log),
LibraryProduct("libboost_log_setup", :libboost_log_setup),
LibraryProduct("libboost_prg_exec_monitor", :libboost_prg_exec_monitor),
LibraryProduct("libboost_program_options", :libboost_program_options),
LibraryProduct("libboost_random", :libboost_random),
LibraryProduct("libboost_regex", :libboost_regex),
LibraryProduct("libboost_serialization", :libboost_serialization),
LibraryProduct("libboost_stacktrace_basic", :libboost_stacktrace_basic),
LibraryProduct("libboost_stacktrace_noop", :libboost_stacktrace_noop),
LibraryProduct("libboost_system", :libboost_system),
LibraryProduct("libboost_thread", :libboost_thread),
LibraryProduct("libboost_timer", :libboost_timer),
LibraryProduct("libboost_type_erasure", :libboost_type_erasure),
LibraryProduct("libboost_unit_test_framework", :libboost_unit_test_framework),
LibraryProduct("libboost_wave", :libboost_wave),
LibraryProduct("libboost_wserialization", :libboost_wserialization),
]
# Dependencies that must be installed before this package can be built
dependencies = [
Dependency(PackageSpec(name="Zlib_jll", uuid="83775a58-1f1d-513f-b197-d71354ab007a")),
]
# 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", julia_compat="1.6")