1 |
commit: 4614473cb2691b97f7cde689ed17ae7563bc29dc |
2 |
Author: Zac Medico <zmedico <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Dec 5 18:51:47 2021 +0000 |
4 |
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Dec 5 18:51:47 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4614473c |
7 |
|
8 |
app-text/calibre: Bump to version 5.33.2 |
9 |
|
10 |
Package-Manager: Portage-3.0.28, Repoman-3.0.3 |
11 |
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org> |
12 |
|
13 |
app-text/calibre/Manifest | 1 + |
14 |
app-text/calibre/calibre-5.33.2.ebuild | 315 +++++++++++++++++++++++++++++++++ |
15 |
2 files changed, 316 insertions(+) |
16 |
|
17 |
diff --git a/app-text/calibre/Manifest b/app-text/calibre/Manifest |
18 |
index a0ec169b0b27..eb07bb98bda8 100644 |
19 |
--- a/app-text/calibre/Manifest |
20 |
+++ b/app-text/calibre/Manifest |
21 |
@@ -6,3 +6,4 @@ DIST calibre-5.31.0.tar.xz 36937976 BLAKE2B 55995aa8fc75ebee5506145ab7995ebcfd04 |
22 |
DIST calibre-5.31.1.tar.xz 36943652 BLAKE2B 13fa46d4426f705f7af2de07a38ca2266148291ca054a1de65b11013907fa51eb7ebefb774988a0b471af31d62ba8eb890cd3fe687505976d9d70738fb64f538 SHA512 c9f8e7fef430961f51699eeda009a799b702b740c9999744b982dbd14d971557f76b31897853435f8947199ca3d65622bf974b2d2afadc813d292b64bc048121 |
23 |
DIST calibre-5.32.0.tar.xz 37115596 BLAKE2B c26340a87f77f373de619a1120f572b21530ebb69ba47975c5fd27e00dc5e72bd23c7265065e25d82f8e964fbeac8a05cc6a08c2d361c4f0105702993230ebd4 SHA512 4ad46e169a0ce23b354d2443b615f2fa80ef69aa763a5f26431968c49af433becf736659daaeb8d8d07e4a2326698c920cafa9a74ac5a8b7bb2f82f0fee2f532 |
24 |
DIST calibre-5.33.0.tar.xz 37075328 BLAKE2B a6bef8b8a2328c8920f3076ed677818810ba5e99ebcbe520b389b587578878c36b72a4bd1ed6d99aa5982c2860e00ca60743f7d1e808f5622f894d89cab26acf SHA512 e714d352de630df91467b6b3822471897d2c9d6ff05f643de15c1317b7fe32bc375fa462a9a0da07987668b7cf0ba1ca08b325686741742c6e1a6d8e91766813 |
25 |
+DIST calibre-5.33.2.tar.xz 37081104 BLAKE2B 7ef40e39d47b10378918dcdefbec5925d9a43f47c345ccb6fd8811b99a2c417923467724f3ba92152b0951e473af7dd20dcb779e1fc6ad7970ac527fc06fe09c SHA512 5886730000005f4e36373ef6d0b3da4e4f06941886f05d1703420720c16aa913dcfca9358c33e4fcec764f0e4bd24e0223ff35421b41f1cc3f818d6d53896d64 |
26 |
|
27 |
diff --git a/app-text/calibre/calibre-5.33.2.ebuild b/app-text/calibre/calibre-5.33.2.ebuild |
28 |
new file mode 100644 |
29 |
index 000000000000..7b6a8c3a07b4 |
30 |
--- /dev/null |
31 |
+++ b/app-text/calibre/calibre-5.33.2.ebuild |
32 |
@@ -0,0 +1,315 @@ |
33 |
+# Copyright 1999-2021 Gentoo Authors |
34 |
+# Distributed under the terms of the GNU General Public License v2 |
35 |
+ |
36 |
+EAPI=8 |
37 |
+ |
38 |
+PYTHON_COMPAT=( python3_{8..9} ) |
39 |
+PYTHON_REQ_USE="ipv6(+),sqlite,ssl" |
40 |
+ |
41 |
+inherit toolchain-funcs python-single-r1 xdg-utils |
42 |
+ |
43 |
+DESCRIPTION="Ebook management application" |
44 |
+HOMEPAGE="https://calibre-ebook.com/" |
45 |
+SRC_URI="https://download.calibre-ebook.com/${PV}/${P}.tar.xz" |
46 |
+ |
47 |
+LICENSE=" |
48 |
+ GPL-3+ |
49 |
+ GPL-3 |
50 |
+ GPL-2+ |
51 |
+ GPL-2 |
52 |
+ GPL-1+ |
53 |
+ LGPL-3+ |
54 |
+ LGPL-2.1+ |
55 |
+ LGPL-2.1 |
56 |
+ BSD |
57 |
+ MIT |
58 |
+ Old-MIT |
59 |
+ Apache-2.0 |
60 |
+ public-domain |
61 |
+ || ( Artistic GPL-1+ ) |
62 |
+ CC-BY-3.0 |
63 |
+ OFL-1.1 |
64 |
+ PSF-2 |
65 |
+" |
66 |
+KEYWORDS="~amd64 ~arm ~x86" |
67 |
+SLOT="0" |
68 |
+IUSE="ios +udisks" |
69 |
+ |
70 |
+REQUIRED_USE="${PYTHON_REQUIRED_USE}" |
71 |
+ |
72 |
+COMMON_DEPEND="${PYTHON_DEPS} |
73 |
+ >=app-text/hunspell-1.7:= |
74 |
+ >=app-text/podofo-0.9.6_pre20171027:= |
75 |
+ >=app-text/poppler-0.26.5[qt5] |
76 |
+ dev-libs/glib:2= |
77 |
+ dev-libs/hyphen:= |
78 |
+ >=dev-libs/icu-57.1:= |
79 |
+ dev-libs/libinput:= |
80 |
+ >=dev-libs/dbus-glib-0.106 |
81 |
+ dev-libs/snowball-stemmer:= |
82 |
+ >=sys-apps/dbus-1.10.8 |
83 |
+ $(python_gen_cond_dep ' |
84 |
+ app-accessibility/speech-dispatcher[python,${PYTHON_USEDEP}] |
85 |
+ >=dev-python/apsw-3.25.2_p1[${PYTHON_USEDEP}] |
86 |
+ dev-python/beautifulsoup4[${PYTHON_USEDEP}] |
87 |
+ dev-python/cchardet[${PYTHON_USEDEP}] |
88 |
+ >=dev-python/chardet-3.0.3[${PYTHON_USEDEP}] |
89 |
+ >=dev-python/cssselect-0.7.1[${PYTHON_USEDEP}] |
90 |
+ >=dev-python/css-parser-1.0.4[${PYTHON_USEDEP}] |
91 |
+ >=dev-python/dbus-python-1.2.4[${PYTHON_USEDEP}] |
92 |
+ dev-python/dnspython[${PYTHON_USEDEP}] |
93 |
+ >=dev-python/feedparser-5.2.1[${PYTHON_USEDEP}] |
94 |
+ >=dev-python/html2text-2019.8.11[${PYTHON_USEDEP}] |
95 |
+ >=dev-python/html5-parser-0.4.9[${PYTHON_USEDEP}] |
96 |
+ dev-python/jeepney[${PYTHON_USEDEP}] |
97 |
+ >=dev-python/lxml-3.8.0[${PYTHON_USEDEP}] |
98 |
+ >=dev-python/markdown-3.0.1[${PYTHON_USEDEP}] |
99 |
+ >=dev-python/mechanize-0.3.5[${PYTHON_USEDEP}] |
100 |
+ >=dev-python/msgpack-0.6.2[${PYTHON_USEDEP}] |
101 |
+ >=dev-python/netifaces-0.10.5[${PYTHON_USEDEP}] |
102 |
+ >=dev-python/pillow-3.2.0[${PYTHON_USEDEP}] |
103 |
+ >=dev-python/psutil-4.3.0[${PYTHON_USEDEP}] |
104 |
+ >=dev-python/pychm-0.8.6[${PYTHON_USEDEP}] |
105 |
+ dev-python/pycryptodome[${PYTHON_USEDEP}] |
106 |
+ >=dev-python/pygments-2.3.1[${PYTHON_USEDEP}] |
107 |
+ >=dev-python/python-dateutil-2.5.3[${PYTHON_USEDEP}] |
108 |
+ >=dev-python/PyQt5-5.15.5_pre2107091435[gui,svg,widgets,network,printsupport,${PYTHON_USEDEP}] |
109 |
+ >=dev-python/PyQt-builder-1.10.3[${PYTHON_USEDEP}] |
110 |
+ >=dev-python/PyQtWebEngine-5.15.5_pre2108100905[${PYTHON_USEDEP}] |
111 |
+ dev-python/regex[${PYTHON_USEDEP}] |
112 |
+ dev-python/zeroconf[${PYTHON_USEDEP}] |
113 |
+ ') |
114 |
+ dev-qt/qtcore:5= |
115 |
+ dev-qt/qtdbus:5= |
116 |
+ dev-qt/qtgui:5=[jpeg] |
117 |
+ >=dev-qt/qtwebengine-5.12 |
118 |
+ dev-qt/qtwidgets:5= |
119 |
+ dev-util/desktop-file-utils |
120 |
+ dev-util/gtk-update-icon-cache |
121 |
+ media-fonts/liberation-fonts |
122 |
+ media-libs/fontconfig:= |
123 |
+ >=media-libs/freetype-2:= |
124 |
+ >=media-libs/libmtp-1.1.11:= |
125 |
+ >=media-libs/libwmf-0.2.8 |
126 |
+ >=media-gfx/optipng-0.7.6 |
127 |
+ >=sys-libs/zlib-1.2.11:= |
128 |
+ virtual/libusb:1= |
129 |
+ x11-libs/libxkbcommon:= |
130 |
+ x11-libs/libX11:= |
131 |
+ x11-libs/libXext:= |
132 |
+ x11-libs/libXrender:= |
133 |
+ x11-misc/shared-mime-info |
134 |
+ >=x11-misc/xdg-utils-1.0.2-r2 |
135 |
+ ios? ( |
136 |
+ >=app-pda/usbmuxd-1.0.8 |
137 |
+ >=app-pda/libimobiledevice-1.2.0 |
138 |
+ ) |
139 |
+ udisks? ( virtual/libudev )" |
140 |
+RDEPEND="${COMMON_DEPEND} |
141 |
+ udisks? ( sys-fs/udisks:2 )" |
142 |
+DEPEND="${COMMON_DEPEND}" |
143 |
+BDEPEND="$(python_gen_cond_dep ' |
144 |
+ >=dev-python/setuptools-23.1.0[${PYTHON_USEDEP}] |
145 |
+ >=dev-python/sip-5[${PYTHON_USEDEP}] |
146 |
+ ') |
147 |
+ >=virtual/podofo-build-0.9.6_pre20171027 |
148 |
+ virtual/pkgconfig" |
149 |
+ |
150 |
+PATCHES=( |
151 |
+ # Don't prompt the user for updates - they've installed via |
152 |
+ # an ebuild. |
153 |
+ "${FILESDIR}/${PN}-2.9.0-no_updates_dialog.patch" |
154 |
+ |
155 |
+ # Skip calling a binary (JxrDecApp) from libjxr which is used for tests |
156 |
+ # We don't (yet?) package libjxr and it seems to be dead upstream |
157 |
+ # (last commit in 2017) |
158 |
+ "${FILESDIR}/${PN}-5.31.0-jxr-test.patch" |
159 |
+ |
160 |
+ # TODO: |
161 |
+ # test_qt tries to load a bunch of images using Qt and it currently fails |
162 |
+ # due to some presumably missing dependencies. This is important and |
163 |
+ # we need to look into it, but at time of writing, none of the tests |
164 |
+ # are even bring run, so I'd like to return to this later. |
165 |
+ # We don't want to skip test_qt entirely, so just skip this particular |
166 |
+ # assert for now. |
167 |
+ "${FILESDIR}/${PN}-5.31.0-qt-image-test.patch" |
168 |
+) |
169 |
+ |
170 |
+pkg_pretend() { |
171 |
+ if [[ ${MERGE_TYPE} != binary ]] && tc-is-gcc && [[ $(gcc-major-version) -lt 6 ]]; then |
172 |
+ eerror "Calibre cannot be built with this version of gcc." |
173 |
+ eerror "You need at least gcc-6.0" |
174 |
+ die "Your C compiler is too old for this package." |
175 |
+ fi |
176 |
+} |
177 |
+ |
178 |
+src_prepare() { |
179 |
+ default |
180 |
+ |
181 |
+ # Warning: |
182 |
+ # |
183 |
+ # While it might be rather tempting to add yet another sed here, |
184 |
+ # please don't. There have been several bugs in Gentoo's packaging |
185 |
+ # of calibre from seds-which-become-stale. Please consider |
186 |
+ # creating a patch instead, but in any case, run the test suite |
187 |
+ # and ensure it passes. |
188 |
+ # |
189 |
+ # If in doubt about a problem, checking Fedora or Arch Linux's packaging |
190 |
+ # is recommended, as Arch Linux's PKGBUILD is maintained by a Calibre |
191 |
+ # contributor. Or just ask them. |
192 |
+ |
193 |
+ # Fix outdated version constant. |
194 |
+ #sed -e "s#\\(^numeric_version =\\).*#\\1 (${PV//./, })#" \ |
195 |
+ # -i src/calibre/constants.py || \ |
196 |
+ # die "sed failed to patch constants.py" |
197 |
+ |
198 |
+ # Avoid sandbox violation in /usr/share/gnome/apps when linux.py |
199 |
+ # calls xdg-* (bug #258938). |
200 |
+ sed -e "s|'xdg-desktop-menu', 'install'|\\0, '--mode', 'user'|" \ |
201 |
+ -e "s|check_call(\\['xdg-desktop-menu', 'forceupdate'\\])|#\\0|" \ |
202 |
+ -e "s|\\(CurrentDir(tdir)\\), \\\\\$|\\1:|" \ |
203 |
+ -e "s|, PreserveMIMEDefaults():|:|" \ |
204 |
+ -e "s|'xdg-icon-resource', 'install'|\\0, '--mode', 'user'|" \ |
205 |
+ -e "s|cmd\[2\]|cmd[4]|" \ |
206 |
+ -e "s|cc(\\['xdg-desktop-menu', 'forceupdate'\\])|#\\0|" \ |
207 |
+ -e "s|'xdg-mime', 'install'|\\0, '--mode', 'user'|" \ |
208 |
+ -i src/calibre/linux.py || die "sed failed to patch linux.py" |
209 |
+ |
210 |
+ # Disable unnecessary privilege dropping for bug #287067. |
211 |
+ sed -e "s:if os.geteuid() == 0:if False and os.geteuid() == 0:" \ |
212 |
+ -i setup/install.py || die "sed failed to patch install.py" |
213 |
+ sed -e "/^ os.chdir(os.path.join(src_dir, 'build'))$/a\ |
214 |
+\\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ self.check_call(['sed', \ |
215 |
+'-e', 's|^CFLAGS .*|\\\\\\\\0 ${CFLAGS}|', \ |
216 |
+'-e', 's|^CXXFLAGS .*|\\\\\\\\0 ${CXXFLAGS}|', \ |
217 |
+'-e', 's|^LFLAGS .*|\\\\\\\\0 ${LDFLAGS}|', \ |
218 |
+'-i', os.path.join(os.path.basename(src_dir), 'Makefile')])" \ |
219 |
+ -e "s|open(self.j(bdir, '.qmake.conf'), 'wb').close()|open(self.j(bdir, '.qmake.conf'), 'wb').write(b'QMAKE_LFLAGS += ${LDFLAGS}')|" \ |
220 |
+ -i setup/build.py || die "sed failed to patch build.py" |
221 |
+} |
222 |
+ |
223 |
+src_compile() { |
224 |
+ # TODO: get qmake called by setup.py to respect CC and CXX too |
225 |
+ tc-export CC CXX |
226 |
+ |
227 |
+ # bug 821871 |
228 |
+ local MY_LIBDIR="${ESYSROOT}/usr/$(get_libdir)" |
229 |
+ export FT_LIB_DIR="${MY_LIBDIR}" HUNSPELL_LIB_DIR="${MY_LIBDIR}" PODOFO_LIB_DIR="${MY_LIBDIR}" |
230 |
+ |
231 |
+ PATH="${T}/bin:${PATH}" ${EPYTHON} setup.py build || die |
232 |
+} |
233 |
+ |
234 |
+src_test() { |
235 |
+ # Skipped tests: |
236 |
+ # - 7z (unpackaged Python dependency: py7zr) |
237 |
+ # - test_unrar (unpackaged Python dependency: unrardll) |
238 |
+ # |
239 |
+ # Note that we currently have a hack to skip one part of test_qt! |
240 |
+ # See PATCHES for more. |
241 |
+ CALIBRE_PY3_PORT=1 ${PYTHON} setup.py test \ |
242 |
+ --exclude-test-name 7z \ |
243 |
+ --exclude-test-name test_searching \ |
244 |
+ --exclude-test-name test_unrar || die |
245 |
+} |
246 |
+ |
247 |
+src_install() { |
248 |
+ # calibre works with python 3, so remove the python 2 constraint |
249 |
+ export CALIBRE_PY3_PORT=1 |
250 |
+ |
251 |
+ # Bypass kbuildsycoca and update-mime-database in order to |
252 |
+ # avoid sandbox violations if xdg-mime tries to call them. |
253 |
+ mkdir "${T}/bin" || die |
254 |
+ cat - > "${T}/bin/kbuildsycoca" <<-EOF |
255 |
+ #!${BASH} |
256 |
+ echo $0 : $@ |
257 |
+ exit 0 |
258 |
+ EOF |
259 |
+ |
260 |
+ cp "${T}"/bin/{kbuildsycoca,update-mime-database} || die |
261 |
+ chmod +x "${T}"/bin/{kbuildsycoca,update-mime-database} || die |
262 |
+ |
263 |
+ export QMAKE="${EPREFIX}/usr/$(get_libdir)/qt5/bin/qmake" |
264 |
+ |
265 |
+ # Unset DISPLAY in order to prevent xdg-mime from triggering a sandbox |
266 |
+ # violation with kbuildsycoca as in bug #287067, comment #13. |
267 |
+ export -n DISPLAY |
268 |
+ |
269 |
+ # Bug #352625 - Some LANGUAGE values can trigger the following ValueError: |
270 |
+ # File "/usr/lib/python2.6/locale.py", line 486, in getdefaultlocale |
271 |
+ # return _parse_localename(localename) |
272 |
+ # File "/usr/lib/python2.6/locale.py", line 418, in _parse_localename |
273 |
+ # raise ValueError, 'unknown locale: %s' % localename |
274 |
+ #ValueError: unknown locale: 46 |
275 |
+ export -n LANG LANGUAGE ${!LC_*} |
276 |
+ export LC_ALL=C.utf8 #709682 |
277 |
+ |
278 |
+ # Bug #295672 - Avoid sandbox violation in ~/.config by forcing |
279 |
+ # variables to point to our fake temporary $HOME. |
280 |
+ export HOME="${T}/fake_homedir" |
281 |
+ export XDG_CONFIG_HOME="${HOME}/.config" |
282 |
+ export XDG_DATA_HOME="${HOME}/.local/share" |
283 |
+ export CALIBRE_CONFIG_DIRECTORY="${XDG_CONFIG_HOME}/calibre" |
284 |
+ mkdir -p "${XDG_DATA_HOME}" "${CALIBRE_CONFIG_DIRECTORY}" || die |
285 |
+ |
286 |
+ tc-export CC CXX |
287 |
+ # Bug #334243 - respect LDFLAGS when building extensions |
288 |
+ export OVERRIDE_CFLAGS="$CFLAGS" OVERRIDE_LDFLAGS="$LDFLAGS" |
289 |
+ local libdir=$(get_libdir) |
290 |
+ [[ -n $libdir ]] || die "get_libdir returned an empty string" |
291 |
+ |
292 |
+ addpredict /dev/dri #665310 |
293 |
+ |
294 |
+ PATH=${T}/bin:${PATH} PYTHONPATH=${S}/src${PYTHONPATH:+:}${PYTHONPATH} \ |
295 |
+ "${PYTHON}" setup.py install \ |
296 |
+ --root="${D}" \ |
297 |
+ --prefix="${EPREFIX}/usr" \ |
298 |
+ --libdir="${EPREFIX}/usr/${libdir}" \ |
299 |
+ --staging-root="${ED}/usr" \ |
300 |
+ --staging-libdir="${ED}/usr/${libdir}" || die |
301 |
+ |
302 |
+ find "${ED}"/usr/share -type d -empty -delete |
303 |
+ |
304 |
+ cd "${ED}"/usr/share/calibre/fonts/liberation || die |
305 |
+ local x |
306 |
+ for x in * ; do |
307 |
+ [[ -f ${EPREFIX}/usr/share/fonts/liberation-fonts/${x} ]] || continue |
308 |
+ ln -sf "../../../fonts/liberation-fonts/${x}" "${x}" || die |
309 |
+ done |
310 |
+ |
311 |
+ einfo "Converting python shebangs" |
312 |
+ python_fix_shebang --force "${ED}" |
313 |
+ |
314 |
+ einfo "Compiling python modules" |
315 |
+ python_optimize "${ED}"/usr/$(get_libdir)/calibre "${D}/$(python_get_sitedir)" |
316 |
+ |
317 |
+ newinitd "${FILESDIR}"/calibre-server-3.init calibre-server |
318 |
+ newconfd "${FILESDIR}"/calibre-server-3.conf calibre-server |
319 |
+} |
320 |
+ |
321 |
+pkg_preinst() { |
322 |
+ # Indentify stray directories from upstream's "Binary install" |
323 |
+ # method (see bug 622728). |
324 |
+ CALIBRE_LIB_DIR=/usr/$(get_libdir)/calibre |
325 |
+ CALIBRE_LIB_CONTENT=$(for x in "${ED}${CALIBRE_LIB_DIR}"/*; do |
326 |
+ printf -- "${x##*/} "; done) || die "Failed to list ${ED}${CALIBRE_LIB_DIR}" |
327 |
+} |
328 |
+ |
329 |
+pkg_postinst() { |
330 |
+ [[ -n ${CALIBRE_LIB_DIR} ]] || die "CALIBRE_LIB_DIR is unset" |
331 |
+ local x |
332 |
+ for x in "${EROOT}${CALIBRE_LIB_DIR}"/*; do |
333 |
+ if [[ " ${CALIBRE_LIB_CONTENT} " != *" ${x##*/} "* ]]; then |
334 |
+ elog "Purging '${x}'" |
335 |
+ rm -rf "${x}" |
336 |
+ fi |
337 |
+ done |
338 |
+ xdg_desktop_database_update |
339 |
+ xdg_mimeinfo_database_update |
340 |
+ xdg_icon_cache_update |
341 |
+} |
342 |
+ |
343 |
+pkg_postrm() { |
344 |
+ xdg_desktop_database_update |
345 |
+ xdg_mimeinfo_database_update |
346 |
+ xdg_icon_cache_update |
347 |
+} |