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: Sun, 01 Oct 2017 20:05:29
Message-Id: 1506888323.6d534217939125ad378a6ff013ddc6f39099d6fc.zmedico@gentoo
1 commit: 6d534217939125ad378a6ff013ddc6f39099d6fc
2 Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
3 AuthorDate: Sun Oct 1 20:01:51 2017 +0000
4 Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
5 CommitDate: Sun Oct 1 20:05:23 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6d534217
7
8 app-text/calibre: version bump to 3.8.0
9
10 Package-Manager: Portage-2.3.10, Repoman-2.3.3
11
12 app-text/calibre/Manifest | 1 +
13 app-text/calibre/calibre-3.8.0.ebuild | 277 ++++++++++++++++++++++++++++++++++
14 2 files changed, 278 insertions(+)
15
16 diff --git a/app-text/calibre/Manifest b/app-text/calibre/Manifest
17 index e43d57044fb..4972d5a602f 100644
18 --- a/app-text/calibre/Manifest
19 +++ b/app-text/calibre/Manifest
20 @@ -1,2 +1,3 @@
21 DIST calibre-2.78.0.tar.xz 38739404 SHA256 d2b0b0c5451d3ac05ce9de0b801ddf8de7664fee45f273d7ee8445a1ec2f898b SHA512 0779ac385dde45ac4baee7cecb0916e245f3e1cf20662bad9d9a4278265390b1aa89c2b478601b57113e7de08a69343288488ee299e8b43332f0129e650aa0ca WHIRLPOOL 325fc344445078ef0df0a29b4cd8e32445a881ede89e3db87606166ff0c8b7db10b7cc34432e63c2bb49382537a5107686339b987f1be807d59a1786ddfd4a75
22 DIST calibre-3.3.0.tar.xz 36308116 SHA256 0cd42109f432995a75bd921a37444c142cc25d178083857efbac756f615403ff SHA512 bb63f83d5e35079daba9ec6e7849e6a65c51cf0b2da9fc45b86a2b64cc147f862f08413730f3d2710793de7b045fc73913534dfca11b128ad0ea72e92033f977 WHIRLPOOL 151c6633f53e75b097276f026fedd083b8b7aa28b28e4d2d0de587a3e8280e40f04a13998b8eae5a9f54f1041e7a8b85fa8de99734437b4246bf66664ce31a7d
23 +DIST calibre-3.8.0.tar.xz 37922608 SHA256 17bfe172420e55ff4f4b19b80253210bacb9a4d0f2fdcffd5b0f456cf5765c4c SHA512 db7ff5cb0ee82b3237090cbf6a13d13bfa5e27139dd067290ed59d407d2dbbae2ecd3dab338a0beed845079387a051b092233350091ef6ec82623d3a16b1d48d WHIRLPOOL 45e56c6157f9047ced7fd06dcf5824baaf0e85707d5c7617c196d0054e852fcbe296e629d30317b197772f5e1d637600a5bfaf54e363729df9fa6074fcc097ad
24
25 diff --git a/app-text/calibre/calibre-3.8.0.ebuild b/app-text/calibre/calibre-3.8.0.ebuild
26 new file mode 100644
27 index 00000000000..e18eb11846b
28 --- /dev/null
29 +++ b/app-text/calibre/calibre-3.8.0.ebuild
30 @@ -0,0 +1,277 @@
31 +# Copyright 1999-2017 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 fdo-mime bash-completion-r1 multilib toolchain-funcs python-single-r1
40 +
41 +DESCRIPTION="Ebook management application"
42 +HOMEPAGE="http://calibre-ebook.com/"
43 +SRC_URI="http://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-python/apsw-3.13.0[${PYTHON_USEDEP}]
78 + >=dev-python/beautifulsoup-3.0.5:python-2[${PYTHON_USEDEP}]
79 + dev-python/chardet[${PYTHON_USEDEP}]
80 + >=dev-python/cssselect-0.7.1[${PYTHON_USEDEP}]
81 + >=dev-python/cssutils-1.0.1[${PYTHON_USEDEP}]
82 + >=dev-python/dbus-python-1.2.4[${PYTHON_USEDEP}]
83 + >=dev-libs/dbus-glib-0.106
84 + >=sys-apps/dbus-1.10.8
85 + dev-python/html5-parser[${PYTHON_USEDEP}]
86 + >=dev-python/lxml-3.2.1[${PYTHON_USEDEP}]
87 + >=dev-python/mechanize-0.2.5[${PYTHON_USEDEP}]
88 + dev-python/msgpack[${PYTHON_USEDEP}]
89 + dev-python/netifaces[${PYTHON_USEDEP}]
90 + dev-python/pillow[${PYTHON_USEDEP}]
91 + dev-python/psutil[${PYTHON_USEDEP}]
92 + >=dev-python/pygments-2.1.3[${PYTHON_USEDEP}]
93 + >=dev-python/python-dateutil-2.5.3[${PYTHON_USEDEP}]
94 + >=dev-python/PyQt5-5.8[gui,svg,webkit,widgets,network,printsupport,${PYTHON_USEDEP}]
95 + dev-python/regex[${PYTHON_USEDEP}]
96 + dev-qt/qtcore:5
97 + dev-qt/qtgui:5
98 + dev-qt/qtwidgets:5
99 + media-fonts/liberation-fonts
100 + >=media-gfx/imagemagick-6.5.9[jpeg,png]
101 + media-libs/fontconfig
102 + >=media-libs/freetype-2:=
103 + >=media-libs/libmtp-1.1.11:=
104 + >=media-libs/libwmf-0.2.8
105 + >=media-gfx/optipng-0.7.6
106 + sys-libs/zlib
107 + virtual/libusb:1=
108 + virtual/python-dnspython[${PYTHON_USEDEP}]
109 + x11-libs/libX11
110 + x11-libs/libXext
111 + x11-libs/libXrender
112 + >=x11-misc/xdg-utils-1.0.2-r2
113 + ios? (
114 + >=app-pda/usbmuxd-1.0.8
115 + >=app-pda/libimobiledevice-1.2.0
116 + )
117 + udisks? ( virtual/libudev )"
118 +RDEPEND="${COMMON_DEPEND}
119 + udisks? ( || ( sys-fs/udisks:2 sys-fs/udisks:0 ) )"
120 +DEPEND="${COMMON_DEPEND}
121 + >=dev-python/setuptools-23.1.0[${PYTHON_USEDEP}]
122 + >=virtual/podofo-build-0.9.4
123 + virtual/pkgconfig"
124 +
125 +src_prepare() {
126 + # no_updates: do not annoy user with "new version is availible all the time
127 + # disable_plugins: walking sec-hole, wait for upstream to use GHNS interface
128 + eapply \
129 + "${FILESDIR}/${PN}-2.9.0-no_updates_dialog.patch" \
130 + "${FILESDIR}/${PN}-disable_plugins.patch"
131 +
132 + eapply_user
133 +
134 + # Fix outdated version constant.
135 + #sed -e "s#\\(^numeric_version =\\).*#\\1 (${PV//./, })#" \
136 + # -i src/calibre/constants.py || \
137 + # die "sed failed to patch constants.py"
138 +
139 + # Avoid sandbox violation in /usr/share/gnome/apps when linux.py
140 + # calls xdg-* (bug #258938).
141 + sed -e "s|'xdg-desktop-menu', 'install'|\\0, '--mode', 'user'|" \
142 + -e "s|check_call(\\['xdg-desktop-menu', 'forceupdate'\\])|#\\0|" \
143 + -e "s|\\(CurrentDir(tdir)\\), \\\\\$|\\1:|" \
144 + -e "s|, PreserveMIMEDefaults():|:|" \
145 + -e "s|'xdg-icon-resource', 'install'|\\0, '--mode', 'user'|" \
146 + -e "s|cmd\[2\]|cmd[4]|" \
147 + -e "s|cc(\\['xdg-desktop-menu', 'forceupdate'\\])|#\\0|" \
148 + -e "s|'xdg-mime', 'install'|\\0, '--mode', 'user'|" \
149 + -i src/calibre/linux.py || die "sed failed to patch linux.py"
150 +
151 + # Disable unnecessary privilege dropping for bug #287067.
152 + sed -e "s:if os.geteuid() == 0:if False and os.geteuid() == 0:" \
153 + -i setup/install.py || die "sed failed to patch install.py"
154 +
155 + sed -e "/^ self.check_call(\\[QMAKE\\] + qmc + \\[proname\\])$/a\
156 +\\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ self.check_call(['sed', \
157 +'-e', 's|^CFLAGS .*|\\\\\\\\0 ${CFLAGS}|', \
158 +'-e', 's|^CXXFLAGS .*|\\\\\\\\0 ${CXXFLAGS}|', \
159 +'-e', 's|^LFLAGS .*|\\\\\\\\0 ${LDFLAGS}|', \
160 +'-i', 'Makefile'])" \
161 + -i setup/build.py || die "sed failed to patch build.py"
162 +
163 + # use system beautifulsoup, instead of bundled
164 + rm -f "${S}"/src/calibre/ebooks/BeautifulSoup.py \
165 + || die "could not remove bundled beautifulsoup"
166 + find "${S}" -type f -name \*.py -exec \
167 + sed -e 's/calibre.ebooks.BeautifulSoup/BeautifulSoup/' -i {} + \
168 + || die "could not sed bundled beautifulsoup out of the source tree"
169 +
170 + # avoid failure of xdg tools to recognize vendor prefix
171 + sed -e "s|xdg-icon-resource install|xdg-icon-resource install --novendor|" \
172 + -e "s|'xdg-mime', 'install'|'xdg-mime', 'install', '--novendor'|" \
173 + -e "s|'xdg-desktop-menu', 'install'|'xdg-desktop-menu', 'install', '--novendor'|" \
174 + -i "${S}"/src/calibre/linux.py || die 'sed failed'
175 +
176 + # don't create/install uninstaller
177 + sed '/self\.create_uninstaller()/d' -i src/calibre/linux.py || die
178 +}
179 +
180 +src_install() {
181 + # Bypass kbuildsycoca and update-mime-database in order to
182 + # avoid sandbox violations if xdg-mime tries to call them.
183 + cat - > "${T}/kbuildsycoca" <<-EOF
184 + #!${BASH}
185 + echo $0 : $@
186 + exit 0
187 + EOF
188 +
189 + cp "${T}"/{kbuildsycoca,update-mime-database} || die
190 + chmod +x "${T}"/{kbuildsycoca,update-mime-database} || die
191 +
192 + export QMAKE="${EPREFIX}/usr/$(get_libdir)/qt5/bin/qmake"
193 +
194 + # Unset DISPLAY in order to prevent xdg-mime from triggering a sandbox
195 + # violation with kbuildsycoca as in bug #287067, comment #13.
196 + export -n DISPLAY
197 +
198 + # Bug #352625 - Some LANGUAGE values can trigger the following ValueError:
199 + # File "/usr/lib/python2.6/locale.py", line 486, in getdefaultlocale
200 + # return _parse_localename(localename)
201 + # File "/usr/lib/python2.6/locale.py", line 418, in _parse_localename
202 + # raise ValueError, 'unknown locale: %s' % localename
203 + #ValueError: unknown locale: 46
204 + export -n LANGUAGE
205 +
206 + # Bug #295672 - Avoid sandbox violation in ~/.config by forcing
207 + # variables to point to our fake temporary $HOME.
208 + export HOME="${T}/fake_homedir"
209 + export XDG_CONFIG_HOME="${HOME}/.config"
210 + export XDG_DATA_HOME="${HOME}/.local/share"
211 + export CALIBRE_CONFIG_DIRECTORY="${XDG_CONFIG_HOME}/calibre"
212 + mkdir -p "${XDG_DATA_HOME}" "${CALIBRE_CONFIG_DIRECTORY}" || die
213 +
214 + tc-export CC CXX
215 + # Bug #334243 - respect LDFLAGS when building extensions
216 + export OVERRIDE_CFLAGS="$CFLAGS" OVERRIDE_LDFLAGS="$LDFLAGS"
217 + local libdir=$(get_libdir)
218 + [[ -n $libdir ]] || die "get_libdir returned an empty string"
219 +
220 + # Bug #472690 - Avoid sandbox violation for /dev/dri/card0.
221 + local x
222 + for x in /dev/dri/card[0-9] ; do
223 + [[ -e ${x} ]] && addpredict ${x}
224 + done
225 +
226 + #dodir "/usr/$(get_libdir)/python2.7/site-packages" # for init_calibre.py
227 + #dodir $(python_get_sitedir)
228 + PATH=${T}:${PATH} PYTHONPATH=${S}/src${PYTHONPATH:+:}${PYTHONPATH} \
229 + "${PYTHON}" setup.py install \
230 + --root="${D}" \
231 + --prefix="${EPREFIX}/usr" \
232 + --libdir="${EPREFIX}/usr/${libdir}" \
233 + --staging-root="${ED}usr" \
234 + --staging-libdir="${ED}usr/${libdir}" || die
235 +
236 + # The menu entries end up here due to '--mode user' being added to
237 + # xdg-* options in src_prepare.
238 + dodir /usr/share/mime/packages
239 + chmod -fR a+rX,u+w,g-w,o-w "${HOME}"/.local
240 + mv "${HOME}"/.local/share/mime/packages/* "${ED}"usr/share/mime/packages/ ||
241 + die "failed to register mime types"
242 + dodir /usr/share/icons
243 + mv "${HOME}"/.local/share/icons/* "${ED}"usr/share/icons/ ||
244 + die "failed to install icon files"
245 +
246 + domenu "${HOME}"/.local/share/applications/*.desktop ||
247 + die "failed to install .desktop menu files"
248 +
249 + find "${ED}"usr/share -type d -empty -delete
250 +
251 + cd "${ED}"/usr/share/calibre/fonts/liberation || die
252 + local x
253 + for x in * ; do
254 + [[ -f ${EPREFIX}usr/share/fonts/liberation-fonts/${x} ]] || continue
255 + ln -sf "../../../fonts/liberation-fonts/${x}" "${x}" || die
256 + done
257 +
258 + einfo "Converting python shebangs"
259 + python_fix_shebang "${ED}"
260 +
261 + einfo "Compiling python modules"
262 + python_optimize "${ED}"usr/lib/calibre
263 +
264 + newinitd "${FILESDIR}"/calibre-server-3.init calibre-server
265 + newconfd "${FILESDIR}"/calibre-server-3.conf calibre-server
266 +
267 + bashcomp_alias calibre \
268 + lrfviewer \
269 + calibre-debug \
270 + ebook-meta \
271 + calibre-server \
272 + ebook-viewer \
273 + ebook-polish \
274 + fetch-ebook-metadata \
275 + lrf2lrs \
276 + ebook-convert \
277 + ebook-edit \
278 + calibre-smtp \
279 + ebook-device
280 +
281 +}
282 +
283 +pkg_preinst() {
284 + # Indentify stray directories from upstream's "Binary install"
285 + # method (see bug 622728).
286 + CALIBRE_LIB_DIR=/usr/$(get_libdir)/calibre
287 + CALIBRE_LIB_CONTENT=$(for x in "${ED%/}${CALIBRE_LIB_DIR}"/*; do
288 + printf -- "${x##*/} "; done) || die "Failed to list ${ED%/}${CALIBRE_LIB_DIR}"
289 +}
290 +
291 +pkg_postinst() {
292 + [[ -n ${CALIBRE_LIB_DIR} ]] || die "CALIBRE_LIB_DIR is unset"
293 + local x
294 + for x in "${EROOT%/}${CALIBRE_LIB_DIR}"/*; do
295 + if [[ " ${CALIBRE_LIB_CONTENT} " != *" ${x##*/} "* ]]; then
296 + elog "Purging '${x}'"
297 + rm -rf "${x}"
298 + fi
299 + done
300 + fdo-mime_desktop_database_update
301 + fdo-mime_mime_database_update
302 +}
303 +
304 +pkg_postrm() {
305 + fdo-mime_desktop_database_update
306 + fdo-mime_mime_database_update
307 +}