Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-office/libreoffice/files/, app-office/libreoffice/
Date: Sun, 08 May 2022 21:57:15
Message-Id: 1652047023.af49d8e308d23be5066757c0c624a4f71d6fdaa4.sam@gentoo
1 commit: af49d8e308d23be5066757c0c624a4f71d6fdaa4
2 Author: Sam James <sam <AT> gentoo <DOT> org>
3 AuthorDate: Sun May 8 21:52:15 2022 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Sun May 8 21:57:03 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=af49d8e3
7
8 app-office/libreoffice: add 7.3.3.2 (unkeyworded)
9
10 Unkeyworded briefly until I get a chance to test PDF import/export
11 with Poppler patches.
12
13 Bug: https://bugs.gentoo.org/843311
14 Thanks-to: Stephan Hartmann <sultan <AT> gentoo.org> (improvement on the FreeBSD patch)
15 Signed-off-by: Sam James <sam <AT> gentoo.org>
16
17 app-office/libreoffice/Manifest | 2 +
18 ...Add-missing-nSize-set-for-Poppler-22.04.0.patch | 25 +
19 ...t-FreeBSD-patch-for-Poppler-22.04.0-build.patch | 76 +++
20 app-office/libreoffice/libreoffice-7.3.3.2.ebuild | 669 +++++++++++++++++++++
21 4 files changed, 772 insertions(+)
22
23 diff --git a/app-office/libreoffice/Manifest b/app-office/libreoffice/Manifest
24 index 644b9adc3ee6..29b86b003ae9 100644
25 --- a/app-office/libreoffice/Manifest
26 +++ b/app-office/libreoffice/Manifest
27 @@ -20,8 +20,10 @@ DIST libcmis-0.5.2.tar.xz 484404 BLAKE2B 7de242393c28fc8289bb598b34e704eb2affaaa
28 DIST libcuckoo-93217f8d391718380c508a722ab9acd5e9081233.tar.gz 5005888 BLAKE2B 836ec268c19c27ac079ea1084587c3e999f39ad2188be1a5cf8337ad0473ffda6c32d0695254d3797d1607707329befa88da6043f424544487238e550eda8590 SHA512 4159dfb4d08e359feb23127e12db590260913e70774161ac9513abb5183ad6ed6d2bdfbe56fc8aa68e2fc57ee29eae67aa0180e1a7d955016884ecba2ca60ff8
29 DIST libreoffice-7.2.6.2.tar.xz 252995284 BLAKE2B b807e666d39b4302b0a33f84f7e8797bc41ec9e1814bfe57f0e06c8bbbf3b8bf89a70a25caa65401f402a593acce04cb1118bd13bbd961d7feeac295511e36e4 SHA512 2b1a92d98595d4a40bf699ebf5ee3cbf4daeb765a8d37ae035f459f2a74c2ce27e53747307d9875aaec7d1d5a2693266ea81b7fe1281c33653c9fa4bbd727242
30 DIST libreoffice-7.3.2.2.tar.xz 255657596 BLAKE2B ef362c6e53ab8668309f1f9b10a8cbb87e8027aaf56a3d1185494757376b89bdf126fe08ef3e416d0330bb96df4ac046b8c60d535eeef8430c60485313e80b5f SHA512 c9f0deaf812425cfc08649f5a9f88c56a9f9221a6b117f9fece56ed17984fec25446ccad52ff2f22ebdfa1db495289edb22a8b7b1fec7a0e42d4b3cd2e81363b
31 +DIST libreoffice-7.3.3.2.tar.xz 256036064 BLAKE2B 8a96121448e3cc1f81990c837d36191a6127e3ff78773440a4ecdfb5f178f7ab522298fec1d0dd872afe38b67ec102d4f5ea4b0cde64caf5d6420a7f02f25e1b SHA512 242d5694b6d09c669992ea68223b62fb8e418e886f68c7e5d843272d55ad2de34e5207180b7a541fd97cbe678c2d12d5290ebd8b82d47c88f1607e6736413c96
32 DIST libreoffice-branding-gentoo-0.8.tar.xz 151568 BLAKE2B f03c7ddeb53c5ca3fd23401679601fcf2c4037ba17be4eb7b784c7ce7ebb71a24b8ab4aac8b7da8c6b1f14dd23bc1294ba85ff4f70ad271fb4ee3c5372e10883 SHA512 785031a699b1d1895ce4b50ffc3ddf645f3a0ef9acdf37facfd18cf75db9484cb8f53a50abb63d6006ead76a80b6ff5aa99661063245ebb84bd64013d713de7f
33 DIST libreoffice-help-7.2.6.2.tar.xz 112079748 BLAKE2B f9d96d6d72e70f28f12dcf656cf8fd22bc8e563ec53c840cf7cd668e3de677ee73a3f3099e7c62c6034cd4d23915b9e7a94012340c6a7db7f8822e4c8c6d0887 SHA512 05f02eb1afaa90547ca388008e02c4a48c191984e77d4022adf02089f69a3b4792cdc065e160f59fbf2f5554b062ff0d6853b12aa9abb9b180dd7c4c855e4d8b
34 DIST libreoffice-help-7.3.2.2.tar.xz 112209056 BLAKE2B 320aa76bdce62b94707cd3b6fafd72ce0322e22f28fbb6059b8e1b5b4ef5e99796aee01592a84bf19527bffc0553b937f2d13451e75f105338beb6c1ac1ca077 SHA512 a1f5b1763841b159c623008075ad48ed916c78a856b557553c498590a7c9cd52e23487652c4ab4e4201fc829e7bf4a489ab467e4f412b5538252d893bd74341d
35 +DIST libreoffice-help-7.3.3.2.tar.xz 112209704 BLAKE2B b0e92b88aeb866d3f611fe89d723287cf037bca1772a861cb8b76ee046ae0d039d67648e121aa253eccbfa132c8d252b947bdcbbc3ee6178b6defd3c876749d0 SHA512 f70e747c5b78be20bbe4dd0c20840923d14b4278c00a12a60f5e58e3226abc0c218ac3cce4885cf5a440ace92141bf0428df40a4d1469edb91103167c5e3d46f
36 DIST skia-m90-45c57e116ee0ce214bdf78405a4762722e4507d9.tar.xz 10630696 BLAKE2B a3d42d08a0622de591d177184b6225cf62e3048d02d8f2012b6b02aae186b644c899c4e73b528b3528a4acec6cec07e3576dd6d97b130fedf3b2ec5b2ddf4ed7 SHA512 625ed461d85ce5c5c73ffd20bc3f2c9b5fe6ba557693b793b387ffb434d4f0d9056bd9befe6760c55e9e47f09c02373a49b8ac106162a40d940ea351e8c873c0
37 DIST skia-m97-a7230803d64ae9d44f4e1282444801119a3ae967.tar.xz 11826600 BLAKE2B 2985ba0318fd72ac216fda33c6961eaa8ee649d2a850eb736accbd91fbc9cee7dc4e5752b2696a35204770a188412e2ecd0cc128cec324c682f9bc35e68358b3 SHA512 fbf5cfef66991565dbad928091a4e795a5b5b79a1e062a98ab9135b9972827de703c449507957294e7471c422c2e2ed239d6df61ffb9b9581a9ca3d848687a76
38
39 diff --git a/app-office/libreoffice/files/libreoffice-7.3.3.2-Add-missing-nSize-set-for-Poppler-22.04.0.patch b/app-office/libreoffice/files/libreoffice-7.3.3.2-Add-missing-nSize-set-for-Poppler-22.04.0.patch
40 new file mode 100644
41 index 000000000000..f273d9565051
42 --- /dev/null
43 +++ b/app-office/libreoffice/files/libreoffice-7.3.3.2-Add-missing-nSize-set-for-Poppler-22.04.0.patch
44 @@ -0,0 +1,25 @@
45 +https://bugs.gentoo.org/843311
46 +
47 +From: Sam James <sam@g.o>
48 +Date: Sun, 8 May 2022 21:22:49 +0000
49 +Subject: [PATCH 2/2] Add missing nSize set for Poppler 22.04.0
50 +
51 +Thanks-to: Stephan Hartmann <sultan@g.o>
52 +--- a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
53 ++++ b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
54 +@@ -478,6 +478,7 @@ int PDFOutDev::parseFont( long long nNewId, GfxFont* gfxFont, const GfxState* st
55 + char* pBuf = gfxFont->readEmbFontFile( m_pDoc->getXRef(), &nSize );
56 + #else
57 + std::optional<std::vector<unsigned char>> pBuf = gfxFont->readEmbFontFile( m_pDoc->getXRef() );
58 ++ nSize = pBuf->size();
59 + #endif
60 + if( pBuf )
61 + {
62 +@@ -502,6 +503,7 @@ void PDFOutDev::writeFontFile( GfxFont* gfxFont ) const
63 + char* pBuf = gfxFont->readEmbFontFile( m_pDoc->getXRef(), &nSize );
64 + #else
65 + std::optional<std::vector<unsigned char>> pBuf = gfxFont->readEmbFontFile( m_pDoc->getXRef() );
66 ++ nSize = pBuf->size();
67 + #endif
68 + if( !pBuf )
69 + return;
70
71 diff --git a/app-office/libreoffice/files/libreoffice-7.3.3.2-Import-FreeBSD-patch-for-Poppler-22.04.0-build.patch b/app-office/libreoffice/files/libreoffice-7.3.3.2-Import-FreeBSD-patch-for-Poppler-22.04.0-build.patch
72 new file mode 100644
73 index 000000000000..7879f87a516b
74 --- /dev/null
75 +++ b/app-office/libreoffice/files/libreoffice-7.3.3.2-Import-FreeBSD-patch-for-Poppler-22.04.0-build.patch
76 @@ -0,0 +1,76 @@
77 +https://bugs.gentoo.org/843311
78 +https://cgit.freebsd.org/ports/commit/?id=d9b5ef800dbd0366eae81b03bfa89689ec73c6f7
79 +
80 +From: Sam James <sam@g.o>
81 +Date: Sun, 8 May 2022 21:20:25 +0000
82 +Subject: [PATCH 1/2] Import FreeBSD patch for Poppler 22.04.0 build
83 +
84 +--- a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
85 ++++ b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
86 +@@ -474,11 +474,17 @@ int PDFOutDev::parseFont( long long nNewId, GfxFont* gfxFont, const GfxState* st
87 + {
88 + // TODO(P3): Unfortunately, need to read stream twice, since
89 + // we must write byte count to stdout before
90 ++#if !POPPLER_CHECK_VERSION(22, 3, 0)
91 + char* pBuf = gfxFont->readEmbFontFile( m_pDoc->getXRef(), &nSize );
92 ++#else
93 ++ std::optional<std::vector<unsigned char>> pBuf = gfxFont->readEmbFontFile( m_pDoc->getXRef() );
94 ++#endif
95 + if( pBuf )
96 + {
97 + aNewFont.isEmbedded = true;
98 ++#if !POPPLER_CHECK_VERSION(22, 3, 0)
99 + gfree(pBuf);
100 ++#endif
101 + }
102 + }
103 +
104 +@@ -492,21 +498,32 @@ void PDFOutDev::writeFontFile( GfxFont* gfxFont ) const
105 + return;
106 +
107 + int nSize = 0;
108 +- char* pBuf = gfxFont->readEmbFontFile( m_pDoc->getXRef(), &nSize );
109 ++#if !POPPLER_CHECK_VERSION(22, 3, 0)
110 ++ char* pBuf = gfxFont->readEmbFontFile( m_pDoc->getXRef(), &nSize );
111 ++#else
112 ++ std::optional<std::vector<unsigned char>> pBuf = gfxFont->readEmbFontFile( m_pDoc->getXRef() );
113 ++#endif
114 + if( !pBuf )
115 + return;
116 +
117 + // ---sync point--- see SYNC STREAMS above
118 + fflush(stdout);
119 +-
120 ++#if !POPPLER_CHECK_VERSION(22, 3, 0)
121 + if( fwrite(pBuf, sizeof(char), nSize, g_binary_out) != static_cast<size_t>(nSize) )
122 ++#else
123 ++ if( fwrite(reinterpret_cast<char*>(pBuf.value().data()), sizeof(char), nSize, g_binary_out) != static_cast<size_t>(nSize) )
124 ++#endif
125 + {
126 +- gfree(pBuf);
127 ++#if !POPPLER_CHECK_VERSION(22, 3, 0)
128 ++ gfree(pBuf);
129 ++#endif
130 + exit(1); // error
131 + }
132 + // ---sync point--- see SYNC STREAMS above
133 + fflush(g_binary_out);
134 +- gfree(pBuf);
135 ++#if !POPPLER_CHECK_VERSION(22, 3, 0)
136 ++ gfree(pBuf);
137 ++#endif
138 + }
139 +
140 + #if POPPLER_CHECK_VERSION(0, 83, 0)
141 +@@ -759,7 +776,11 @@ void PDFOutDev::updateFont(GfxState *state)
142 + {
143 + assert(state);
144 +
145 ++#if !POPPLER_CHECK_VERSION(22, 3, 0)
146 + GfxFont *gfxFont = state->getFont();
147 ++#else
148 ++ GfxFont *gfxFont = state->getFont().get();
149 ++#endif
150 + if( !gfxFont )
151 + return;
152 +
153
154 diff --git a/app-office/libreoffice/libreoffice-7.3.3.2.ebuild b/app-office/libreoffice/libreoffice-7.3.3.2.ebuild
155 new file mode 100644
156 index 000000000000..f229dff9382b
157 --- /dev/null
158 +++ b/app-office/libreoffice/libreoffice-7.3.3.2.ebuild
159 @@ -0,0 +1,669 @@
160 +# Copyright 1999-2022 Gentoo Authors
161 +# Distributed under the terms of the GNU General Public License v2
162 +
163 +EAPI=8
164 +
165 +PYTHON_COMPAT=( python3_{8..10} )
166 +PYTHON_REQ_USE="threads(+),xml"
167 +
168 +MY_PV="${PV/_alpha/.alpha}"
169 +MY_PV="${MY_PV/_beta/.beta}"
170 +# experimental ; release ; old
171 +# Usually the tarballs are moved a lot so this should make everyone happy.
172 +DEV_URI="
173 + https://dev-builds.libreoffice.org/pre-releases/src
174 + https://download.documentfoundation.org/libreoffice/src/${MY_PV:0:5}/
175 + https://downloadarchive.documentfoundation.org/libreoffice/old/${MY_PV}/src
176 +"
177 +ADDONS_URI="https://dev-www.libreoffice.org/src/"
178 +
179 +BRANDING="${PN}-branding-gentoo-0.8.tar.xz"
180 +# PATCHSET="${P}-patchset-01.tar.xz"
181 +
182 +[[ ${MY_PV} == *9999* ]] && inherit git-r3
183 +inherit autotools bash-completion-r1 check-reqs flag-o-matic java-pkg-opt-2 multiprocessing python-single-r1 qmake-utils toolchain-funcs xdg-utils
184 +
185 +DESCRIPTION="A full office productivity suite"
186 +HOMEPAGE="https://www.libreoffice.org"
187 +SRC_URI="branding? ( https://dev.gentoo.org/~dilfridge/distfiles/${BRANDING} )"
188 +[[ -n ${PATCHSET} ]] && SRC_URI+=" https://dev.gentoo.org/~asturm/distfiles/${PATCHSET}"
189 +
190 +# Split modules following git/tarballs; Core MUST be first!
191 +# Help is used for the image generator
192 +# Only release has the tarballs
193 +if [[ ${MY_PV} != *9999* ]]; then
194 + for i in ${DEV_URI}; do
195 + SRC_URI+=" ${i}/${PN}-${MY_PV}.tar.xz"
196 + SRC_URI+=" ${i}/${PN}-help-${MY_PV}.tar.xz"
197 + done
198 + unset i
199 +fi
200 +unset DEV_URI
201 +
202 +# Really required addons
203 +# These are bundles that can't be removed for now due to huge patchsets.
204 +# If you want them gone, patches are welcome.
205 +ADDONS_SRC=(
206 + # not packaged in Gentoo, https://github.com/efficient/libcuckoo/
207 + "${ADDONS_URI}/libcuckoo-93217f8d391718380c508a722ab9acd5e9081233.tar.gz"
208 + # broken against latest upstream release, too many patches on top:
209 + # https://github.com/tdf/libcmis/pull/43
210 + "${ADDONS_URI}/libcmis-0.5.2.tar.xz"
211 + # not packaged in Gentoo, https://www.netlib.org/fp/dtoa.c
212 + "${ADDONS_URI}/dtoa-20180411.tgz"
213 + # not packaged in Gentoo, https://skia.org/
214 + "${ADDONS_URI}/skia-m97-a7230803d64ae9d44f4e1282444801119a3ae967.tar.xz"
215 + "base? (
216 + ${ADDONS_URI}/commons-logging-1.2-src.tar.gz
217 + ${ADDONS_URI}/ba2930200c9f019c2d93a8c88c651a0f-flow-engine-0.9.4.zip
218 + ${ADDONS_URI}/d8bd5eed178db6e2b18eeed243f85aa8-flute-1.1.6.zip
219 + ${ADDONS_URI}/eeb2c7ddf0d302fba4bfc6e97eac9624-libbase-1.1.6.zip
220 + ${ADDONS_URI}/3bdf40c0d199af31923e900d082ca2dd-libfonts-1.1.6.zip
221 + ${ADDONS_URI}/3404ab6b1792ae5f16bbd603bd1e1d03-libformula-1.1.7.zip
222 + ${ADDONS_URI}/db60e4fde8dd6d6807523deb71ee34dc-liblayout-0.2.10.zip
223 + ${ADDONS_URI}/97b2d4dba862397f446b217e2b623e71-libloader-1.1.6.zip
224 + ${ADDONS_URI}/8ce2fcd72becf06c41f7201d15373ed9-librepository-1.1.6.zip
225 + ${ADDONS_URI}/f94d9870737518e3b597f9265f4e9803-libserializer-1.1.6.zip
226 + ${ADDONS_URI}/ace6ab49184e329db254e454a010f56d-libxml-1.1.7.zip
227 + ${ADDONS_URI}/39bb3fcea1514f1369fcfc87542390fd-sacjava-1.3.zip
228 + )"
229 + "java? ( ${ADDONS_URI}/17410483b5b5f267aa18b7e00b65e6e0-hsqldb_1_8_0.zip )"
230 + # no release for 8 years, should we package it?
231 + "libreoffice_extensions_wiki-publisher? ( ${ADDONS_URI}/a7983f859eafb2677d7ff386a023bc40-xsltml_2.1.2.zip )"
232 + # Does not build with 1.6 rhino at all
233 + "libreoffice_extensions_scripting-javascript? ( ${ADDONS_URI}/798b2ffdc8bcfe7bca2cf92b62caf685-rhino1_5R5.zip )"
234 + # requirement of rhino
235 + "libreoffice_extensions_scripting-javascript? ( ${ADDONS_URI}/35c94d2df8893241173de1d16b6034c0-swingExSrc.zip )"
236 + # not packageable
237 + "odk? ( http://download.go-oo.org/extern/185d60944ea767075d27247c3162b3bc-unowinreg.dll )"
238 +)
239 +SRC_URI+=" ${ADDONS_SRC[*]}"
240 +
241 +unset ADDONS_URI
242 +unset ADDONS_SRC
243 +
244 +# Extensions that need extra work:
245 +LO_EXTS="nlpsolver scripting-beanshell scripting-javascript wiki-publisher"
246 +
247 +IUSE="accessibility base bluetooth +branding clang coinmp +cups custom-cflags +dbus debug eds firebird
248 +googledrive gstreamer +gtk kde ldap +mariadb odk pdfimport postgres test vulkan
249 +$(printf 'libreoffice_extensions_%s ' ${LO_EXTS})"
250 +
251 +REQUIRED_USE="${PYTHON_REQUIRED_USE}
252 + base? ( firebird java )
253 + bluetooth? ( dbus )
254 + gtk? ( dbus )
255 + libreoffice_extensions_nlpsolver? ( java )
256 + libreoffice_extensions_scripting-beanshell? ( java )
257 + libreoffice_extensions_scripting-javascript? ( java )
258 + libreoffice_extensions_wiki-publisher? ( java )
259 +"
260 +
261 +RESTRICT="!test? ( test )"
262 +
263 +LICENSE="|| ( LGPL-3 MPL-1.1 )"
264 +SLOT="0"
265 +
266 +#[[ ${MY_PV} == *9999* ]] || \
267 +#KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86 ~amd64-linux"
268 +
269 +COMMON_DEPEND="${PYTHON_DEPS}
270 + app-arch/unzip
271 + app-arch/zip
272 + app-crypt/gpgme:=[cxx]
273 + app-text/hunspell:=
274 + >=app-text/libabw-0.1.0
275 + >=app-text/libebook-0.1
276 + app-text/libepubgen
277 + >=app-text/libetonyek-0.1
278 + app-text/libexttextcat
279 + app-text/liblangtag
280 + >=app-text/libmspub-0.1.0
281 + >=app-text/libmwaw-0.3.1
282 + >=app-text/libnumbertext-1.0.6
283 + >=app-text/libodfgen-0.1.0
284 + app-text/libqxp
285 + app-text/libstaroffice
286 + app-text/libwpd:0.10[tools]
287 + app-text/libwpg:0.3
288 + >=app-text/libwps-0.4
289 + app-text/mythes
290 + dev-cpp/abseil-cpp:=
291 + >=dev-cpp/clucene-2.3.3.4-r2
292 + >=dev-cpp/libcmis-0.5.2
293 + dev-db/unixODBC
294 + dev-lang/perl
295 + >=dev-libs/boost-1.72.0:=[nls]
296 + dev-libs/expat
297 + dev-libs/hyphen
298 + dev-libs/icu:=
299 + dev-libs/libassuan
300 + dev-libs/libgpg-error
301 + >=dev-libs/liborcus-0.17.2:0/0.17
302 + dev-libs/librevenge
303 + dev-libs/libxml2
304 + dev-libs/libxslt
305 + dev-libs/nspr
306 + dev-libs/nss
307 + >=dev-libs/redland-1.0.16
308 + >=dev-libs/xmlsec-1.2.28[nss]
309 + >=games-engines/box2d-2.4.1:0
310 + media-gfx/fontforge
311 + media-gfx/graphite2
312 + media-libs/fontconfig
313 + >=media-libs/freetype-2.11.0-r1:2
314 + >=media-libs/harfbuzz-0.9.42:=[graphite,icu]
315 + media-libs/lcms:2
316 + >=media-libs/libcdr-0.1.0
317 + >=media-libs/libepoxy-1.3.1[X]
318 + >=media-libs/libfreehand-0.1.0
319 + media-libs/libjpeg-turbo:=
320 + media-libs/libpagemaker
321 + >=media-libs/libpng-1.4:0=
322 + >=media-libs/libvisio-0.1.0
323 + media-libs/libzmf
324 + media-libs/openjpeg:=
325 + media-libs/zxing-cpp
326 + >=net-libs/neon-0.31.1:=
327 + net-misc/curl
328 + sci-mathematics/lpsolve
329 + sys-libs/zlib
330 + virtual/opengl
331 + x11-libs/cairo[X]
332 + x11-libs/libXinerama
333 + x11-libs/libXrandr
334 + x11-libs/libXrender
335 + accessibility? (
336 + $(python_gen_cond_dep 'dev-python/lxml[${PYTHON_USEDEP}]')
337 + )
338 + bluetooth? (
339 + dev-libs/glib:2
340 + net-wireless/bluez
341 + )
342 + coinmp? ( sci-libs/coinor-mp )
343 + cups? ( net-print/cups )
344 + dbus? ( sys-apps/dbus[X] )
345 + eds? (
346 + dev-libs/glib:2
347 + gnome-base/dconf
348 + gnome-extra/evolution-data-server
349 + )
350 + firebird? ( >=dev-db/firebird-3.0.2.32703.0-r1[server] )
351 + gstreamer? (
352 + media-libs/gstreamer:1.0
353 + media-libs/gst-plugins-base:1.0
354 + )
355 + gtk? (
356 + dev-libs/glib:2
357 + dev-libs/gobject-introspection
358 + gnome-base/dconf
359 + media-libs/mesa[egl(+)]
360 + x11-libs/gtk+:3[X]
361 + x11-libs/pango
362 + )
363 + kde? (
364 + dev-qt/qtcore:5
365 + dev-qt/qtgui:5
366 + dev-qt/qtwidgets:5
367 + dev-qt/qtx11extras:5
368 + kde-frameworks/kconfig:5
369 + kde-frameworks/kcoreaddons:5
370 + kde-frameworks/ki18n:5
371 + kde-frameworks/kio:5
372 + kde-frameworks/kwindowsystem:5
373 + )
374 + ldap? ( net-nds/openldap:= )
375 + libreoffice_extensions_scripting-beanshell? ( dev-java/bsh )
376 + libreoffice_extensions_scripting-javascript? ( >=dev-java/rhino-1.7.14:1.6 )
377 + mariadb? ( dev-db/mariadb-connector-c:= )
378 + !mariadb? ( dev-db/mysql-connector-c:= )
379 + pdfimport? ( app-text/poppler:=[cxx] )
380 + postgres? ( >=dev-db/postgresql-9.0:*[kerberos] )
381 +"
382 +# FIXME: cppunit should be moved to test conditional
383 +# after everything upstream is under gbuild
384 +# as dmake execute tests right away
385 +# tests apparently also need google-carlito-fonts (not packaged)
386 +DEPEND="${COMMON_DEPEND}
387 + >=dev-libs/libatomic_ops-7.2d
388 + dev-perl/Archive-Zip
389 + >=dev-util/cppunit-1.14.0
390 + >=dev-util/gperf-3.1
391 + dev-util/mdds:1/2.0
392 + media-libs/glm
393 + sys-devel/ucpp
394 + x11-base/xorg-proto
395 + x11-libs/libXt
396 + x11-libs/libXtst
397 + java? (
398 + dev-java/ant-core
399 + || (
400 + dev-java/openjdk:11
401 + dev-java/openjdk-bin:11
402 + )
403 + )
404 + test? (
405 + app-crypt/gnupg
406 + dev-util/cppunit
407 + media-fonts/dejavu
408 + media-fonts/liberation-fonts
409 + )
410 +"
411 +RDEPEND="${COMMON_DEPEND}
412 + !app-office/libreoffice-bin
413 + !app-office/libreoffice-bin-debug
414 + media-fonts/liberation-fonts
415 + || ( x11-misc/xdg-utils kde-plasma/kde-cli-tools )
416 + java? ( || (
417 + dev-java/openjdk:11
418 + dev-java/openjdk-jre-bin:11
419 + >=virtual/jre-1.8
420 + ) )
421 + kde? ( kde-frameworks/breeze-icons:* )
422 +"
423 +BDEPEND="
424 + dev-util/intltool
425 + sys-devel/bison
426 + sys-devel/flex
427 + sys-devel/gettext
428 + virtual/pkgconfig
429 + clang? (
430 + || (
431 + (
432 + sys-devel/clang:14
433 + sys-devel/llvm:14
434 + =sys-devel/lld-14* )
435 + ( sys-devel/clang:13
436 + sys-devel/llvm:13
437 + =sys-devel/lld-13* )
438 + ( sys-devel/clang:12
439 + sys-devel/llvm:12
440 + =sys-devel/lld-12* )
441 + )
442 + )
443 + odk? ( >=app-doc/doxygen-1.8.4 )
444 +"
445 +if [[ ${MY_PV} != *9999* ]] && [[ ${PV} != *_* ]]; then
446 + PDEPEND="=app-office/libreoffice-l10n-$(ver_cut 1-2)*"
447 +else
448 + # Translations are not reliable on live ebuilds
449 + # rather force people to use english only.
450 + PDEPEND="!app-office/libreoffice-l10n"
451 +fi
452 +
453 +PATCHES=(
454 + # "${WORKDIR}"/${PATCHSET/.tar.xz/}
455 +
456 + # not upstreamable stuff
457 + "${FILESDIR}/${PN}-5.3.4.2-kioclient5.patch"
458 + "${FILESDIR}/${PN}-6.1-nomancompress.patch"
459 + "${FILESDIR}/${PN}-7.2.0.4-qt5detect.patch"
460 +
461 + # TODO: upstream
462 + "${FILESDIR}/${PN}-7.2.6.2-poppler-22.03.0.patch" # by Archlinux
463 + "${FILESDIR}/${PN}-7.3.3.2-Import-FreeBSD-patch-for-Poppler-22.04.0-build.patch" # from FreeBSD
464 + "${FILESDIR}/${PN}-7.3.3.2-Add-missing-nSize-set-for-Poppler-22.04.0.patch" # fixup for FreeBSD patch
465 +)
466 +
467 +S="${WORKDIR}/${PN}-${MY_PV}"
468 +
469 +_check_reqs() {
470 + CHECKREQS_MEMORY="512M"
471 + if is-flagq "-g*" && ! is-flagq "-g*0" ; then
472 + CHECKREQS_DISK_BUILD="22G"
473 + else
474 + CHECKREQS_DISK_BUILD="6G"
475 + fi
476 + check-reqs_$1
477 +}
478 +
479 +pkg_pretend() {
480 + if use x86; then
481 + elog "Unfortunately for packaging reasons on x86, various Java-based wizards,"
482 + elog "most notably Report Builder in LibreOffice Base, will not be available."
483 + elog "See also: https://bugs.gentoo.org/785640"
484 + else
485 + use base ||
486 + ewarn "If you plan to use Base application you must enable USE base."
487 + use java ||
488 + ewarn "Without USE java, several wizards are not going to be available."
489 + fi
490 +
491 + [[ ${MERGE_TYPE} != binary ]] && _check_reqs pkg_pretend
492 +}
493 +
494 +pkg_setup() {
495 + java-pkg-opt-2_pkg_setup
496 + python-single-r1_pkg_setup
497 + xdg_environment_reset
498 +
499 + [[ ${MERGE_TYPE} != binary ]] && _check_reqs pkg_setup
500 +}
501 +
502 +src_unpack() {
503 + default
504 +
505 + if [[ ${MY_PV} = *9999* ]]; then
506 + local base_uri branch mypv
507 + base_uri="https://anongit.freedesktop.org/git"
508 + branch="master"
509 + mypv=${MY_PV/.9999}
510 + [[ ${mypv} != ${MY_PV} ]] && branch="${PN}-${mypv/./-}"
511 + git-r3_fetch "${base_uri}/${PN}/core" "refs/heads/${branch}"
512 + git-r3_checkout "${base_uri}/${PN}/core"
513 + LOCOREGIT_VERSION=${EGIT_VERSION}
514 +
515 + git-r3_fetch "${base_uri}/${PN}/help" "refs/heads/master"
516 + git-r3_checkout "${base_uri}/${PN}/help" "helpcontent2" # doesn't match on help
517 + fi
518 +}
519 +
520 +src_prepare() {
521 + default
522 +
523 + # sandbox violations on many systems, we don't need it. Bug #646406
524 + sed -i \
525 + -e "/KF5_CONFIG/s/kf5-config/no/" \
526 + configure.ac || die "Failed to disable kf5-config"
527 +
528 + AT_M4DIR="m4" eautoreconf
529 + # hack in the autogen.sh
530 + touch autogen.lastrun
531 +
532 + # sed in the tests
533 + sed -i \
534 + -e "s#all : build unitcheck#all : build#g" \
535 + solenv/gbuild/Module.mk || die
536 + sed -i \
537 + -e "s#check: dev-install subsequentcheck#check: unitcheck slowcheck dev-install subsequentcheck#g" \
538 + -e "s#Makefile.gbuild all slowcheck#Makefile.gbuild all#g" \
539 + Makefile.in || die
540 +
541 + sed -i \
542 + -e "s,/usr/share/bash-completion/completions,$(get_bashcompdir)," \
543 + -e "s,\$INSTALLDIRNAME.sh,${PN}," \
544 + bin/distro-install-desktop-integration || die
545 +
546 + if use branding; then
547 + # hack...
548 + mv -v "${WORKDIR}/branding-intro.png" "icon-themes/colibre/brand/intro.png" || die
549 + fi
550 +
551 + # Don't list pdfimport support in desktop when built with none, bug # 605464
552 + if ! use pdfimport; then
553 + sed -i \
554 + -e ":MimeType: s:application/pdf;::" \
555 + -e ":Keywords: s:pdf;::" \
556 + sysui/desktop/menus/draw.desktop || die
557 + fi
558 +}
559 +
560 +src_configure() {
561 + # Set up Google API keys, see https://www.chromium.org/developers/how-tos/api-keys
562 + # Note: these are for Gentoo use ONLY. For your own distribution, please get
563 + # your own set of keys. Feel free to contact chromium@g.o for more info.
564 + local google_default_client_id="329227923882.apps.googleusercontent.com"
565 + local google_default_client_secret="vgKG0NNv7GoDpbtoFNLxCUXu"
566 +
567 + # Show flags set at the beginning
568 + einfo "Preset CFLAGS: ${CFLAGS}"
569 + einfo "Preset LDFLAGS: ${LDFLAGS}"
570 +
571 + if use clang ; then
572 + # Force clang
573 + einfo "Enforcing the use of clang due to USE=clang ..."
574 + AR=llvm-ar
575 + CC=${CHOST}-clang
576 + CXX=${CHOST}-clang++
577 + NM=llvm-nm
578 + RANLIB=llvm-ranlib
579 + LDFLAGS+=" -fuse-ld=lld"
580 + else
581 + # Force gcc
582 + einfo "Enforcing the use of gcc due to USE=-clang ..."
583 + AR=gcc-ar
584 + CC=${CHOST}-gcc
585 + CXX=${CHOST}-g++
586 + NM=gcc-nm
587 + RANLIB=gcc-ranlib
588 + fi
589 +
590 + if use custom-cflags ; then
591 + elog "USE=custom-cflags has been selected. You are on your own to make sure that"
592 + elog "the build succeeds. Good luck!"
593 + else
594 + strip-flags
595 + fi
596 +
597 + export LO_CLANG_CC=${CC}
598 + export LO_CLANG_CXX=${CXX}
599 +
600 + # Show flags set at the end
601 + einfo " Used CFLAGS: ${CFLAGS}"
602 + einfo " Used LDFLAGS: ${LDFLAGS}"
603 +
604 + # Ensure we use correct toolchain
605 + tc-export CC CXX LD AR NM OBJDUMP RANLIB PKG_CONFIG
606 +
607 + if use vulkan && ! use clang ; then
608 + ewarn "Building skia with gcc may lead to performance issues. Disable vulkan or enable clang."
609 + fi
610 +
611 + # optimization flags
612 + export GMAKE_OPTIONS="${MAKEOPTS}"
613 + # System python enablement:
614 + export PYTHON_CFLAGS=$(python_get_CFLAGS)
615 + export PYTHON_LIBS=$(python_get_LIBS)
616 +
617 + use kde && export QT5DIR="$(qt5_get_bindir)/.."
618 +
619 + local gentoo_buildid="Gentoo official package"
620 + if [[ -n ${LOCOREGIT_VERSION} ]]; then
621 + gentoo_buildid+=" (from git: ${LOCOREGIT_VERSION})"
622 + fi
623 +
624 + # system headers/libs/...: enforce using system packages
625 + # --disable-breakpad: requires not-yet-in-tree dev-utils/breakpad
626 + # --enable-cairo: ensure that cairo is always required
627 + # --enable-*-link: link to the library rather than just dlopen on runtime
628 + # --enable-release-build: build the libreoffice as release
629 + # --disable-fetch-external: prevent dowloading during compile phase
630 + # --enable-extension-integration: enable any extension integration support
631 + # --without-{fonts,myspell-dicts,ppsd}: prevent install of sys pkgs
632 + # --disable-report-builder: too much java packages pulled in without pkgs
633 + # --without-system-sane: just sane.h header that is used for scan in writer,
634 + # not linked or anything else, worthless to depend on
635 + # --disable-pdfium: not yet packaged
636 + local myeconfargs=(
637 + --with-system-dicts
638 + --with-system-epoxy
639 + --with-system-headers
640 + --with-system-jars
641 + --with-system-libs
642 + --enable-build-opensymbol
643 + --enable-cairo-canvas
644 + --enable-largefile
645 + --enable-mergelibs
646 + --enable-python=system
647 + --enable-randr
648 + --enable-release-build
649 + --disable-breakpad
650 + --disable-bundle-mariadb
651 + --disable-ccache
652 + --disable-epm
653 + --disable-fetch-external
654 + --disable-gtk3-kde5
655 + --disable-online-update
656 + --disable-openssl
657 + --disable-pdfium
658 + --disable-qt6
659 + --with-extra-buildid="${gentoo_buildid}"
660 + --enable-extension-integration
661 + --with-external-dict-dir="${EPREFIX}/usr/share/myspell"
662 + --with-external-hyph-dir="${EPREFIX}/usr/share/myspell"
663 + --with-external-thes-dir="${EPREFIX}/usr/share/myspell"
664 + --with-external-tar="${DISTDIR}"
665 + --with-lang=""
666 + --with-parallelism=$(makeopts_jobs)
667 + --with-system-abseil
668 + --with-system-openjpeg
669 + --with-system-ucpp
670 + --with-tls=nss
671 + --with-vendor="Gentoo Foundation"
672 + --with-webdav="neon"
673 + --with-x
674 + --without-fonts
675 + --without-myspell-dicts
676 + --with-help="html"
677 + --without-helppack-integration
678 + --with-system-gpgmepp
679 + --without-system-cuckoo
680 + --without-system-jfreereport
681 + --without-system-libcmis
682 + --without-system-sane
683 + $(use_enable base report-builder)
684 + $(use_enable bluetooth sdremote-bluetooth)
685 + $(use_enable coinmp)
686 + $(use_enable cups)
687 + $(use_enable dbus)
688 + $(use_enable debug)
689 + $(use_enable eds evolution2)
690 + $(use_enable firebird firebird-sdbc)
691 + $(use_enable gstreamer gstreamer-1-0)
692 + $(use_enable gtk gtk3)
693 + $(use_enable kde kf5)
694 + $(use_enable kde qt5)
695 + $(use_enable ldap)
696 + $(use_enable odk)
697 + $(use_enable pdfimport)
698 + $(use_enable postgres postgresql-sdbc)
699 + $(use_enable vulkan skia)
700 + $(use_with accessibility lxml)
701 + $(use_with coinmp system-coinmp)
702 + $(use_with googledrive gdrive-client-id ${google_default_client_id})
703 + $(use_with googledrive gdrive-client-secret ${google_default_client_secret})
704 + $(use_with java)
705 + $(use_with odk doxygen)
706 + )
707 +
708 + if use eds || use gtk; then
709 + myeconfargs+=( --enable-dconf --enable-gio )
710 + else
711 + myeconfargs+=( --disable-dconf --disable-gio )
712 + fi
713 +
714 + # libreoffice extensions handling
715 + for lo_xt in ${LO_EXTS}; do
716 + if [[ "${lo_xt}" == "scripting-beanshell" || "${lo_xt}" == "scripting-javascript" ]]; then
717 + myeconfargs+=( $(use_enable libreoffice_extensions_${lo_xt} ${lo_xt}) )
718 + else
719 + myeconfargs+=( $(use_enable libreoffice_extensions_${lo_xt} ext-${lo_xt}) )
720 + fi
721 + done
722 +
723 + if use java; then
724 + # hsqldb: system one is too new
725 + myeconfargs+=(
726 + --without-junit
727 + --without-system-hsqldb
728 + --with-ant-home="${ANT_HOME}"
729 + )
730 + if has_version "dev-java/openjdk:11"; then
731 + myeconfargs+=( --with-jdk-home="${EPREFIX}/usr/$(get_libdir)/openjdk-11" )
732 + elif has_version "dev-java/openjdk-bin:11"; then
733 + myeconfargs+=( --with-jdk-home="${EPREFIX}/opt/openjdk-bin-11" )
734 + fi
735 +
736 + use libreoffice_extensions_scripting-beanshell && \
737 + myeconfargs+=( --with-beanshell-jar=$(java-pkg_getjar bsh bsh.jar) )
738 +
739 + use libreoffice_extensions_scripting-javascript && \
740 + myeconfargs+=( --with-rhino-jar=$(java-pkg_getjar rhino-1.6 rhino.jar) )
741 + fi
742 +
743 + is-flagq "-flto*" && myeconfargs+=( --enable-lto )
744 +
745 + MARIADBCONFIG="$(type -p $(usex mariadb mariadb mysql)_config)" \
746 + econf "${myeconfargs[@]}"
747 +}
748 +
749 +src_compile() {
750 + # more and more LO stuff tries to use OpenGL, including tests during build
751 + # bug 501508, bug 540624, bug 545974 and probably more
752 + addpredict /dev/dri
753 + addpredict /dev/ati
754 + addpredict /dev/nvidiactl
755 +
756 + default
757 +}
758 +
759 +src_test() {
760 + make unitcheck || die
761 + make slowcheck || die
762 +}
763 +
764 +src_install() {
765 + # This is not Makefile so no buildserver
766 + emake DESTDIR="${D}" distro-pack-install -o build -o check
767 +
768 + # bug 593514
769 + if use gtk; then
770 + dosym libreoffice/program/liblibreofficekitgtk.so \
771 + /usr/$(get_libdir)/liblibreofficekitgtk.so
772 + fi
773 +
774 + # bash completion aliases
775 + bashcomp_alias \
776 + libreoffice \
777 + unopkg loimpress lobase localc lodraw lomath lowriter lofromtemplate loweb loffice
778 +
779 + if use branding; then
780 + insinto /usr/$(get_libdir)/${PN}/program
781 + newins "${WORKDIR}/branding-sofficerc" sofficerc
782 + dodir /etc/env.d
783 + echo "CONFIG_PROTECT=/usr/$(get_libdir)/${PN}/program/sofficerc" > "${ED}"/etc/env.d/99${PN} || die
784 + fi
785 +
786 + # bug 703474
787 + insinto /usr/include
788 + doins -r include/LibreOfficeKit
789 +
790 + local lodir=/usr/$(get_libdir)/libreoffice
791 + # patching this would break tests
792 + cat <<-EOF > "${T}"/uno.py
793 +import sys, os
794 +sys.path.append('${EPREFIX}${lodir}/program')
795 +os.putenv('URE_BOOTSTRAP', 'vnd.sun.star.pathname:${EPREFIX}${lodir}/program/fundamentalrc')
796 +EOF
797 + sed -e "/^import sys/d" -e "/^import os/d" \
798 + -i "${D}"${lodir}/program/uno.py || die "cleanup dupl imports failed"
799 + cat "${D}"${lodir}/program/uno.py >> "${T}"/uno.py || die
800 + cp "${T}"/uno.py "${D}"${lodir}/program/uno.py || die
801 +
802 + # more system pyuno mess
803 + sed -e "/sOffice = \"\" # lets hope for the best/s:\"\":\"${EPREFIX}${lodir}/program\":" \
804 + -i "${D}"${lodir}/program/officehelper.py || die
805 +
806 + python_optimize "${D}"${lodir}/program
807 + # link python bridge in site-packages, bug 667802
808 + local py pyc loprogdir=/usr/$(get_libdir)/libreoffice/program
809 + for py in uno.py unohelper.py officehelper.py; do
810 + dosym -r ${loprogdir}/${py} $(python_get_sitedir)/${py}
811 + while IFS="" read -d $'\0' -r pyc; do
812 + pyc=${pyc//*\/}
813 + dosym -r ${loprogdir}/__pycache__/${pyc} $(python_get_sitedir)/__pycache__/${pyc}
814 + done < <(find "${D}"${lodir}/program -type f -name ${py/.py/*.pyc} -print0)
815 + done
816 +}
817 +
818 +pkg_postinst() {
819 + xdg_icon_cache_update
820 + xdg_desktop_database_update
821 + xdg_mimeinfo_database_update
822 +}
823 +
824 +pkg_postrm() {
825 + xdg_icon_cache_update
826 + xdg_desktop_database_update
827 + xdg_mimeinfo_database_update
828 +}