Skip to content

Commit

Permalink
Upgrade to latest release (v2.2)
Browse files Browse the repository at this point in the history
Fixes #47
  • Loading branch information
simonbyrne committed Mar 6, 2019
1 parent dbcedf6 commit b29b144
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 22 deletions.
55 changes: 33 additions & 22 deletions deps/build.jl
Original file line number Diff line number Diff line change
@@ -1,37 +1,48 @@
using BinaryProvider
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 = Product[
LibraryProduct(prefix, String["libbid"], :libbid),
products = [
LibraryProduct(prefix, ["libbid"], :libbid),
]

# Download binaries from hosted location
bin_prefix = "https://github.com/quinnj/DecFPBuilder/releases/download/v0.4"
bin_prefix = "https://github.com/quinnj/DecFPBuilder/releases/download/v0.8"

# Listing of files generated by BinaryBuilder:
download_info = Dict(
BinaryProvider.Linux(:i686, :glibc) => ("$bin_prefix/DecFP.i686-linux-gnu.tar.gz", "7a6f2460ffdf4f07a5b03246400a65f57f7d378490252af6b67f25da2df5b53d"),
BinaryProvider.Windows(:i686) => ("$bin_prefix/DecFP.i686-w64-mingw32.tar.gz", "f7dbf57fce1450d1eaf891580491a1a982b8c3491b9e2aba7992d62da89d202d"),
BinaryProvider.MacOS() => ("$bin_prefix/DecFP.x86_64-apple-darwin14.tar.gz", "b4fe9a370eb4b9bbe486c9a93a0aae0c1f1cca51e74d9b39bd7cdb0d9553e221"),
BinaryProvider.Linux(:x86_64, :glibc) => ("$bin_prefix/DecFP.x86_64-linux-gnu.tar.gz", "ac336480e4c0200ff0d320e68f30feb40b2894105b5eaf49ae7b4ddf73078a67"),
BinaryProvider.Windows(:x86_64) => ("$bin_prefix/DecFP.x86_64-w64-mingw32.tar.gz", "25eceff1f2b4d39042704f9a44a0295032d481d4240ec22e8000fc38ccf19be7"),
Linux(:aarch64, libc=:glibc) => ("$bin_prefix/DecFP.v2.2.0.aarch64-linux-gnu.tar.gz", "5a1c1bca574fab3e69cd920b70aec962a3d10e977f6bc243ecc3036a8b6e4c46"),
Linux(:aarch64, libc=:musl) => ("$bin_prefix/DecFP.v2.2.0.aarch64-linux-musl.tar.gz", "920b52ae9c26e97cbfc33b89f5374d6a33a80581c9a2209c23b43cdac0b8d19b"),
Linux(:armv7l, libc=:glibc, call_abi=:eabihf) => ("$bin_prefix/DecFP.v2.2.0.arm-linux-gnueabihf.tar.gz", "1184ec6f3c7286cbce3cdccca21683d282ffe144c72cdd946b1a75748545e182"),
Linux(:armv7l, libc=:musl, call_abi=:eabihf) => ("$bin_prefix/DecFP.v2.2.0.arm-linux-musleabihf.tar.gz", "702160b032ecf23f4be8743e9bae23b1f160c9365dc10eec28ca68a3ec96d1b9"),
Linux(:i686, libc=:glibc) => ("$bin_prefix/DecFP.v2.2.0.i686-linux-gnu.tar.gz", "a54fe00681818029a9250de168ce4c503a978f879557835772b10ecfc1e65c4a"),
Linux(:i686, libc=:musl) => ("$bin_prefix/DecFP.v2.2.0.i686-linux-musl.tar.gz", "3ec176d322348611e7654b47ee83d9022bdcec75e0c4a3a185fa77c56a87a49f"),
Windows(:i686) => ("$bin_prefix/DecFP.v2.2.0.i686-w64-mingw32.tar.gz", "bdb9e0b4af6eaab0834480f9d491b08322a6d48ba9d6516dfe240a1c02c0ee50"),
Linux(:powerpc64le, libc=:glibc) => ("$bin_prefix/DecFP.v2.2.0.powerpc64le-linux-gnu.tar.gz", "e65fbf632657f4c53036c0b986891fc9ae2250c570e4dc716f1b390297b61b99"),
MacOS(:x86_64) => ("$bin_prefix/DecFP.v2.2.0.x86_64-apple-darwin14.tar.gz", "1cbbe0e3da894b23735461ff487f9e34306c1e8b7ea5f9d0a6069dfdd767d5f3"),
Linux(:x86_64, libc=:glibc) => ("$bin_prefix/DecFP.v2.2.0.x86_64-linux-gnu.tar.gz", "7b5d506fbde03efc45813e9800b6da4e343c559edad9d37ba435c24a876eb604"),
Linux(:x86_64, libc=:musl) => ("$bin_prefix/DecFP.v2.2.0.x86_64-linux-musl.tar.gz", "b90bf19d8de6dcd10c3cd647a2ad1664ab278e535bf3e7c933c3c9ea93ade327"),
FreeBSD(:x86_64) => ("$bin_prefix/DecFP.v2.2.0.x86_64-unknown-freebsd11.1.tar.gz", "92a2b1dacda7e5e483535857055f861323637313905386f3e2e83c7c2f52b612"),
Windows(:x86_64) => ("$bin_prefix/DecFP.v2.2.0.x86_64-w64-mingw32.tar.gz", "78b6a1be664d0ede9d3c82c08e3e49a7f736f9e34a456ad0d0a4d8c616c2dffa"),
)

# First, check to see if we're all satisfied
if any(!satisfied(p; verbose=verbose) for p in products)
if haskey(download_info, platform_key())
# Download and install binaries
url, tarball_hash = download_info[platform_key()]
install(url, tarball_hash; prefix=prefix, force=true, verbose=verbose)
else
# If we don't have a BinaryProvider-compatible .tar.gz to download, complain.
# Alternatively, you could attempt to install from a separate provider,
# build from source or something more even more ambitious here.
error("Your platform $(Sys.MACHINE) is not supported by this package!")
end
# 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)
write_deps_file(joinpath(@__DIR__, "deps.jl"), products, verbose=verbose)
2 changes: 2 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -212,3 +212,5 @@ end

@test Float64(d64"1e100") == 1e100

# issue #47
@test exp10(Dec128(0)) == 1

0 comments on commit b29b144

Please sign in to comment.