Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add gdal/3.1.0 #1722

Merged
merged 6 commits into from
Jun 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions recipes/gdal/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
sources:
"3.1.0":
url: "https://github.com/OSGeo/gdal/releases/download/v3.1.0/gdal-3.1.0.tar.gz"
sha256: "6793ddb2b1ca042494d938ac82c71d06b9125bbb00c9bb9414a7c5e3a707c639"
patches:
"3.1.0":
- patch_file: "patches/fix-autotools.patch"
base_path: "source_subfolder"
- patch_file: "patches/fix-nmake.patch"
base_path: "source_subfolder"
- patch_file: "patches/fix-include-jsonc.patch"
base_path: "source_subfolder"
- patch_file: "patches/fix-include-xerces.patch"
base_path: "source_subfolder"
663 changes: 663 additions & 0 deletions recipes/gdal/all/conanfile.py

Large diffs are not rendered by default.

245 changes: 245 additions & 0 deletions recipes/gdal/all/patches/fix-autotools.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,245 @@
--- a/GDALmake.opt.in
+++ b/GDALmake.opt.in
@@ -601,7 +601,7 @@ endif

ifeq ($(HAVE_LIBTOOL), yes)

-CONFIG_LIBS = $(GDAL_ROOT)/$(LIBGDAL)
+CONFIG_LIBS = $(GDAL_ROOT)/$(LIBGDAL) $(LIBS)
ifeq ($(MACOSX_FRAMEWORK),yes)
CONFIG_LIBS_INS = -L$(INST_LIB)/unix/lib -lgdal
else
--- a/configure.ac
+++ b/configure.ac
@@ -1214,6 +1214,7 @@ dnl ---------------------------------------------------------------------------
dnl PROJ.6 related stuff
dnl ---------------------------------------------------------------------------

+PKG_PROG_PKG_CONFIG([0.21])
AC_MSG_CHECKING([for PROJ >= 6 library])

AC_ARG_WITH(proj,[ --with-proj=ARG Compile with PROJ.x (ARG=yes or path)],,)
@@ -1229,11 +1230,7 @@ if test "x$with_proj" = "xno" ; then
else

if test "x$with_proj" = "xyes" -o "x$with_proj" = "x"; then
- ORIG_LIBS="$LIBS"
- LIBS="-lproj $ORIG_LIBS"
- AC_LANG_PUSH([C++])
- AC_CHECK_LIB(proj,proj_create_from_wkt,PROJ_FOUND=yes,PROJ_FOUND=no,)
- AC_LANG_POP([C++])
+ PROJ_FOUND=yes
if test "$PROJ_FOUND" = "no"; then
AC_LANG_PUSH([C++])
AC_CHECK_LIB(proj,internal_proj_create_from_wkt,PROJ_FOUND=yes,PROJ_FOUND=no,)
@@ -2019,7 +2016,7 @@ else
AC_MSG_RESULT([using libtiff from ${with_libtiff}.])

dnl Check for the BigTIFF enabled library (libtiff >= 4.0)
- AC_CHECK_LIB(tiff,TIFFScanlineSize64,HAVE_BIGTIFF=yes,HAVE_BIGTIFF=no,)
+ AC_CHECK_LIB(tiff,TIFFScanlineSize64,HAVE_BIGTIFF=yes,HAVE_BIGTIFF=no,$LIBS)

fi

@@ -2089,7 +2086,6 @@ else

dnl We now require libgeotiff 1.5.0
dnl first check if $with_geotiff/lib has the library:
- AC_CHECK_LIB(geotiff,GTIFAttachPROJContext,GEOTIFF_SETTING=external,GEOTIFF_SETTING=not_found,-L$with_geotiff/lib)

if test $GEOTIFF_SETTING = "external" ; then
LIBS="-L$with_geotiff/lib -lgeotiff $LIBS"
@@ -2649,6 +2645,10 @@ if test x"$with_hdf4" = x"no" ; then

echo "hdf4 support disabled."

+elif test x"$with_hdf4" = x"yes" ; then
+ PKG_CHECK_MODULES([HDF4], [hdf], [HAVE_HDF4=yes], [HAVE_HDF4=no])
+ PKG_CHECK_MODULES([HDF4], [hdf >= 4.2.5], [HDF4_HAS_MAXOPENFILES=yes], [HDF4_HAS_MAXOPENFILES=no])
+ HDF4_INCLUDE="$HDF4_CFLAGS"
else

if test x"$with_hdf4" = x"yes" -o x"$with_hdf4" = x"" ; then
@@ -2779,7 +2779,6 @@ elif test "$with_hdf5" = "yes" -o "$with_hdf5" = "" ; then
# Test that the package found is for the right architecture
saved_LIBS="$LIBS"
LIBS="$HDF5_LIBS"
- AC_CHECK_LIB(hdf5,H5Fopen, [HAVE_HDF5=yes], [HAVE_HDF5=no])
LIBS="$saved_LIBS"

