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