summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
author Matteo Bernardini2022-08-22 19:08:44 +0200
committer Matteo Bernardini2022-10-01 10:28:21 +0200
commiteb2c940a420c2e2b02a5d4b8283e46682d0c1cd3 (patch)
tree6838fc79dab0178a5c7ca077718231c6900501d4
parent1bbfcb24994b4f85d5525c6a462e1110099ea32e (diff)
downloadslackbuilds-podofo.tar.gz
libraries/podofo: Updated for version 0.9.8, patch for gcc >= 12.x.podofo
Signed-off-by: Matteo Bernardini <ponce@slackbuilds.org>
-rw-r--r--libraries/podofo/XRefStrParObj-deprecated.patch61
-rw-r--r--libraries/podofo/gcc12.patch39
-rw-r--r--libraries/podofo/podofo.SlackBuild14
-rw-r--r--libraries/podofo/podofo.info6
4 files changed, 49 insertions, 71 deletions
diff --git a/libraries/podofo/XRefStrParObj-deprecated.patch b/libraries/podofo/XRefStrParObj-deprecated.patch
deleted file mode 100644
index d2a74b68b5..0000000000
--- a/libraries/podofo/XRefStrParObj-deprecated.patch
+++ /dev/null
@@ -1,61 +0,0 @@
-diff -Naur podofo-0.9.6.orig/src/base/PdfXRefStreamParserObject.h podofo-0.9.6/src/base/PdfXRefStreamParserObject.h
---- podofo-0.9.6.orig/src/base/PdfXRefStreamParserObject.h 2014-06-06 22:13:22.000000000 +0000
-+++ podofo-0.9.6/src/base/PdfXRefStreamParserObject.h 2020-05-03 02:26:01.119538387 +0000
-@@ -47,8 +47,11 @@
- * an XRef stream object.
- *
- * It is mainly here to make PdfParser more modular.
-+ * This is only marked PODOFO_API for the benefit of the tests,
-+ * the class is for internal use only. It is deprecated, so
-+ * don't ever rely on it (i.e. externally or in PoDoFo tools).
- */
--class PdfXRefStreamParserObject : public PdfParserObject {
-+class PODOFO_DEPRECATED PODOFO_API PdfXRefStreamParserObject : public PdfParserObject {
- public:
-
- /** Parse the object data from the given file handle starting at
-diff -Naur podofo-0.9.6.orig/src/base/podofoapi.h podofo-0.9.6/src/base/podofoapi.h
---- podofo-0.9.6.orig/src/base/podofoapi.h 2017-10-27 06:38:19.000000000 +0000
-+++ podofo-0.9.6/src/base/podofoapi.h 2020-05-03 02:27:03.874537513 +0000
-@@ -173,9 +173,22 @@
-
- /* Set up some other compiler-specific but not platform-specific macros */
-
--#if defined(__GNUC__)
-- /* gcc will issue a warning if a function or variable so annotated is used */
-- #define PODOFO_DEPRECATED __attribute__((deprecated))
-+#ifdef __GNU__
-+ #define PODOFO_HAS_GCC_ATTRIBUTE_DEPRECATED 1
-+#elif defined(__has_attribute)
-+ #if __has_attribute(__deprecated__)
-+ #define PODOFO_HAS_GCC_ATTRIBUTE_DEPRECATED 1
-+ #endif
-+#endif
-+
-+#ifdef PODOFO_HAS_GCC_ATTRIBUTE_DEPRECATED
-+ /* gcc (or compat. clang) will issue a warning if a function or variable so annotated is used */
-+ #define PODOFO_DEPRECATED __attribute__((__deprecated__))
-+#else
-+ #define PODOFO_DEPRECATED
-+#endif
-+
-+#ifdef __GNU__
- /* gcc can do some additional optimisations on functions annotated as pure.
- * See the documentation on __attribute__((pure)) in the gcc docs. */
- #define PODOFO_PURE_FUNCTION __attribute__((pure))
-@@ -185,9 +198,12 @@
- * (see CODINGSTYLE.txt) .*/
- #define PODOFO_NOTHROW __attribute__((nothrow))
- #else
-- #define PODOFO_DEPRECATED
-- #define PODOFO_PURE_FUNCTION
-- #define PODOFO_NOTHROW __declspec(nothrow)
-+ #define PODOFO_PURE_FUNCTION
-+ #ifdef _MSC_VER
-+ #define PODOFO_NOTHROW __declspec(nothrow)
-+ #else
-+ #define PODOFO_NOTHROW
-+ #endif
- #endif
-
- // Peter Petrov 27 April 2008
diff --git a/libraries/podofo/gcc12.patch b/libraries/podofo/gcc12.patch
new file mode 100644
index 0000000000..1bd71721e3
--- /dev/null
+++ b/libraries/podofo/gcc12.patch
@@ -0,0 +1,39 @@
+From d0e9f5d503b0cb79516ec9bff989f3d7d625b678 Mon Sep 17 00:00:00 2001
+From: Pino Toscano <toscano.pino@tiscali.it>
+Date: Sun, 14 Aug 2022 08:27:13 +0200
+Subject: [PATCH] Fix declaration of operator<< for PoDoFo::PdfString
+
+Since PdfString is in the PoDoFo namespace, the operator<< for it must
+be in the same namespace as well, otherwise it is not found. In
+particular, operator<<(std::ostream&) is needed by cppunit as a way to
+get the string representation of an arbitrary type, when using
+CPPUNIT_ASSERT_EQUAL() on instances of it.
+
+This used to work with GCC until 11 because of a buggy behaviour.
+GCC 12 fixed it [1], causing this test to fail to build with it.
+
+[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51577
+---
+ test/unit/StringTest.cpp | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/test/unit/StringTest.cpp b/test/unit/StringTest.cpp
+index a7841f78..b52b7880 100644
+--- a/test/unit/StringTest.cpp
++++ b/test/unit/StringTest.cpp
+@@ -29,11 +29,15 @@ using namespace PoDoFo;
+ // Registers the fixture into the 'registry'
+ CPPUNIT_TEST_SUITE_REGISTRATION( StringTest );
+
++namespace PoDoFo {
++
+ inline std::ostream& operator<<(std::ostream& o, const PdfString& s)
+ {
+ return o << s.GetStringUtf8();
+ }
+
++}
++
+ void StringTest::setUp()
+ {
+ }
diff --git a/libraries/podofo/podofo.SlackBuild b/libraries/podofo/podofo.SlackBuild
index 8484a157da..d425cbd091 100644
--- a/libraries/podofo/podofo.SlackBuild
+++ b/libraries/podofo/podofo.SlackBuild
@@ -29,8 +29,8 @@
cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=podofo
-VERSION=${VERSION:-0.9.6}
-BUILD=${BUILD:-2}
+VERSION=${VERSION:-0.9.8}
+BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
@@ -80,12 +80,13 @@ find -L . \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \+
-sed -i "s/BINARY_DIR}\/objects\"/BINARY_DIR}\/objects\" || true/" test/TokenizerTest/CMakeLists.txt
+# Thanks to chrisretusn on LQ!
+patch -p1 < $CWD/gcc12.patch
+
+sed -i "s/BINARY_DIR}\/objects\"/BINARY_DIR}\/objects\" || true/" test/TokenizerTest/CMakeLists.txt || exit 1
# Fix mandir directory.
-sed -i 's|share/man|man|' CMakeLists.txt
-# Ref: https://sourceforge.net/p/podofo/tickets/28/
-patch -p1 < $CWD/XRefStrParObj-deprecated.patch
+sed -i 's|share/man|man|' CMakeLists.txt || exit 1
mkdir build
cd build
@@ -96,7 +97,6 @@ cd build
-DPODOFO_BUILD_STATIC:BOOL=FALSE \
-DPODOFO_BUILD_SHARED:BOOL=TRUE \
-DPODOFO_USE_VISIBILITY:BOOL=1 \
- -DCMAKE_CXX_STANDARD:STRING=11 \
-DWANT_BOOST:BOOL=1 \
-DLIB_SUFFIX:STRING="$LIBDIRSUFFIX" \
-DCMAKE_BUILD_TYPE=Release ..
diff --git a/libraries/podofo/podofo.info b/libraries/podofo/podofo.info
index 5a97ef24ef..5d3f34b904 100644
--- a/libraries/podofo/podofo.info
+++ b/libraries/podofo/podofo.info
@@ -1,8 +1,8 @@
PRGNAM="podofo"
-VERSION="0.9.6"
+VERSION="0.9.8"
HOMEPAGE="http://podofo.sourceforge.net/"
-DOWNLOAD="http://downloads.sourceforge.net/podofo/podofo-0.9.6.tar.gz"
-MD5SUM="46336fc4c4ce4be814bb5fbb4d918334"
+DOWNLOAD="http://downloads.sourceforge.net/podofo/podofo-0.9.8.tar.gz"
+MD5SUM="f6d3d5f917c7150c44fc6a15848442dd"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES=""