gdal: Rebuild with poppler-0.73

This commit is contained in:
Alexey Pavlov
2019-01-11 12:57:22 +03:00
parent 5c49c82a69
commit c8574ab6a3
2 changed files with 54 additions and 9 deletions

View File

@@ -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 <poppler/goo/gtypes.h>' > 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 <poppler/goo/GooString.h>' > 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 <poppler/OptionalContent.h>' > 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 <goo/gtypes.h>
+#endif
#include <goo/GooList.h>
/* 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@

View File

@@ -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