-
Notifications
You must be signed in to change notification settings - Fork 39
/
Copy pathbuild_OpenSSL.v1.1.1.jl
50 lines (44 loc) · 3.69 KB
/
build_OpenSSL.v1.1.1.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 BinaryProvider # requires BinaryProvider 0.3.0 or later
# Parse some basic command-line arguments
const verbose = "--verbose" in ARGS
const prefix = Prefix(get([a for a in ARGS if a != "--verbose"], 1, joinpath(@__DIR__, "usr")))
products = [
LibraryProduct(prefix, ["libcrypto", "libcrypto-1_1", "libcrypto-1_1-x64"], :libcrypto),
LibraryProduct(prefix, ["libssl", "libssl-1_1", "libssl-1_1-x64"], :libssl),
ExecutableProduct(prefix, "openssl", :openssl),
]
# Download binaries from hosted location
bin_prefix = "https://github.com/JuliaBinaryWrappers/OpenSSL_jll.jl/releases/download/OpenSSL-v1.1.1+1"
# Listing of files generated by BinaryBuilder:
download_info = Dict(
Linux(:aarch64, libc=:glibc) => ("$bin_prefix/OpenSSL.v1.1.1.aarch64-linux-gnu.tar.gz", "3f23289e31c55d39c3416f71857471c2013b864c1975cc91b91d1410757d4628"),
Linux(:aarch64, libc=:musl) => ("$bin_prefix/OpenSSL.v1.1.1.aarch64-linux-musl.tar.gz", "8086c7218c7a10e533033aa40732f29a6baa2c48d25d6fc1588731c055de725b"),
Linux(:armv7l, libc=:glibc, call_abi=:eabihf) => ("$bin_prefix/OpenSSL.v1.1.1.arm-linux-gnueabihf.tar.gz", "8fd3cc4f224977c4865aa1257fd24793d7e8968e74b01fcbfea8c64763bba1f7"),
Linux(:armv7l, libc=:musl, call_abi=:eabihf) => ("$bin_prefix/OpenSSL.v1.1.1.arm-linux-musleabihf.tar.gz", "bdcedc556ca69fe1083f3fb77a698500eb3375c40fc49ec89f17572cb51d3f6d"),
Linux(:i686, libc=:glibc) => ("$bin_prefix/OpenSSL.v1.1.1.i686-linux-gnu.tar.gz", "89ad5443976496d97a8da843fa98899e472e0d3869da46689fdefc631b65ef4b"),
Linux(:i686, libc=:musl) => ("$bin_prefix/OpenSSL.v1.1.1.i686-linux-musl.tar.gz", "f2b6fce059998d3e4e3973bdc787c6ad2eb009c394318656c520e81f41bb5de5"),
Windows(:i686) => ("$bin_prefix/OpenSSL.v1.1.1.i686-w64-mingw32.tar.gz", "2317b2bb7f0d054664b76a2064587ff2c6f8a97bf9c821564553c3099e3611fe"),
Linux(:powerpc64le, libc=:glibc) => ("$bin_prefix/OpenSSL.v1.1.1.powerpc64le-linux-gnu.tar.gz", "09615dabe990ceaf830bd278ec9eaef25b22a841b91df011ecf34309df04f52f"),
MacOS(:x86_64) => ("$bin_prefix/OpenSSL.v1.1.1.x86_64-apple-darwin14.tar.gz", "6ff1942636fcfc62bbfe30ea230a87705a90d955d15d3b9cb2dc341185203130"),
Linux(:x86_64, libc=:glibc) => ("$bin_prefix/OpenSSL.v1.1.1.x86_64-linux-gnu.tar.gz", "e33131286c0d398bd45c02d2c2c6d7af4e281dac70950834f046ba70c71f1440"),
Linux(:x86_64, libc=:musl) => ("$bin_prefix/OpenSSL.v1.1.1.x86_64-linux-musl.tar.gz", "9da3b5ee287cfcd01bb98712cd5d0424a04d5e0557e50ca7dafda3e8a776be11"),
FreeBSD(:x86_64) => ("$bin_prefix/OpenSSL.v1.1.1.x86_64-unknown-freebsd11.1.tar.gz", "4eb203c409f96fd1f71f6db7ff56f86c721bfdfbba87e790ae65e5a9536192a8"),
Windows(:x86_64) => ("$bin_prefix/OpenSSL.v1.1.1.x86_64-w64-mingw32.tar.gz", "9960a873ae56f8aeffc2d0619ba37e734389969f57740a07ad9a78bb55d084ef"),
)
# Install unsatisfied or updated dependencies:
unsatisfied = any(!satisfied(p; verbose=verbose) for p in products)
dl_info = choose_download(download_info, platform_key_abi())
if dl_info === nothing && unsatisfied
# If we don't have a compatible .tar.gz to download, complain.
# Alternatively, you could attempt to install from a separate provider,
# build from source or something even more ambitious here.
error("Your platform (\"$(Sys.MACHINE)\", parsed as \"$(triplet(platform_key_abi()))\") is not supported by this package!")
end
# If we have a download, and we are unsatisfied (or the version we're
# trying to install is not itself installed) then load it up!
if unsatisfied || !isinstalled(dl_info...; prefix=prefix)
# Download and install binaries
install(dl_info...; prefix=prefix, force=true, verbose=verbose)
end
# Write out a deps.jl file that will contain mappings for our products
write_deps_file(joinpath(@__DIR__, "deps.jl"), products, verbose=verbose)