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: Fri, 03 Jan 2020 03:24:05
Message-Id: 1578021787.3ca85cd6bbae5553f3077e61c740451be63ac44e.zmedico@gentoo
1 commit: 3ca85cd6bbae5553f3077e61c740451be63ac44e
2 Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
3 AuthorDate: Fri Jan 3 03:19:26 2020 +0000
4 Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
5 CommitDate: Fri Jan 3 03:23:07 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3ca85cd6
7
8 app-text/calibre: Bump to version 4.8.0
9
10 Package-Manager: Portage-2.3.84, Repoman-2.3.20
11 Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>
12
13 app-text/calibre/Manifest | 1 +
14 app-text/calibre/calibre-4.8.0.ebuild | 273 ++++++++++++++++++++++++++++++++++
15 2 files changed, 274 insertions(+)
16
17 diff --git a/app-text/calibre/Manifest b/app-text/calibre/Manifest
18 index 69e7574f245..dfccb2d318e 100644
19 --- a/app-text/calibre/Manifest
20 +++ b/app-text/calibre/Manifest
21 @@ -4,3 +4,4 @@ DIST calibre-4.4.0.tar.xz 36389440 BLAKE2B d6f6bfb98dd95012a7d145d7700a2818974b2
22 DIST calibre-4.5.0.tar.xz 36472092 BLAKE2B b742f897b45e3832e5d8ebec93d8223973b6f5b6d6b3074a07e529eb4b823fa63cbf55c2d6b46ee7e0b5868dc45a858d0a841ce6b9a071ebc27a8977c44b00c6 SHA512 0d024ca7bda1ba9f2bb20fd02af1c4225d63c1a1e1bd71bf7760c214cec9ccf821fe31859cf389c6e45ba7fca21c706e5619f2066b600571f17660c52d84bd09
23 DIST calibre-4.6.0.tar.xz 37397188 BLAKE2B 145f329bb4dfeaffcc1a1dec741cf7f0d2bb943bc343f83828ad3755452c6313e59cc2e1518d8b05120746928080bc2c0de52827202c6a45733495bddf9995ed SHA512 4a057ffa6a77dfcec99a7ac89caf98045e2884af5a2833aed232620bd668ce92f542c903ea3817cfc05bbdbf10d89be029a459924d889fc83c8151100779a70d
24 DIST calibre-4.7.0.tar.xz 37432756 BLAKE2B 5030bee02506c2051949c248a941289da7b4e6b48aa638abcf14ab9c56f6552b1043f85bc6fbae644e33843711ad11d03da4ac3a320cb7cf4590bc1d0bf92ed8 SHA512 852f3ff45cbf055571c47754b55b51607ede63865fe04263a9c8d5d59973eaa8c5da718f589d2b830567796f59d5bd5189c8e5e9455e3f98e879a37acb7174e3
25 +DIST calibre-4.8.0.tar.xz 37448552 BLAKE2B 416500da33c5a7e0bb84e521db757c1ba5c6e38f04c2b92ad08c2039c64a7c7cc6daddf379cffe120e966e856468cb99da6d80feab75c518a3218a2e07c9cfd9 SHA512 5ab2340d9f4a8e4592aa5929827513127830bca5830f4861db97699fe491845dd17018158dc7c143255ce57730bc9e5ba556ddebb033d18086d0e1901388f840
26
27 diff --git a/app-text/calibre/calibre-4.8.0.ebuild b/app-text/calibre/calibre-4.8.0.ebuild
28 new file mode 100644
29 index 00000000000..d15693e1393
30 --- /dev/null
31 +++ b/app-text/calibre/calibre-4.8.0.ebuild
32 @@ -0,0 +1,273 @@
33 +# Copyright 1999-2020 Gentoo Authors
34 +# Distributed under the terms of the GNU General Public License v2
35 +
36 +EAPI=7
37 +
38 +PYTHON_COMPAT=( python2_7 )
39 +PYTHON_REQ_USE="sqlite,ssl"
40 +
41 +inherit bash-completion-r1 desktop 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/chmlib-0.40:=
77 + dev-libs/glib:2=
78 + dev-libs/hyphen:=
79 + >=dev-libs/icu-57.1:=
80 + dev-libs/libinput:=
81 + >=dev-python/apsw-3.25.2_p1[${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/css-parser-1.0.4[${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/dnspython[${PYTHON_USEDEP}]
90 + >=dev-python/feedparser-5.2.1[${PYTHON_USEDEP}]
91 + >=dev-python/html2text-2019.8.11[${PYTHON_USEDEP}]
92 + >=dev-python/html5-parser-0.4.3[${PYTHON_USEDEP}]
93 + >=dev-python/lxml-3.8.0[${PYTHON_USEDEP}]
94 + >=dev-python/markdown-3.0.1[${PYTHON_USEDEP}]
95 + >=dev-python/mechanize-0.3.5[${PYTHON_USEDEP}]
96 + >=dev-python/msgpack-0.5.6[${PYTHON_USEDEP}]
97 + >=dev-python/netifaces-0.10.5[${PYTHON_USEDEP}]
98 + >=dev-python/pillow-3.2.0[${PYTHON_USEDEP}]
99 + >=dev-python/psutil-4.3.0[${PYTHON_USEDEP}]
100 + >=dev-python/pygments-2.3.1[${PYTHON_USEDEP}]
101 + >=dev-python/python-dateutil-2.5.3[${PYTHON_USEDEP}]
102 + >=dev-python/PyQt5-5.12[gui,svg,widgets,network,printsupport,${PYTHON_USEDEP}]
103 + >=dev-python/PyQtWebEngine-5.12[${PYTHON_USEDEP}]
104 + dev-python/regex[${PYTHON_USEDEP}]
105 + dev-qt/qtcore:5=
106 + dev-qt/qtdbus:5=
107 + dev-qt/qtgui:5=
108 + >=dev-qt/qtwebengine-5.12
109 + dev-qt/qtwidgets:5=
110 + dev-util/desktop-file-utils
111 + dev-util/gtk-update-icon-cache
112 + media-fonts/liberation-fonts
113 + media-libs/fontconfig:=
114 + >=media-libs/freetype-2:=
115 + >=media-libs/libmtp-1.1.11:=
116 + >=media-libs/libwmf-0.2.8
117 + >=media-gfx/optipng-0.7.6
118 + >=sys-libs/zlib-1.2.11:=
119 + virtual/libusb:1=
120 + x11-libs/libxkbcommon:=
121 + x11-libs/libX11:=
122 + x11-libs/libXext:=
123 + x11-libs/libXrender:=
124 + x11-misc/shared-mime-info
125 + >=x11-misc/xdg-utils-1.0.2-r2
126 + ios? (
127 + >=app-pda/usbmuxd-1.0.8
128 + >=app-pda/libimobiledevice-1.2.0
129 + )
130 + udisks? ( virtual/libudev )"
131 +RDEPEND="${COMMON_DEPEND}
132 + udisks? ( || ( sys-fs/udisks:2 sys-fs/udisks:0 ) )"
133 +DEPEND="${COMMON_DEPEND}
134 + >=dev-python/setuptools-23.1.0[${PYTHON_USEDEP}]
135 + dev-python/sip[${PYTHON_USEDEP}]
136 + >=virtual/podofo-build-0.9.6_pre20171027
137 + virtual/pkgconfig"
138 +
139 +pkg_pretend() {
140 + if [[ ${MERGE_TYPE} != binary && $(gcc-major-version) -lt 6 ]]; then
141 + eerror "Calibre cannot be built with this version of gcc."
142 + eerror "You need at least gcc-6.0"
143 + die "Your C compiler is too old for this package."
144 + fi
145 +}
146 +
147 +src_prepare() {
148 + # no_updates: do not annoy user with "new version is availible all the time
149 + # disable_plugins: walking sec-hole, wait for upstream to use GHNS interface
150 + eapply \
151 + "${FILESDIR}/${PN}-2.9.0-no_updates_dialog.patch" \
152 + "${FILESDIR}/${PN}-disable_plugins.patch"
153 +
154 + eapply_user
155 +
156 + # Fix outdated version constant.
157 + #sed -e "s#\\(^numeric_version =\\).*#\\1 (${PV//./, })#" \
158 + # -i src/calibre/constants.py || \
159 + # die "sed failed to patch constants.py"
160 +
161 + # Avoid sandbox violation in /usr/share/gnome/apps when linux.py
162 + # calls xdg-* (bug #258938).
163 + sed -e "s|'xdg-desktop-menu', 'install'|\\0, '--mode', 'user'|" \
164 + -e "s|check_call(\\['xdg-desktop-menu', 'forceupdate'\\])|#\\0|" \
165 + -e "s|\\(CurrentDir(tdir)\\), \\\\\$|\\1:|" \
166 + -e "s|, PreserveMIMEDefaults():|:|" \
167 + -e "s|'xdg-icon-resource', 'install'|\\0, '--mode', 'user'|" \
168 + -e "s|cmd\[2\]|cmd[4]|" \
169 + -e "s|cc(\\['xdg-desktop-menu', 'forceupdate'\\])|#\\0|" \
170 + -e "s|'xdg-mime', 'install'|\\0, '--mode', 'user'|" \
171 + -i src/calibre/linux.py || die "sed failed to patch linux.py"
172 +
173 + # Disable unnecessary privilege dropping for bug #287067.
174 + sed -e "s:if os.geteuid() == 0:if False and os.geteuid() == 0:" \
175 + -i setup/install.py || die "sed failed to patch install.py"
176 +
177 + sed -e "/^ self.check_call(\\[QMAKE\\] + qmc + \\[proname\\])$/a\
178 +\\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ self.check_call(['sed', \
179 +'-e', 's|^CFLAGS .*|\\\\\\\\0 ${CFLAGS}|', \
180 +'-e', 's|^CXXFLAGS .*|\\\\\\\\0 ${CXXFLAGS}|', \
181 +'-e', 's|^LFLAGS .*|\\\\\\\\0 ${LDFLAGS}|', \
182 +'-i', 'Makefile'])" \
183 + -i setup/build.py || die "sed failed to patch build.py"
184 +
185 + # use system beautifulsoup, instead of bundled
186 + rm -f "${S}"/src/calibre/ebooks/BeautifulSoup.py \
187 + || die "could not remove bundled beautifulsoup"
188 + find "${S}" -type f -name \*.py -exec \
189 + sed -e 's/calibre.ebooks.BeautifulSoup/BeautifulSoup/' -i {} + \
190 + || die "could not sed bundled beautifulsoup out of the source tree"
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 LANG LANGUAGE ${!LC_*}
218 + export LC_ALL=C #684484
219 +
220 + # Bug #295672 - Avoid sandbox violation in ~/.config by forcing
221 + # variables to point to our fake temporary $HOME.
222 + export HOME="${T}/fake_homedir"
223 + export XDG_CONFIG_HOME="${HOME}/.config"
224 + export XDG_DATA_HOME="${HOME}/.local/share"
225 + export CALIBRE_CONFIG_DIRECTORY="${XDG_CONFIG_HOME}/calibre"
226 + mkdir -p "${XDG_DATA_HOME}" "${CALIBRE_CONFIG_DIRECTORY}" || die
227 +
228 + tc-export CC CXX
229 + # Bug #334243 - respect LDFLAGS when building extensions
230 + export OVERRIDE_CFLAGS="$CFLAGS" OVERRIDE_LDFLAGS="$LDFLAGS"
231 + local libdir=$(get_libdir)
232 + [[ -n $libdir ]] || die "get_libdir returned an empty string"
233 +
234 + addpredict /dev/dri #665310
235 +
236 + PATH=${T}:${PATH} PYTHONPATH=${S}/src${PYTHONPATH:+:}${PYTHONPATH} \
237 + "${PYTHON}" setup.py install \
238 + --root="${D}" \
239 + --prefix="${EPREFIX}/usr" \
240 + --libdir="${EPREFIX}/usr/${libdir}" \
241 + --staging-root="${ED}/usr" \
242 + --staging-libdir="${ED}/usr/${libdir}" || die
243 +
244 + rm "${ED}/usr/share/applications/defaults.list" || die
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 --force "${ED}"
256 +
257 + einfo "Compiling python modules"
258 + python_optimize "${ED}"/usr/lib/calibre
259 +
260 + newinitd "${FILESDIR}"/calibre-server-3.init calibre-server
261 + newconfd "${FILESDIR}"/calibre-server-3.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_preinst() {
280 + # Indentify stray directories from upstream's "Binary install"
281 + # method (see bug 622728).
282 + CALIBRE_LIB_DIR=/usr/$(get_libdir)/calibre
283 + CALIBRE_LIB_CONTENT=$(for x in "${ED}${CALIBRE_LIB_DIR}"/*; do
284 + printf -- "${x##*/} "; done) || die "Failed to list ${ED}${CALIBRE_LIB_DIR}"
285 +}
286 +
287 +pkg_postinst() {
288 + [[ -n ${CALIBRE_LIB_DIR} ]] || die "CALIBRE_LIB_DIR is unset"
289 + local x
290 + for x in "${EROOT}${CALIBRE_LIB_DIR}"/*; do
291 + if [[ " ${CALIBRE_LIB_CONTENT} " != *" ${x##*/} "* ]]; then
292 + elog "Purging '${x}'"
293 + rm -rf "${x}"
294 + fi
295 + done
296 + xdg_desktop_database_update
297 + xdg_mimeinfo_database_update
298 + xdg_icon_cache_update
299 +}
300 +
301 +pkg_postrm() {
302 + xdg_desktop_database_update
303 + xdg_mimeinfo_database_update
304 + xdg_icon_cache_update
305 +}