-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from JuliaGeometry/sd/binaryprovider
use binaryprovider
- Loading branch information
Showing
6 changed files
with
78 additions
and
5,323 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,38 +1,46 @@ | ||
using BinaryProvider | ||
|
||
# This is where all binaries will get installed | ||
const prefix = Prefix(!isempty(ARGS) ? ARGS[1] : joinpath(@__DIR__,"usr")) | ||
|
||
# Instantiate products here. Examples: | ||
clipper_lib = LibraryProduct(prefix, "cclipper") | ||
|
||
# Assign products to `products`: | ||
products = [clipper_lib] | ||
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, String["cclipper"], :cclipper), | ||
] | ||
|
||
# Download binaries from hosted location | ||
bin_prefix = "https://github.com/SimonDanisch/ClipperBuilder/raw/v0.1.0/products" | ||
bin_prefix = "https://github.com/SimonDanisch/ClipperBuilder/releases/download/v1.0.0" | ||
|
||
# Listing of files generated by BinaryBuilder: | ||
download_info = Dict( | ||
BinaryProvider.Linux(:aarch64, :glibc) => ("$bin_prefix/Clipper.aarch64-linux-gnu.tar.gz", "d1247e882a03ab96e6c34f2119ed1f4b513e25d30b3605feab38f61360353272"), | ||
BinaryProvider.Linux(:armv7l, :glibc) => ("$bin_prefix/Clipper.arm-linux-gnueabihf.tar.gz", "6d9912c43e02a51f727192724d08b590c8b0033bb29494e6e47a779f4be522d1"), | ||
BinaryProvider.Linux(:i686, :glibc) => ("$bin_prefix/Clipper.i686-linux-gnu.tar.gz", "0ef8480ecec02c2fb8aebd50f5cdc578d33da09f7f608ddf3430b4adc4ce60d0"), | ||
BinaryProvider.Windows(:i686) => ("$bin_prefix/Clipper.i686-w64-mingw32.tar.gz", "90df03f09ecbec00840e2f9c67a71996c37968b2ac482e6d8c58649ee4ef69a7"), | ||
BinaryProvider.Linux(:powerpc64le, :glibc) => ("$bin_prefix/Clipper.powerpc64le-linux-gnu.tar.gz", "bc064758985bc4fda32f4c1edd5c11d64db803176d5d6bddfb74aa8fd03663e2"), | ||
BinaryProvider.MacOS() => ("$bin_prefix/Clipper.x86_64-apple-darwin14.tar.gz", "ef7284520db5aa10a15fc0c0f45c6a61a3b1e1e050c736d9505e7b6fe5ed48bc"), | ||
BinaryProvider.Linux(:x86_64, :glibc) => ("$bin_prefix/Clipper.x86_64-linux-gnu.tar.gz", "46d5646b9dc6bffe677fec5482d09988a8919538cb4f00da1a38e359d3ea8e6c"), | ||
BinaryProvider.Windows(:x86_64) => ("$bin_prefix/Clipper.x86_64-w64-mingw32.tar.gz", "f74c707b2aea78424e7b4cdc28adec59770cde864d7eacde6c252a693cc7e63d"), | ||
Linux(:aarch64, :glibc) => ("$bin_prefix/Clipper.v1.0.0.aarch64-linux-gnu.tar.gz", "8257bdcb54563f2effbd1ea484be39437e245a01bd1badb93706625599019581"), | ||
Linux(:aarch64, :musl) => ("$bin_prefix/Clipper.v1.0.0.aarch64-linux-musl.tar.gz", "2967e0e6a400053f01fcaf6ea3c214342c346c627ef1d11343088d8dae8211d2"), | ||
Linux(:armv7l, :glibc, :eabihf) => ("$bin_prefix/Clipper.v1.0.0.arm-linux-gnueabihf.tar.gz", "a03c2e0455af89eeefcd4f5ca22ed72db47ee5718c7b815a347221ab2692da2a"), | ||
Linux(:armv7l, :musl, :eabihf) => ("$bin_prefix/Clipper.v1.0.0.arm-linux-musleabihf.tar.gz", "49d14834c9817e4d877bd6facd33bf242f394e82af5a6c711c063e4aa225131e"), | ||
Linux(:i686, :glibc) => ("$bin_prefix/Clipper.v1.0.0.i686-linux-gnu.tar.gz", "8bbdf10ba64b039d5172b5362f3048fec329b048c21e385a2c8feea78fc62c11"), | ||
Linux(:i686, :musl) => ("$bin_prefix/Clipper.v1.0.0.i686-linux-musl.tar.gz", "bf1e3a62bbf6cc8ea871b242d89dfa12477313a7ad990c1a930f83e18dd075f5"), | ||
Windows(:i686) => ("$bin_prefix/Clipper.v1.0.0.i686-w64-mingw32.tar.gz", "320ac5a275f33943421df9123e74344c59eeb20bc0c89de73501a83924be1453"), | ||
Linux(:powerpc64le, :glibc) => ("$bin_prefix/Clipper.v1.0.0.powerpc64le-linux-gnu.tar.gz", "ee312d90ceb0ec87092a502014d1d3e56d735186fa728c3cc77088145d6f9ce9"), | ||
MacOS(:x86_64) => ("$bin_prefix/Clipper.v1.0.0.x86_64-apple-darwin14.tar.gz", "0ddc80a5a9d8be456facc92fadddde6755d1aa9d5d9cea8095f69dcc6adec1ba"), | ||
Linux(:x86_64, :glibc) => ("$bin_prefix/Clipper.v1.0.0.x86_64-linux-gnu.tar.gz", "0883bcac9afb68d2ffb822453727ad9fe309a088f9192dd13c26654100d39c57"), | ||
Linux(:x86_64, :musl) => ("$bin_prefix/Clipper.v1.0.0.x86_64-linux-musl.tar.gz", "fd61e7319a79d6a9d32d1c7ad72302d313ca20756472a21a7bae8c41e942d01a"), | ||
FreeBSD(:x86_64) => ("$bin_prefix/Clipper.v1.0.0.x86_64-unknown-freebsd11.1.tar.gz", "39a010ff1d9007641524c276ca9c58ddf68a9f9b4bde98b6fda84950593d385a"), | ||
Windows(:x86_64) => ("$bin_prefix/Clipper.v1.0.0.x86_64-w64-mingw32.tar.gz", "214b2ab0646e2b7fc33376480823a19481a88200a4463a240bb2a747b593a3fd"), | ||
) | ||
if platform_key() in keys(download_info) | ||
# First, check to see if we're all satisfied | ||
if any(!satisfied(p; verbose=true) for p in products) | ||
|
||
# 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 | ||
url, tarball_hash = download_info[platform_key()] | ||
install(url, tarball_hash; prefix=prefix, force=true, verbose=true) | ||
install(url, tarball_hash; prefix=prefix, force=true, verbose=verbose) | ||
end | ||
|
||
@write_deps_file clipper_lib | ||
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) |
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
Oops, something went wrong.