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, 10 Mar 2017 05:58:27
Message-Id: 1489125368.8de6e6721d52ec23a88f88f2e354da6c10fe061f.zmedico@gentoo
1 commit: 8de6e6721d52ec23a88f88f2e354da6c10fe061f
2 Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
3 AuthorDate: Fri Mar 10 05:34:50 2017 +0000
4 Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
5 CommitDate: Fri Mar 10 05:56:08 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8de6e672
7
8 app-text/calibre: version bump to 2.80.0
9
10 Package-Manager: Portage-2.3.4, Repoman-2.3.2
11
12 app-text/calibre/Manifest | 1 +
13 app-text/calibre/calibre-2.80.0.ebuild | 250 +++++++++++++++++++++++++++++++++
14 2 files changed, 251 insertions(+)
15
16 diff --git a/app-text/calibre/Manifest b/app-text/calibre/Manifest
17 index 5004dc1fe89..cc4db3db000 100644
18 --- a/app-text/calibre/Manifest
19 +++ b/app-text/calibre/Manifest
20 @@ -1 +1,2 @@
21 DIST calibre-2.78.0.tar.xz 38739404 SHA256 d2b0b0c5451d3ac05ce9de0b801ddf8de7664fee45f273d7ee8445a1ec2f898b SHA512 0779ac385dde45ac4baee7cecb0916e245f3e1cf20662bad9d9a4278265390b1aa89c2b478601b57113e7de08a69343288488ee299e8b43332f0129e650aa0ca WHIRLPOOL 325fc344445078ef0df0a29b4cd8e32445a881ede89e3db87606166ff0c8b7db10b7cc34432e63c2bb49382537a5107686339b987f1be807d59a1786ddfd4a75
22 +DIST calibre-2.80.0.tar.xz 38781996 SHA256 33a6dbc578c7a2f3d1c97253769506a1afc10f688c062f027d64d7081618f2b1 SHA512 9dc874cd7bfcc883514e354a494a83c63d19b88980df8f28fc03b57d3ebaafb45dad36f0d61e8ef08d363ed18a7bd953e8d624c69f0c3d7f7d66308fceac8982 WHIRLPOOL b40701e810d9a9fab333f420bb1f14a89ac55dd7397407d4f31837efc97d323f74b94181436b8038004e404aff6e9c5696deee89daf1cd949e5659dbe43207c4
23
24 diff --git a/app-text/calibre/calibre-2.80.0.ebuild b/app-text/calibre/calibre-2.80.0.ebuild
25 new file mode 100644
26 index 00000000000..f41f4e7f5e7
27 --- /dev/null
28 +++ b/app-text/calibre/calibre-2.80.0.ebuild
29 @@ -0,0 +1,250 @@
30 +# Copyright 1999-2017 Gentoo Foundation
31 +# Distributed under the terms of the GNU General Public License v2
32 +
33 +EAPI=6
34 +
35 +PYTHON_COMPAT=( python2_7 )
36 +PYTHON_REQ_USE="sqlite,ssl"
37 +
38 +inherit eutils fdo-mime bash-completion-r1 multilib toolchain-funcs python-single-r1
39 +
40 +DESCRIPTION="Ebook management application"
41 +HOMEPAGE="http://calibre-ebook.com/"
42 +SRC_URI="http://download.calibre-ebook.com/${PV}/${P}.tar.xz"
43 +
44 +LICENSE="
45 + GPL-3+
46 + GPL-3
47 + GPL-2+
48 + GPL-2
49 + GPL-1+
50 + LGPL-3+
51 + LGPL-2.1+
52 + LGPL-2.1
53 + BSD
54 + MIT
55 + Old-MIT
56 + Apache-2.0
57 + public-domain
58 + || ( Artistic GPL-1+ )
59 + CC-BY-3.0
60 + OFL-1.1
61 + PSF-2
62 + unRAR
63 +"
64 +KEYWORDS="~amd64 ~arm ~x86"
65 +SLOT="0"
66 +IUSE="+udisks"
67 +
68 +REQUIRED_USE="${PYTHON_REQUIRED_USE}"
69 +
70 +COMMON_DEPEND="${PYTHON_DEPS}
71 + >=app-text/podofo-0.8.2:=
72 + >=app-text/poppler-0.26.5[qt5]
73 + >=dev-libs/chmlib-0.40:=
74 + dev-libs/glib:2
75 + >=dev-libs/icu-4.4:=
76 + >=dev-python/apsw-3.7.17[${PYTHON_USEDEP}]
77 + >=dev-python/beautifulsoup-3.0.5:python-2[${PYTHON_USEDEP}]
78 + >=dev-python/cssselect-0.7.1[${PYTHON_USEDEP}]
79 + >=dev-python/cssutils-0.9.9[${PYTHON_USEDEP}]
80 + >=dev-python/dbus-python-1.2.0[${PYTHON_USEDEP}]
81 + >=dev-python/lxml-3.2.1[${PYTHON_USEDEP}]
82 + >=dev-python/mechanize-0.1.11[${PYTHON_USEDEP}]
83 + dev-python/netifaces[${PYTHON_USEDEP}]
84 + dev-python/pillow[${PYTHON_USEDEP}]
85 + dev-python/psutil[${PYTHON_USEDEP}]
86 + >=dev-python/pygments-2.0.1[${PYTHON_USEDEP}]
87 + >=dev-python/python-dateutil-1.4.1[${PYTHON_USEDEP}]
88 + >=dev-python/PyQt5-5.3.1[gui,svg,webkit,widgets,network,printsupport,${PYTHON_USEDEP}]
89 + dev-qt/qtcore:5
90 + dev-qt/qtgui:5
91 + dev-qt/qtwidgets:5
92 + media-fonts/liberation-fonts
93 + >=media-gfx/imagemagick-6.5.9[jpeg,png]
94 + media-libs/fontconfig
95 + >=media-libs/freetype-2:=
96 + >=media-libs/libmtp-1.1.5:=
97 + >=media-libs/libwmf-0.2.8
98 + sys-libs/zlib
99 + virtual/libusb:1=
100 + virtual/python-dnspython[${PYTHON_USEDEP}]
101 + x11-libs/libX11
102 + x11-libs/libXext
103 + x11-libs/libXrender
104 + >=x11-misc/xdg-utils-1.0.2-r2
105 + udisks? ( virtual/libudev )"
106 +RDEPEND="${COMMON_DEPEND}
107 + udisks? ( || ( sys-fs/udisks:2 sys-fs/udisks:0 ) )"
108 +DEPEND="${COMMON_DEPEND}
109 + >=dev-python/setuptools-0.6_rc5[${PYTHON_USEDEP}]
110 + >=virtual/podofo-build-0.8.2
111 + virtual/pkgconfig"
112 +
113 +src_prepare() {
114 + # no_updates: do not annoy user with "new version is availible all the time
115 + # disable_plugins: walking sec-hole, wait for upstream to use GHNS interface
116 + eapply \
117 + "${FILESDIR}/${PN}-2.9.0-no_updates_dialog.patch" \
118 + "${FILESDIR}/${PN}-disable_plugins.patch"
119 +
120 + eapply_user
121 +
122 + # Fix outdated version constant.
123 + #sed -e "s#\\(^numeric_version =\\).*#\\1 (${PV//./, })#" \
124 + # -i src/calibre/constants.py || \
125 + # die "sed failed to patch constants.py"
126 +
127 + # Avoid sandbox violation in /usr/share/gnome/apps when linux.py
128 + # calls xdg-* (bug #258938).
129 + sed -e "s|'xdg-desktop-menu', 'install'|\\0, '--mode', 'user'|" \
130 + -e "s|check_call(\\['xdg-desktop-menu', 'forceupdate'\\])|#\\0|" \
131 + -e "s|\\(CurrentDir(tdir)\\), \\\\\$|\\1:|" \
132 + -e "s|, PreserveMIMEDefaults():|:|" \
133 + -e "s|'xdg-icon-resource', 'install'|\\0, '--mode', 'user'|" \
134 + -e "s|cmd\[2\]|cmd[4]|" \
135 + -e "s|cc(\\['xdg-desktop-menu', 'forceupdate'\\])|#\\0|" \
136 + -e "s|'xdg-mime', 'install'|\\0, '--mode', 'user'|" \
137 + -i src/calibre/linux.py || die "sed failed to patch linux.py"
138 +
139 + # Disable unnecessary privilege dropping for bug #287067.
140 + sed -e "s:if os.geteuid() == 0:if False and os.geteuid() == 0:" \
141 + -i setup/install.py || die "sed failed to patch install.py"
142 +
143 + sed -e "/^ self\\.check_call(qmc + \\[.*\\.pro'\\])$/a\
144 +\\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ self.check_call(['sed', \
145 +'-e', 's|^CFLAGS .*|\\\\\\\\0 ${CFLAGS}|', \
146 +'-e', 's|^CXXFLAGS .*|\\\\\\\\0 ${CXXFLAGS}|', \
147 +'-e', 's|^LFLAGS .*|\\\\\\\\0 ${LDFLAGS}|', \
148 +'-i', 'Makefile'])" \
149 + -i setup/build.py || die "sed failed to patch build.py"
150 +
151 + # use system beautifulsoup, instead of bundled
152 + rm -f "${S}"/src/calibre/ebooks/BeautifulSoup.py \
153 + || die "could not remove bundled beautifulsoup"
154 + find "${S}" -type f -name \*.py -exec \
155 + sed -e 's/calibre.ebooks.BeautifulSoup/BeautifulSoup/' -i {} + \
156 + || die "could not sed bundled beautifulsoup out of the source tree"
157 +
158 + # avoid failure of xdg tools to recognize vendor prefix
159 + sed -e "s|xdg-icon-resource install|xdg-icon-resource install --novendor|" \
160 + -e "s|'xdg-mime', 'install'|'xdg-mime', 'install', '--novendor'|" \
161 + -e "s|'xdg-desktop-menu', 'install'|'xdg-desktop-menu', 'install', '--novendor'|" \
162 + -i "${S}"/src/calibre/linux.py || die 'sed failed'
163 +
164 + # don't create/install uninstaller
165 + sed '/self\.create_uninstaller()/d' -i src/calibre/linux.py || die
166 +}
167 +
168 +src_install() {
169 + # Bypass kbuildsycoca and update-mime-database in order to
170 + # avoid sandbox violations if xdg-mime tries to call them.
171 + cat - > "${T}/kbuildsycoca" <<-EOF
172 + #!${BASH}
173 + echo $0 : $@
174 + exit 0
175 + EOF
176 +
177 + cp "${T}"/{kbuildsycoca,update-mime-database} || die
178 + chmod +x "${T}"/{kbuildsycoca,update-mime-database} || die
179 +
180 + export QMAKE="${EPREFIX}/usr/$(get_libdir)/qt5/bin/qmake"
181 +
182 + # Unset DISPLAY in order to prevent xdg-mime from triggering a sandbox
183 + # violation with kbuildsycoca as in bug #287067, comment #13.
184 + export -n DISPLAY
185 +
186 + # Bug #352625 - Some LANGUAGE values can trigger the following ValueError:
187 + # File "/usr/lib/python2.6/locale.py", line 486, in getdefaultlocale
188 + # return _parse_localename(localename)
189 + # File "/usr/lib/python2.6/locale.py", line 418, in _parse_localename
190 + # raise ValueError, 'unknown locale: %s' % localename
191 + #ValueError: unknown locale: 46
192 + export -n LANGUAGE
193 +
194 + # Bug #295672 - Avoid sandbox violation in ~/.config by forcing
195 + # variables to point to our fake temporary $HOME.
196 + export HOME="${T}/fake_homedir"
197 + export XDG_CONFIG_HOME="${HOME}/.config"
198 + export XDG_DATA_HOME="${HOME}/.local/share"
199 + export CALIBRE_CONFIG_DIRECTORY="${XDG_CONFIG_HOME}/calibre"
200 + mkdir -p "${XDG_DATA_HOME}" "${CALIBRE_CONFIG_DIRECTORY}" || die
201 +
202 + tc-export CC CXX
203 + # Bug #334243 - respect LDFLAGS when building extensions
204 + export OVERRIDE_CFLAGS="$CFLAGS" OVERRIDE_LDFLAGS="$LDFLAGS"
205 + local libdir=$(get_libdir)
206 + [[ -n $libdir ]] || die "get_libdir returned an empty string"
207 +
208 + # Bug #472690 - Avoid sandbox violation for /dev/dri/card0.
209 + local x
210 + for x in /dev/dri/card[0-9] ; do
211 + [[ -e ${x} ]] && addpredict ${x}
212 + done
213 +
214 + #dodir "/usr/$(get_libdir)/python2.7/site-packages" # for init_calibre.py
215 + #dodir $(python_get_sitedir)
216 + PATH=${T}:${PATH} PYTHONPATH=${S}/src${PYTHONPATH:+:}${PYTHONPATH} \
217 + "${PYTHON}" setup.py install \
218 + --root="${D}" \
219 + --prefix="${EPREFIX}/usr" \
220 + --libdir="${EPREFIX}/usr/${libdir}" \
221 + --staging-root="${ED}usr" \
222 + --staging-libdir="${ED}usr/${libdir}" || die
223 +
224 + # The menu entries end up here due to '--mode user' being added to
225 + # xdg-* options in src_prepare.
226 + dodir /usr/share/mime/packages
227 + chmod -fR a+rX,u+w,g-w,o-w "${HOME}"/.local
228 + mv "${HOME}"/.local/share/mime/packages/* "${ED}"usr/share/mime/packages/ ||
229 + die "failed to register mime types"
230 + dodir /usr/share/icons
231 + mv "${HOME}"/.local/share/icons/* "${ED}"usr/share/icons/ ||
232 + die "failed to install icon files"
233 +
234 + domenu "${HOME}"/.local/share/applications/*.desktop ||
235 + die "failed to install .desktop menu files"
236 +
237 + find "${ED}"usr/share -type d -empty -delete
238 +
239 + cd "${ED}"/usr/share/calibre/fonts/liberation || die
240 + local x
241 + for x in * ; do
242 + [[ -f ${EPREFIX}usr/share/fonts/liberation-fonts/${x} ]] || continue
243 + ln -sf "../../../fonts/liberation-fonts/${x}" "${x}" || die
244 + done
245 +
246 + einfo "Converting python shebangs"
247 + python_fix_shebang "${ED}"
248 +
249 + einfo "Compiling python modules"
250 + python_optimize "${ED}"usr/lib/calibre
251 +
252 + newinitd "${FILESDIR}"/calibre-server.init calibre-server
253 + newconfd "${FILESDIR}"/calibre-server.conf calibre-server
254 +
255 + bashcomp_alias calibre \
256 + lrfviewer \
257 + calibre-debug \
258 + ebook-meta \
259 + calibre-server \
260 + ebook-viewer \
261 + ebook-polish \
262 + fetch-ebook-metadata \
263 + lrf2lrs \
264 + ebook-convert \
265 + ebook-edit \
266 + calibre-smtp \
267 + ebook-device
268 +
269 +}
270 +
271 +pkg_postinst() {
272 + fdo-mime_desktop_database_update
273 + fdo-mime_mime_database_update
274 +}
275 +
276 +pkg_postrm() {
277 + fdo-mime_desktop_database_update
278 + fdo-mime_mime_database_update
279 +}