Gentoo Archives: gentoo-commits

From: Lars Wendler <polynomial-c@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-text/calibre/
Date: Sat, 26 Nov 2016 22:00:22
Message-Id: 1480197496.e09ca6169414a270a9a820412e16ae1a7ae6ad77.polynomial-c@gentoo
1 commit: e09ca6169414a270a9a820412e16ae1a7ae6ad77
2 Author: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
3 AuthorDate: Sat Nov 26 21:58:16 2016 +0000
4 Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
5 CommitDate: Sat Nov 26 21:58:16 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e09ca616
7
8 app-text/calibre: Bump to version 2.73.0
9
10 Disabled build/installation of uninstaller (/usr/bin/calibre-uninstaller).
11
12 Package-Manager: portage-2.3.2
13
14 app-text/calibre/Manifest | 1 +
15 app-text/calibre/calibre-2.73.0.ebuild | 254 +++++++++++++++++++++++++++++++++
16 2 files changed, 255 insertions(+)
17
18 diff --git a/app-text/calibre/Manifest b/app-text/calibre/Manifest
19 index a88bbc5..a1b9d17 100644
20 --- a/app-text/calibre/Manifest
21 +++ b/app-text/calibre/Manifest
22 @@ -4,3 +4,4 @@ DIST calibre-2.47.0.tar.xz 38924632 SHA256 048681cf6cb09b136017c6c99a1f1d908c6fc
23 DIST calibre-2.55.0.tar.xz 39854472 SHA256 a3a4f2914d491ab8c63725c11272d53bb4a91d282e6e5c6e0f245cb94b138188 SHA512 f067c93f7b32dbb8f94e30831df1bf755c25edaeb9dd4793ec79941738e2431e5fe51219d169056b3bb1f71b4223e933cc29fdae6572f212109b44b696bd6af4 WHIRLPOOL 433c68117f2aec343db026851de1807ebbcef91b229cb7790a9a3de35bb9ea6e20c194097ab4b283935843d998aba61f5a036483d743e35b9cc8dffaa809c5fb
24 DIST calibre-2.68.0.tar.xz 39949696 SHA256 f57e9d4939db15fd9bb441575f55d52db112cbfa6d970bb727acf7a079e3c656 SHA512 60d70f494b80f6fd10266162f54284e824207c9105e50d21ea0a14f6e612a911d2e6475c78cb4b499f3e411893ab2c7255c7b762ac8c5bfa5040e6a2efb100c1 WHIRLPOOL e55a55cffb4a9f469b96204ca652f243a3c96a10d2ace49641f2438c421703352feff0e5fa61a6665a21a2a342a1047959cc335f007893f2239424e505413b8a
25 DIST calibre-2.70.0.tar.xz 40279720 SHA256 90391605c43db01acd7acf21707f5aa95c329b2055cca1b09b6fa46e050b3ba2 SHA512 1b98cdbd32dd02e64792b5e02ceb010a694c5669b8de3b0d03994b6f1e03e10dfcff6462317e1abfd27ca4b0085897218a12d79dd82604dad8a156d2f0fa5317 WHIRLPOOL d9c61f8d3514631fb8907e2fb5d63e32c6626c9d2fa35a985810b035f5a74c68e0d4fa8a63164c566030190ed362092d4d2145ee5e406fda8d97bbf778afbc1d
26 +DIST calibre-2.73.0.tar.xz 38674308 SHA256 ec05836d60ae6214c3dde22ec7f9340ab77b05eac25b0df5e245b43f553b1a9f SHA512 395ae04ca580b25ec5d72bf2134c073a9182eccf9c30b053a52e342ddf7bec27d2479acba8cde15da175dfd0b6f5f9add54c9a13d9da421c494b70de3217968d WHIRLPOOL b5de25d5c170578c21719e72ead9c2040d338a6e19d8d7af9f788392acf27989c00bf092a6e3f64e4422409bdf2639f1bbc61be088c5baee72b85fe16e9c4b0b
27
28 diff --git a/app-text/calibre/calibre-2.73.0.ebuild b/app-text/calibre/calibre-2.73.0.ebuild
29 new file mode 100644
30 index 00000000..9083e7f
31 --- /dev/null
32 +++ b/app-text/calibre/calibre-2.73.0.ebuild
33 @@ -0,0 +1,254 @@
34 +# Copyright 1999-2016 Gentoo Foundation
35 +# Distributed under the terms of the GNU General Public License v2
36 +# $Id$
37 +
38 +EAPI=6
39 +
40 +PYTHON_COMPAT=( python2_7 )
41 +PYTHON_REQ_USE="sqlite,ssl"
42 +
43 +inherit eutils fdo-mime bash-completion-r1 multilib toolchain-funcs python-single-r1
44 +
45 +DESCRIPTION="Ebook management application"
46 +HOMEPAGE="http://calibre-ebook.com/"
47 +SRC_URI="http://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 + unRAR
68 +"
69 +KEYWORDS="~amd64 ~arm ~x86"
70 +SLOT="0"
71 +IUSE="+udisks"
72 +
73 +REQUIRED_USE="${PYTHON_REQUIRED_USE}"
74 +
75 +COMMON_DEPEND="${PYTHON_DEPS}
76 + >=app-text/podofo-0.8.2:=
77 + >=app-text/poppler-0.26.5[qt5]
78 + >=dev-libs/chmlib-0.40:=
79 + dev-libs/glib:2
80 + >=dev-libs/icu-4.4:=
81 + >=dev-python/apsw-3.7.17[${PYTHON_USEDEP}]
82 + >=dev-python/beautifulsoup-3.0.5:python-2[${PYTHON_USEDEP}]
83 + >=dev-python/cssselect-0.7.1[${PYTHON_USEDEP}]
84 + >=dev-python/cssutils-0.9.9[${PYTHON_USEDEP}]
85 + >=dev-python/dbus-python-1.2.0[${PYTHON_USEDEP}]
86 + >=dev-python/lxml-3.2.1[${PYTHON_USEDEP}]
87 + >=dev-python/mechanize-0.1.11[${PYTHON_USEDEP}]
88 + dev-python/netifaces[${PYTHON_USEDEP}]
89 + dev-python/pillow[${PYTHON_USEDEP}]
90 + dev-python/psutil[${PYTHON_USEDEP}]
91 + >=dev-python/pygments-2.0.1[${PYTHON_USEDEP}]
92 + >=dev-python/python-dateutil-1.4.1[${PYTHON_USEDEP}]
93 + >=dev-python/PyQt5-5.3.1[gui,svg,webkit,widgets,network,printsupport,${PYTHON_USEDEP}]
94 + dev-qt/qtcore:5
95 + dev-qt/qtgui:5
96 + dev-qt/qtwidgets:5
97 + media-fonts/liberation-fonts
98 + >=media-gfx/imagemagick-6.5.9[jpeg,png]
99 + media-libs/fontconfig
100 + >=media-libs/freetype-2:=
101 + >=media-libs/libmtp-1.1.5:=
102 + >=media-libs/libwmf-0.2.8
103 + sys-libs/zlib
104 + virtual/libusb:1=
105 + virtual/python-dnspython[${PYTHON_USEDEP}]
106 + x11-libs/libX11
107 + x11-libs/libXext
108 + x11-libs/libXrender
109 + >=x11-misc/xdg-utils-1.0.2-r2
110 + udisks? ( virtual/libudev )"
111 +RDEPEND="${COMMON_DEPEND}
112 + udisks? ( || ( sys-fs/udisks:2 sys-fs/udisks:0 ) )"
113 +DEPEND="${COMMON_DEPEND}
114 + >=dev-python/setuptools-0.6_rc5[${PYTHON_USEDEP}]
115 + >=virtual/podofo-build-0.8.2
116 + virtual/pkgconfig"
117 +
118 +src_prepare() {
119 + # no_updates: do not annoy user with "new version is availible all the time
120 + # disable_plugins: walking sec-hole, wait for upstream to use GHNS interface
121 + eapply \
122 + "${FILESDIR}/${PN}-2.9.0-no_updates_dialog.patch" \
123 + "${FILESDIR}/${PN}-disable_plugins.patch"
124 +
125 + eapply_user
126 +
127 + # Fix outdated version constant.
128 + #sed -e "s#\\(^numeric_version =\\).*#\\1 (${PV//./, })#" \
129 + # -i src/calibre/constants.py || \
130 + # die "sed failed to patch constants.py"
131 +
132 + # Avoid sandbox violation in /usr/share/gnome/apps when linux.py
133 + # calls xdg-* (bug #258938).
134 + sed -e "s|'xdg-desktop-menu', 'install'|\\0, '--mode', 'user'|" \
135 + -e "s|check_call(\\['xdg-desktop-menu', 'forceupdate'\\])|#\\0|" \
136 + -e "s|\\(CurrentDir(tdir)\\), \\\\\$|\\1:|" \
137 + -e "s|, PreserveMIMEDefaults():|:|" \
138 + -e "s|'xdg-icon-resource', 'install'|\\0, '--mode', 'user'|" \
139 + -e "s|cmd\[2\]|cmd[4]|" \
140 + -e "s|cc(\\['xdg-desktop-menu', 'forceupdate'\\])|#\\0|" \
141 + -e "s|'xdg-mime', 'install'|\\0, '--mode', 'user'|" \
142 + -i src/calibre/linux.py || die "sed failed to patch linux.py"
143 +
144 + # Disable unnecessary privilege dropping for bug #287067.
145 + sed -e "s:if os.geteuid() == 0:if False and os.geteuid() == 0:" \
146 + -i setup/install.py || die "sed failed to patch install.py"
147 +
148 + sed -e "/^ self\\.check_call(qmc + \\[.*\\.pro'\\])$/a\
149 +\\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ self.check_call(['sed', \
150 +'-e', 's|^CFLAGS .*|\\\\\\\\0 ${CFLAGS}|', \
151 +'-e', 's|^CXXFLAGS .*|\\\\\\\\0 ${CXXFLAGS}|', \
152 +'-e', 's|^LFLAGS .*|\\\\\\\\0 ${LDFLAGS}|', \
153 +'-i', 'Makefile'])" \
154 + -i setup/build.py || die "sed failed to patch build.py"
155 +
156 + # use system beautifulsoup, instead of bundled
157 + rm -f "${S}"/src/calibre/ebooks/BeautifulSoup.py \
158 + || die "could not remove bundled beautifulsoup"
159 + find "${S}" -type f -name \*.py -exec \
160 + sed -e 's/calibre.ebooks.BeautifulSoup/BeautifulSoup/' -i {} + \
161 + || die "could not sed bundled beautifulsoup out of the source tree"
162 +
163 + # avoid failure of xdg tools to recognize vendor prefix
164 + sed -e "s|xdg-icon-resource install|xdg-icon-resource install --novendor|" \
165 + -e "s|'xdg-mime', 'install'|'xdg-mime', 'install', '--novendor'|" \
166 + -e "s|'xdg-desktop-menu', 'install'|'xdg-desktop-menu', 'install', '--novendor'|" \
167 + -i "${S}"/src/calibre/linux.py || die 'sed failed'
168 +
169 + # don't create/install uninstaller
170 + sed '/self\.create_uninstaller()/d' -i src/calibre/linux.py || die
171 +}
172 +
173 +src_install() {
174 + # Bypass kbuildsycoca and update-mime-database in order to
175 + # avoid sandbox violations if xdg-mime tries to call them.
176 + cat - > "${T}/kbuildsycoca" <<-EOF
177 + #!${BASH}
178 + echo $0 : $@
179 + exit 0
180 + EOF
181 +
182 + cp "${T}"/{kbuildsycoca,update-mime-database} || die
183 + chmod +x "${T}"/{kbuildsycoca,update-mime-database} || die
184 +
185 + export QMAKE="${EPREFIX}/usr/$(get_libdir)/qt5/bin/qmake"
186 +
187 + # Unset DISPLAY in order to prevent xdg-mime from triggering a sandbox
188 + # violation with kbuildsycoca as in bug #287067, comment #13.
189 + export -n DISPLAY
190 +
191 + # Bug #352625 - Some LANGUAGE values can trigger the following ValueError:
192 + # File "/usr/lib/python2.6/locale.py", line 486, in getdefaultlocale
193 + # return _parse_localename(localename)
194 + # File "/usr/lib/python2.6/locale.py", line 418, in _parse_localename
195 + # raise ValueError, 'unknown locale: %s' % localename
196 + #ValueError: unknown locale: 46
197 + export -n LANGUAGE
198 +
199 + # Bug #295672 - Avoid sandbox violation in ~/.config by forcing
200 + # variables to point to our fake temporary $HOME.
201 + export HOME="${T}/fake_homedir"
202 + export XDG_CONFIG_HOME="${HOME}/.config"
203 + export XDG_DATA_HOME="${HOME}/.local/share"
204 + export CALIBRE_CONFIG_DIRECTORY="${XDG_CONFIG_HOME}/calibre"
205 + mkdir -p "${XDG_DATA_HOME}" "${CALIBRE_CONFIG_DIRECTORY}" || die
206 +
207 + tc-export CC CXX
208 + # Bug #334243 - respect LDFLAGS when building extensions
209 + export OVERRIDE_CFLAGS="$CFLAGS" OVERRIDE_LDFLAGS="$LDFLAGS"
210 + local libdir=$(get_libdir)
211 + [[ -n $libdir ]] || die "get_libdir returned an empty string"
212 +
213 + # Bug #472690 - Avoid sandbox violation for /dev/dri/card0.
214 + local x
215 + for x in /dev/dri/card[0-9] ; do
216 + [[ -e ${x} ]] && addpredict ${x}
217 + done
218 +
219 + #dodir "/usr/$(get_libdir)/python2.7/site-packages" # for init_calibre.py
220 + #dodir $(python_get_sitedir)
221 + PATH=${T}:${PATH} PYTHONPATH=${S}/src${PYTHONPATH:+:}${PYTHONPATH} \
222 + "${PYTHON}" setup.py install \
223 + --root="${D}" \
224 + --prefix="${EPREFIX}/usr" \
225 + --libdir="${EPREFIX}/usr/${libdir}" \
226 + --staging-root="${ED}usr" \
227 + --staging-libdir="${ED}usr/${libdir}" || die
228 +
229 + #grep -rlZ "${ED}" "${ED}" | xargs -0 sed -e "s:${D}:/:g" -i ||
230 + # die "failed to fix harcoded \$D in paths"
231 +
232 + # The menu entries end up here due to '--mode user' being added to
233 + # xdg-* options in src_prepare.
234 + dodir /usr/share/mime/packages
235 + chmod -fR a+rX,u+w,g-w,o-w "${HOME}"/.local
236 + mv "${HOME}"/.local/share/mime/packages/* "${ED}"usr/share/mime/packages/ ||
237 + die "failed to register mime types"
238 + dodir /usr/share/icons
239 + mv "${HOME}"/.local/share/icons/* "${ED}"usr/share/icons/ ||
240 + die "failed to install icon files"
241 +
242 + domenu "${HOME}"/.local/share/applications/*.desktop ||
243 + die "failed to install .desktop menu files"
244 +
245 + find "${ED}"usr/share -type d -empty -delete
246 +
247 + cd "${ED}"/usr/share/calibre/fonts/liberation || die
248 + local x
249 + for x in * ; do
250 + [[ -f ${EPREFIX}usr/share/fonts/liberation-fonts/${x} ]] || continue
251 + ln -sf "../../../fonts/liberation-fonts/${x}" "${x}" || die
252 + done
253 +
254 + einfo "Converting python shebangs"
255 + python_fix_shebang "${ED}"
256 +
257 + einfo "Compiling python modules"
258 + python_optimize "${ED}"usr/lib/calibre
259 +
260 + newinitd "${FILESDIR}"/calibre-server.init calibre-server
261 + newconfd "${FILESDIR}"/calibre-server.conf calibre-server
262 +
263 + bashcomp_alias calibre \
264 + lrfviewer \
265 + calibre-debug \
266 + ebook-meta \
267 + calibre-server \
268 + ebook-viewer \
269 + ebook-polish \
270 + fetch-ebook-metadata \
271 + lrf2lrs \
272 + ebook-convert \
273 + ebook-edit \
274 + calibre-smtp \
275 + ebook-device
276 +
277 +}
278 +
279 +pkg_postinst() {
280 + fdo-mime_desktop_database_update
281 + fdo-mime_mime_database_update
282 +}
283 +
284 +pkg_postrm() {
285 + fdo-mime_desktop_database_update
286 + fdo-mime_mime_database_update
287 +}