Gentoo Archives: gentoo-commits

From: Zac Medico <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-text/calibre/
Date: Sun, 21 Jul 2019 04:22:05
Message-Id: 1563682856.855e17a25ed216ab33fdf82fbb17ad753300997f.zmedico@gentoo
1 commit: 855e17a25ed216ab33fdf82fbb17ad753300997f
2 Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
3 AuthorDate: Sun Jul 21 04:20:19 2019 +0000
4 Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
5 CommitDate: Sun Jul 21 04:20:56 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=855e17a2
7
8 app-text/calibre: Remove old versions
9
10 Package-Manager: Portage-2.3.69, Repoman-2.3.16
11 Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>
12
13 app-text/calibre/Manifest | 2 -
14 app-text/calibre/calibre-3.42.0.ebuild | 291 ---------------------------------
15 app-text/calibre/calibre-3.43.0.ebuild | 270 ------------------------------
16 3 files changed, 563 deletions(-)
17
18 diff --git a/app-text/calibre/Manifest b/app-text/calibre/Manifest
19 index a6fd9cd885a..ab0710392ec 100644
20 --- a/app-text/calibre/Manifest
21 +++ b/app-text/calibre/Manifest
22 @@ -1,4 +1,2 @@
23 DIST calibre-3.26.1.tar.xz 39109660 BLAKE2B 0e98c273b8a5dfafea7a7027de3f83ad25ab835edadedf78b7e9bc356bcac8937d915944f2ab6503b414c49b4e792e090e7bd2433a4e86373bf115720ed78b0a SHA512 893e36b101defaca29281b4bd072aafc1c4cb20a9cd3ee06a0b68fbe6b39cab34952799939ac4f54c77148c87861c5ab4ddff84f5ec8c2274ae7fa6424259ff5
24 -DIST calibre-3.42.0.tar.xz 38530420 BLAKE2B 3b1fa7abfed277f7a787fa2b65697817d0fe8553d570901a8817e63756f7edc8321c18768fb9c965382f9027d053af708fdf54c4288c831acb0ec03a64748651 SHA512 0a9b18cbf1d4e75d1e10e9dcf7318f07687e0a39d1d524f99f47240d28bc13cad6f28bc30e7cc9662766264d9a465fa4f24cbc27e5f36d20cfb1a8f94ed8ced2
25 -DIST calibre-3.43.0.tar.xz 38682448 BLAKE2B 6a19be6741ecc2abc839731ca35684363310431db5fa8f5cccd264f7bef37cd365ae5f38f97f8b4de323c035bcfcab30e0b2ade8a366d1e96a70a22f6c4aaa54 SHA512 e187b2509041303102980cbd70b856b7699a7d5b2a9010f817406164ef785cd0c6c7ee77ebf8d674183e0dfc6928ed9316d2c2440bc1fe762f112784216c35a8
26 DIST calibre-3.44.0.tar.xz 38643008 BLAKE2B 7eb1412aa5de6ba2f48ea13e922dffff7ace0f4f475832ebe122db967c71df05b6bbb45092bdd53ddfe35d7a0c2af566ed83dde9aac64200d41ea2adc4cb1886 SHA512 a97f45f5f788357f62b4088c4d8190cd3e3b790685871d5a024342d5d21ca978d46fa4e47f85eef4b9fbc0774923732938a812dd188cd4a315445cf25b187d28
27
28 diff --git a/app-text/calibre/calibre-3.42.0.ebuild b/app-text/calibre/calibre-3.42.0.ebuild
29 deleted file mode 100644
30 index 93cdc79a92e..00000000000
31 --- a/app-text/calibre/calibre-3.42.0.ebuild
32 +++ /dev/null
33 @@ -1,291 +0,0 @@
34 -# Copyright 1999-2019 Gentoo Authors
35 -# Distributed under the terms of the GNU General Public License v2
36 -
37 -EAPI=7
38 -
39 -PYTHON_COMPAT=( python2_7 )
40 -PYTHON_REQ_USE="sqlite,ssl"
41 -
42 -inherit bash-completion-r1 desktop toolchain-funcs python-single-r1 xdg-utils
43 -
44 -DESCRIPTION="Ebook management application"
45 -HOMEPAGE="https://calibre-ebook.com/"
46 -SRC_URI="https://download.calibre-ebook.com/${PV}/${P}.tar.xz"
47 -
48 -LICENSE="
49 - GPL-3+
50 - GPL-3
51 - GPL-2+
52 - GPL-2
53 - GPL-1+
54 - LGPL-3+
55 - LGPL-2.1+
56 - LGPL-2.1
57 - BSD
58 - MIT
59 - Old-MIT
60 - Apache-2.0
61 - public-domain
62 - || ( Artistic GPL-1+ )
63 - CC-BY-3.0
64 - OFL-1.1
65 - PSF-2
66 -"
67 -KEYWORDS="~amd64 ~arm ~x86"
68 -SLOT="0"
69 -IUSE="ios +udisks"
70 -
71 -REQUIRED_USE="${PYTHON_REQUIRED_USE}"
72 -
73 -COMMON_DEPEND="${PYTHON_DEPS}
74 - >=app-text/podofo-0.9.6_pre20171027:=
75 - >=app-text/poppler-0.26.5[qt5]
76 - >=dev-libs/chmlib-0.40:=
77 - dev-libs/glib:2=
78 - >=dev-libs/icu-57.1:=
79 - dev-libs/libinput:=
80 - >=dev-python/apsw-3.25.2_p1[${PYTHON_USEDEP}]
81 - >=dev-python/beautifulsoup-3.0.5:python-2[${PYTHON_USEDEP}]
82 - >=dev-python/chardet-3.0.3[${PYTHON_USEDEP}]
83 - >=dev-python/cssselect-0.7.1[${PYTHON_USEDEP}]
84 - >=dev-python/css-parser-1.0.4[${PYTHON_USEDEP}]
85 - >=dev-python/dbus-python-1.2.4[${PYTHON_USEDEP}]
86 - >=dev-libs/dbus-glib-0.106
87 - >=sys-apps/dbus-1.10.8
88 - >=dev-python/feedparser-5.2.1[${PYTHON_USEDEP}]
89 - >=dev-python/html5-parser-0.4.3[${PYTHON_USEDEP}]
90 - >=dev-python/lxml-3.8.0[${PYTHON_USEDEP}]
91 - >=dev-python/markdown-3.0.1[${PYTHON_USEDEP}]
92 - >=dev-python/mechanize-0.3.5[${PYTHON_USEDEP}]
93 - >=dev-python/msgpack-0.5.6[${PYTHON_USEDEP}]
94 - >=dev-python/netifaces-0.10.5[${PYTHON_USEDEP}]
95 - >=dev-python/pillow-3.2.0[${PYTHON_USEDEP}]
96 - >=dev-python/psutil-4.3.0[${PYTHON_USEDEP}]
97 - >=dev-python/pygments-2.3.1[${PYTHON_USEDEP}]
98 - >=dev-python/python-dateutil-2.5.3[${PYTHON_USEDEP}]
99 - >=dev-python/PyQt5-5.8[gui,svg,webkit,widgets,network,printsupport,${PYTHON_USEDEP}]
100 - dev-python/regex[${PYTHON_USEDEP}]
101 - dev-qt/qtcore:5=
102 - dev-qt/qtdbus:5=
103 - dev-qt/qtgui:5=
104 - dev-qt/qtwidgets:5=
105 - dev-util/desktop-file-utils
106 - dev-util/gtk-update-icon-cache
107 - media-fonts/liberation-fonts
108 - media-libs/fontconfig:=
109 - >=media-libs/freetype-2:=
110 - >=media-libs/libmtp-1.1.11:=
111 - >=media-libs/libwmf-0.2.8
112 - >=media-gfx/optipng-0.7.6
113 - >=sys-libs/zlib-1.2.11:=
114 - virtual/libusb:1=
115 - virtual/python-dnspython[${PYTHON_USEDEP}]
116 - x11-libs/libxkbcommon:=
117 - x11-libs/libX11:=
118 - x11-libs/libXext:=
119 - x11-libs/libXrender:=
120 - x11-misc/shared-mime-info
121 - >=x11-misc/xdg-utils-1.0.2-r2
122 - ios? (
123 - >=app-pda/usbmuxd-1.0.8
124 - >=app-pda/libimobiledevice-1.2.0
125 - )
126 - udisks? ( virtual/libudev )"
127 -RDEPEND="${COMMON_DEPEND}
128 - udisks? ( || ( sys-fs/udisks:2 sys-fs/udisks:0 ) )"
129 -DEPEND="${COMMON_DEPEND}
130 - >=dev-python/setuptools-23.1.0[${PYTHON_USEDEP}]
131 - dev-python/sip[${PYTHON_USEDEP}]
132 - >=virtual/podofo-build-0.9.6_pre20171027
133 - virtual/pkgconfig"
134 -
135 -pkg_pretend() {
136 - if [[ ${MERGE_TYPE} != binary && $(gcc-major-version) -lt 6 ]]; then
137 - eerror "Calibre cannot be built with this version of gcc."
138 - eerror "You need at least gcc-6.0"
139 - die "Your C compiler is too old for this package."
140 - fi
141 -}
142 -
143 -src_prepare() {
144 - # no_updates: do not annoy user with "new version is availible all the time
145 - # disable_plugins: walking sec-hole, wait for upstream to use GHNS interface
146 - eapply \
147 - "${FILESDIR}/${PN}-2.9.0-no_updates_dialog.patch" \
148 - "${FILESDIR}/${PN}-disable_plugins.patch"
149 -
150 - eapply_user
151 -
152 - # Fix outdated version constant.
153 - #sed -e "s#\\(^numeric_version =\\).*#\\1 (${PV//./, })#" \
154 - # -i src/calibre/constants.py || \
155 - # die "sed failed to patch constants.py"
156 -
157 - # Avoid sandbox violation in /usr/share/gnome/apps when linux.py
158 - # calls xdg-* (bug #258938).
159 - sed -e "s|'xdg-desktop-menu', 'install'|\\0, '--mode', 'user'|" \
160 - -e "s|check_call(\\['xdg-desktop-menu', 'forceupdate'\\])|#\\0|" \
161 - -e "s|\\(CurrentDir(tdir)\\), \\\\\$|\\1:|" \
162 - -e "s|, PreserveMIMEDefaults():|:|" \
163 - -e "s|'xdg-icon-resource', 'install'|\\0, '--mode', 'user'|" \
164 - -e "s|cmd\[2\]|cmd[4]|" \
165 - -e "s|cc(\\['xdg-desktop-menu', 'forceupdate'\\])|#\\0|" \
166 - -e "s|'xdg-mime', 'install'|\\0, '--mode', 'user'|" \
167 - -i src/calibre/linux.py || die "sed failed to patch linux.py"
168 -
169 - # Disable unnecessary privilege dropping for bug #287067.
170 - sed -e "s:if os.geteuid() == 0:if False and os.geteuid() == 0:" \
171 - -i setup/install.py || die "sed failed to patch install.py"
172 -
173 - sed -e "/^ self.check_call(\\[QMAKE\\] + qmc + \\[proname\\])$/a\
174 -\\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ self.check_call(['sed', \
175 -'-e', 's|^CFLAGS .*|\\\\\\\\0 ${CFLAGS}|', \
176 -'-e', 's|^CXXFLAGS .*|\\\\\\\\0 ${CXXFLAGS}|', \
177 -'-e', 's|^LFLAGS .*|\\\\\\\\0 ${LDFLAGS}|', \
178 -'-i', 'Makefile'])" \
179 - -i setup/build.py || die "sed failed to patch build.py"
180 -
181 - # use system beautifulsoup, instead of bundled
182 - rm -f "${S}"/src/calibre/ebooks/BeautifulSoup.py \
183 - || die "could not remove bundled beautifulsoup"
184 - find "${S}" -type f -name \*.py -exec \
185 - sed -e 's/calibre.ebooks.BeautifulSoup/BeautifulSoup/' -i {} + \
186 - || die "could not sed bundled beautifulsoup out of the source tree"
187 -
188 - # avoid failure of xdg tools to recognize vendor prefix
189 - sed -e "s|xdg-icon-resource install|xdg-icon-resource install --novendor|" \
190 - -e "s|'xdg-mime', 'install'|'xdg-mime', 'install', '--novendor'|" \
191 - -e "s|'xdg-desktop-menu', 'install'|'xdg-desktop-menu', 'install', '--novendor'|" \
192 - -i "${S}"/src/calibre/linux.py || die 'sed failed'
193 -
194 - # don't create/install uninstaller
195 - sed '/self\.create_uninstaller()/d' -i src/calibre/linux.py || die
196 -}
197 -
198 -src_install() {
199 - # Bypass kbuildsycoca and update-mime-database in order to
200 - # avoid sandbox violations if xdg-mime tries to call them.
201 - cat - > "${T}/kbuildsycoca" <<-EOF
202 - #!${BASH}
203 - echo $0 : $@
204 - exit 0
205 - EOF
206 -
207 - cp "${T}"/{kbuildsycoca,update-mime-database} || die
208 - chmod +x "${T}"/{kbuildsycoca,update-mime-database} || die
209 -
210 - export QMAKE="${EPREFIX}/usr/$(get_libdir)/qt5/bin/qmake"
211 -
212 - # Unset DISPLAY in order to prevent xdg-mime from triggering a sandbox
213 - # violation with kbuildsycoca as in bug #287067, comment #13.
214 - export -n DISPLAY
215 -
216 - # Bug #352625 - Some LANGUAGE values can trigger the following ValueError:
217 - # File "/usr/lib/python2.6/locale.py", line 486, in getdefaultlocale
218 - # return _parse_localename(localename)
219 - # File "/usr/lib/python2.6/locale.py", line 418, in _parse_localename
220 - # raise ValueError, 'unknown locale: %s' % localename
221 - #ValueError: unknown locale: 46
222 - export -n LANG LANGUAGE ${!LC_*}
223 - export LC_ALL=C #684484
224 -
225 - # Bug #295672 - Avoid sandbox violation in ~/.config by forcing
226 - # variables to point to our fake temporary $HOME.
227 - export HOME="${T}/fake_homedir"
228 - export XDG_CONFIG_HOME="${HOME}/.config"
229 - export XDG_DATA_HOME="${HOME}/.local/share"
230 - export CALIBRE_CONFIG_DIRECTORY="${XDG_CONFIG_HOME}/calibre"
231 - mkdir -p "${XDG_DATA_HOME}" "${CALIBRE_CONFIG_DIRECTORY}" || die
232 -
233 - tc-export CC CXX
234 - # Bug #334243 - respect LDFLAGS when building extensions
235 - export OVERRIDE_CFLAGS="$CFLAGS" OVERRIDE_LDFLAGS="$LDFLAGS"
236 - local libdir=$(get_libdir)
237 - [[ -n $libdir ]] || die "get_libdir returned an empty string"
238 -
239 - addpredict /dev/dri #665310
240 -
241 - #dodir "/usr/$(get_libdir)/python2.7/site-packages" # for init_calibre.py
242 - #dodir $(python_get_sitedir)
243 - PATH=${T}:${PATH} PYTHONPATH=${S}/src${PYTHONPATH:+:}${PYTHONPATH} \
244 - "${PYTHON}" setup.py install \
245 - --root="${D}" \
246 - --prefix="${EPREFIX}/usr" \
247 - --libdir="${EPREFIX}/usr/${libdir}" \
248 - --staging-root="${ED}/usr" \
249 - --staging-libdir="${ED}/usr/${libdir}" || die
250 -
251 - # The menu entries end up here due to '--mode user' being added to
252 - # xdg-* options in src_prepare.
253 - dodir /usr/share/mime/packages
254 - chmod -fR a+rX,u+w,g-w,o-w "${HOME}"/.local
255 - mv "${HOME}"/.local/share/mime/packages/* "${ED}"/usr/share/mime/packages/ ||
256 - die "failed to register mime types"
257 - dodir /usr/share/icons
258 - mv "${HOME}"/.local/share/icons/* "${ED}"/usr/share/icons/ ||
259 - die "failed to install icon files"
260 -
261 - domenu "${HOME}"/.local/share/applications/*.desktop ||
262 - die "failed to install .desktop menu files"
263 -
264 - find "${ED}"/usr/share -type d -empty -delete
265 -
266 - cd "${ED}"/usr/share/calibre/fonts/liberation || die
267 - local x
268 - for x in * ; do
269 - [[ -f ${EPREFIX}usr/share/fonts/liberation-fonts/${x} ]] || continue
270 - ln -sf "../../../fonts/liberation-fonts/${x}" "${x}" || die
271 - done
272 -
273 - einfo "Converting python shebangs"
274 - python_fix_shebang --force "${ED}"
275 -
276 - einfo "Compiling python modules"
277 - python_optimize "${ED}"/usr/lib/calibre
278 -
279 - newinitd "${FILESDIR}"/calibre-server-3.init calibre-server
280 - newconfd "${FILESDIR}"/calibre-server-3.conf calibre-server
281 -
282 - bashcomp_alias calibre \
283 - lrfviewer \
284 - calibre-debug \
285 - ebook-meta \
286 - calibre-server \
287 - ebook-viewer \
288 - ebook-polish \
289 - fetch-ebook-metadata \
290 - lrf2lrs \
291 - ebook-convert \
292 - ebook-edit \
293 - calibre-smtp \
294 - ebook-device
295 -
296 -}
297 -
298 -pkg_preinst() {
299 - # Indentify stray directories from upstream's "Binary install"
300 - # method (see bug 622728).
301 - CALIBRE_LIB_DIR=/usr/$(get_libdir)/calibre
302 - CALIBRE_LIB_CONTENT=$(for x in "${ED}${CALIBRE_LIB_DIR}"/*; do
303 - printf -- "${x##*/} "; done) || die "Failed to list ${ED}${CALIBRE_LIB_DIR}"
304 -}
305 -
306 -pkg_postinst() {
307 - [[ -n ${CALIBRE_LIB_DIR} ]] || die "CALIBRE_LIB_DIR is unset"
308 - local x
309 - for x in "${EROOT%/}${CALIBRE_LIB_DIR}"/*; do
310 - if [[ " ${CALIBRE_LIB_CONTENT} " != *" ${x##*/} "* ]]; then
311 - elog "Purging '${x}'"
312 - rm -rf "${x}"
313 - fi
314 - done
315 - xdg_desktop_database_update
316 - xdg_mimeinfo_database_update
317 - xdg_icon_cache_update
318 -}
319 -
320 -pkg_postrm() {
321 - xdg_desktop_database_update
322 - xdg_mimeinfo_database_update
323 - xdg_icon_cache_update
324 -}
325
326 diff --git a/app-text/calibre/calibre-3.43.0.ebuild b/app-text/calibre/calibre-3.43.0.ebuild
327 deleted file mode 100644
328 index cc0a05f19e8..00000000000
329 --- a/app-text/calibre/calibre-3.43.0.ebuild
330 +++ /dev/null
331 @@ -1,270 +0,0 @@
332 -# Copyright 1999-2019 Gentoo Authors
333 -# Distributed under the terms of the GNU General Public License v2
334 -
335 -EAPI=7
336 -
337 -PYTHON_COMPAT=( python2_7 )
338 -PYTHON_REQ_USE="sqlite,ssl"
339 -
340 -inherit bash-completion-r1 desktop toolchain-funcs python-single-r1 xdg-utils
341 -
342 -DESCRIPTION="Ebook management application"
343 -HOMEPAGE="https://calibre-ebook.com/"
344 -SRC_URI="https://download.calibre-ebook.com/${PV}/${P}.tar.xz"
345 -
346 -LICENSE="
347 - GPL-3+
348 - GPL-3
349 - GPL-2+
350 - GPL-2
351 - GPL-1+
352 - LGPL-3+
353 - LGPL-2.1+
354 - LGPL-2.1
355 - BSD
356 - MIT
357 - Old-MIT
358 - Apache-2.0
359 - public-domain
360 - || ( Artistic GPL-1+ )
361 - CC-BY-3.0
362 - OFL-1.1
363 - PSF-2
364 -"
365 -KEYWORDS="~amd64 ~arm ~x86"
366 -SLOT="0"
367 -IUSE="ios +udisks"
368 -
369 -REQUIRED_USE="${PYTHON_REQUIRED_USE}"
370 -
371 -COMMON_DEPEND="${PYTHON_DEPS}
372 - >=app-text/podofo-0.9.6_pre20171027:=
373 - >=app-text/poppler-0.26.5[qt5]
374 - >=dev-libs/chmlib-0.40:=
375 - dev-libs/glib:2=
376 - >=dev-libs/icu-57.1:=
377 - dev-libs/libinput:=
378 - >=dev-python/apsw-3.25.2_p1[${PYTHON_USEDEP}]
379 - >=dev-python/beautifulsoup-3.0.5:python-2[${PYTHON_USEDEP}]
380 - >=dev-python/chardet-3.0.3[${PYTHON_USEDEP}]
381 - >=dev-python/cssselect-0.7.1[${PYTHON_USEDEP}]
382 - >=dev-python/css-parser-1.0.4[${PYTHON_USEDEP}]
383 - >=dev-python/dbus-python-1.2.4[${PYTHON_USEDEP}]
384 - >=dev-libs/dbus-glib-0.106
385 - >=sys-apps/dbus-1.10.8
386 - >=dev-python/feedparser-5.2.1[${PYTHON_USEDEP}]
387 - >=dev-python/html5-parser-0.4.3[${PYTHON_USEDEP}]
388 - >=dev-python/lxml-3.8.0[${PYTHON_USEDEP}]
389 - >=dev-python/markdown-3.0.1[${PYTHON_USEDEP}]
390 - >=dev-python/mechanize-0.3.5[${PYTHON_USEDEP}]
391 - >=dev-python/msgpack-0.5.6[${PYTHON_USEDEP}]
392 - >=dev-python/netifaces-0.10.5[${PYTHON_USEDEP}]
393 - >=dev-python/pillow-3.2.0[${PYTHON_USEDEP}]
394 - >=dev-python/psutil-4.3.0[${PYTHON_USEDEP}]
395 - >=dev-python/pygments-2.3.1[${PYTHON_USEDEP}]
396 - >=dev-python/python-dateutil-2.5.3[${PYTHON_USEDEP}]
397 - >=dev-python/PyQt5-5.8[gui,svg,webkit,widgets,network,printsupport,${PYTHON_USEDEP}]
398 - dev-python/regex[${PYTHON_USEDEP}]
399 - dev-qt/qtcore:5=
400 - dev-qt/qtdbus:5=
401 - dev-qt/qtgui:5=
402 - dev-qt/qtwidgets:5=
403 - dev-util/desktop-file-utils
404 - dev-util/gtk-update-icon-cache
405 - media-fonts/liberation-fonts
406 - media-libs/fontconfig:=
407 - >=media-libs/freetype-2:=
408 - >=media-libs/libmtp-1.1.11:=
409 - >=media-libs/libwmf-0.2.8
410 - >=media-gfx/optipng-0.7.6
411 - >=sys-libs/zlib-1.2.11:=
412 - virtual/libusb:1=
413 - virtual/python-dnspython[${PYTHON_USEDEP}]
414 - x11-libs/libxkbcommon:=
415 - x11-libs/libX11:=
416 - x11-libs/libXext:=
417 - x11-libs/libXrender:=
418 - x11-misc/shared-mime-info
419 - >=x11-misc/xdg-utils-1.0.2-r2
420 - ios? (
421 - >=app-pda/usbmuxd-1.0.8
422 - >=app-pda/libimobiledevice-1.2.0
423 - )
424 - udisks? ( virtual/libudev )"
425 -RDEPEND="${COMMON_DEPEND}
426 - udisks? ( || ( sys-fs/udisks:2 sys-fs/udisks:0 ) )"
427 -DEPEND="${COMMON_DEPEND}
428 - >=dev-python/setuptools-23.1.0[${PYTHON_USEDEP}]
429 - dev-python/sip[${PYTHON_USEDEP}]
430 - >=virtual/podofo-build-0.9.6_pre20171027
431 - virtual/pkgconfig"
432 -
433 -pkg_pretend() {
434 - if [[ ${MERGE_TYPE} != binary && $(gcc-major-version) -lt 6 ]]; then
435 - eerror "Calibre cannot be built with this version of gcc."
436 - eerror "You need at least gcc-6.0"
437 - die "Your C compiler is too old for this package."
438 - fi
439 -}
440 -
441 -src_prepare() {
442 - # no_updates: do not annoy user with "new version is availible all the time
443 - # disable_plugins: walking sec-hole, wait for upstream to use GHNS interface
444 - eapply \
445 - "${FILESDIR}/${PN}-2.9.0-no_updates_dialog.patch" \
446 - "${FILESDIR}/${PN}-disable_plugins.patch"
447 -
448 - eapply_user
449 -
450 - # Fix outdated version constant.
451 - #sed -e "s#\\(^numeric_version =\\).*#\\1 (${PV//./, })#" \
452 - # -i src/calibre/constants.py || \
453 - # die "sed failed to patch constants.py"
454 -
455 - # Avoid sandbox violation in /usr/share/gnome/apps when linux.py
456 - # calls xdg-* (bug #258938).
457 - sed -e "s|'xdg-desktop-menu', 'install'|\\0, '--mode', 'user'|" \
458 - -e "s|check_call(\\['xdg-desktop-menu', 'forceupdate'\\])|#\\0|" \
459 - -e "s|\\(CurrentDir(tdir)\\), \\\\\$|\\1:|" \
460 - -e "s|, PreserveMIMEDefaults():|:|" \
461 - -e "s|'xdg-icon-resource', 'install'|\\0, '--mode', 'user'|" \
462 - -e "s|cmd\[2\]|cmd[4]|" \
463 - -e "s|cc(\\['xdg-desktop-menu', 'forceupdate'\\])|#\\0|" \
464 - -e "s|'xdg-mime', 'install'|\\0, '--mode', 'user'|" \
465 - -i src/calibre/linux.py || die "sed failed to patch linux.py"
466 -
467 - # Disable unnecessary privilege dropping for bug #287067.
468 - sed -e "s:if os.geteuid() == 0:if False and os.geteuid() == 0:" \
469 - -i setup/install.py || die "sed failed to patch install.py"
470 -
471 - sed -e "/^ self.check_call(\\[QMAKE\\] + qmc + \\[proname\\])$/a\
472 -\\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ self.check_call(['sed', \
473 -'-e', 's|^CFLAGS .*|\\\\\\\\0 ${CFLAGS}|', \
474 -'-e', 's|^CXXFLAGS .*|\\\\\\\\0 ${CXXFLAGS}|', \
475 -'-e', 's|^LFLAGS .*|\\\\\\\\0 ${LDFLAGS}|', \
476 -'-i', 'Makefile'])" \
477 - -i setup/build.py || die "sed failed to patch build.py"
478 -
479 - # use system beautifulsoup, instead of bundled
480 - rm -f "${S}"/src/calibre/ebooks/BeautifulSoup.py \
481 - || die "could not remove bundled beautifulsoup"
482 - find "${S}" -type f -name \*.py -exec \
483 - sed -e 's/calibre.ebooks.BeautifulSoup/BeautifulSoup/' -i {} + \
484 - || die "could not sed bundled beautifulsoup out of the source tree"
485 -}
486 -
487 -src_install() {
488 - # Bypass kbuildsycoca and update-mime-database in order to
489 - # avoid sandbox violations if xdg-mime tries to call them.
490 - cat - > "${T}/kbuildsycoca" <<-EOF
491 - #!${BASH}
492 - echo $0 : $@
493 - exit 0
494 - EOF
495 -
496 - cp "${T}"/{kbuildsycoca,update-mime-database} || die
497 - chmod +x "${T}"/{kbuildsycoca,update-mime-database} || die
498 -
499 - export QMAKE="${EPREFIX}/usr/$(get_libdir)/qt5/bin/qmake"
500 -
501 - # Unset DISPLAY in order to prevent xdg-mime from triggering a sandbox
502 - # violation with kbuildsycoca as in bug #287067, comment #13.
503 - export -n DISPLAY
504 -
505 - # Bug #352625 - Some LANGUAGE values can trigger the following ValueError:
506 - # File "/usr/lib/python2.6/locale.py", line 486, in getdefaultlocale
507 - # return _parse_localename(localename)
508 - # File "/usr/lib/python2.6/locale.py", line 418, in _parse_localename
509 - # raise ValueError, 'unknown locale: %s' % localename
510 - #ValueError: unknown locale: 46
511 - export -n LANG LANGUAGE ${!LC_*}
512 - export LC_ALL=C #684484
513 -
514 - # Bug #295672 - Avoid sandbox violation in ~/.config by forcing
515 - # variables to point to our fake temporary $HOME.
516 - export HOME="${T}/fake_homedir"
517 - export XDG_CONFIG_HOME="${HOME}/.config"
518 - export XDG_DATA_HOME="${HOME}/.local/share"
519 - export CALIBRE_CONFIG_DIRECTORY="${XDG_CONFIG_HOME}/calibre"
520 - mkdir -p "${XDG_DATA_HOME}" "${CALIBRE_CONFIG_DIRECTORY}" || die
521 -
522 - tc-export CC CXX
523 - # Bug #334243 - respect LDFLAGS when building extensions
524 - export OVERRIDE_CFLAGS="$CFLAGS" OVERRIDE_LDFLAGS="$LDFLAGS"
525 - local libdir=$(get_libdir)
526 - [[ -n $libdir ]] || die "get_libdir returned an empty string"
527 -
528 - addpredict /dev/dri #665310
529 -
530 - #dodir "/usr/$(get_libdir)/python2.7/site-packages" # for init_calibre.py
531 - #dodir $(python_get_sitedir)
532 - PATH=${T}:${PATH} PYTHONPATH=${S}/src${PYTHONPATH:+:}${PYTHONPATH} \
533 - "${PYTHON}" setup.py install \
534 - --root="${D}" \
535 - --prefix="${EPREFIX}/usr" \
536 - --libdir="${EPREFIX}/usr/${libdir}" \
537 - --staging-root="${ED}/usr" \
538 - --staging-libdir="${ED}/usr/${libdir}" || die
539 -
540 - rm "${ED}/usr/share/applications/defaults.list" || die
541 - find "${ED}"/usr/share -type d -empty -delete
542 -
543 - cd "${ED}"/usr/share/calibre/fonts/liberation || die
544 - local x
545 - for x in * ; do
546 - [[ -f ${EPREFIX}usr/share/fonts/liberation-fonts/${x} ]] || continue
547 - ln -sf "../../../fonts/liberation-fonts/${x}" "${x}" || die
548 - done
549 -
550 - einfo "Converting python shebangs"
551 - python_fix_shebang --force "${ED}"
552 -
553 - einfo "Compiling python modules"
554 - python_optimize "${ED}"/usr/lib/calibre
555 -
556 - newinitd "${FILESDIR}"/calibre-server-3.init calibre-server
557 - newconfd "${FILESDIR}"/calibre-server-3.conf calibre-server
558 -
559 - bashcomp_alias calibre \
560 - lrfviewer \
561 - calibre-debug \
562 - ebook-meta \
563 - calibre-server \
564 - ebook-viewer \
565 - ebook-polish \
566 - fetch-ebook-metadata \
567 - lrf2lrs \
568 - ebook-convert \
569 - ebook-edit \
570 - calibre-smtp \
571 - ebook-device
572 -
573 -}
574 -
575 -pkg_preinst() {
576 - # Indentify stray directories from upstream's "Binary install"
577 - # method (see bug 622728).
578 - CALIBRE_LIB_DIR=/usr/$(get_libdir)/calibre
579 - CALIBRE_LIB_CONTENT=$(for x in "${ED}${CALIBRE_LIB_DIR}"/*; do
580 - printf -- "${x##*/} "; done) || die "Failed to list ${ED}${CALIBRE_LIB_DIR}"
581 -}
582 -
583 -pkg_postinst() {
584 - [[ -n ${CALIBRE_LIB_DIR} ]] || die "CALIBRE_LIB_DIR is unset"
585 - local x
586 - for x in "${EROOT%/}${CALIBRE_LIB_DIR}"/*; do
587 - if [[ " ${CALIBRE_LIB_CONTENT} " != *" ${x##*/} "* ]]; then
588 - elog "Purging '${x}'"
589 - rm -rf "${x}"
590 - fi
591 - done
592 - xdg_desktop_database_update
593 - xdg_mimeinfo_database_update
594 - xdg_icon_cache_update
595 -}
596 -
597 -pkg_postrm() {
598 - xdg_desktop_database_update
599 - xdg_mimeinfo_database_update
600 - xdg_icon_cache_update
601 -}