Gentoo Archives: gentoo-commits

From: Andreas Sturmlechner <asturm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: kde-apps/kitinerary/files/, kde-apps/kitinerary/
Date: Fri, 01 Nov 2019 18:39:38
Message-Id: 1572633562.7341b195af4dee435c8a27ed0a8601b474362292.asturm@gentoo
1 commit: 7341b195af4dee435c8a27ed0a8601b474362292
2 Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
3 AuthorDate: Fri Nov 1 17:55:29 2019 +0000
4 Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
5 CommitDate: Fri Nov 1 18:39:22 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7341b195
7
8 kde-apps/kitinerary: Fix build with poppler-0.82.0
9
10 Package-Manager: Portage-2.3.78, Repoman-2.3.17
11 Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>
12
13 .../files/kitinerary-19.08.2-poppler-0.82.patch | 127 +++++++++++++++++++++
14 kde-apps/kitinerary/kitinerary-19.08.2.ebuild | 2 +
15 2 files changed, 129 insertions(+)
16
17 diff --git a/kde-apps/kitinerary/files/kitinerary-19.08.2-poppler-0.82.patch b/kde-apps/kitinerary/files/kitinerary-19.08.2-poppler-0.82.patch
18 new file mode 100644
19 index 00000000000..be2152dafef
20 --- /dev/null
21 +++ b/kde-apps/kitinerary/files/kitinerary-19.08.2-poppler-0.82.patch
22 @@ -0,0 +1,127 @@
23 +From 0f8b2babcc69c490ae6548bda7ceeb1ffd27a9e3 Mon Sep 17 00:00:00 2001
24 +From: Volker Krause <vkrause@×××.org>
25 +Date: Sun, 29 Sep 2019 12:51:57 +0200
26 +Subject: Fix compatibility with Poppler 0.82
27 +
28 +---
29 + CMakeLists.txt | 17 ++++++-----------
30 + src/config-kitinerary.h.cmake | 1 +
31 + src/pdf/pdfextractoroutputdevice.cpp | 2 +-
32 + src/pdf/pdfextractoroutputdevice_p.h | 3 ++-
33 + src/pdf/popplertypes_p.h | 30 ++++++++++++++++++++++++++++++
34 + 5 files changed, 40 insertions(+), 13 deletions(-)
35 + create mode 100644 src/pdf/popplertypes_p.h
36 +
37 +diff --git a/CMakeLists.txt b/CMakeLists.txt
38 +index cb222d9..1d66d3b 100644
39 +--- a/CMakeLists.txt
40 ++++ b/CMakeLists.txt
41 +@@ -62,17 +62,12 @@ if(TARGET Poppler::Core)
42 + if (${Poppler_VERSION} VERSION_GREATER 0.68)
43 + set(HAVE_POPPLER_0_69 ON)
44 + endif()
45 +- set(CMAKE_REQUIRED_LIBRARIES Poppler::Core Qt5::Core)
46 +- check_cxx_source_compiles("
47 +- #include <goo/GooString.h>
48 +- #include <QString>
49 +- int main()
50 +- {
51 +- GooString s;
52 +- QString val = QString::fromUtf8(s.c_str());
53 +- return 0;
54 +- }
55 +- " HAVE_POPPLER_0_72)
56 ++ if (${Poppler_VERSION} VERSION_GREATER 0.71)
57 ++ set(HAVE_POPPLER_0_72 ON)
58 ++ endif()
59 ++ if (${Poppler_VERSION} VERSION_GREATER 0.81)
60 ++ set(HAVE_POPPLER_0_82 ON)
61 ++ endif()
62 + endif()
63 +
64 + if (TARGET ZXing::Core)
65 +diff --git a/src/config-kitinerary.h.cmake b/src/config-kitinerary.h.cmake
66 +index b0bda20..6d3b156 100644
67 +--- a/src/config-kitinerary.h.cmake
68 ++++ b/src/config-kitinerary.h.cmake
69 +@@ -24,6 +24,7 @@
70 + #cmakedefine HAVE_POPPLER_0_58
71 + #cmakedefine HAVE_POPPLER_0_69
72 + #cmakedefine HAVE_POPPLER_0_72
73 ++#cmakedefine HAVE_POPPLER_0_82
74 +
75 + #cmakedefine HAVE_ZXING
76 +
77 +diff --git a/src/pdf/pdfextractoroutputdevice.cpp b/src/pdf/pdfextractoroutputdevice.cpp
78 +index 2a06c82..0027cad 100644
79 +--- a/src/pdf/pdfextractoroutputdevice.cpp
80 ++++ b/src/pdf/pdfextractoroutputdevice.cpp
81 +@@ -30,7 +30,7 @@ PdfExtractorOutputDevice::PdfExtractorOutputDevice()
82 + {
83 + }
84 +
85 +-void PdfExtractorOutputDevice::drawImage(GfxState* state, Object* ref, Stream* str, int width, int height, GfxImageColorMap* colorMap, bool interpolate, int* maskColors, bool inlineImg)
86 ++void PdfExtractorOutputDevice::drawImage(GfxState* state, Object* ref, Stream* str, int width, int height, GfxImageColorMap* colorMap, bool interpolate, PopplerMaskColors* maskColors, bool inlineImg)
87 + {
88 + Q_UNUSED(str);
89 + Q_UNUSED(interpolate);
90 +diff --git a/src/pdf/pdfextractoroutputdevice_p.h b/src/pdf/pdfextractoroutputdevice_p.h
91 +index 9241f9f..5d448d3 100644
92 +--- a/src/pdf/pdfextractoroutputdevice_p.h
93 ++++ b/src/pdf/pdfextractoroutputdevice_p.h
94 +@@ -21,6 +21,7 @@
95 + #include <config-kitinerary.h>
96 +
97 + #include "pdfvectorpicture_p.h"
98 ++#include "popplertypes_p.h"
99 +
100 + #ifdef HAVE_POPPLER
101 + #include <TextOutputDev.h>
102 +@@ -43,7 +44,7 @@ public:
103 + void finalize();
104 +
105 + bool needNonText() override { return true; }
106 +- void drawImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, bool interpolate, int *maskColors, bool inlineImg) override;
107 ++ void drawImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, bool interpolate, PopplerMaskColors *maskColors, bool inlineImg) override;
108 +
109 + // operations used to detect vector barcodes
110 + void saveState(GfxState *state) override;
111 +diff --git a/src/pdf/popplertypes_p.h b/src/pdf/popplertypes_p.h
112 +new file mode 100644
113 +index 0000000..f9d844a
114 +--- /dev/null
115 ++++ b/src/pdf/popplertypes_p.h
116 +@@ -0,0 +1,30 @@
117 ++/*
118 ++ Copyright (C) 2019 Volker Krause <vkrause@×××.org>
119 ++
120 ++ This program is free software; you can redistribute it and/or modify it
121 ++ under the terms of the GNU Library General Public License as published by
122 ++ the Free Software Foundation; either version 2 of the License, or (at your
123 ++ option) any later version.
124 ++
125 ++ This program is distributed in the hope that it will be useful, but WITHOUT
126 ++ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
127 ++ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
128 ++ License for more details.
129 ++
130 ++ You should have received a copy of the GNU General Public License
131 ++ along with this program. If not, see <https://www.gnu.org/licenses/>.
132 ++*/
133 ++
134 ++#ifndef KITINERARY_POPPLERTYPES_P_H
135 ++#define KITINERARY_POPPLERTYPES_P_H
136 ++
137 ++#include <config-kitinerary.h>
138 ++
139 ++#ifdef HAVE_POPPLER_0_82
140 ++using PopplerMaskColors = const int;
141 ++#else
142 ++using PopplerMaskColors = int;
143 ++#endif
144 ++
145 ++#endif // KITINERARY_POPPLERTYPES_P_H
146 ++
147 +--
148 +cgit v1.1
149 +
150
151 diff --git a/kde-apps/kitinerary/kitinerary-19.08.2.ebuild b/kde-apps/kitinerary/kitinerary-19.08.2.ebuild
152 index c813a4246b4..3ad5d865506 100644
153 --- a/kde-apps/kitinerary/kitinerary-19.08.2.ebuild
154 +++ b/kde-apps/kitinerary/kitinerary-19.08.2.ebuild
155 @@ -31,6 +31,8 @@ RDEPEND="${DEPEND}
156 !<kde-apps/kdepim-addons-18.07.80
157 "
158
159 +PATCHES=( "${FILESDIR}"/${P}-poppler-0.82.patch )
160 +
161 src_configure() {
162 local mycmakeargs=(
163 $(cmake-utils_use_find_package barcode ZXing)