Skip to content

Commit

Permalink
[GDAL] Bump to v3.7.1 (#7050)
Browse files Browse the repository at this point in the history
* [GDAL] Bump to v3.7.1

* Missing comma

* Switch to gitsource

* Update G/GDAL/build_tarballs.jl

* Update build_tarballs.jl

* Update build_tarballs.jl

* Update build_tarballs.jl

* Update build_tarballs.jl

* Update build_tarballs.jl

* Update build_tarballs.jl

* Update build_tarballs.jl

* Update build_tarballs.jl

* Update build_tarballs.jl

* tweak ldflags

* Update build_tarballs.jl

* use gcc for freebsd

* add patch

* tweak paths

* Fix ordering, etc.

* Add back dependency bounds

* Fix bsd patch

* Apply patch for all platforms

* Bump HDF5

* Update G/GDAL/build_tarballs.jl

Co-authored-by: Martijn Visser <mgvisser@gmail.com>

* expand hdf5 platforms, bump gdal

* Update G/GDAL/build_tarballs.jl

Co-authored-by: Martijn Visser <mgvisser@gmail.com>

* Update G/GDAL/build_tarballs.jl

* move license.txt import

* trigger build...

* Update build_tarballs.jl

* Update build_tarballs.jl

---------

Co-authored-by: Martijn Visser <mgvisser@gmail.com>
  • Loading branch information
jeremiahpslewis and visr authored Sep 22, 2023
1 parent 452cb0e commit 9aa7a94
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 38 deletions.
82 changes: 44 additions & 38 deletions G/GDAL/build_tarballs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,26 @@
using BinaryBuilder, Pkg

name = "GDAL"
upstream_version = v"3.6.2"
version_offset = v"1.0.0"
upstream_version = v"3.7.2"
version_offset = v"0.0.0"
version = VersionNumber(upstream_version.major * 100 + version_offset.major,
upstream_version.minor * 100 + version_offset.minor,
upstream_version.patch * 100 + version_offset.patch)

# Collection of sources required to build GDAL
sources = [
ArchiveSource("https://github.com/OSGeo/gdal/releases/download/v$upstream_version/gdal-$upstream_version.tar.gz",
"cd5bf004af85b88414676b0d5694d3192414e556961ee3d47164f3298078a818"),
GitSource("https://github.com/OSGeo/gdal.git",
"f74cd4144199fd7667e5c151a251cdbad1f44641"),
ArchiveSource("https://github.com/phracker/MacOSX-SDKs/releases/download/10.15/MacOSX10.15.sdk.tar.xz",
"2408d07df7f324d3beea818585a6d990ba99587c218a3969f924dfcc4de93b62"),
DirectorySource("./bundled")
]

# Bash recipe for building across all platforms
script = raw"""
cd $WORKSPACE/srcdir/gdal-*/
install_license LICENSE.TXT
cd $WORKSPACE/srcdir/gdal
mkdir build
cd build
atomic_patch -p1 ../patches/bsd-environ-undefined-fix.patch
if [[ "${target}" == *-freebsd* ]]; then
# Our FreeBSD libc has `environ` as undefined symbol, so the linker will
Expand All @@ -48,28 +47,30 @@ if [[ "${target}" == x86_64-apple-darwin* ]]; then
popd
fi
mkdir build && cd build
CMAKE_FLAGS=(-DCMAKE_INSTALL_PREFIX=${prefix}
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TARGET_TOOLCHAIN}
-DCMAKE_PREFIX_PATH=${prefix}
-DCMAKE_FIND_ROOT_PATH=${prefix}
-DCMAKE_BUILD_TYPE=Release
-DBUILD_PYTHON_BINDINGS=OFF
-DBUILD_JAVA_BINDINGS=OFF
-DBUILD_CSHARP_BINDINGS=OFF
-DGDAL_USE_CURL=ON
-DGDAL_USE_EXPAT=ON
-DGDAL_USE_GEOTIFF=ON
-DGDAL_USE_GEOS=ON
-DGDAL_USE_OPENJPEG=ON
-DGDAL_USE_SQLITE3=ON
-DGDAL_USE_TIFF=ON
-DGDAL_USE_ZLIB=ON
-DGDAL_USE_ZSTD=ON
-DGDAL_USE_POSTGRESQL=ON
-DPostgreSQL_INCLUDE_DIR=${includedir}
-DPostgreSQL_LIBRARY=${libdir}/libpq.${dlext}
-DGDAL_USE_ARROW=ON
-DGDAL_USE_PARQUET=ON)
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TARGET_TOOLCHAIN}
-DCMAKE_PREFIX_PATH=${prefix}
-DCMAKE_FIND_ROOT_PATH=${prefix}
-DCMAKE_BUILD_TYPE=Release
-DBUILD_PYTHON_BINDINGS=OFF
-DBUILD_JAVA_BINDINGS=OFF
-DBUILD_CSHARP_BINDINGS=OFF
-DGDAL_USE_CURL=ON
-DGDAL_USE_EXPAT=ON
-DGDAL_USE_GEOTIFF=ON
-DGDAL_USE_GEOS=ON
-DGDAL_USE_OPENJPEG=ON
-DGDAL_USE_SQLITE3=ON
-DGDAL_USE_TIFF=ON
-DGDAL_USE_ZLIB=ON
-DGDAL_USE_ZSTD=ON
-DGDAL_USE_POSTGRESQL=ON
-DPostgreSQL_INCLUDE_DIR=${includedir}
-DPostgreSQL_LIBRARY=${libdir}/libpq.${dlext}
-DGDAL_USE_ARROW=ON
-DGDAL_USE_PARQUET=ON)
# NetCDF is the most restrictive dependency as far as platform availability, so we'll use it where applicable but disable it otherwise
if ! find ${libdir} -name "libnetcdf*.${dlext}" -exec false '{}' +; then
Expand All @@ -90,6 +91,8 @@ fi
cmake .. ${CMAKE_FLAGS[@]}
cmake --build . -j${nproc}
cmake --build . -j${nproc} --target install
install_license ../LICENSE.TXT
"""

# These are the platforms we will build for by default, unless further
Expand Down Expand Up @@ -122,30 +125,33 @@ products = [

hdf5_platforms = [
Platform("x86_64", "linux"),
Platform("aarch64", "linux"; libc="glibc"),
Platform("aarch64", "linux"),
Platform("armv6l", "linux"),
Platform("armv7l", "linux"),
Platform("i686", "linux"),
Platform("powerpc64le", "linux"),
Platform("x86_64", "macos"),
Platform("aarch64", "macos"),
Platform("x86_64", "windows"),
Platform("i686", "windows"),
Platform("aarch64", "macos"),
]
hdf5_platforms = expand_cxxstring_abis(hdf5_platforms)

# Dependencies that must be installed before this package can be built
dependencies = [
Dependency("GEOS_jll"; compat="~3.11"),
Dependency("PROJ_jll"; compat="~900.100"),
Dependency("GEOS_jll"; compat="3.11.2"),
Dependency("PROJ_jll"; compat="901.300.0"),
Dependency("Zlib_jll"),
Dependency("SQLite_jll"),
Dependency("LibPQ_jll"),
Dependency("OpenJpeg_jll"),
Dependency("Expat_jll"; compat="2.2.10"),
Dependency("Zstd_jll"),
Dependency("Libtiff_jll"; compat="4.3"),
Dependency("libgeotiff_jll"; compat="100.700.100"),
Dependency("Libtiff_jll"; compat="~4.5.1"),
Dependency("libgeotiff_jll"; compat="100.701.100"),
Dependency("LibCURL_jll"; compat="7.73,8"),
Dependency("NetCDF_jll"; compat="400.902.5", platforms=hdf5_platforms),
# Updating to a newer HDF5 version is likely possible without problems but requires rebuilding this package
Dependency("HDF5_jll"; compat="~1.12", platforms=hdf5_platforms),
Dependency("NetCDF_jll"; compat="400.902.208", platforms=hdf5_platforms),
Dependency("HDF5_jll"; compat="~1.14", platforms=hdf5_platforms),
Dependency("Arrow_jll"; compat="10"),
]

Expand Down
13 changes: 13 additions & 0 deletions G/GDAL/bundled/patches/bsd-environ-undefined-fix.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/gdal.cmake b/gdal.cmake
index e221f99b79..9c93be2cd8 100644
--- a/gdal.cmake
+++ b/gdal.cmake
@@ -280,7 +280,7 @@ endif ()
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
include(CheckLinkerFlag)
check_linker_flag(C "-Wl,--no-undefined" HAS_NO_UNDEFINED)
- if (HAS_NO_UNDEFINED AND (NOT "${CMAKE_CXX_FLAGS}" MATCHES "-fsanitize") AND NOT CMAKE_SYSTEM_NAME MATCHES "OpenBSD")
+ if (HAS_NO_UNDEFINED AND (NOT "${CMAKE_CXX_FLAGS}" MATCHES "-fsanitize") AND NOT CMAKE_SYSTEM_NAME MATCHES "OpenBSD" AND NOT CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
string(APPEND CMAKE_SHARED_LINKER_FLAGS " -Wl,--no-undefined")
string(APPEND CMAKE_MODULE_LINKER_FLAGS " -Wl,--no-undefined")
endif ()

0 comments on commit 9aa7a94

Please sign in to comment.