1 |
commit: de5382db2e3649bced7f3b6b8edcda0a0ca5dee2 |
2 |
Author: Marek Szuba <marecki <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Dec 22 12:47:40 2020 +0000 |
4 |
Commit: Marek Szuba <marecki <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Dec 22 12:50:28 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=de5382db |
7 |
|
8 |
app-text/podofo: migrate to lua-single.eclass |
9 |
|
10 |
CMake-based => the usual treatment. |
11 |
|
12 |
Compatibility - upstream officially supports only lua5.1 but it turns out |
13 |
that with the 5.2 fix which was already included in the unmigrated ebuild, |
14 |
it builds and installs fine even against 5.4. |
15 |
|
16 |
Closes: https://bugs.gentoo.org/752567 |
17 |
Signed-off-by: Marek Szuba <marecki <AT> gentoo.org> |
18 |
|
19 |
.../podofo-0.9.6_p20190928-cmake_lua_version.patch | 15 ++ |
20 |
app-text/podofo/podofo-0.9.6_p20190928-r100.ebuild | 159 +++++++++++++++++++++ |
21 |
profiles/package.mask | 1 + |
22 |
3 files changed, 175 insertions(+) |
23 |
|
24 |
diff --git a/app-text/podofo/files/podofo-0.9.6_p20190928-cmake_lua_version.patch b/app-text/podofo/files/podofo-0.9.6_p20190928-cmake_lua_version.patch |
25 |
new file mode 100644 |
26 |
index 00000000000..f178ae2a6c0 |
27 |
--- /dev/null |
28 |
+++ b/app-text/podofo/files/podofo-0.9.6_p20190928-cmake_lua_version.patch |
29 |
@@ -0,0 +1,15 @@ |
30 |
+Switch from the non-standard upstream CMake Lua module to the one bundled |
31 |
+with CMake, use only the Lua version requested by the ebuild, and do not |
32 |
+semi-quietly ignore the absence of Lua. |
33 |
+ |
34 |
+--- a/CMakeLists.txt |
35 |
++++ b/CMakeLists.txt |
36 |
+@@ -433,7 +433,7 @@ |
37 |
+ ENDIF(WANT_FONTCONFIG) |
38 |
+ |
39 |
+ IF(NOT PODOFO_BUILD_LIB_ONLY) |
40 |
+-FIND_PACKAGE(LUA) |
41 |
++FIND_PACKAGE(Lua ${LUA_VERSION} EXACT REQUIRED) |
42 |
+ IF(LUA_FOUND) |
43 |
+ # If we have lua, we can build podofoimpose. |
44 |
+ MESSAGE("Lua found - PoDoFoImpose and PoDoFoColor will be built with Lua support") |
45 |
|
46 |
diff --git a/app-text/podofo/podofo-0.9.6_p20190928-r100.ebuild b/app-text/podofo/podofo-0.9.6_p20190928-r100.ebuild |
47 |
new file mode 100644 |
48 |
index 00000000000..cf6bcc0de02 |
49 |
--- /dev/null |
50 |
+++ b/app-text/podofo/podofo-0.9.6_p20190928-r100.ebuild |
51 |
@@ -0,0 +1,159 @@ |
52 |
+# Copyright 1999-2020 Gentoo Authors |
53 |
+# Distributed under the terms of the GNU General Public License v2 |
54 |
+ |
55 |
+EAPI=7 |
56 |
+ |
57 |
+LUA_COMPAT=( lua5-{1..4} ) |
58 |
+ |
59 |
+inherit cmake flag-o-matic lua-single toolchain-funcs |
60 |
+ |
61 |
+DESCRIPTION="PoDoFo is a C++ library to work with the PDF file format" |
62 |
+HOMEPAGE="https://sourceforge.net/projects/podofo/" |
63 |
+SRC_URI="https://dev.gentoo.org/~zmedico/dist/${P}.tar.xz" |
64 |
+ |
65 |
+LICENSE="GPL-2 LGPL-2.1" |
66 |
+SLOT="0/${PV%_*}" |
67 |
+KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~sparc ~x86" |
68 |
+IUSE="+boost idn libressl debug test +tools" |
69 |
+RESTRICT="!test? ( test )" |
70 |
+REQUIRED_USE="${LUA_REQUIRED_USE} |
71 |
+ test? ( tools )" |
72 |
+ |
73 |
+RDEPEND="${LUA_DEPS} |
74 |
+ idn? ( net-dns/libidn:= ) |
75 |
+ !libressl? ( dev-libs/openssl:0= ) |
76 |
+ libressl? ( dev-libs/libressl:0= ) |
77 |
+ media-libs/fontconfig:= |
78 |
+ media-libs/freetype:2= |
79 |
+ virtual/jpeg:0= |
80 |
+ media-libs/libpng:0= |
81 |
+ media-libs/tiff:0= |
82 |
+ sys-libs/zlib:=" |
83 |
+DEPEND="${RDEPEND} |
84 |
+ virtual/pkgconfig |
85 |
+ boost? ( dev-util/boost-build ) |
86 |
+ test? ( dev-util/cppunit )" |
87 |
+ |
88 |
+PATCHES=( |
89 |
+ "${FILESDIR}"/${PN}-0.9.6_p20190928-cmake_lua_version.patch |
90 |
+) |
91 |
+ |
92 |
+DOCS="AUTHORS ChangeLog TODO" |
93 |
+ |
94 |
+src_prepare() { |
95 |
+ cmake_src_prepare |
96 |
+ local x sed_args |
97 |
+ |
98 |
+ if use libressl; then |
99 |
+ sed -e 's:^#ifdef PODOFO_HAVE_OPENSSL_1_1$:#ifndef PODOFO_HAVE_OPENSSL_1_1:' \ |
100 |
+ -i tools/podofosign/podofosign.cpp || die #663602 |
101 |
+ fi |
102 |
+ |
103 |
+ # bug 620934 - Disable linking with cppunit when possible, since it |
104 |
+ # triggers errors with some older compilers. |
105 |
+ use test || sed -e 's:^FIND_PACKAGE(CppUnit):#\0:' -i CMakeLists.txt || die |
106 |
+ |
107 |
+ # bug 556962 |
108 |
+ sed -i -e 's|Decrypt( pEncryptedBuffer, nOutputLen, pDecryptedBuffer, m_lLen );|Decrypt( pEncryptedBuffer, (pdf_long)nOutputLen, pDecryptedBuffer, (pdf_long\&)m_lLen );|' \ |
109 |
+ test/unit/EncryptTest.cpp || die |
110 |
+ |
111 |
+ sed -i \ |
112 |
+ -e "s:LIBDIRNAME \"lib\":LIBDIRNAME \"$(get_libdir)\":" \ |
113 |
+ -e "s:LIBIDN_FOUND:HAVE_LIBIDN:g" \ |
114 |
+ CMakeLists.txt || die |
115 |
+ |
116 |
+ # Use pkg-config to find headers for bug #459404. |
117 |
+ sed_args= |
118 |
+ for x in $($(tc-getPKG_CONFIG) --cflags freetype2) ; do |
119 |
+ [[ ${x} == -I* ]] || continue |
120 |
+ x=${x#-I} |
121 |
+ if [[ -f ${x}/ft2build.h ]] ; then |
122 |
+ sed_args+=" -e s:/usr/include/\\r\$:${x}:" |
123 |
+ elif [[ -f ${x}/freetype/config/ftheader.h ]] ; then |
124 |
+ sed_args+=" -e s:/usr/include/freetype2\\r\$:${x}:" |
125 |
+ fi |
126 |
+ done |
127 |
+ [[ -n ${sed_args} ]] && \ |
128 |
+ { sed -i ${sed_args} cmake/modules/FindFREETYPE.cmake || die; } |
129 |
+ |
130 |
+ # Bug #439784: Add missing unistd include for close() and unlink(). |
131 |
+ sed -i 's:^#include <stdio.h>$:#include <unistd.h>\n\0:' -i \ |
132 |
+ test/unit/TestUtils.cpp || die |
133 |
+ |
134 |
+ # TODO: fix these test cases |
135 |
+ # ColorTest.cpp:62:Assertion |
136 |
+ # Test name: ColorTest::testDefaultConstructor |
137 |
+ # expected exception not thrown |
138 |
+ # - Expected: PdfError |
139 |
+ sed -e 's:CPPUNIT_TEST( testDefaultConstructor ://\0:' \ |
140 |
+ -e 's:CPPUNIT_TEST( testGreyConstructor ://\0:' \ |
141 |
+ -e 's:CPPUNIT_TEST( testRGBConstructor ://\0:' \ |
142 |
+ -e 's:CPPUNIT_TEST( testCMYKConstructor ://\0:' \ |
143 |
+ -e 's:CPPUNIT_TEST( testColorSeparationAllConstructor ://\0:' \ |
144 |
+ -e 's:CPPUNIT_TEST( testColorSeparationNoneConstructor ://\0:' \ |
145 |
+ -e 's:CPPUNIT_TEST( testColorSeparationConstructor ://\0:' \ |
146 |
+ -e 's:CPPUNIT_TEST( testColorCieLabConstructor ://\0:' \ |
147 |
+ -i test/unit/ColorTest.h || die |
148 |
+ |
149 |
+ # ColorTest.cpp:42:Assertion |
150 |
+ # Test name: ColorTest::testHexNames |
151 |
+ # assertion failed |
152 |
+ # - Expression: static_cast<int>(rgb.GetGreen() * 255.0) == 0x0A |
153 |
+ sed -e 's:CPPUNIT_TEST( testHexNames ://\0:' \ |
154 |
+ -i test/unit/ColorTest.h || die |
155 |
+ |
156 |
+ # Bug #352125: test failure, depending on installed fonts |
157 |
+ # ##Failure Location unknown## : Error |
158 |
+ # Test name: FontTest::testFonts |
159 |
+ # uncaught exception of type PoDoFo::PdfError |
160 |
+ # - ePdfError_UnsupportedFontFormat |
161 |
+ sed -e 's:CPPUNIT_TEST( testFonts ://\0:' \ |
162 |
+ -i test/unit/FontTest.h || die |
163 |
+ |
164 |
+ # Test name: EncodingTest::testDifferencesEncoding |
165 |
+ # equality assertion failed |
166 |
+ # - Expected: 1 |
167 |
+ # - Actual : 0 |
168 |
+ sed -e 's:CPPUNIT_TEST( testDifferencesEncoding ://\0:' \ |
169 |
+ -i test/unit/EncodingTest.h || die |
170 |
+ |
171 |
+ # Bug #407015: fix to compile with Lua 5.2+ |
172 |
+ case "${ELUA}" in |
173 |
+ lua5-1|luajit) |
174 |
+ ;; |
175 |
+ *) |
176 |
+ sed -e 's: lua_open(: luaL_newstate(:' \ |
177 |
+ -e 's: luaL_getn(: lua_rawlen(:' -i \ |
178 |
+ tools/podofocolor/luaconverter.cpp \ |
179 |
+ tools/podofoimpose/planreader_lua.cpp || die |
180 |
+ ;; |
181 |
+ esac |
182 |
+} |
183 |
+ |
184 |
+src_configure() { |
185 |
+ |
186 |
+ # Bug #381359: undefined reference to `PoDoFo::PdfVariant::DelayedLoadImpl()' |
187 |
+ filter-flags -fvisibility-inlines-hidden |
188 |
+ |
189 |
+ mycmakeargs+=( |
190 |
+ "-DPODOFO_BUILD_SHARED=1" |
191 |
+ "-DPODOFO_HAVE_JPEG_LIB=1" |
192 |
+ "-DPODOFO_HAVE_PNG_LIB=1" |
193 |
+ "-DPODOFO_HAVE_TIFF_LIB=1" |
194 |
+ "-DWANT_FONTCONFIG=1" |
195 |
+ "-DUSE_STLPORT=0" |
196 |
+ -DLUA_VERSION="$(lua_get_version)" |
197 |
+ -DWANT_BOOST=$(usex boost ON OFF) |
198 |
+ -DHAVE_LIBIDN=$(usex idn ON OFF) |
199 |
+ -DPODOFO_HAVE_CPPUNIT=$(usex test ON OFF) |
200 |
+ -DPODOFO_BUILD_LIB_ONLY=$(usex tools OFF ON) |
201 |
+ ) |
202 |
+ |
203 |
+ cmake_src_configure |
204 |
+ mkdir -p "${S}/test/TokenizerTest/objects" || die |
205 |
+} |
206 |
+ |
207 |
+src_test() { |
208 |
+ cd "${BUILD_DIR}"/test/unit || die |
209 |
+ ./podofo-test --selftest || die "self test failed" |
210 |
+} |
211 |
|
212 |
diff --git a/profiles/package.mask b/profiles/package.mask |
213 |
index 75e5a55f428..549f1b2c39d 100644 |
214 |
--- a/profiles/package.mask |
215 |
+++ b/profiles/package.mask |
216 |
@@ -457,6 +457,7 @@ kde-apps/kdebase-meta:5 |
217 |
>=app-metrics/nginx-lua-prometheus-0.1_pre20170610-r100 |
218 |
>=app-misc/worker-3.8.3-r100 |
219 |
>=app-text/highlight-3.57-r100 |
220 |
+>=app-text/podofo-0.9.6_p20190928-r100 |
221 |
>=dev-db/redis-6.0.9-r100 |
222 |
>=dev-games/cegui-0.8.7-r100 |
223 |
>=dev-games/openscenegraph-3.6.5-r100 |