Skip to content
This repository has been archived by the owner on Jul 1, 2022. It is now read-only.

Commit

Permalink
update for upstream FLINT_jll
Browse files Browse the repository at this point in the history
  • Loading branch information
benlorenz committed Apr 4, 2020
1 parent e00cbde commit 1bf4ac5
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 43 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ version = "0.1.2"

[deps]
BinaryProvider = "b99e7846-7c00-51b0-8f62-c81ae34c0232"
FLINT_jll = "e134572f-a0d5-539d-bddf-3cad8db41a82"
GMP_jll = "781609d7-10c4-51f6-84f2-b8444358ff6d"
Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
flint_jll = "cabf4574-4f87-5802-9a0b-e4b5b01a80fc"

[compat]
BinaryProvider = "0.4, 0.5"
Expand Down
2 changes: 1 addition & 1 deletion deps/build.jl
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ elseif VERSION < v"1.3.0-rc4"

dependencies = [
# This has to be in sync with the jll packages (using generate_build.jl and build_tarballs.jl from Yggdrasil)
"build_flint.v0.0.0-dd1021a6.jl",
"build_FLINT.v0.0.1.jl",
]
# GMP and MPFR are not needed as julia should have those loaded already

Expand Down
48 changes: 48 additions & 0 deletions deps/build_FLINT.v0.0.1.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
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, ["libflint"], :libflint),
]

# Download binaries from hosted location
bin_prefix = "https://github.com/JuliaBinaryWrappers/FLINT_jll.jl/releases/download/FLINT-v0.0.1+0"

# Listing of files generated by BinaryBuilder:
download_info = Dict(
Linux(:aarch64, libc=:glibc) => ("$bin_prefix/FLINT.v0.0.1.aarch64-linux-gnu.tar.gz", "ec9887a7f7fa75cd40cbf9816d4aa85c14682be8c122f2767dd33d6e3485c57d"),
Linux(:aarch64, libc=:musl) => ("$bin_prefix/FLINT.v0.0.1.aarch64-linux-musl.tar.gz", "2095b17382f4f6e93cc9c6682ce1bca2b5446e40ef3befcc8a39b58fbe021cf7"),
Linux(:armv7l, libc=:glibc, call_abi=:eabihf) => ("$bin_prefix/FLINT.v0.0.1.armv7l-linux-gnueabihf.tar.gz", "8a90c173a644001f781d4045e02cc3683c28ea7503c380d4500636827afe4b6b"),
Linux(:armv7l, libc=:musl, call_abi=:eabihf) => ("$bin_prefix/FLINT.v0.0.1.armv7l-linux-musleabihf.tar.gz", "75a5b34ba2362f4b480218090cc0d1c955bf339ee036cf7e318b1c0e463b4f3b"),
Linux(:i686, libc=:glibc) => ("$bin_prefix/FLINT.v0.0.1.i686-linux-gnu.tar.gz", "efda0718eac26e25a6a91f7407836779d1ce7de3518e5f8ca4e940eecc1f7cba"),
Linux(:i686, libc=:musl) => ("$bin_prefix/FLINT.v0.0.1.i686-linux-musl.tar.gz", "9504a94062e5836c47c5cb731e8c967b917230e50f99e8b82bbfd9ca87b7d878"),
Windows(:i686) => ("$bin_prefix/FLINT.v0.0.1.i686-w64-mingw32.tar.gz", "c0a5fc39425467da297ccab4c10c7f4065cf06f2b846b033ebbc455dfa2efdc0"),
Linux(:powerpc64le, libc=:glibc) => ("$bin_prefix/FLINT.v0.0.1.powerpc64le-linux-gnu.tar.gz", "3c8aaa11fbd591b21fe2defb4b0429fb025e375990c71dbd09cf1f496353dfd8"),
MacOS(:x86_64) => ("$bin_prefix/FLINT.v0.0.1.x86_64-apple-darwin14.tar.gz", "24ac5e8e9891426c221bca1009fb99b8799a4c1c0a037d8b54fdbb09000e0813"),
Linux(:x86_64, libc=:glibc) => ("$bin_prefix/FLINT.v0.0.1.x86_64-linux-gnu.tar.gz", "68319251b42c7fc306ca92a6c9c9c5883bdbf41833c388c214f3f3672cb03ad0"),
Linux(:x86_64, libc=:musl) => ("$bin_prefix/FLINT.v0.0.1.x86_64-linux-musl.tar.gz", "9ca6dd40dbff5d7b43ddad0206e27c6e4c5570cd87d1248911c63d9a0ce17e60"),
FreeBSD(:x86_64) => ("$bin_prefix/FLINT.v0.0.1.x86_64-unknown-freebsd11.1.tar.gz", "b7c82997dbb802eb5fc5b0aaad6ca5ce61306af821141c3b47a4f65da1818ff0"),
Windows(:x86_64) => ("$bin_prefix/FLINT.v0.0.1.x86_64-w64-mingw32.tar.gz", "02c0a3bc08e00d3ad59a00173407b62fe91c1269e5903f8b7365f856ec233f82"),
)

# 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)
38 changes: 0 additions & 38 deletions deps/build_flint.v0.0.0-dd1021a6.jl

This file was deleted.

4 changes: 2 additions & 2 deletions deps/generate_buildjl.jl
Original file line number Diff line number Diff line change
Expand Up @@ -222,5 +222,5 @@ open(buildjl_path, "w") do io
print_buildjl(io, products, product_hashes, bin_path)
end

# julia --color=yes generate_buildjl.jl somewhere/Flint2Builder/build_tarballs.jl benlorenz/flint_jll.jl flint-v0.0.0-dd1021a6+0
# build_flint...jl needs some extra fixes afterwards to work
# julia --color=yes generate_buildjl.jl Yggdrasil/F/FLINT/build_tarballs.jl
# one needs to add prefix as first argument to LibraryProduct afterwards
3 changes: 2 additions & 1 deletion src/LoadFlint.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ using Libdl

if VERSION > v"1.3.0-rc4"
# this should do the dlopen vor 1.3 and later
using flint_jll
using FLINT_jll
else
deps_dir = joinpath(@__DIR__, "..", "deps")
include(joinpath(deps_dir,"deps.jl"))
Expand All @@ -24,6 +24,7 @@ function __init__()
error("there should be exactly one libflint, but we have: ", f)
end

# the -10 / . at the end is important to avoid matching libgmpxx
tmp = Sys.iswindows() ? "libgmp-10" : "libgmp."
f = filter(x->occursin(tmp, x), l)
if length(f) != 1
Expand Down

0 comments on commit 1bf4ac5

Please sign in to comment.