|
1 | | -using BinaryProvider |
| 1 | +using BinaryProvider # requires BinaryProvider 0.3.0 or later |
2 | 2 |
|
3 | 3 | # Parse some basic command-line arguments |
4 | 4 | const verbose = "--verbose" in ARGS |
5 | 5 | const prefix = Prefix(get([a for a in ARGS if a != "--verbose"], 1, joinpath(@__DIR__, "usr"))) |
6 | | - |
7 | | -products = Product[ |
8 | | - LibraryProduct(prefix, "libgeos_c", :libgeos), |
9 | | - LibraryProduct(prefix, "libgeos", :libgeos_cpp) |
| 6 | +products = [ |
| 7 | + LibraryProduct(prefix, String["libgeos_c"], :libgeos), |
| 8 | + LibraryProduct(prefix, String["libgeos"], :libgeos_cpp), |
10 | 9 | ] |
11 | 10 |
|
12 | 11 | # Download binaries from hosted location |
13 | | -bin_prefix = "https://github.com/JuliaGeo/GEOSBuilder/releases/download/v3.6.2-0" |
| 12 | +bin_prefix = "https://github.com/JuliaGeo/GEOSBuilder/releases/download/v3.6.2-2" |
14 | 13 |
|
15 | 14 | # Listing of files generated by BinaryBuilder: |
16 | 15 | download_info = Dict( |
17 | | - Linux(:i686, :glibc) => ("$bin_prefix/GEOS.i686-linux-gnu.tar.gz", "b8569ca5dd4a1aec464ae2eaec4247ea5a93f55bb843854cab09f06952c4fcd9"), |
18 | | - Linux(:x86_64, :glibc) => ("$bin_prefix/GEOS.x86_64-linux-gnu.tar.gz", "a9f58321ff86ca05c87ec637cc6126ba5db313337491123b76b4ca7e7705223b"), |
19 | | - Linux(:aarch64, :glibc) => ("$bin_prefix/GEOS.aarch64-linux-gnu.tar.gz", "c91616f06f03d64d9b7e06dd74b6056815e0e54e74a9af8288e4d0cd79929d6e"), |
20 | | - Linux(:armv7l, :glibc) => ("$bin_prefix/GEOS.arm-linux-gnueabihf.tar.gz", "5ab9b9b92319daf7c08db63e711fea5724946c973a38307b33f61b49a8e93531"), |
21 | | - Linux(:powerpc64le, :glibc) => ("$bin_prefix/GEOS.powerpc64le-linux-gnu.tar.gz", "e24c68a8e5cd517fae4ca089bd66ee2081aef5e1b492fc0835accdc112995ad6"), |
22 | | - MacOS() => ("$bin_prefix/GEOS.x86_64-apple-darwin14.tar.gz", "017c593d91806578538d8dbdeefa9f2b88700e06c32cc07be52cdbe78f55390d"), |
23 | | - Windows(:i686) => ("$bin_prefix/GEOS.i686-w64-mingw32.tar.gz", "f3fa4db98b50821db2b7209de76b0ac31d4d87c4d9bbbab60a6adb5f19ca0155"), |
24 | | - Windows(:x86_64) => ("$bin_prefix/GEOS.x86_64-w64-mingw32.tar.gz", "9e8cba2c107884d1380bd6e5a6fce1003b6fa50be59e689b0a9bbe014d46d3ac"), |
| 16 | + Linux(:aarch64, :glibc) => ("$bin_prefix/GEOS.aarch64-linux-gnu.tar.gz", "bdd07a586bfd952f92ac939e5372b651af16982b542a27252ca5704c3c73dbd7"), |
| 17 | + Linux(:armv7l, :glibc, :eabihf) => ("$bin_prefix/GEOS.arm-linux-gnueabihf.tar.gz", "94bb0679bb6a02b5a75a6c2727053816ed4edf8678df89dc3637d62fcd23ae21"), |
| 18 | + Linux(:i686, :glibc) => ("$bin_prefix/GEOS.i686-linux-gnu.tar.gz", "bb4e67f8a9b81eca7edf6f41c1eaddaf171398810a2b2cd0b6d272b96550ec57"), |
| 19 | + Windows(:i686) => ("$bin_prefix/GEOS.i686-w64-mingw32.tar.gz", "c3e2e8867d7af852dd5696d0eabe87449fce29853c7fa4b8e809cb86f1e4bcec"), |
| 20 | + Linux(:powerpc64le, :glibc) => ("$bin_prefix/GEOS.powerpc64le-linux-gnu.tar.gz", "8ea4bce7bc613c4f4a7541173844b12e1ba6d18836e7b09955cf5503a49de3c8"), |
| 21 | + MacOS(:x86_64) => ("$bin_prefix/GEOS.x86_64-apple-darwin14.tar.gz", "93eecb3f0a0336feb46b8bb899684d50b9025b7e4703dfca81e7ea10eb021d2b"), |
| 22 | + Linux(:x86_64, :glibc) => ("$bin_prefix/GEOS.x86_64-linux-gnu.tar.gz", "602f759fa580346f59f4b50713e82621ac34ddb397a69ef608b24ab6761223ce"), |
| 23 | + Windows(:x86_64) => ("$bin_prefix/GEOS.x86_64-w64-mingw32.tar.gz", "b3d1713345a73b230065281ebccd7867d952b5369ae64da2919b05b9c40e248a"), |
25 | 24 | ) |
26 | 25 |
|
27 | | -# First, check to see if we're all satisfied |
28 | | -if any(!satisfied(p; verbose=verbose) for p in products) |
29 | | - if platform_key() in keys(download_info) |
| 26 | +# Install unsatisfied or updated dependencies: |
| 27 | +unsatisfied = any(!satisfied(p; verbose=verbose) for p in products) |
| 28 | +if haskey(download_info, platform_key()) |
| 29 | + url, tarball_hash = download_info[platform_key()] |
| 30 | + if unsatisfied || !isinstalled(url, tarball_hash; prefix=prefix) |
30 | 31 | # Download and install binaries |
31 | | - url, tarball_hash = download_info[platform_key()] |
32 | | - install(url, tarball_hash; prefix=prefix, force=true, verbose=true) |
33 | | - else |
34 | | - error("Your platform $(Sys.MACHINE) is not supported by this package!") |
| 32 | + install(url, tarball_hash; prefix=prefix, force=true, verbose=verbose) |
35 | 33 | end |
36 | | - |
37 | | - # Finally, write out a deps.jl file |
38 | | - write_deps_file(joinpath(@__DIR__, "deps.jl"), products) |
| 34 | +elseif unsatisfied |
| 35 | + # If we don't have a BinaryProvider-compatible .tar.gz to download, complain. |
| 36 | + # Alternatively, you could attempt to install from a separate provider, |
| 37 | + # build from source or something even more ambitious here. |
| 38 | + error("Your platform $(triplet(platform_key())) is not supported by this package!") |
39 | 39 | end |
| 40 | + |
| 41 | +# Write out a deps.jl file that will contain mappings for our products |
| 42 | +write_deps_file(joinpath(@__DIR__, "deps.jl"), products) |
0 commit comments