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