-
Notifications
You must be signed in to change notification settings - Fork 549
/
build_tarballs.jl
68 lines (55 loc) · 2.34 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
# 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 = "libssh"
version = v"0.10.6"
# Collection of sources required to complete build
sources = [
ArchiveSource("https://www.libssh.org/files/$(version.major).$(version.minor)/libssh-$(version).tar.xz", "1861d498f5b6f1741b6abc73e608478491edcf9c9d4b6630eef6e74596de9dc1")
]
# Bash recipe for building across all platforms
script = raw"""
# Necessary for cmake to find openssl on Windows
if [[ ${target} == x86_64-*-mingw* ]]; then
export OPENSSL_ROOT_DIR=${prefix}/lib64
fi
DOC_DIR=${prefix}/usr/share/doc/libssh
# Build and install library
cd $WORKSPACE/srcdir/libssh-*
mkdir build
cd build/
# Kerberos_krb5_jll is only built for Linux and FreeBSD, so GSSAPI support is
# only available on those platforms.
if [[ ${target} == *linux* || ${target} == *freebsd* ]]; then
export GSSAPI_ENABLED=ON
else
export GSSAPI_ENABLED=OFF
fi
cmake -DCMAKE_INSTALL_PREFIX=$prefix -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TARGET_TOOLCHAIN} \
-DCMAKE_BUILD_TYPE=Release \
-DWITH_GSSAPI=${GSSAPI_ENABLED} \
-DWITH_EXAMPLES=OFF \
-DDOXYGEN_GENERATE_TAGFILE='tags.xml' ..
make -j${nproc}
make docs install
# Install Doxygen tagfile
mkdir -p ${DOC_DIR}
install -Dv ../doc/tags.xml "${DOC_DIR}/tags.xml"
"""
# These are the platforms we will build for by default, unless further
# platforms are passed in on the command line
platforms = supported_platforms()
# The products that we will ensure are always built
products = [
LibraryProduct("libssh", :libssh),
FileProduct("usr/share/doc/libssh/tags.xml", :doxygen_tags)
]
# Dependencies that must be installed before this package can be built
dependencies = [
HostBuildDependency("Doxygen_jll"),
Dependency("Kerberos_krb5_jll"; compat="1.19.3"),
Dependency(PackageSpec(name="OpenSSL_jll", uuid="458c3c95-2e84-50aa-8efc-19380b2a3a95"); compat="3.0.8"),
Dependency(PackageSpec(name="Zlib_jll", uuid="83775a58-1f1d-513f-b197-d71354ab007a"); compat="1.2.12")
]
# Build the tarballs, and possibly a `build.jl` as well.
build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies; julia_compat="1.6")