1 |
commit: 89bc7b87ddd5cb1e02ad0118a1c96c237718d6d3 |
2 |
Author: Zac Medico <zmedico <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Jul 4 18:29:51 2018 +0000 |
4 |
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Jul 4 18:30:27 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=89bc7b87 |
7 |
|
8 |
app-text/calibre: version bump to 3.26.1 |
9 |
|
10 |
Closes: https://bugs.gentoo.org/653354 |
11 |
Package-Manager: Portage-2.3.41, Repoman-2.3.9 |
12 |
|
13 |
app-text/calibre/Manifest | 1 + |
14 |
app-text/calibre/calibre-3.26.1.ebuild | 293 +++++++++++++++++++++++++++++++++ |
15 |
2 files changed, 294 insertions(+) |
16 |
|
17 |
diff --git a/app-text/calibre/Manifest b/app-text/calibre/Manifest |
18 |
index 68e28630507..c3a94f916a0 100644 |
19 |
--- a/app-text/calibre/Manifest |
20 |
+++ b/app-text/calibre/Manifest |
21 |
@@ -1 +1,2 @@ |
22 |
DIST calibre-3.15.0.tar.xz 38177684 BLAKE2B 7d3892f81db61f8d4a08589a42ccd71183d9dc7fa401480d4426d1205a9a633216a79865140481f63e1e3a741d34f604ea9d7f98c490949d0d4452cb9123fb9b SHA512 93a9f3b7122d8f4cd1d847727f6d1ccd1f9d828651e9ee77a34544742884b3e925552ca61ec1d0a1196b04a0874e97fc877e679dd8a69ba8b754b7688b730697 |
23 |
+DIST calibre-3.26.1.tar.xz 39109660 BLAKE2B 0e98c273b8a5dfafea7a7027de3f83ad25ab835edadedf78b7e9bc356bcac8937d915944f2ab6503b414c49b4e792e090e7bd2433a4e86373bf115720ed78b0a SHA512 893e36b101defaca29281b4bd072aafc1c4cb20a9cd3ee06a0b68fbe6b39cab34952799939ac4f54c77148c87861c5ab4ddff84f5ec8c2274ae7fa6424259ff5 |
24 |
|
25 |
diff --git a/app-text/calibre/calibre-3.26.1.ebuild b/app-text/calibre/calibre-3.26.1.ebuild |
26 |
new file mode 100644 |
27 |
index 00000000000..ab8c6f98f7a |
28 |
--- /dev/null |
29 |
+++ b/app-text/calibre/calibre-3.26.1.ebuild |
30 |
@@ -0,0 +1,293 @@ |
31 |
+# Copyright 1999-2018 Gentoo Foundation |
32 |
+# Distributed under the terms of the GNU General Public License v2 |
33 |
+ |
34 |
+EAPI=6 |
35 |
+ |
36 |
+PYTHON_COMPAT=( python2_7 ) |
37 |
+PYTHON_REQ_USE="sqlite,ssl" |
38 |
+ |
39 |
+inherit eutils bash-completion-r1 gnome2-utils multilib toolchain-funcs python-single-r1 xdg-utils |
40 |
+ |
41 |
+DESCRIPTION="Ebook management application" |
42 |
+HOMEPAGE="https://calibre-ebook.com/" |
43 |
+SRC_URI="https://download.calibre-ebook.com/${PV}/${P}.tar.xz" |
44 |
+ |
45 |
+LICENSE=" |
46 |
+ GPL-3+ |
47 |
+ GPL-3 |
48 |
+ GPL-2+ |
49 |
+ GPL-2 |
50 |
+ GPL-1+ |
51 |
+ LGPL-3+ |
52 |
+ LGPL-2.1+ |
53 |
+ LGPL-2.1 |
54 |
+ BSD |
55 |
+ MIT |
56 |
+ Old-MIT |
57 |
+ Apache-2.0 |
58 |
+ public-domain |
59 |
+ || ( Artistic GPL-1+ ) |
60 |
+ CC-BY-3.0 |
61 |
+ OFL-1.1 |
62 |
+ PSF-2 |
63 |
+ unRAR |
64 |
+" |
65 |
+KEYWORDS="~amd64 ~arm ~x86" |
66 |
+SLOT="0" |
67 |
+IUSE="ios +udisks" |
68 |
+ |
69 |
+REQUIRED_USE="${PYTHON_REQUIRED_USE}" |
70 |
+ |
71 |
+COMMON_DEPEND="${PYTHON_DEPS} |
72 |
+ >=app-text/podofo-0.8.2:= |
73 |
+ >=app-text/poppler-0.26.5[qt5] |
74 |
+ >=dev-libs/chmlib-0.40:= |
75 |
+ dev-libs/glib:2= |
76 |
+ >=dev-libs/icu-57.1:= |
77 |
+ dev-libs/libinput:= |
78 |
+ >=dev-python/apsw-3.13.0[${PYTHON_USEDEP}] |
79 |
+ >=dev-python/beautifulsoup-3.0.5:python-2[${PYTHON_USEDEP}] |
80 |
+ dev-python/chardet[${PYTHON_USEDEP}] |
81 |
+ >=dev-python/cssselect-0.7.1[${PYTHON_USEDEP}] |
82 |
+ >=dev-python/cssutils-1.0.1[${PYTHON_USEDEP}] |
83 |
+ >=dev-python/dbus-python-1.2.4[${PYTHON_USEDEP}] |
84 |
+ >=dev-libs/dbus-glib-0.106 |
85 |
+ >=sys-apps/dbus-1.10.8 |
86 |
+ dev-python/html5-parser[${PYTHON_USEDEP}] |
87 |
+ >=dev-python/lxml-3.2.1[${PYTHON_USEDEP}] |
88 |
+ >=dev-python/mechanize-0.2.5[${PYTHON_USEDEP}] |
89 |
+ dev-python/msgpack[${PYTHON_USEDEP}] |
90 |
+ dev-python/netifaces[${PYTHON_USEDEP}] |
91 |
+ dev-python/pillow[${PYTHON_USEDEP}] |
92 |
+ dev-python/psutil[${PYTHON_USEDEP}] |
93 |
+ >=dev-python/pygments-2.1.3[${PYTHON_USEDEP}] |
94 |
+ >=dev-python/python-dateutil-2.5.3[${PYTHON_USEDEP}] |
95 |
+ >=dev-python/PyQt5-5.8[gui,svg,webkit,widgets,network,printsupport,${PYTHON_USEDEP}] |
96 |
+ dev-python/regex[${PYTHON_USEDEP}] |
97 |
+ dev-qt/qtcore:5= |
98 |
+ dev-qt/qtdbus:5= |
99 |
+ dev-qt/qtgui:5= |
100 |
+ dev-qt/qtwidgets:5= |
101 |
+ dev-util/desktop-file-utils |
102 |
+ dev-util/gtk-update-icon-cache |
103 |
+ media-fonts/liberation-fonts |
104 |
+ media-libs/fontconfig:= |
105 |
+ >=media-libs/freetype-2:= |
106 |
+ >=media-libs/libmtp-1.1.11:= |
107 |
+ >=media-libs/libwmf-0.2.8 |
108 |
+ >=media-gfx/optipng-0.7.6 |
109 |
+ sys-libs/zlib:= |
110 |
+ virtual/libusb:1= |
111 |
+ virtual/python-dnspython[${PYTHON_USEDEP}] |
112 |
+ x11-libs/libxkbcommon:= |
113 |
+ x11-libs/libX11:= |
114 |
+ x11-libs/libXext:= |
115 |
+ x11-libs/libXrender:= |
116 |
+ x11-misc/shared-mime-info |
117 |
+ >=x11-misc/xdg-utils-1.0.2-r2 |
118 |
+ ios? ( |
119 |
+ >=app-pda/usbmuxd-1.0.8 |
120 |
+ >=app-pda/libimobiledevice-1.2.0 |
121 |
+ ) |
122 |
+ udisks? ( virtual/libudev )" |
123 |
+RDEPEND="${COMMON_DEPEND} |
124 |
+ udisks? ( || ( sys-fs/udisks:2 sys-fs/udisks:0 ) )" |
125 |
+DEPEND="${COMMON_DEPEND} |
126 |
+ >=dev-python/setuptools-23.1.0[${PYTHON_USEDEP}] |
127 |
+ >=virtual/podofo-build-0.9.4 |
128 |
+ virtual/pkgconfig" |
129 |
+ |
130 |
+pkg_pretend() { |
131 |
+ if [[ ${MERGE_TYPE} != binary && $(gcc-major-version) -lt 6 ]]; then |
132 |
+ eerror "Calibre cannot be built with this version of gcc." |
133 |
+ eerror "You need at least gcc-6.0" |
134 |
+ die "Your C compiler is too old for this package." |
135 |
+ fi |
136 |
+} |
137 |
+ |
138 |
+src_prepare() { |
139 |
+ # no_updates: do not annoy user with "new version is availible all the time |
140 |
+ # disable_plugins: walking sec-hole, wait for upstream to use GHNS interface |
141 |
+ eapply \ |
142 |
+ "${FILESDIR}/${PN}-2.9.0-no_updates_dialog.patch" \ |
143 |
+ "${FILESDIR}/${PN}-disable_plugins.patch" |
144 |
+ |
145 |
+ eapply_user |
146 |
+ |
147 |
+ # Fix outdated version constant. |
148 |
+ #sed -e "s#\\(^numeric_version =\\).*#\\1 (${PV//./, })#" \ |
149 |
+ # -i src/calibre/constants.py || \ |
150 |
+ # die "sed failed to patch constants.py" |
151 |
+ |
152 |
+ # Avoid sandbox violation in /usr/share/gnome/apps when linux.py |
153 |
+ # calls xdg-* (bug #258938). |
154 |
+ sed -e "s|'xdg-desktop-menu', 'install'|\\0, '--mode', 'user'|" \ |
155 |
+ -e "s|check_call(\\['xdg-desktop-menu', 'forceupdate'\\])|#\\0|" \ |
156 |
+ -e "s|\\(CurrentDir(tdir)\\), \\\\\$|\\1:|" \ |
157 |
+ -e "s|, PreserveMIMEDefaults():|:|" \ |
158 |
+ -e "s|'xdg-icon-resource', 'install'|\\0, '--mode', 'user'|" \ |
159 |
+ -e "s|cmd\[2\]|cmd[4]|" \ |
160 |
+ -e "s|cc(\\['xdg-desktop-menu', 'forceupdate'\\])|#\\0|" \ |
161 |
+ -e "s|'xdg-mime', 'install'|\\0, '--mode', 'user'|" \ |
162 |
+ -i src/calibre/linux.py || die "sed failed to patch linux.py" |
163 |
+ |
164 |
+ # Disable unnecessary privilege dropping for bug #287067. |
165 |
+ sed -e "s:if os.geteuid() == 0:if False and os.geteuid() == 0:" \ |
166 |
+ -i setup/install.py || die "sed failed to patch install.py" |
167 |
+ |
168 |
+ sed -e "/^ self.check_call(\\[QMAKE\\] + qmc + \\[proname\\])$/a\ |
169 |
+\\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ self.check_call(['sed', \ |
170 |
+'-e', 's|^CFLAGS .*|\\\\\\\\0 ${CFLAGS}|', \ |
171 |
+'-e', 's|^CXXFLAGS .*|\\\\\\\\0 ${CXXFLAGS}|', \ |
172 |
+'-e', 's|^LFLAGS .*|\\\\\\\\0 ${LDFLAGS}|', \ |
173 |
+'-i', 'Makefile'])" \ |
174 |
+ -i setup/build.py || die "sed failed to patch build.py" |
175 |
+ |
176 |
+ # use system beautifulsoup, instead of bundled |
177 |
+ rm -f "${S}"/src/calibre/ebooks/BeautifulSoup.py \ |
178 |
+ || die "could not remove bundled beautifulsoup" |
179 |
+ find "${S}" -type f -name \*.py -exec \ |
180 |
+ sed -e 's/calibre.ebooks.BeautifulSoup/BeautifulSoup/' -i {} + \ |
181 |
+ || die "could not sed bundled beautifulsoup out of the source tree" |
182 |
+ |
183 |
+ # avoid failure of xdg tools to recognize vendor prefix |
184 |
+ sed -e "s|xdg-icon-resource install|xdg-icon-resource install --novendor|" \ |
185 |
+ -e "s|'xdg-mime', 'install'|'xdg-mime', 'install', '--novendor'|" \ |
186 |
+ -e "s|'xdg-desktop-menu', 'install'|'xdg-desktop-menu', 'install', '--novendor'|" \ |
187 |
+ -i "${S}"/src/calibre/linux.py || die 'sed failed' |
188 |
+ |
189 |
+ # don't create/install uninstaller |
190 |
+ sed '/self\.create_uninstaller()/d' -i src/calibre/linux.py || die |
191 |
+} |
192 |
+ |
193 |
+src_install() { |
194 |
+ # Bypass kbuildsycoca and update-mime-database in order to |
195 |
+ # avoid sandbox violations if xdg-mime tries to call them. |
196 |
+ cat - > "${T}/kbuildsycoca" <<-EOF |
197 |
+ #!${BASH} |
198 |
+ echo $0 : $@ |
199 |
+ exit 0 |
200 |
+ EOF |
201 |
+ |
202 |
+ cp "${T}"/{kbuildsycoca,update-mime-database} || die |
203 |
+ chmod +x "${T}"/{kbuildsycoca,update-mime-database} || die |
204 |
+ |
205 |
+ export QMAKE="${EPREFIX}/usr/$(get_libdir)/qt5/bin/qmake" |
206 |
+ |
207 |
+ # Unset DISPLAY in order to prevent xdg-mime from triggering a sandbox |
208 |
+ # violation with kbuildsycoca as in bug #287067, comment #13. |
209 |
+ export -n DISPLAY |
210 |
+ |
211 |
+ # Bug #352625 - Some LANGUAGE values can trigger the following ValueError: |
212 |
+ # File "/usr/lib/python2.6/locale.py", line 486, in getdefaultlocale |
213 |
+ # return _parse_localename(localename) |
214 |
+ # File "/usr/lib/python2.6/locale.py", line 418, in _parse_localename |
215 |
+ # raise ValueError, 'unknown locale: %s' % localename |
216 |
+ #ValueError: unknown locale: 46 |
217 |
+ export -n LANGUAGE |
218 |
+ |
219 |
+ # Bug #295672 - Avoid sandbox violation in ~/.config by forcing |
220 |
+ # variables to point to our fake temporary $HOME. |
221 |
+ export HOME="${T}/fake_homedir" |
222 |
+ export XDG_CONFIG_HOME="${HOME}/.config" |
223 |
+ export XDG_DATA_HOME="${HOME}/.local/share" |
224 |
+ export CALIBRE_CONFIG_DIRECTORY="${XDG_CONFIG_HOME}/calibre" |
225 |
+ mkdir -p "${XDG_DATA_HOME}" "${CALIBRE_CONFIG_DIRECTORY}" || die |
226 |
+ |
227 |
+ tc-export CC CXX |
228 |
+ # Bug #334243 - respect LDFLAGS when building extensions |
229 |
+ export OVERRIDE_CFLAGS="$CFLAGS" OVERRIDE_LDFLAGS="$LDFLAGS" |
230 |
+ local libdir=$(get_libdir) |
231 |
+ [[ -n $libdir ]] || die "get_libdir returned an empty string" |
232 |
+ |
233 |
+ # Bug #472690 - Avoid sandbox violation for /dev/dri/card0. |
234 |
+ local x |
235 |
+ for x in /dev/dri/card[0-9] ; do |
236 |
+ [[ -e ${x} ]] && addpredict ${x} |
237 |
+ done |
238 |
+ |
239 |
+ #dodir "/usr/$(get_libdir)/python2.7/site-packages" # for init_calibre.py |
240 |
+ #dodir $(python_get_sitedir) |
241 |
+ PATH=${T}:${PATH} PYTHONPATH=${S}/src${PYTHONPATH:+:}${PYTHONPATH} \ |
242 |
+ "${PYTHON}" setup.py install \ |
243 |
+ --root="${D}" \ |
244 |
+ --prefix="${EPREFIX}/usr" \ |
245 |
+ --libdir="${EPREFIX}/usr/${libdir}" \ |
246 |
+ --staging-root="${ED}usr" \ |
247 |
+ --staging-libdir="${ED}usr/${libdir}" || die |
248 |
+ |
249 |
+ # The menu entries end up here due to '--mode user' being added to |
250 |
+ # xdg-* options in src_prepare. |
251 |
+ dodir /usr/share/mime/packages |
252 |
+ chmod -fR a+rX,u+w,g-w,o-w "${HOME}"/.local |
253 |
+ mv "${HOME}"/.local/share/mime/packages/* "${ED}"usr/share/mime/packages/ || |
254 |
+ die "failed to register mime types" |
255 |
+ dodir /usr/share/icons |
256 |
+ mv "${HOME}"/.local/share/icons/* "${ED}"usr/share/icons/ || |
257 |
+ die "failed to install icon files" |
258 |
+ |
259 |
+ domenu "${HOME}"/.local/share/applications/*.desktop || |
260 |
+ die "failed to install .desktop menu files" |
261 |
+ |
262 |
+ find "${ED}"usr/share -type d -empty -delete |
263 |
+ |
264 |
+ cd "${ED}"/usr/share/calibre/fonts/liberation || die |
265 |
+ local x |
266 |
+ for x in * ; do |
267 |
+ [[ -f ${EPREFIX}usr/share/fonts/liberation-fonts/${x} ]] || continue |
268 |
+ ln -sf "../../../fonts/liberation-fonts/${x}" "${x}" || die |
269 |
+ done |
270 |
+ |
271 |
+ einfo "Converting python shebangs" |
272 |
+ python_fix_shebang "${ED}" |
273 |
+ |
274 |
+ einfo "Compiling python modules" |
275 |
+ python_optimize "${ED}"usr/lib/calibre |
276 |
+ |
277 |
+ newinitd "${FILESDIR}"/calibre-server-3.init calibre-server |
278 |
+ newconfd "${FILESDIR}"/calibre-server-3.conf calibre-server |
279 |
+ |
280 |
+ bashcomp_alias calibre \ |
281 |
+ lrfviewer \ |
282 |
+ calibre-debug \ |
283 |
+ ebook-meta \ |
284 |
+ calibre-server \ |
285 |
+ ebook-viewer \ |
286 |
+ ebook-polish \ |
287 |
+ fetch-ebook-metadata \ |
288 |
+ lrf2lrs \ |
289 |
+ ebook-convert \ |
290 |
+ ebook-edit \ |
291 |
+ calibre-smtp \ |
292 |
+ ebook-device |
293 |
+ |
294 |
+} |
295 |
+ |
296 |
+pkg_preinst() { |
297 |
+ gnome2_icon_savelist |
298 |
+ # Indentify stray directories from upstream's "Binary install" |
299 |
+ # method (see bug 622728). |
300 |
+ CALIBRE_LIB_DIR=/usr/$(get_libdir)/calibre |
301 |
+ CALIBRE_LIB_CONTENT=$(for x in "${ED%/}${CALIBRE_LIB_DIR}"/*; do |
302 |
+ printf -- "${x##*/} "; done) || die "Failed to list ${ED%/}${CALIBRE_LIB_DIR}" |
303 |
+} |
304 |
+ |
305 |
+pkg_postinst() { |
306 |
+ [[ -n ${CALIBRE_LIB_DIR} ]] || die "CALIBRE_LIB_DIR is unset" |
307 |
+ local x |
308 |
+ for x in "${EROOT%/}${CALIBRE_LIB_DIR}"/*; do |
309 |
+ if [[ " ${CALIBRE_LIB_CONTENT} " != *" ${x##*/} "* ]]; then |
310 |
+ elog "Purging '${x}'" |
311 |
+ rm -rf "${x}" |
312 |
+ fi |
313 |
+ done |
314 |
+ xdg_desktop_database_update |
315 |
+ xdg_mimeinfo_database_update |
316 |
+ gnome2_icon_cache_update |
317 |
+} |
318 |
+ |
319 |
+pkg_postrm() { |
320 |
+ xdg_desktop_database_update |
321 |
+ xdg_mimeinfo_database_update |
322 |
+ gnome2_icon_cache_update |
323 |
+} |