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, 02 Sep 2019 04:26:24
Message-Id: 1567398371.299d19d7466b87d4dba2e5af081eb3638e607e8c.zmedico@gentoo
1 commit: 299d19d7466b87d4dba2e5af081eb3638e607e8c
2 Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
3 AuthorDate: Mon Sep 2 04:09:08 2019 +0000
4 Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
5 CommitDate: Mon Sep 2 04:26:11 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=299d19d7
7
8 app-text/calibre: Bump to version 3.47.1
9
10 Package-Manager: Portage-2.3.75, Repoman-2.3.17
11 Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>
12
13 app-text/calibre/Manifest | 1 +
14 app-text/calibre/calibre-3.47.1.ebuild | 268 +++++++++++++++++++++++++++++++++
15 2 files changed, 269 insertions(+)
16
17 diff --git a/app-text/calibre/Manifest b/app-text/calibre/Manifest
18 index f63c3972759..d99dbe4e820 100644
19 --- a/app-text/calibre/Manifest
20 +++ b/app-text/calibre/Manifest
21 @@ -2,3 +2,4 @@ DIST calibre-3.26.1.tar.xz 39109660 BLAKE2B 0e98c273b8a5dfafea7a7027de3f83ad25ab
22 DIST calibre-3.44.0.tar.xz 38643008 BLAKE2B 7eb1412aa5de6ba2f48ea13e922dffff7ace0f4f475832ebe122db967c71df05b6bbb45092bdd53ddfe35d7a0c2af566ed83dde9aac64200d41ea2adc4cb1886 SHA512 a97f45f5f788357f62b4088c4d8190cd3e3b790685871d5a024342d5d21ca978d46fa4e47f85eef4b9fbc0774923732938a812dd188cd4a315445cf25b187d28
23 DIST calibre-3.46.0.tar.xz 38750284 BLAKE2B 5590ba422d0323ea7c0cea67d88d448f00f5a470e7a8fdf9851b488c0856c88175bd107715a856706e95b2e1a45604713d061f4a7a3603ecaa01dfc018c1ed58 SHA512 d8eb014ba4d943e1c2ed05104d9b0c13f45a8b0085fa240248210cd43ab3739036936324183ae8a63dc636f7f8603484e3ddf50a260308ce1127745a8d3c6763
24 DIST calibre-3.47.0.tar.xz 38720656 BLAKE2B 4626eac9f0940c1cd6ebab69c16b69eba3c01f62594bc7c60fb9bd097e513f0767a8b5706d07429f7529ed29ed5a7c47621ec6e62a9db82dc99accaaed028524 SHA512 b34d69f31e37ff528b22b6fab43836d53cabfaa4d4c03af42a8c2b73301bd737927f03eb256da765262f73dbb0631484ed164d46230f730e4b742b837c2dfce6
25 +DIST calibre-3.47.1.tar.xz 38710008 BLAKE2B 60915345dd756d085386af61128e92569304be64aadbc21b69973e93adf3fb5cc88f7250153c238ecf423546f408bfc094b5bce329a54e7f080f831c4a8c23c1 SHA512 010796b3ac3fc6adcdf26dbc7966946be0f48b2684e1317da11d77fa55151d1f6ad2b86adf3c8eced5559823567e6672bfdfd953c17e6cc978894544131fb6bd
26
27 diff --git a/app-text/calibre/calibre-3.47.1.ebuild b/app-text/calibre/calibre-3.47.1.ebuild
28 new file mode 100644
29 index 00000000000..9b8c29fcc23
30 --- /dev/null
31 +++ b/app-text/calibre/calibre-3.47.1.ebuild
32 @@ -0,0 +1,268 @@
33 +# Copyright 1999-2019 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/podofo-0.9.6_pre20171027:=
74 + >=app-text/poppler-0.26.5[qt5]
75 + >=dev-libs/chmlib-0.40:=
76 + dev-libs/glib:2=
77 + >=dev-libs/icu-57.1:=
78 + dev-libs/libinput:=
79 + >=dev-python/apsw-3.25.2_p1[${PYTHON_USEDEP}]
80 + >=dev-python/beautifulsoup-3.0.5:python-2[${PYTHON_USEDEP}]
81 + >=dev-python/chardet-3.0.3[${PYTHON_USEDEP}]
82 + >=dev-python/cssselect-0.7.1[${PYTHON_USEDEP}]
83 + >=dev-python/css-parser-1.0.4[${PYTHON_USEDEP}]
84 + >=dev-python/dbus-python-1.2.4[${PYTHON_USEDEP}]
85 + >=dev-libs/dbus-glib-0.106
86 + >=sys-apps/dbus-1.10.8
87 + dev-python/dnspython[${PYTHON_USEDEP}]
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 + 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 + dev-python/sip[${PYTHON_USEDEP}]
131 + >=virtual/podofo-build-0.9.6_pre20171027
132 + virtual/pkgconfig"
133 +
134 +pkg_pretend() {
135 + if [[ ${MERGE_TYPE} != binary && $(gcc-major-version) -lt 6 ]]; then
136 + eerror "Calibre cannot be built with this version of gcc."
137 + eerror "You need at least gcc-6.0"
138 + die "Your C compiler is too old for this package."
139 + fi
140 +}
141 +
142 +src_prepare() {
143 + # no_updates: do not annoy user with "new version is availible all the time
144 + # disable_plugins: walking sec-hole, wait for upstream to use GHNS interface
145 + eapply \
146 + "${FILESDIR}/${PN}-2.9.0-no_updates_dialog.patch" \
147 + "${FILESDIR}/${PN}-disable_plugins.patch"
148 +
149 + eapply_user
150 +
151 + # Fix outdated version constant.
152 + #sed -e "s#\\(^numeric_version =\\).*#\\1 (${PV//./, })#" \
153 + # -i src/calibre/constants.py || \
154 + # die "sed failed to patch constants.py"
155 +
156 + # Avoid sandbox violation in /usr/share/gnome/apps when linux.py
157 + # calls xdg-* (bug #258938).
158 + sed -e "s|'xdg-desktop-menu', 'install'|\\0, '--mode', 'user'|" \
159 + -e "s|check_call(\\['xdg-desktop-menu', 'forceupdate'\\])|#\\0|" \
160 + -e "s|\\(CurrentDir(tdir)\\), \\\\\$|\\1:|" \
161 + -e "s|, PreserveMIMEDefaults():|:|" \
162 + -e "s|'xdg-icon-resource', 'install'|\\0, '--mode', 'user'|" \
163 + -e "s|cmd\[2\]|cmd[4]|" \
164 + -e "s|cc(\\['xdg-desktop-menu', 'forceupdate'\\])|#\\0|" \
165 + -e "s|'xdg-mime', 'install'|\\0, '--mode', 'user'|" \
166 + -i src/calibre/linux.py || die "sed failed to patch linux.py"
167 +
168 + # Disable unnecessary privilege dropping for bug #287067.
169 + sed -e "s:if os.geteuid() == 0:if False and os.geteuid() == 0:" \
170 + -i setup/install.py || die "sed failed to patch install.py"
171 +
172 + sed -e "/^ self.check_call(\\[QMAKE\\] + qmc + \\[proname\\])$/a\
173 +\\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ self.check_call(['sed', \
174 +'-e', 's|^CFLAGS .*|\\\\\\\\0 ${CFLAGS}|', \
175 +'-e', 's|^CXXFLAGS .*|\\\\\\\\0 ${CXXFLAGS}|', \
176 +'-e', 's|^LFLAGS .*|\\\\\\\\0 ${LDFLAGS}|', \
177 +'-i', 'Makefile'])" \
178 + -i setup/build.py || die "sed failed to patch build.py"
179 +
180 + # use system beautifulsoup, instead of bundled
181 + rm -f "${S}"/src/calibre/ebooks/BeautifulSoup.py \
182 + || die "could not remove bundled beautifulsoup"
183 + find "${S}" -type f -name \*.py -exec \
184 + sed -e 's/calibre.ebooks.BeautifulSoup/BeautifulSoup/' -i {} + \
185 + || die "could not sed bundled beautifulsoup out of the source tree"
186 +}
187 +
188 +src_install() {
189 + # Bypass kbuildsycoca and update-mime-database in order to
190 + # avoid sandbox violations if xdg-mime tries to call them.
191 + cat - > "${T}/kbuildsycoca" <<-EOF
192 + #!${BASH}
193 + echo $0 : $@
194 + exit 0
195 + EOF
196 +
197 + cp "${T}"/{kbuildsycoca,update-mime-database} || die
198 + chmod +x "${T}"/{kbuildsycoca,update-mime-database} || die
199 +
200 + export QMAKE="${EPREFIX}/usr/$(get_libdir)/qt5/bin/qmake"
201 +
202 + # Unset DISPLAY in order to prevent xdg-mime from triggering a sandbox
203 + # violation with kbuildsycoca as in bug #287067, comment #13.
204 + export -n DISPLAY
205 +
206 + # Bug #352625 - Some LANGUAGE values can trigger the following ValueError:
207 + # File "/usr/lib/python2.6/locale.py", line 486, in getdefaultlocale
208 + # return _parse_localename(localename)
209 + # File "/usr/lib/python2.6/locale.py", line 418, in _parse_localename
210 + # raise ValueError, 'unknown locale: %s' % localename
211 + #ValueError: unknown locale: 46
212 + export -n LANG LANGUAGE ${!LC_*}
213 + export LC_ALL=C #684484
214 +
215 + # Bug #295672 - Avoid sandbox violation in ~/.config by forcing
216 + # variables to point to our fake temporary $HOME.
217 + export HOME="${T}/fake_homedir"
218 + export XDG_CONFIG_HOME="${HOME}/.config"
219 + export XDG_DATA_HOME="${HOME}/.local/share"
220 + export CALIBRE_CONFIG_DIRECTORY="${XDG_CONFIG_HOME}/calibre"
221 + mkdir -p "${XDG_DATA_HOME}" "${CALIBRE_CONFIG_DIRECTORY}" || die
222 +
223 + tc-export CC CXX
224 + # Bug #334243 - respect LDFLAGS when building extensions
225 + export OVERRIDE_CFLAGS="$CFLAGS" OVERRIDE_LDFLAGS="$LDFLAGS"
226 + local libdir=$(get_libdir)
227 + [[ -n $libdir ]] || die "get_libdir returned an empty string"
228 +
229 + addpredict /dev/dri #665310
230 +
231 + PATH=${T}:${PATH} PYTHONPATH=${S}/src${PYTHONPATH:+:}${PYTHONPATH} \
232 + "${PYTHON}" setup.py install \
233 + --root="${D}" \
234 + --prefix="${EPREFIX}/usr" \
235 + --libdir="${EPREFIX}/usr/${libdir}" \
236 + --staging-root="${ED}/usr" \
237 + --staging-libdir="${ED}/usr/${libdir}" || die
238 +
239 + rm "${ED}/usr/share/applications/defaults.list" || die
240 + find "${ED}"/usr/share -type d -empty -delete
241 +
242 + cd "${ED}"/usr/share/calibre/fonts/liberation || die
243 + local x
244 + for x in * ; do
245 + [[ -f ${EPREFIX}usr/share/fonts/liberation-fonts/${x} ]] || continue
246 + ln -sf "../../../fonts/liberation-fonts/${x}" "${x}" || die
247 + done
248 +
249 + einfo "Converting python shebangs"
250 + python_fix_shebang --force "${ED}"
251 +
252 + einfo "Compiling python modules"
253 + python_optimize "${ED}"/usr/lib/calibre
254 +
255 + newinitd "${FILESDIR}"/calibre-server-3.init calibre-server
256 + newconfd "${FILESDIR}"/calibre-server-3.conf calibre-server
257 +
258 + bashcomp_alias calibre \
259 + lrfviewer \
260 + calibre-debug \
261 + ebook-meta \
262 + calibre-server \
263 + ebook-viewer \
264 + ebook-polish \
265 + fetch-ebook-metadata \
266 + lrf2lrs \
267 + ebook-convert \
268 + ebook-edit \
269 + calibre-smtp \
270 + ebook-device
271 +
272 +}
273 +
274 +pkg_preinst() {
275 + # Indentify stray directories from upstream's "Binary install"
276 + # method (see bug 622728).
277 + CALIBRE_LIB_DIR=/usr/$(get_libdir)/calibre
278 + CALIBRE_LIB_CONTENT=$(for x in "${ED}${CALIBRE_LIB_DIR}"/*; do
279 + printf -- "${x##*/} "; done) || die "Failed to list ${ED}${CALIBRE_LIB_DIR}"
280 +}
281 +
282 +pkg_postinst() {
283 + [[ -n ${CALIBRE_LIB_DIR} ]] || die "CALIBRE_LIB_DIR is unset"
284 + local x
285 + for x in "${EROOT}${CALIBRE_LIB_DIR}"/*; do
286 + if [[ " ${CALIBRE_LIB_CONTENT} " != *" ${x##*/} "* ]]; then
287 + elog "Purging '${x}'"
288 + rm -rf "${x}"
289 + fi
290 + done
291 + xdg_desktop_database_update
292 + xdg_mimeinfo_database_update
293 + xdg_icon_cache_update
294 +}
295 +
296 +pkg_postrm() {
297 + xdg_desktop_database_update
298 + xdg_mimeinfo_database_update
299 + xdg_icon_cache_update
300 +}