Skip to content

Commit

Permalink
use new GDAL build with working CURL and GEOS (#81)
Browse files Browse the repository at this point in the history
* use new GDAL build with working CURL and GEOS

See JuliaGeo/GDALBuilder#12 for more details.

* fix linux builds by not using strip

* New GDAL release, without stripped Linux objects.

* Linux x64 now uses gcc8 build

* Ignore platforms.

* New (huge) builds.

* Correct url. Upped version number.

* Smaller libtool builds.

Co-authored-by: Maarten Pronk <evetion@users.noreply.github.com>
  • Loading branch information
visr and evetion committed Dec 25, 2019
1 parent 0af8893 commit 96440e8
Show file tree
Hide file tree
Showing 6 changed files with 90 additions and 92 deletions.
5 changes: 2 additions & 3 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,16 @@ uuid = "add2ef01-049f-52c4-9ee2-e494f65e021a"
keywords = ["GDAL", "IO"]
license = "MIT"
desc = "Wrapper for GDAL - Geospatial Data Abstraction Library"
version = "1.0.1"
version = "1.0.2"

[deps]
BinaryProvider = "b99e7846-7c00-51b0-8f62-c81ae34c0232"
CEnum = "fa961155-64e5-5f13-b03f-caf6b980ea82"
Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb"

[compat]
BinaryProvider = "≥ 0.5.0"
julia = "≥ 1.0.4"
CEnum = "≥ 0.2.0"
julia = "≥ 1.0.4"

[extras]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Expand Down
37 changes: 19 additions & 18 deletions deps/build.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ dependencies = [
"build_GEOS.v3.7.2.jl",
"build_SQLite.v3.28.0.jl",
"build_PROJ.v6.1.0.jl",
# "build_LibCURL.v7.64.1.jl"
"build_MbedTLS.v2.6.1.jl"
]

for elem in dependencies
Expand All @@ -22,6 +22,7 @@ const verbose = "--verbose" in ARGS
const prefix = Prefix(get([a for a in ARGS if a != "--verbose"], 1, joinpath(@__DIR__, "usr")))
products = [
LibraryProduct(prefix, ["libgdal"], :libgdal),
LibraryProduct(prefix, ["libcurl"], :libcurl),
ExecutableProduct(prefix, "gdal_contour", :gdal_contour_path),
ExecutableProduct(prefix, "gdal_grid", :gdal_grid_path),
ExecutableProduct(prefix, "gdal_rasterize", :gdal_rasterize_path),
Expand All @@ -44,27 +45,27 @@ products = [
]

# Download binaries from hosted location
bin_prefix = "https://github.com/JuliaGeo/GDALBuilder/releases/download/v3.0.0-3"
bin_prefix = "https://github.com/JuliaGeo/GDALBuilder/releases/download/v3.0.2-1"

# Listing of files generated by BinaryBuilder:
download_info = Dict(
Linux(:aarch64, libc=:glibc) => ("$bin_prefix/GDAL.v3.0.0.aarch64-linux-gnu.tar.gz", "ebe236883d8480fe7482fd1d27c2535c41e808abe1e5cf8c4550be538c3b77e2"),
Linux(:aarch64, libc=:musl) => ("$bin_prefix/GDAL.v3.0.0.aarch64-linux-musl.tar.gz", "0425ae5159cd02c41a526fcb8469b2676bc2f5b4120bea014c8383e291d0c4eb"),
Linux(:armv7l, libc=:glibc, call_abi=:eabihf) => ("$bin_prefix/GDAL.v3.0.0.arm-linux-gnueabihf.tar.gz", "8e9af6c82436788805d59b7c62b26f319fe4460898186939bda3d2931dff28d3"),
Linux(:armv7l, libc=:musl, call_abi=:eabihf) => ("$bin_prefix/GDAL.v3.0.0.arm-linux-musleabihf.tar.gz", "08c659da2d0bdd9b5c67458e9506ac2ef92ee5c6143f45f0650ade3d6e7f6722"),
Linux(:i686, libc=:glibc) => ("$bin_prefix/GDAL.v3.0.0.i686-linux-gnu.tar.gz", "99bd95d5de4dcd7ac9248654c7e53d9b7cb65aaf47352d923ba5da2c41336017"),
Linux(:i686, libc=:musl) => ("$bin_prefix/GDAL.v3.0.0.i686-linux-musl.tar.gz", "7cbd4de983f1b6c470cfcf208febaaa5467e91f46644fac034ad70e0603e42d1"),
Linux(:aarch64, libc=:glibc) => ("$bin_prefix/GDAL.v3.0.2.aarch64-linux-gnu-gcc7.tar.gz", "7be8cdfdb823424b0be778bd9675f2db8394f6cbe8a4407573f5ad24e047ef7a"),
Linux(:aarch64, libc=:musl) => ("$bin_prefix/GDAL.v3.0.2.aarch64-linux-musl-gcc7.tar.gz", "223c4b22dfd86037ac5d4fabf3ce9c21405f214447e6daf100aa67743c091457"),
Linux(:armv7l, libc=:glibc, call_abi=:eabihf) => ("$bin_prefix/GDAL.v3.0.2.arm-linux-gnueabihf-gcc7.tar.gz", "61ea5557f91dd49efc0e3c23db52f894b07fe37fa9b451535995be7020cb3210"),
Linux(:armv7l, libc=:musl, call_abi=:eabihf) => ("$bin_prefix/GDAL.v3.0.2.arm-linux-musleabihf-gcc7.tar.gz", "947101abd918f21b302be0c0160fb9619acc36ed829fb9600c8065768f98fe08"),
Linux(:i686, libc=:glibc) => ("$bin_prefix/GDAL.v3.0.2.i686-linux-gnu-gcc7.tar.gz", "7dea2c01ec2d045f0e404f8622ec2779ecf37e04163be94833a1cf35dd131dea"),
Linux(:i686, libc=:musl) => ("$bin_prefix/GDAL.v3.0.2.i686-linux-musl-gcc7.tar.gz", "9354ee7a3e0db074fedba8904e14bca10bee88e59551eca4ed124cbec572ee2f"),
# removed compiler_abi as suggested in https://github.com/JuliaPackaging/BinaryBuilder.jl/issues/407#issuecomment-473688254
# such that GCC4 platforms will also pick up this GCC7 build, ref https://github.com/JuliaPackaging/BinaryBuilder.jl/issues/407
Windows(:i686) => ("$bin_prefix/GDAL.v3.0.0.i686-w64-mingw32-gcc7.tar.gz", "8d056a9a4781cc13e572b689c581ef9ab48d5f397b2ca3882466e168aabb5b45"),
Linux(:powerpc64le, libc=:glibc) => ("$bin_prefix/GDAL.v3.0.0.powerpc64le-linux-gnu.tar.gz", "29772014a34d5300c950399f6d07dcc960feff6671a30fc21a834c7482d4e359"),
MacOS(:x86_64) => ("$bin_prefix/GDAL.v3.0.0.x86_64-apple-darwin14.tar.gz", "df0dd3dfec28cf98b7a8d4fdf9f770599bd3bde2fe223f33e903aa052a4f0ada"),
Linux(:x86_64, libc=:glibc) => ("$bin_prefix/GDAL.v3.0.0.x86_64-linux-gnu.tar.gz", "22e576ebb9c45a8571869f5ebaca0ab1c6f443aa281c0fcdf5176c75d9912742"),
Linux(:x86_64, libc=:musl) => ("$bin_prefix/GDAL.v3.0.0.x86_64-linux-musl.tar.gz", "f2ab4b8ff55621f22963f6749c210876b5be14c3cee724ece7dfc73ea9b3a14e"),
FreeBSD(:x86_64) => ("$bin_prefix/GDAL.v3.0.0.x86_64-unknown-freebsd11.1.tar.gz", "0b4b817a13fccb3e65b32df535679163aa0d061077542ceda00764d34c96159e"),
Windows(:i686) => ("$bin_prefix/GDAL.v3.0.2.i686-w64-mingw32-gcc7.tar.gz", "d09aa8b69bd5915ad797be86f1a04c01a1cf38407b6f48cc80d724284ede63ef"),
Linux(:powerpc64le, libc=:glibc) => ("$bin_prefix/GDAL.v3.0.2.powerpc64le-linux-gnu-gcc7.tar.gz", "f064d0bfd73e803876c43fd7ab4d33ecbc56cc4751a027eb5a3656a0edcb229d"),
MacOS(:x86_64) => ("$bin_prefix/GDAL.v3.0.2.x86_64-apple-darwin14.tar.gz", "4e58078594ce150612428d14fa494b41273362674ee46b4670f335f3c6d0f8e2"),
Linux(:x86_64, libc=:glibc) => ("$bin_prefix/GDAL.v3.0.2.x86_64-linux-gnu-gcc7.tar.gz", "956dd45cdb7b17d544fc4441e3d8b191482472b63d4bc313865a9076061aeb4a"),
Linux(:x86_64, libc=:musl) => ("$bin_prefix/GDAL.v3.0.2.x86_64-linux-musl-gcc7.tar.gz", "d75c4e4b434c0cf5601bca6d7d343902a0f0a962d98e93929c9f0bf15c97cce5"),
FreeBSD(:x86_64) => ("$bin_prefix/GDAL.v3.0.2.x86_64-unknown-freebsd11.1.tar.gz", "ebb4a0f340db48e62e36c81d9c092b93421a643ab2b90d6c06262ea363cd185c"),
# removed compiler_abi as suggested in https://github.com/JuliaPackaging/BinaryBuilder.jl/issues/407#issuecomment-473688254
# such that GCC4 platforms will also pick up this GCC7 build, ref https://github.com/JuliaPackaging/BinaryBuilder.jl/issues/407
Windows(:x86_64) => ("$bin_prefix/GDAL.v3.0.0.x86_64-w64-mingw32-gcc7.tar.gz", "aa1b84e77de61eda6f3e9f569ff8e7bab3b99d38fa2edddb9069ef82ba3d5256"),
Windows(:x86_64) => ("$bin_prefix/GDAL.v3.0.2.x86_64-w64-mingw32-gcc7.tar.gz", "75e35bab535edeb7588d8b695910bfb2f4827bfc35143c441eb74f7f79c7b591"),
)

# Install unsatisfied or updated dependencies:
Expand All @@ -81,7 +82,7 @@ end
# 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)
install(dl_info...; prefix=prefix, ignore_platform=true, force=true, verbose=verbose)
end

# Write out a deps.jl file that will contain mappings for our products
Expand All @@ -100,7 +101,7 @@ function include_deps(name)
end

open("deps.jl", "w") do io
for dep in (:zlib, :geos, :sqlite, :proj, #=:curl,=# :gdal)
for dep in (:zlib, :geos, :sqlite, :proj, :mbedtls, :gdal)
println(io, include_deps(dep))
end
println(io, """
Expand All @@ -111,7 +112,7 @@ open("deps.jl", "w") do io
geos.check_deps()
sqlite.check_deps()
proj.check_deps()
# curl.check_deps()
mbedtls.check_deps()
gdal.check_deps()
end
""")
Expand Down
48 changes: 0 additions & 48 deletions deps/build_LibCURL.v7.64.1.jl

This file was deleted.

50 changes: 50 additions & 0 deletions deps/build_MbedTLS.v2.6.1.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
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, ["libmbedx509"], :libmbedx509),
LibraryProduct(prefix, ["libmbedcrypto"], :libmbedcrypto),
LibraryProduct(prefix, ["libmbedtls"], :libmbedtls),
]

# Download binaries from hosted location
bin_prefix = "https://github.com/JuliaWeb/MbedTLSBuilder/releases/download/v0.20.0"

# Listing of files generated by BinaryBuilder:
download_info = Dict(
Linux(:aarch64, libc=:glibc) => ("$bin_prefix/MbedTLS.v2.6.1.aarch64-linux-gnu.tar.gz", "b5c6aa8f367f6d4a1d940381c30740e1daa9653104423412a078f2f41862bccc"),
Linux(:aarch64, libc=:musl) => ("$bin_prefix/MbedTLS.v2.6.1.aarch64-linux-musl.tar.gz", "56c22a9246c42baed29337049925ecb932b84fabfcd4904ba19e974579ef9c9c"),
Linux(:armv7l, libc=:glibc, call_abi=:eabihf) => ("$bin_prefix/MbedTLS.v2.6.1.arm-linux-gnueabihf.tar.gz", "05755bc4a886e5b020776e23a3778db811312a284c42418924c94c2150288970"),
Linux(:armv7l, libc=:musl, call_abi=:eabihf) => ("$bin_prefix/MbedTLS.v2.6.1.arm-linux-musleabihf.tar.gz", "982ba365a4d8551b4629abbab428b3bec0a997823b834b59f867e3316b5e711c"),
Linux(:i686, libc=:glibc) => ("$bin_prefix/MbedTLS.v2.6.1.i686-linux-gnu.tar.gz", "97e7651ba4d162b5cd0ef53e0d364a7f6dc5e5b8d35fd89d7df9e10863de77b8"),
Linux(:i686, libc=:musl) => ("$bin_prefix/MbedTLS.v2.6.1.i686-linux-musl.tar.gz", "4430e4a32ddd6932057498d4f21e307c1d06ef4ddbbf0224ed68f5a617c16b08"),
Windows(:i686) => ("$bin_prefix/MbedTLS.v2.6.1.i686-w64-mingw32.tar.gz", "30cccba8debbf30d61002ca3fb6de325ff9919b4229329b7cb1a4f3b4175e555"),
Linux(:powerpc64le, libc=:glibc) => ("$bin_prefix/MbedTLS.v2.6.1.powerpc64le-linux-gnu.tar.gz", "b2dfc9887701376329f2a59cda0d813a2e412c934b7c233b1278c90b3fd7c7a5"),
MacOS(:x86_64) => ("$bin_prefix/MbedTLS.v2.6.1.x86_64-apple-darwin14.tar.gz", "245779d96eb8dc2c929f77210eab02d2ba4e7cd078f2f936c46339daae62e3a0"),
Linux(:x86_64, libc=:glibc) => ("$bin_prefix/MbedTLS.v2.6.1.x86_64-linux-gnu.tar.gz", "b667e285de1bb797882d0a253ba31869d22dc73250ad91da094bfe7ca220363c"),
Linux(:x86_64, libc=:musl) => ("$bin_prefix/MbedTLS.v2.6.1.x86_64-linux-musl.tar.gz", "9bf7484b274e3cd7c1dd93e6f7957c734b720ed77f2f8348e63f67bbcc016ae7"),
FreeBSD(:x86_64) => ("$bin_prefix/MbedTLS.v2.6.1.x86_64-unknown-freebsd11.1.tar.gz", "3d333991f9a72e9538b6b2915c87990028400ebdd5714ff6f21d2602135536c2"),
Windows(:x86_64) => ("$bin_prefix/MbedTLS.v2.6.1.x86_64-w64-mingw32.tar.gz", "371b01c03217caf5b021113df6807485d916553f983b9ebb21c0c601c270d22b"),
)

# 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_mbedtls.jl"), products, verbose=verbose)
29 changes: 14 additions & 15 deletions test/drivers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ available_drivers = [
"GTiff",
"MEM",
"PCRaster",
# libcurl raster drivers
"EEDAI",
"PLMosaic",
"RDA",
"WCS",
"WMS",
"WMTS",
# vector drivers
"ARCGEN",
"GeoJSON",
Expand All @@ -20,20 +27,6 @@ available_drivers = [
"TopoJSON",
"VRT",
"SQLite",
]

for drivername in available_drivers
@test GDAL.gdalgetdriverbyname(drivername) != C_NULL
end

not_available_drivers = [
# libcurl raster drivers
"EEDAI",
"PLMosaic",
"RDA",
"WCS",
"WMS",
"WMTS",
# libcurl vector drivers
"AmigoCloud",
"Carto",
Expand All @@ -47,7 +40,13 @@ not_available_drivers = [
"PLScenes",
"WFS",
"WFS3",
"Carto",
]

for drivername in available_drivers
@test GDAL.gdalgetdriverbyname(drivername) != C_NULL
end

not_available_drivers = [
"JP2OpenJPEG", # up next, see #64
]

Expand Down
13 changes: 5 additions & 8 deletions test/tutorial_vector.jl
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,11 @@ feature = GDAL.ogr_f_create(featuredefn)
GDAL.ogr_f_setfieldstring(feature, GDAL.ogr_f_getfieldindex(feature, "Name"), "myname")
point = GDAL.ogr_g_creategeometry(GDAL.wkbPoint)
GDAL.ogr_g_setpoint_2d(point, 0, 100.123, 0.123)
# no GEOS support on Linux: https://github.com/JuliaGeo/GDALBuilder/issues/10
if Sys.islinux()
@test_broken GDAL.ogr_g_isvalid(point) == 1
@test_broken GDAL.ogr_g_isring(point) == 0
else
@test GDAL.ogr_g_isvalid(point) == 1
@test GDAL.ogr_g_isring(point) == 0
end

# check GEOS support
@test GDAL.ogr_g_isvalid(point) == 1
@test GDAL.ogr_g_isring(point) == 0

@test GDAL.ogr_f_setgeometry(feature, point) == GDAL.OGRERR_NONE
GDAL.ogr_g_destroygeometry(point)
GDAL.ogr_l_createfeature(layer, feature)
Expand Down

0 comments on commit 96440e8

Please sign in to comment.