if test "$HAVE_HDF5" = "yes"; then
@@ -3714,18 +3713,15 @@ MYSQL_CONFIG=no
AC_ARG_WITH(mysql,[ --with-mysql[=ARG] Include MySQL (ARG=path to mysql_config) [[default=no]]],,)

if test "$with_mysql" = "yes" ; then
- AC_PATH_PROG(MYSQL_CONFIG, mysql_config, no)
+ HAVE_MYSQL=yes
else
- if test "x$with_mysql" != "x" ; then
- MYSQL_CONFIG=$with_mysql
- fi
+ HAVE_MYSQL=no
fi

AC_MSG_CHECKING([for MySQL])

if test "$MYSQL_CONFIG" = "no" ; then

- HAVE_MYSQL=no
MYSQL_LIB=
MYSQL_INC=

@@ -3819,8 +3815,11 @@ dnl Check for Expat configuration.
dnl ---------------------------------------------------------------------------

dnl Expat 1.95.0 released in 2000-09-28
-EXPAT_REQ_VERSION="1.95.0"
-AX_LIB_EXPAT($EXPAT_REQ_VERSION)
+# AX_LIB_EXPAT is too fragile, it doesn't properly handle debug expat on Windows
+HAVE_EXPAT=no
+AC_ARG_WITH([expat], AS_HELP_STRING([--with-expat[=ARG]], [use Expat library (ARG=yes or no)]),,)
+if test x"$with_expat" = x"yes" ; then
+PKG_CHECK_MODULES([EXPAT], [expat >= 1.95.0], [HAVE_EXPAT=yes], [HAVE_EXPAT=no])

if test "$HAVE_EXPAT" = "yes"; then
LIBS="$EXPAT_LDFLAGS $LIBS"
@@ -3833,6 +3832,7 @@ m4_foreach_w([frmt],EXPAT_DRIVERS,[
fi
])

+fi
fi

