forked from staticfloat/ZlibBuilder
-
Notifications
You must be signed in to change notification settings - Fork 4
/
build_tarballs.jl
43 lines (33 loc) · 1.21 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
using BinaryBuilder
# zlib version
version = v"1.2.11"
# Collection of sources required to build zlib
sources = [
"https://zlib.net/zlib-$(version).tar.gz" =>
"c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1",
]
# Bash recipe for building across all platforms
script = raw"""
cd $WORKSPACE/srcdir/zlib-*
# On windows platforms, our ./configure and make invocations differ a bit
if [[ ${target} == *-w64-mingw* ]]; then
EXTRA_CONFIGURE_FLAGS="--sharedlibdir=${prefix}/bin"
EXTRA_MAKE_FLAGS="SHAREDLIB=libz.dll SHAREDLIBM=libz-1.dll SHAREDLIBV=libz-1.2.11.dll LDSHAREDLIBC= "
fi
if [[ ${target} == *-freebsd* ]]; then
cmake -DCMAKE_INSTALL_PREFIX=${prefix} -DCMAKE_TOOLCHAIN_FILE=/opt/${target}/${target}.toolchain
else
./configure ${EXTRA_CONFIGURE_FLAGS} --prefix=${prefix}
fi
make install ${EXTRA_MAKE_FLAGS} -j${nproc}
"""
# Build for ALL THE PLATFORMS!
platforms = supported_platforms()
# The products that we will ensure are always built
products = prefix -> [
LibraryProduct(prefix, "libz", :libz),
]
# Dependencies that must be installed before this package can be built
dependencies = [
]
build_tarballs(ARGS, "Zlib", version, sources, script, platforms, products, dependencies)