|
1 | | -using BinDeps |
2 | | -@BinDeps.setup |
| 1 | +using BinaryProvider |
3 | 2 |
|
4 | | -libgeos = library_dependency("libgeos",aliases=["libgeos_c", "libgeos_c-1"], validate = function(path, handle) |
5 | | - return Libdl.dlsym_e(handle,:initGEOS) != C_NULL && Libdl.dlsym_e(handle,:GEOSDelaunayTriangulation) != C_NULL |
6 | | -end) |
| 3 | +# Parse some basic command-line arguments |
| 4 | +const verbose = "--verbose" in ARGS |
| 5 | +const prefix = Prefix(get([a for a in ARGS if a != "--verbose"], 1, joinpath(@__DIR__, "usr"))) |
7 | 6 |
|
8 | | -version = "3.6.1" |
| 7 | +products = Product[ |
| 8 | + LibraryProduct(prefix, "libgeos_c", :libgeos), |
| 9 | + LibraryProduct(prefix, "libgeos", :libgeos_cpp) |
| 10 | +] |
9 | 11 |
|
10 | | -provides(Sources, URI("http://download.osgeo.org/geos/geos-$(version).tar.bz2"), [libgeos], os = :Unix) |
11 | | -provides(BuildProcess,Autotools(libtarget = "capi/.libs/libgeos_c."*Libdl.dlext),libgeos) |
12 | | -# provides(AptGet,"libgeos-dev", libgeos) |
13 | | -# TODO: provides(Yum,"libgeos-dev", libgeos) |
14 | | -# TODO: provides(Pacman,"libgeos-dev", libgeos) |
| 12 | +# Download binaries from hosted location |
| 13 | +bin_prefix = "https://github.com/JuliaGeo/GEOSBuilder/releases/download/v3.6.2-0" |
15 | 14 |
|
16 | | -if is_windows() |
17 | | - using WinRPM |
18 | | - push!(WinRPM.sources, "http://download.opensuse.org/repositories/home:yeesian/openSUSE_Leap_42.2") |
19 | | - WinRPM.update() |
20 | | - provides(WinRPM.RPM, "libgeos", [libgeos], os = :Windows) |
21 | | -end |
| 15 | +# Listing of files generated by BinaryBuilder: |
| 16 | +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"), |
| 25 | +) |
22 | 26 |
|
23 | | -if is_apple() |
24 | | - if Pkg.installed("Homebrew") === nothing |
25 | | - error("Homebrew package not installed, please run Pkg.add(\"Homebrew\")") |
| 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) |
| 30 | + # 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!") |
26 | 35 | end |
27 | | - using Homebrew |
28 | | - provides(Homebrew.HB, "geos", libgeos, os = :Darwin) |
29 | | -end |
30 | 36 |
|
31 | | -@BinDeps.install Dict(:libgeos => :libgeos) |
| 37 | + # Finally, write out a deps.jl file |
| 38 | + write_deps_file(joinpath(@__DIR__, "deps.jl"), products) |
| 39 | +end |
0 commit comments