AC_SUBST([HAVE_EXPAT], $HAVE_EXPAT)
@@ -4058,29 +4058,16 @@ AC_ARG_WITH(curl,
dnl Clear some cache variables
unset ac_cv_path_LIBCURL

-if test "`basename xx/$with_curl`" = "curl-config" ; then
- LIBCURL_CONFIG="$with_curl"
-elif test "$with_curl" = "no" ; then
- LIBCURL_CONFIG=no
+if test "$with_curl" = "yes" ; then
+ PKG_CHECK_MODULES([CURL], [libcurl], [CURL_SETTING=yes], [CURL_SETTING=no])
else
- AC_PATH_PROG(LIBCURL_CONFIG, curl-config, no)
-fi
-
-if test "$LIBCURL_CONFIG" != "no" ; then
-
- CURL_VERNUM=`$LIBCURL_CONFIG --vernum`
- CURL_VER=`$LIBCURL_CONFIG --version | awk '{print $2}'`
-
- AC_MSG_RESULT([ found libcurl version $CURL_VER])
-
- AC_CHECK_LIB(curl,curl_global_init,CURL_SETTING=yes,CURL_SETTING=no,`$LIBCURL_CONFIG --libs`)
-
+ CURL_SETTING=no
fi

if test "$CURL_SETTING" = "yes" ; then

- CURL_INC=`$LIBCURL_CONFIG --cflags`
- CURL_LIB=`$LIBCURL_CONFIG --libs`
+ CURL_INC="$CURL_CFLAGS"
+ CURL_LIB="$CURL_LIBS"
m4_foreach_w([frmt],CURL_FORMATS,[
driver_enabled=m4_join([_],[$INTERNAL_FORMAT],frmt,[ENABLED])
if test "x$driver_enabled" = "xyes"; then
@@ -4120,7 +4107,6 @@ if test "x$with_xml2" = "xyes" -o "x$with_xml2" = "x" ; then
if test "${HAVE_LIBXML2}" = "yes"; then
SAVED_LIBS="${LIBS}"
LIBS="${LIBXML2_LIBS}"
- AC_CHECK_LIB(xml2,xmlParseDoc,HAVE_LIBXML2=yes,HAVE_LIBXML2=no)
LIBS="${SAVED_LIBS}"
fi

@@ -4241,9 +4227,12 @@ dnl ---------------------------------------------------------------------------
dnl Check for SQLite (only if SpatiaLite is not detected)
dnl ---------------------------------------------------------------------------

+HAVE_SQLITE3=no
+AC_ARG_WITH(sqlite3, AS_HELP_STRING([--with-sqlite3[=ARG]], [use SQLite 3 library (ARG=yes or no)]),,)
if test "${HAVE_SPATIALITE}" = "no" -o "${HAVE_SPATIALITE}" = "dlopen" ; then
- SQLITE3_REQ_VERSION="3.0.0"
- AX_LIB_SQLITE3($SQLITE3_REQ_VERSION)
+ if test x"$with_sqlite3" = x"yes" ; then
+ PKG_CHECK_MODULES([SQLITE3], [sqlite3 >= 3.0.0], [HAVE_SQLITE3=yes], [HAVE_SQLITE3=no])
+ fi

if test "$HAVE_SQLITE3" = "yes"; then
LIBS="$SQLITE3_LDFLAGS $LIBS"
@@ -4596,8 +4585,12 @@ dnl ---------------------------------------------------------------------------
dnl Check if geos library is available.
dnl ---------------------------------------------------------------------------

-GEOS_INIT(3.1.0)
+AC_ARG_WITH(geos, AS_HELP_STRING([--with-geos[=ARG]], [Include GEOS support (ARG=yes or no)]),,)
HAVE_GEOS_RESULT="no"
+if test x"$with_geos" = x"no" ; then
+ AC_MSG_RESULT([GEOS support disabled])
+else
+ PKG_CHECK_MODULES([GEOS], [geos >= 3.1.0], [HAVE_GEOS=yes], [HAVE_GEOS=no])
if test "${HAVE_GEOS}" = "yes" ; then

AC_MSG_NOTICE([Using C API from GEOS $GEOS_VERSION])
@@ -4606,6 +4599,7 @@ if test "${HAVE_GEOS}" = "yes" ; then
LIBS="${GEOS_LIBS} ${LIBS}"
HAVE_GEOS_RESULT="yes"
fi
+fi

dnl ---------------------------------------------------------------------------
dnl Check if SFCGAL library is available.
@@ -4640,20 +4634,18 @@ elif test "$with_qhull" = "yes" -o "$with_qhull" = "" ; then
# qhull/qhull.h
AC_CHECK_HEADERS([qhull/libqhull.h])
if test "$ac_cv_header_qhull_libqhull_h" = "yes"; then
- AC_CHECK_LIB(qhull,qh_new_qhull,QHULL_SETTING=yes,QHULL_SETTING=no,)
+ QHULL_SETTING=yes
if test "$QHULL_SETTING" = "yes"; then
QHULL_SETTING=external
QHULL_INCLUDE_SUBDIR_IS_LIBQHULL=0
- LIBS="-lqhull $LIBS"
fi
fi
AC_CHECK_HEADERS([libqhull/libqhull.h])
if test "$ac_cv_header_libqhull_libqhull_h" = "yes"; then
- AC_CHECK_LIB(qhull,qh_new_qhull,QHULL_SETTING=yes,QHULL_SETTING=no,)
+ QHULL_SETTING=yes
if test "$QHULL_SETTING" = "yes"; then
QHULL_SETTING=external
QHULL_INCLUDE_SUBDIR_IS_LIBQHULL=1
- LIBS="-lqhull $LIBS"
fi
fi

@@ -4740,7 +4732,9 @@ AC_MSG_CHECKING([for FreeXL support])
HAVE_FREEXL=no
FREEXL_INCLUDE=

-if test "$with_freexl" = "" -o "$with_freexl" = "yes" ; then
+if test "$with_freexl" = "yes"; then
+ PKG_CHECK_MODULES([FREEXL], [freexl >= 1.0.0], [HAVE_FREEXL=yes], [HAVE_FREEXL=no])
+elif test "$with_freexl" = ""; then
AC_CHECK_HEADERS(freexl.h)
AC_CHECK_LIB(freexl,freexl_open,FREEXL_LIBS="-lfreexl",FREEXL_LIBS=missing)

@@ -4846,8 +4840,7 @@ if test "$with_libjson_c" = "external" -o "$with_libjson_c" = "" -o "$with_libjs
elif test "$with_libjson_c" = "internal" ; then
LIBJSONC_SETTING=internal
elif test "$with_libjson_c" != "no"; then
- LIBS="-L$with_libjson_c/lib $LIBS"
- AC_CHECK_LIB(json-c,json_object_set_serializer,LIBJSONC_SETTING=external,LIBJSONC_SETTING=internal,-L$with_libjson_c/lib)
+ LIBJSONC_SETTING=external
else
AC_MSG_ERROR([libjson-c (internal or external) is required])
fi
@@ -5951,7 +5944,6 @@ else
# Test that the package found is for the right architecture
saved_LIBS="$LIBS"
LIBS="$EXR_LIBS"
- AC_CHECK_LIB(IlmImf,ImfTiledInputReadTile, [HAVE_EXR=yes], [HAVE_EXR=no])
LIBS="$saved_LIBS"

if test "$HAVE_EXR" = "yes"; then
106 changes: 106 additions & 0 deletions recipes/gdal/all/patches/fix-include-jsonc.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
--- a/gcore/gdal_rat.cpp
+++ b/gcore/gdal_rat.cpp
@@ -50,7 +50,7 @@
#pragma clang diagnostic ignored "-Wunknown-pragmas"
#pragma clang diagnostic ignored "-Wdocumentation"
#endif
-#include "json.h"
+#include <json-c/json.h>
#ifdef __clang__
#pragma clang diagnostic pop
#endif
--- a/ogr/ogrsf_frmts/geojson/ogresrijsonreader.cpp
+++ b/ogr/ogrsf_frmts/geojson/ogresrijsonreader.cpp
@@ -37,7 +37,7 @@

#include "cpl_conv.h"
#include "cpl_error.h"
-#include "json.h"
+#include <json-c/json.h>
// #include "json_object.h"
// #include "json_tokener.h"
#include "ogr_api.h"
--- a/ogr/ogrsf_frmts/geojson/ogrgeojsondatasource.cpp
+++ b/ogr/ogrsf_frmts/geojson/ogrgeojsondatasource.cpp
@@ -41,7 +41,7 @@
#include "cpl_string.h"
#include "cpl_vsi.h"
#include "cpl_vsi_error.h"
-#include "json.h"
+#include <json-c/json.h>
// #include "json_object.h"
#include "gdal_utils.h"
#include "gdal.h"
--- a/ogr/ogrsf_frmts/geojson/ogrgeojsonlayer.cpp
+++ b/ogr/ogrsf_frmts/geojson/ogrgeojsonlayer.cpp
@@ -37,7 +37,7 @@
# endif
#endif // !DEBUG_VERBOSE

-#include <json.h>
+#include <json-c/json.h>

#if !DEBUG_JSON
# ifdef __clang
--- a/ogr/ogrsf_frmts/geojson/ogrgeojsonreader.cpp
+++ b/ogr/ogrsf_frmts/geojson/ogrgeojsonreader.cpp
@@ -32,7 +32,7 @@
#include "ogrgeojsonreader.h"
#include "ogrgeojsonutils.h"
#include "ogr_geojson.h"
-#include <json.h> // JSON-C
+#include <json-c/json.h> // JSON-C

#if (!defined(JSON_C_VERSION_NUM)) || (JSON_C_VERSION_NUM < JSON_C_VER_013)
#include <json_object_private.h> // just for sizeof(struct json_object)
--- a/ogr/ogrsf_frmts/geojson/ogrgeojsonutils.cpp
+++ b/ogr/ogrsf_frmts/geojson/ogrgeojsonutils.cpp
@@ -31,7 +31,7 @@
#include <cpl_port.h>
#include <cpl_conv.h>
#include <ogr_geometry.h>
-#include <json.h> // JSON-C
+#include <json-c/json.h> // JSON-C

#include <algorithm>
#include <memory>
--- a/ogr/ogrsf_frmts/geojson/ogrgeojsonwriter.cpp
+++ b/ogr/ogrsf_frmts/geojson/ogrgeojsonwriter.cpp
@@ -33,13 +33,13 @@
#include "ogrgeojsonutils.h"
#include "ogr_geojson.h"
#include "ogrgeojsonreader.h"
-#include <json.h> // JSON-C
+#include <json-c/json.h> // JSON-C

#if (!defined(JSON_C_VERSION_NUM)) || (JSON_C_VERSION_NUM < JSON_C_VER_013)
#include <json_object_private.h>
#endif

-#include <printbuf.h>
+#include <json-c/printbuf.h>
#include <ogr_api.h>
#include <ogr_p.h>

--- a/ogr/ogrsf_frmts/geojson/ogrtopojsonreader.cpp
+++ b/ogr/ogrsf_frmts/geojson/ogrtopojsonreader.cpp
@@ -29,7 +29,7 @@
#include "ogrgeojsonreader.h"
#include "ogrgeojsonutils.h"
#include "ogr_geojson.h"
-#include <json.h> // JSON-C
+#include <json-c/json.h> // JSON-C
#include <ogr_api.h>

CPL_CVSID("$Id: ogrtopojsonreader.cpp 3a7914cee018d5b65dc1639368edbd8faac2543d 2020-01-07 22:30:27 +0100 Even Rouault $")
--- a/port/cpl_json_header.h
+++ b/port/cpl_json_header.h
@@ -33,7 +33,7 @@
#pragma GCC system_header
#endif

-#include <json.h>
+#include <json-c/json.h>

#undef json_object_object_foreachC
#define json_object_object_foreachC(obj,iter) \
Loading