diff --git a/0001-adapt-to-poppler-0.58.patch b/0001-adapt-to-poppler-0.58.patch new file mode 100644 index 0000000..b2819da --- /dev/null +++ b/0001-adapt-to-poppler-0.58.patch @@ -0,0 +1,105 @@ +From 6a4adabfd7e02e6fef99049e8e2373b12b559e69 Mon Sep 17 00:00:00 2001 +From: David Tardon +Date: Wed, 6 Sep 2017 12:58:12 +0200 +Subject: [PATCH] adapt to poppler 0.58 + +--- + gb.pdf/configure.ac | 2 ++ + gb.pdf/src/CPdfDocument.cpp | 24 ++++++++++++++++++++++++ + 2 files changed, 26 insertions(+) + +diff --git a/gb.pdf/configure.ac b/gb.pdf/configure.ac +index 25b344a9a..be4bf9557 100644 +--- a/gb.pdf/configure.ac ++++ b/gb.pdf/configure.ac +@@ -29,6 +29,8 @@ if test "$have_poppler" = "yes"; then + AC_DEFINE_UNQUOTED(POPPLER_VERSION_0_17, $((1-$?)), Poppler version >= 0.17) + pkg-config --atleast-version=0.20.0 poppler + AC_DEFINE_UNQUOTED(POPPLER_VERSION_0_20, $((1-$?)), Poppler version >= 0.20) ++ pkg-config --atleast-version=0.58.0 poppler ++ AC_DEFINE_UNQUOTED(POPPLER_VERSION_0_58, $((1-$?)), Poppler version >= 0.58) + fi + + AC_OUTPUT( \ +diff --git a/gb.pdf/src/CPdfDocument.cpp b/gb.pdf/src/CPdfDocument.cpp +index 43802c77b..80d2d97c5 100644 +--- a/gb.pdf/src/CPdfDocument.cpp ++++ b/gb.pdf/src/CPdfDocument.cpp +@@ -132,11 +132,19 @@ static void aux_return_string_info(void *_object, const char *key) + Dict *info_dict; + char *tmpstr; + ++ #if POPPLER_VERSION_0_58 ++ obj = THIS->doc->getDocInfo (); ++ #else + THIS->doc->getDocInfo (&obj); ++ #endif + if (!obj.isDict()) { GB.ReturnNewZeroString(""); return; } + + info_dict=obj.getDict(); ++ #if POPPLER_VERSION_0_58 ++ dst = info_dict->lookup ((char *)key); ++ #else + info_dict->lookup ((char *)key, &dst); ++ #endif + if (!dst.isString ()) { GB.ReturnNewZeroString(""); } + else { + goo_value = dst.getString(); +@@ -149,8 +157,10 @@ static void aux_return_string_info(void *_object, const char *key) + else + GB.ReturnNewString(goo_value->getCString(),goo_value->getLength()); + } ++ #if ! POPPLER_VERSION_0_58 + dst.free(); + obj.free(); ++ #endif + } + + static void aux_return_date_info(void *_object, const char *key) +@@ -167,11 +177,19 @@ static void aux_return_date_info(void *_object, const char *key) + + GB.ReturnDate(NULL); + ++ #if POPPLER_VERSION_0_58 ++ obj = THIS->doc->getDocInfo (); ++ #else + THIS->doc->getDocInfo (&obj); ++ #endif + if (!obj.isDict()) return; + + info_dict=obj.getDict(); ++ #if POPPLER_VERSION_0_58 ++ dst = info_dict->lookup ((char *)key); ++ #else + info_dict->lookup ((char *)key, &dst); ++ #endif + if (dst.isString ()) + { + goo = dst.getString(); +@@ -197,8 +215,10 @@ static void aux_return_date_info(void *_object, const char *key) + } + + if (tofree) GB.FreeString(&tofree); ++ #if ! POPPLER_VERSION_0_58 + dst.free(); + obj.free(); ++ #endif + } + + static LinkDest *get_dest(LinkAction *act) +@@ -426,8 +446,12 @@ int32_t open_document (void *_object, char *sfile, int32_t lfile) + + if ( GB.LoadFile(sfile,lfile,&buf,&len) ) return -1; + ++ #if POPPLER_VERSION_0_58 ++ stream=new MemStream(buf,0,(Guint)len,std::move(obj)); ++ #else + obj.initNull(); + stream=new MemStream(buf,0,(Guint)len,&obj); ++ #endif + test=new PDFDoc (stream,0,0); + + if (!test->isOk()) +-- +2.13.5 + diff --git a/gambas3.spec b/gambas3.spec index 5d5ac24..4fffd70 100644 --- a/gambas3.spec +++ b/gambas3.spec @@ -12,7 +12,7 @@ Name: gambas3 Summary: IDE based on a basic interpreter with object extensions Version: 3.10.0 -Release: 3%{?dist} +Release: 4%{?dist} License: GPL+ Group: Development/Tools URL: http://gambas.sourceforge.net/ @@ -52,6 +52,8 @@ Patch2: %{name}-3.2.0-noliconv.patch Patch5: gambas3-3.1.1-linux-siginfo.patch # Fix incorrect quotes causing SDL2 detection failures Patch7: gambas3-3.9.2-gb.sdl2-quotefix.patch +# https://gitlab.com/gambas/gambas/merge_requests/14 +Patch8: 0001-adapt-to-poppler-0.58.patch %description Gambas3 is a free development environment based on a Basic interpreter @@ -963,6 +965,7 @@ Requires: %{name}-gb-xml = %{version}-%{release} %patch1 -p1 -b .nolintl %patch2 -p1 -b .noliconv %patch7 -p1 -b .quotefix +%patch8 -p1 -b .poppler # %%patch5 -p1 -b .linux-siginfo # We used to patch these out, but this is simpler. for i in `find . |grep acinclude.m4`; do @@ -1614,6 +1617,9 @@ update-mime-database %{?fedora:-n} %{_datadir}/mime &> /dev/null || : %{_datadir}/%{name}/info/gb.xml.xslt.* %changelog +* Fri Sep 08 2017 David Tardon - 3.10.0-4 +- rebuild for poppler 0.59.0 + * Thu Aug 03 2017 David Tardon - 3.10.0-3 - rebuild for poppler 0.57.0