-
Notifications
You must be signed in to change notification settings - Fork 571
/
Copy pathbuild_tarballs.jl
50 lines (38 loc) · 1.8 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
using BinaryBuilder
name = "Zstd"
upstream_version = v"1.5.6"
version = v"1.5.7" # need to change version to change compat bounds, but in the future we can go back to follow upstream
sources = [
ArchiveSource("https://github.com/facebook/zstd/releases/download/v$(upstream_version)/zstd-$(upstream_version).tar.gz",
"8c29e06cf42aacc1eafc4077ae2ec6c6fcb96a626157e0593d5e82a34fd403c1"),
]
script = raw"""
cd ${WORKSPACE}/srcdir/zstd-*
mkdir build-zstd && cd build-zstd
if [[ "${target}" == *86*-linux-gnu ]]; then
# Using `clock_gettime` on old Glibc requires linking to `librt`.
sed -ri "s/^c_link_args = \[(.*)\]/c_link_args = [\1, '-lrt']/" ${MESON_TARGET_TOOLCHAIN}
elif [[ "${target}" == i686-*-mingw* ]]; then
# Using `WakeConditionVariable`/`InitializeConditionVariable`/`SleepConditionVariableCS`
# require Windows Vista:
# <https://learn.microsoft.com/en-us/windows/win32/api/synchapi/nf-synchapi-wakeconditionvariable>.
sed -ri "s/^c_args = \[(.*)\]/c_args = [\1, '-D_WIN32_WINNT=_WIN32_WINNT_VISTA']/" ${MESON_TARGET_TOOLCHAIN}
fi
meson --cross-file="${MESON_TARGET_TOOLCHAIN}" ../build/meson
# Meson beautifully forces thin archives, without checking whether the dynamic linker
# actually supports them: <https://github.com/mesonbuild/meson/issues/10823>. Let's remove
# the (deprecated...) `T` option to `ar`, until they fix it in Meson.
sed -i.bak 's/csrDT/csrD/' build.ninja
ninja -j${nproc}
ninja install
"""
platforms = supported_platforms()
products = [
LibraryProduct("libzstd", :libzstd),
ExecutableProduct("zstd", :zstd),
ExecutableProduct("zstdmt", :zstdmt),
]
dependencies = Dependency[]
build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies;
clang_use_lld=false, julia_compat="1.6")
# Build Trigger: 2