Skip to content

Commit

Permalink
Update libxml2 binaries (fixes #64 and #65)
Browse files Browse the repository at this point in the history
  • Loading branch information
bicycle1885 committed Jun 30, 2018
1 parent 5067804 commit 4fd687b
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 23 deletions.
2 changes: 1 addition & 1 deletion REQUIRE
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
julia 0.6
BinaryProvider 0.2
BinaryProvider 0.3
Compat 0.62
62 changes: 40 additions & 22 deletions deps/build.jl
Original file line number Diff line number Diff line change
@@ -1,28 +1,46 @@
using BinaryProvider
using BinaryProvider # requires BinaryProvider 0.3.0 or later

# Configure the binary dependency.
prefix = Prefix(!isempty(ARGS) ? ARGS[1] : joinpath(@__DIR__, "usr"))
libxml2 = LibraryProduct(prefix, "libxml2", :libxml2)
products = [libxml2]
bin_prefix = "https://github.com/bicycle1885/XML2Builder/releases/download/v1.0.0"
# 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, String["libxml2"], :libxml2),
]

# Download binaries from hosted location
bin_prefix = "https://github.com/bicycle1885/XML2Builder/releases/download/v1.0.1"

# Listing of files generated by BinaryBuilder:
download_info = Dict(
BinaryProvider.Linux(:aarch64, :glibc) => ("$bin_prefix/XML2Builder.aarch64-linux-gnu.tar.gz", "cc64013edbf308f1d26e02b05b29c2072545276122884024a2e79871c4f23be6"),
BinaryProvider.Linux(:armv7l, :glibc) => ("$bin_prefix/XML2Builder.arm-linux-gnueabihf.tar.gz", "08c1b599aeda68e1783479b147e68a79224167ba4f693f431d02f734523b11a5"),
BinaryProvider.Linux(:i686, :glibc) => ("$bin_prefix/XML2Builder.i686-linux-gnu.tar.gz", "f6a076cfa78cc04f782428e23f1492b8c583fcf3d177a1b7eea206721666cecb"),
BinaryProvider.Linux(:powerpc64le, :glibc) => ("$bin_prefix/XML2Builder.powerpc64le-linux-gnu.tar.gz", "2c04d6dd67107b933ed5fb2b2afd50892b6f3a94bdf2412604a49654f033947b"),
BinaryProvider.Linux(:x86_64, :glibc) => ("$bin_prefix/XML2Builder.x86_64-linux-gnu.tar.gz", "d3125723e5c75ded1eb01e5ce06c7dfae149ee276aa2d3f82a64edb2e8df23b8"),
BinaryProvider.MacOS() => ("$bin_prefix/XML2Builder.x86_64-apple-darwin14.tar.gz", "c29fc38446b74830ce26d135974cc5043b636e0fe350bfa0e26e166edcebd7b7"),
BinaryProvider.Windows(:i686) => ("$bin_prefix/XML2Builder.i686-w64-mingw32.tar.gz", "d09490cc615b541c236485b170007911587501ee8c3a3e3edc8d054e5412553c"),
BinaryProvider.Windows(:x86_64) => ("$bin_prefix/XML2Builder.x86_64-w64-mingw32.tar.gz", "37f5b9d4df9e919a196dacbc2ede80b75a3aae7058890701958925336d145fb6"),
Linux(:aarch64, :glibc) => ("$bin_prefix/XML2Builder.v2.9.7.aarch64-linux-gnu.tar.gz", "66ecfa4f24b83c7f34956b402edb9567e79770fb6da3638c9bd477cb01f7f4c3"),
Linux(:aarch64, :musl) => ("$bin_prefix/XML2Builder.v2.9.7.aarch64-linux-musl.tar.gz", "e52ed67eeff893a91a402433c01bc9830bc7b1780d4524236c4d0b3992118988"),
Linux(:armv7l, :glibc, :eabihf) => ("$bin_prefix/XML2Builder.v2.9.7.arm-linux-gnueabihf.tar.gz", "d71fdbde8b706fdcef8b1a3ef407189b0f586f85bc916641d9b91da016c7fe7e"),
Linux(:armv7l, :musl, :eabihf) => ("$bin_prefix/XML2Builder.v2.9.7.arm-linux-musleabihf.tar.gz", "5a065dcefd9451f709322b86e917f88044c8201e989ad90634684a7f286bb425"),
Linux(:i686, :glibc) => ("$bin_prefix/XML2Builder.v2.9.7.i686-linux-gnu.tar.gz", "f5a94aeca9db3742dacd044b26699588165eb1c77583d6010e1541c963cf87be"),
Linux(:i686, :musl) => ("$bin_prefix/XML2Builder.v2.9.7.i686-linux-musl.tar.gz", "7457ec35e19e6cf4a9d2915ffa93cf3408bebc25c5003b414c6ce00c807cd25b"),
Windows(:i686) => ("$bin_prefix/XML2Builder.v2.9.7.i686-w64-mingw32.tar.gz", "ace37958dafe0c1b7ab9c93bb63752d49168ddc01fab630ed0ba235b57614218"),
Linux(:powerpc64le, :glibc) => ("$bin_prefix/XML2Builder.v2.9.7.powerpc64le-linux-gnu.tar.gz", "2c1c339882866581a7808cc34fd5c03518440834dd731dca9bff660b6621e786"),
MacOS(:x86_64) => ("$bin_prefix/XML2Builder.v2.9.7.x86_64-apple-darwin14.tar.gz", "af563dc33436d0e2f4b86203b707e4adcae889d8669f65a630b73a1d86b1f8d3"),
Linux(:x86_64, :glibc) => ("$bin_prefix/XML2Builder.v2.9.7.x86_64-linux-gnu.tar.gz", "fd9c988c9732238a45b1d262ea7d363454df915565de9d740e269016e6e81156"),
Linux(:x86_64, :musl) => ("$bin_prefix/XML2Builder.v2.9.7.x86_64-linux-musl.tar.gz", "74948f532c3bd14c4be7a185decdbef0aa108c7b56677624169410240c977755"),
FreeBSD(:x86_64) => ("$bin_prefix/XML2Builder.v2.9.7.x86_64-unknown-freebsd11.1.tar.gz", "f92a70169c812f9be4b7e765484acd996760058671aa1996b7fc9c4efc23a32e"),
Windows(:x86_64) => ("$bin_prefix/XML2Builder.v2.9.7.x86_64-w64-mingw32.tar.gz", "a396a6a84e9282f753bd1a57be1c1e3132445b4d6b827ee28db949ab92ef4f1c"),
)

# Download and install it.
if platform_key() in keys(download_info)
if any(!satisfied(p; verbose=true) for p in products)
url, tarball_hash = download_info[platform_key()]
install(url, tarball_hash; prefix=prefix, force=true, verbose=true)
# Install unsatisfied or updated dependencies:
unsatisfied = any(!satisfied(p; verbose=verbose) for p in products)
if haskey(download_info, platform_key())
url, tarball_hash = download_info[platform_key()]
if unsatisfied || !isinstalled(url, tarball_hash; prefix=prefix)
# Download and install binaries
install(url, tarball_hash; prefix=prefix, force=true, verbose=verbose)
end
write_deps_file(joinpath(@__DIR__, "deps.jl"), products)
else
error("Your platform $(Sys.MACHINE) is not supported by this package!")
elseif unsatisfied
# 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 even more ambitious here.
error("Your platform $(triplet(platform_key())) is not supported by this package!")
end

# Write out a deps.jl file that will contain mappings for our products
write_deps_file(joinpath(@__DIR__, "deps.jl"), products)

0 comments on commit 4fd687b

Please sign in to comment.