Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use BinaryProvider to download binaries
- Loading branch information
1 parent
b98961c
commit a3ac87a
Showing
7 changed files
with
86 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
julia 0.6 | ||
Compat 0.59.0 | ||
BinaryProvider 0.3 | ||
BinDeps |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,51 @@ | ||
using Compat | ||
using Compat.Sys: isapple, islinux, iswindows | ||
using BinaryProvider # requires BinaryProvider 0.3.0 or later | ||
if VERSION < v"0.7.0-DEV.1760" | ||
# No need to build or download anything; openspecfun is part of Julia | ||
else | ||
const forcecompile = get(ENV, "JULIA_SPECIALFUNCTIONS_BUILD_SOURCE", "false") == "true" | ||
|
||
if VERSION >= v"0.7.0-DEV.3382" | ||
using Libdl | ||
end | ||
# Parse some basic command-line arguments | ||
const verbose = "--verbose" in ARGS | ||
const prefix = Prefix(get([a for a in ARGS if a != "--verbos"], 1, joinpath(@__DIR__, "usr"))) | ||
products = [ | ||
LibraryProduct(prefix, String["libopenspecfun"], :openspecfun), | ||
] | ||
|
||
did_setup = false | ||
# Download binaries from hosted location | ||
bin_prefix = "https://github.com/JuliaMath/OpenspecfunBuilder/releases/download/v0.5.3-1" | ||
|
||
if VERSION < v"0.7.0-DEV.1760" | ||
# No need to build or download anything; openspecfun is part of Julia | ||
elseif get(ENV, "JULIA_SPECIALFUNCTIONS_BUILD_SOURCE", "false") == "true" | ||
# Allow a fast-path for building from source | ||
info("Building openspecfun from source by request") | ||
include("scratch.jl") | ||
elseif isapple() || iswindows() | ||
# Windows and macOS can always use our binaries, and we have no binaries | ||
# for other non-Linux systems (e.g. BSDs) | ||
include("binaries.jl") | ||
elseif !islinux() | ||
include("scratch.jl") | ||
else # linux | ||
# Determine the glibc version. If the check fails, we know we're on a non-glibc | ||
# system, which means we can't use the binaries and need to build from source. | ||
# The glibc version used by the binaries is 2.6, so we need at least that. | ||
libc_ptr = ccall(:jl_dlopen, Ptr{Cvoid}, (Ptr{Cvoid}, UInt32), C_NULL, 0) | ||
glibc_ptr = Libdl.dlsym_e(libc_ptr, :gnu_get_libc_version) | ||
if glibc_ptr == C_NULL | ||
# Listing of files generated by BinaryBuilder: | ||
download_info = Dict( | ||
Linux(:aarch64, :glibc) => ("$bin_prefix/libopenspecfun.aarch64-linux-gnu.tar.gz", "513cd981b1465b92942955369a41c8b65ce6e39ea15d39dda40aa0ecce348581"), | ||
Linux(:aarch64, :musl) => ("$bin_prefix/libopenspecfun.aarch64-linux-musl.tar.gz", "11928ed68eaa3a97d2f59be36d21cff5a8e83decfbbef7b6422775735684abf8"), | ||
Linux(:armv7l, :glibc, :eabihf) => ("$bin_prefix/libopenspecfun.arm-linux-gnueabihf.tar.gz", "5bc5f2f57b4faaed1124b59dd565f67164390ea668d0a35cc58e5dbb7256b883"), | ||
Linux(:armv7l, :musl, :eabihf) => ("$bin_prefix/libopenspecfun.arm-linux-musleabihf.tar.gz", "5d396b66de7200248ecb156e7926d2460b5e06800202a3e181d778665aa8c4cc"), | ||
Linux(:i686, :glibc) => ("$bin_prefix/libopenspecfun.i686-linux-gnu.tar.gz", "e407cab2ceac07680031a710b371e72d0f8ddb95a165969f78a1726e1aa3754e"), | ||
Linux(:i686, :musl) => ("$bin_prefix/libopenspecfun.i686-linux-musl.tar.gz", "87f7419160c299f74c8cd8ef01102adde151824cda569ce5abef3b651ea6fb8e"), | ||
Windows(:i686) => ("$bin_prefix/libopenspecfun.i686-w64-mingw32.tar.gz", "308efa58c6af46eba2ef3a0a93c029dad8f203b84de2f1fee463ea61ac505935"), | ||
Linux(:powerpc64le, :glibc) => ("$bin_prefix/libopenspecfun.powerpc64le-linux-gnu.tar.gz", "6360c407784151e469735018ad01959dba0ebfbb48537bc1ed3b078be1cd2b18"), | ||
MacOS(:x86_64) => ("$bin_prefix/libopenspecfun.x86_64-apple-darwin14.tar.gz", "88712e1a5faa31c633172716f0b27a749c018dc90eb012aa7f457e88a91a8838"), | ||
Linux(:x86_64, :glibc) => ("$bin_prefix/libopenspecfun.x86_64-linux-gnu.tar.gz", "e1e8c04b164de3cd39dde3ad0a20ee87b7ca393cf41345c5f0db270fd680bed0"), | ||
Linux(:x86_64, :musl) => ("$bin_prefix/libopenspecfun.x86_64-linux-musl.tar.gz", "9b9d12e36226689ced304cdbdbf0041982a9c9a4ddd4a62fdd3b43b39f541a47"), | ||
FreeBSD(:x86_64) => ("$bin_prefix/libopenspecfun.x86_64-unknown-freebsd11.1.tar.gz", "9e1c31bf28dee3ac42d9d1f045a4abfcbd98edee3dc645858f6a70b32896022b"), | ||
Windows(:x86_64) => ("$bin_prefix/libopenspecfun.x86_64-w64-mingw32.tar.gz", "05ff98c239f34efe514922301f9d15d1081c8e26851ace91731db468b15f5b40"), | ||
) | ||
|
||
# Install unsatisfied or updated dependencies: | ||
unsatisfied = any(!satisfied(p; verbose=verbose) for p in products) | ||
if haskey(download_info, platform_key()) && !forcecompile | ||
url, tarball_hash = download_info[platform_key()] | ||
if !isinstalled(url, tarball_hash; prefix=prefix) | ||
# Download and install binaries | ||
install(url, tarball_hash; prefix=prefix, force=true, verbose=verbose) | ||
unsatisfied = any(!satisfied(p; verbose=verbose) for p in products) | ||
end | ||
end | ||
|
||
if unsatisfied || forcecompile | ||
include("scratch.jl") | ||
else | ||
glibc_vers = unsafe_string(ccall(glibc_ptr, Ptr{UInt8}, ())) | ||
if isempty(glibc_vers) || VersionNumber(glibc_vers) < v"2.6.0" | ||
include("scratch.jl") | ||
else | ||
include("binaries.jl") | ||
end | ||
# Write out a deps.jl file that will contain mappings for our products | ||
write_deps_file(joinpath(@__DIR__, "deps.jl"), products) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters