From c8574ab6a3cd5fcfb8929ba559654d7bcd8cbed9 Mon Sep 17 00:00:00 2001 From: Alexey Pavlov Date: Fri, 11 Jan 2019 12:57:22 +0300 Subject: [PATCH] gdal: Rebuild with poppler-0.73 --- ....patch => 0010-poppler-0_73-support.patch} | 55 +++++++++++++++++-- mingw-w64-gdal/PKGBUILD | 8 +-- 2 files changed, 54 insertions(+), 9 deletions(-) rename mingw-w64-gdal/{0010-poppler-0_72-support.patch => 0010-poppler-0_73-support.patch} (72%) diff --git a/mingw-w64-gdal/0010-poppler-0_72-support.patch b/mingw-w64-gdal/0010-poppler-0_73-support.patch similarity index 72% rename from mingw-w64-gdal/0010-poppler-0_72-support.patch rename to mingw-w64-gdal/0010-poppler-0_73-support.patch index db5eb73aed..de3fbbdfc1 100644 --- a/mingw-w64-gdal/0010-poppler-0_72-support.patch +++ b/mingw-w64-gdal/0010-poppler-0_73-support.patch @@ -1,18 +1,42 @@ diff -Naur gdal-2.4.0-orig/configure.ac gdal-2.4.0/configure.ac --- gdal-2.4.0-orig/configure.ac 2018-12-15 00:34:19.000000000 +0300 +++ gdal-2.4.0/configure.ac 2018-12-25 11:58:47.052523400 +0300 -@@ -4499,6 +4499,7 @@ +@@ -4499,6 +4499,8 @@ POPPLER_0_23_OR_LATER=no POPPLER_0_58_OR_LATER=no POPPLER_0_69_OR_LATER=no +POPPLER_0_72_OR_LATER=no ++POPPLER_0_73_OR_LATER=no AC_MSG_CHECKING([for poppler]) -@@ -4540,6 +4541,30 @@ +@@ -4540,6 +4541,53 @@ CHECK_OTHER_POPPLER_VERSION=yes if test "$CHECK_OTHER_POPPLER_VERSION" = "yes"; then ++ AC_MSG_CHECKING([if poppler have gtypes.h header]) ++ rm -f testpoppler.* ++ echo '#include ' > testpoppler.cpp ++ echo 'int main(int argc, char** argv) {' >> testpoppler.cpp ++ echo 'return 0; }' >> testpoppler.cpp ++ if test -z "`${CXX} ${CXXFLAGS} ${CPPFLAGS} testpoppler.cpp -c ${POPPLER_INC} 2>&1`" ; then ++ AC_MSG_RESULT([yes]) ++ else ++ POPPLER_0_73_OR_LATER=yes ++ POPPLER_0_72_OR_LATER=yes ++ POPPLER_0_71_OR_LATER=yes ++ POPPLER_0_69_OR_LATER=yes ++ POPPLER_0_58_OR_LATER=yes ++ POPPLER_0_23_OR_LATER=yes ++ POPPLER_0_20_OR_LATER=yes ++ POPPLER_BASE_STREAM_HAS_TWO_ARGS=yes ++ POPPLER_HAS_OPTCONTENT=yes ++ CHECK_OTHER_POPPLER_VERSION=no ++ AC_MSG_RESULT([no]) ++ fi ++ fi ++ ++ if test "$CHECK_OTHER_POPPLER_VERSION" = "yes"; then + AC_MSG_CHECKING([if GooString has API >= 0.72.0]) + rm -f testpoppler.* + echo '#include ' > testpoppler.cpp @@ -40,24 +64,29 @@ diff -Naur gdal-2.4.0-orig/configure.ac gdal-2.4.0/configure.ac AC_MSG_CHECKING([if OptionalContent has API >= 0.69.0]) rm -f testpoppler.* echo '#include ' > testpoppler.cpp -@@ -4663,6 +4688,7 @@ +@@ -4663,6 +4688,8 @@ AC_SUBST(POPPLER_0_23_OR_LATER, $POPPLER_0_23_OR_LATER) AC_SUBST(POPPLER_0_58_OR_LATER, $POPPLER_0_58_OR_LATER) AC_SUBST(POPPLER_0_69_OR_LATER, $POPPLER_0_69_OR_LATER) +AC_SUBST(POPPLER_0_72_OR_LATER, $POPPLER_0_72_OR_LATER) ++AC_SUBST(POPPLER_0_73_OR_LATER, $POPPLER_0_73_OR_LATER) AC_SUBST(POPPLER_INC, $POPPLER_INC) AC_SUBST(POPPLER_PLUGIN_LIB, $POPPLER_PLUGIN_LIB) diff -Naur gdal-2.4.0-orig/frmts/pdf/GNUmakefile gdal-2.4.0/frmts/pdf/GNUmakefile --- gdal-2.4.0-orig/frmts/pdf/GNUmakefile 2018-12-15 00:34:20.000000000 +0300 +++ gdal-2.4.0/frmts/pdf/GNUmakefile 2018-12-25 11:59:44.039423500 +0300 -@@ -38,6 +38,10 @@ +@@ -38,6 +38,14 @@ CPPFLAGS += -DPOPPLER_0_69_OR_LATER endif +ifeq ($(POPPLER_0_72_OR_LATER),yes) +CPPFLAGS += -DPOPPLER_0_72_OR_LATER +endif ++ ++ifeq ($(POPPLER_0_73_OR_LATER),yes) ++CPPFLAGS += -DPOPPLER_0_73_OR_LATER ++endif + ifeq ($(HAVE_PODOFO),yes) CPPFLAGS += -DHAVE_PODOFO @@ -116,14 +145,30 @@ diff -Naur gdal-2.4.0-orig/frmts/pdf/pdfobject.cpp gdal-2.4.0/frmts/pdf/pdfobjec pszContent[m_nLength] = '\0'; } delete gstr; +diff -Naur gdal-2.4.0-orig/frmts/pdf/pdfsdk_headers.h gdal-2.4.0/frmts/pdf/pdfsdk_headers.h +--- gdal-2.4.0-orig/frmts/pdf/pdfsdk_headers.h 2018-12-15 00:37:15.000000000 +0300 ++++ gdal-2.4.0/frmts/pdf/pdfsdk_headers.h 2018-12-25 12:05:19.681549600 +0300 +@@ -50,7 +50,11 @@ + #pragma warning( disable : 4244 ) /* conversion from 'const int' to 'Guchar', possible loss of data */ + #endif + ++#if defined(POPPLER_0_73_OR_LATER) ++typedef unsigned char Guchar; ++#else + #include ++#endif + #include + + /* begin of poppler xpdf includes */ diff -Naur gdal-2.4.0-orig/GDALmake.opt.in gdal-2.4.0/GDALmake.opt.in --- gdal-2.4.0-orig/GDALmake.opt.in 2018-12-15 00:34:19.000000000 +0300 +++ gdal-2.4.0/GDALmake.opt.in 2018-12-25 11:55:57.757409400 +0300 -@@ -482,6 +482,7 @@ +@@ -482,6 +482,8 @@ POPPLER_0_23_OR_LATER = @POPPLER_0_23_OR_LATER@ POPPLER_0_58_OR_LATER = @POPPLER_0_58_OR_LATER@ POPPLER_0_69_OR_LATER = @POPPLER_0_69_OR_LATER@ +POPPLER_0_72_OR_LATER = @POPPLER_0_72_OR_LATER@ ++POPPLER_0_73_OR_LATER = @POPPLER_0_73_OR_LATER@ POPPLER_INC = @POPPLER_INC@ POPPLER_PLUGIN_LIB = @POPPLER_PLUGIN_LIB@ diff --git a/mingw-w64-gdal/PKGBUILD b/mingw-w64-gdal/PKGBUILD index 32683693b5..e18153a3a8 100644 --- a/mingw-w64-gdal/PKGBUILD +++ b/mingw-w64-gdal/PKGBUILD @@ -8,7 +8,7 @@ _realname=gdal pkgbase=mingw-w64-${_realname} pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}" pkgver=2.4.0 -pkgrel=1 +pkgrel=2 pkgdesc="A translator library for raster geospatial data formats (mingw-w64)" arch=('any') url="http://www.gdal.org/" @@ -51,11 +51,11 @@ options=('strip' 'staticlibs') source=(http://download.osgeo.org/${_realname}/${pkgver}/${_realname}-${pkgver}.tar.gz 0001-external-qhull-static.patch 0002-libproj4-dll-name.patch - 0010-poppler-0_72-support.patch) + 0010-poppler-0_73-support.patch) sha256sums=('a568cf3dc7bb203ae12a48e1eb2a42302cded499ef6eccaf9e8f09187d8ce75a' '6952586cd4436003748e8d99f2e8e8a660ba59bdb3c0b294493695ef57f93077' '392123102d2884dfd91f4cdd89041c2f84467f40a60659cfc65c5e9983c15c6e' - '40868b7be157637c1cf3bad8125adc7cb65d1690c6fac09e252963d5762a1791') + '0f36fdbcfea47126971a289c6da4f1fcef8964c050e9d4886c0b91f70a74d9ce') prepare() { [[ -d ${srcdir}/build-${MINGW_CHOST} ]] && rm -rf ${srcdir}/build-${MINGW_CHOST} @@ -72,7 +72,7 @@ prepare() { #patch -p1 -i ${srcdir}/0001-external-qhull-static.patch patch -p1 -i ${srcdir}/0002-libproj4-dll-name.patch - patch -p1 -i ${srcdir}/0010-poppler-0_72-support.patch + patch -p1 -i ${srcdir}/0010-poppler-0_73-support.patch # bug: http://osgeo-org.1560.x6.nabble.com/gdal-dev-jpeg2000-jasper-error-compiling-gdal-2-1-from-git-release-branch-td5299100.html sed -i -e 's@uchar@unsigned char@' frmts/jpeg2000/jpeg2000_vsil_io.cpp