Gentoo Archives: gentoo-commits

From: "Zac Medico (zmedico)" <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in app-text/calibre: calibre-1.1.ebuild ChangeLog
Date: Fri, 30 Aug 2013 18:34:43
Message-Id: 20130830183437.5272C2004C@flycatcher.gentoo.org
1 zmedico 13/08/30 18:34:37
2
3 Modified: ChangeLog
4 Added: calibre-1.1.ebuild
5 Log:
6 1.1 version bump.
7
8 (Portage version: 2.2.1/cvs/Linux i686, signed Manifest commit with key 0xFDE8EF85AE5719A3)
9
10 Revision Changes Path
11 1.300 app-text/calibre/ChangeLog
12
13 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-text/calibre/ChangeLog?rev=1.300&view=markup
14 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-text/calibre/ChangeLog?rev=1.300&content-type=text/plain
15 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-text/calibre/ChangeLog?r1=1.299&r2=1.300
16
17 Index: ChangeLog
18 ===================================================================
19 RCS file: /var/cvsroot/gentoo-x86/app-text/calibre/ChangeLog,v
20 retrieving revision 1.299
21 retrieving revision 1.300
22 diff -u -r1.299 -r1.300
23 --- ChangeLog 25 Aug 2013 17:08:43 -0000 1.299
24 +++ ChangeLog 30 Aug 2013 18:34:37 -0000 1.300
25 @@ -1,6 +1,11 @@
26 # ChangeLog for app-text/calibre
27 # Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
28 -# $Header: /var/cvsroot/gentoo-x86/app-text/calibre/ChangeLog,v 1.299 2013/08/25 17:08:43 zmedico Exp $
29 +# $Header: /var/cvsroot/gentoo-x86/app-text/calibre/ChangeLog,v 1.300 2013/08/30 18:34:37 zmedico Exp $
30 +
31 +*calibre-1.1 (30 Aug 2013)
32 +
33 + 30 Aug 2013; Zac Medico <zmedico@g.o> +calibre-1.1.ebuild:
34 + 1.1 version bump.
35
36 25 Aug 2013; Zac Medico <zmedico@g.o> calibre-1.0.ebuild:
37 Add dev-python/apsw dep for bug #482294.
38
39
40
41 1.1 app-text/calibre/calibre-1.1.ebuild
42
43 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-text/calibre/calibre-1.1.ebuild?rev=1.1&view=markup
44 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-text/calibre/calibre-1.1.ebuild?rev=1.1&content-type=text/plain
45
46 Index: calibre-1.1.ebuild
47 ===================================================================
48 # Copyright 1999-2013 Gentoo Foundation
49 # Distributed under the terms of the GNU General Public License v2
50 # $Header: /var/cvsroot/gentoo-x86/app-text/calibre/calibre-1.1.ebuild,v 1.1 2013/08/30 18:34:37 zmedico Exp $
51
52 EAPI=5
53
54 inherit eutils fdo-mime bash-completion-r1 multilib toolchain-funcs
55
56 DESCRIPTION="Ebook management application."
57 HOMEPAGE="http://calibre-ebook.com/"
58 [[ ${PV} == ${PV%.*}.${PV#*.} ]] && MY_PV=${PV}.0 || MY_PV=${PV}
59 SRC_URI="http://sourceforge.net/projects/calibre/files/${MY_PV}/${PN}-${MY_PV}.tar.xz"
60
61 # Restrict mirror due non-free prs500 fonts (bug #470212).
62 RESTRICT="mirror"
63
64 LICENSE="
65 GPL-3+
66 GPL-3
67 GPL-2+
68 GPL-2
69 GPL-1+
70 LGPL-3+
71 LGPL-2.1+
72 LGPL-2.1
73 BSD
74 MIT
75 Old-MIT
76 Apache-2.0
77 public-domain
78 || ( Artistic GPL-1+ )
79 CC-BY-3.0
80 OFL-1.1
81 PSF-2
82 unRAR
83 "
84
85 KEYWORDS="~amd64 ~x86"
86
87 SLOT="0"
88
89 IUSE="+udisks"
90
91 COMMON_DEPEND="
92 >=app-text/podofo-0.8.2:=
93 >=app-text/poppler-0.12.3-r3:=[qt4,xpdf-headers(+)]
94 >=dev-lang/python-2.7.1:2.7[sqlite,ssl]
95 >=dev-libs/chmlib-0.40:=
96 >=dev-libs/icu-4.4:=
97 dev-python/apsw
98 >=dev-python/beautifulsoup-3.0.5:python-2
99 dev-python/netifaces
100 dev-python/python-dateutil
101 >=dev-python/dnspython-1.6.0
102 >=dev-python/cssselect-0.7.1
103 >=dev-python/cssutils-0.9.9
104 >=dev-python/dbus-python-0.82.2
105 virtual/python-imaging
106 >=dev-python/lxml-2.2.1
107 >=dev-python/mechanize-0.1.11
108 >=dev-python/python-dateutil-1.4.1
109 >=dev-python/PyQt4-4.9.1[X,svg,webkit]
110 media-fonts/liberation-fonts
111 >=media-gfx/imagemagick-6.5.9[jpeg,png]
112 >=media-libs/freetype-2:=
113 >=media-libs/libwmf-0.2.8
114 >=media-libs/libmtp-1.1.4:=
115 virtual/libusb:1=
116 dev-qt/qtdbus:4=
117 dev-qt/qtsvg:4=
118 >=x11-misc/xdg-utils-1.0.2-r2"
119
120 RDEPEND="${COMMON_DEPEND}
121 udisks? ( || ( sys-fs/udisks:2 sys-fs/udisks:0 ) )"
122
123 DEPEND="${COMMON_DEPEND}
124 >=dev-python/setuptools-0.6_rc5"
125
126 S=${WORKDIR}/${PN}
127
128 src_prepare() {
129 # Fix outdated version constant.
130 #sed -e "s#\\(^numeric_version =\\).*#\\1 (${PV//./, })#" \
131 # -i src/calibre/constants.py || \
132 # die "sed failed to patch constants.py"
133
134 # Avoid sandbox violation in /usr/share/gnome/apps when linux.py
135 # calls xdg-* (bug #258938).
136 sed -e "s|'xdg-desktop-menu', 'install'|\\0, '--mode', 'user'|" \
137 -e "s|check_call(\\['xdg-desktop-menu', 'forceupdate'\\])|#\\0|" \
138 -e "s|\\(CurrentDir(tdir)\\), \\\\\$|\\1:|" \
139 -e "s|PreserveMIMEDefaults():||" \
140 -e "s|xdg-icon-resource install|\\0 --mode user|" \
141 -e "s|cc(\\['xdg-desktop-menu', 'forceupdate'\\])|#\\0|" \
142 -e "s|xdg-mime install|\\0 --mode user|" \
143 -i src/calibre/linux.py || die "sed failed to patch linux.py"
144
145 # Disable unnecessary privilege dropping for bug #287067.
146 sed -e "s:if os.geteuid() == 0:if False and os.geteuid() == 0:" \
147 -i setup/install.py || die "sed failed to patch install.py"
148
149 sed -e "/^ self\\.check_call(qmc + \\[.*\\.pro'\\])$/a\
150 \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ self.check_call(['sed', \
151 '-e', 's|^CFLAGS .*|\\\\\\\\0 ${CFLAGS}|', \
152 '-e', 's|^CXXFLAGS .*|\\\\\\\\0 ${CXXFLAGS}|', \
153 '-e', 's|^LFLAGS .*|\\\\\\\\0 ${LDFLAGS}|', \
154 '-i', 'Makefile'])" \
155 -i setup/extensions.py || die "sed failed to patch extensions.py"
156
157 # no_updates: do not annoy user with "new version is availible all the time
158 # disable_plugins: walking sec-hole, wait for upstream to use GHNS interface
159 epatch \
160 "${FILESDIR}/${PN}-no_updates_dialog.patch" \
161 "${FILESDIR}/${PN}-disable_plugins.patch"
162
163 # Remove non-free fonts (bug #470212).
164 rm -r resources/fonts/prs500 || die
165 }
166
167 src_install() {
168 # Bypass kbuildsycoca and update-mime-database in order to
169 # avoid sandbox violations if xdg-mime tries to call them.
170 cat - > "${T}/kbuildsycoca" <<-EOF
171 #!${BASH}
172 exit 0
173 EOF
174
175 cp "${T}"/{kbuildsycoca,update-mime-database}
176 chmod +x "${T}"/{kbuildsycoca,update-mime-database}
177
178 # Unset DISPLAY in order to prevent xdg-mime from triggering a sandbox
179 # violation with kbuildsycoca as in bug #287067, comment #13.
180 export -n DISPLAY
181
182 # Bug #352625 - Some LANGUAGE values can trigger the following ValueError:
183 # File "/usr/lib/python2.6/locale.py", line 486, in getdefaultlocale
184 # return _parse_localename(localename)
185 # File "/usr/lib/python2.6/locale.py", line 418, in _parse_localename
186 # raise ValueError, 'unknown locale: %s' % localename
187 #ValueError: unknown locale: 46
188 export -n LANGUAGE
189
190 # Bug #295672 - Avoid sandbox violation in ~/.config by forcing
191 # variables to point to our fake temporary $HOME.
192 export HOME="${T}/fake_homedir"
193 export XDG_CONFIG_HOME="${HOME}/.config"
194 export XDG_DATA_HOME="${HOME}/.local/share"
195 export CALIBRE_CONFIG_DIRECTORY="${XDG_CONFIG_HOME}/calibre"
196 mkdir -p "${XDG_CONFIG_HOME}" "${CALIBRE_CONFIG_DIRECTORY}"
197
198 tc-export CC CXX
199 # Bug #334243 - respect LDFLAGS when building calibre-mount-helper
200 export OVERRIDE_CFLAGS="$CFLAGS" OVERRIDE_LDFLAGS="$LDFLAGS"
201 local libdir=$(get_libdir)
202 [[ -n $libdir ]] || die "get_libdir returned an empty string"
203
204 # Bug #472690 - Avoid sandbox violation for /dev/dri/card0.
205 local x
206 for x in /dev/dri/card[0-9] ; do
207 [[ -e ${x} ]] && addpredict ${x}
208 done
209
210 dodir "/usr/$(get_libdir)/python2.7/site-packages" # for init_calibre.py
211 PATH=${T}:${PATH} PYTHONPATH=${S}/src${PYTHONPATH:+:}${PYTHONPATH} \
212 "${EPREFIX}"/usr/bin/python2.7 setup.py install \
213 --root="${D}" \
214 --prefix="${EPREFIX}/usr" \
215 --libdir="${EPREFIX}/usr/${libdir}" \
216 --staging-root="${ED}usr" \
217 --staging-libdir="${ED}usr/${libdir}" || die
218
219 grep -rlZ "${ED}" "${ED}" | xargs -0 sed -e "s:${D}:/:g" -i ||
220 die "failed to fix harcoded \$D in paths"
221
222 # Remove dummy calibre-mount-helper which is unused since calibre-0.8.25
223 # due to bug #389515 (instead, calibre now calls udisks via dbus).
224 rm "${ED}usr/bin/calibre-mount-helper" || die
225
226 # The menu entries end up here due to '--mode user' being added to
227 # xdg-* options in src_prepare.
228 dodir /usr/share/mime/packages
229 chmod -fR a+rX,u+w,g-w,o-w "${HOME}"/.local
230 mv "${HOME}"/.local/share/mime/packages/* "${ED}"usr/share/mime/packages/ ||
231 die "failed to register mime types"
232 dodir /usr/share/icons
233 mv "${HOME}"/.local/share/icons/* "${ED}"usr/share/icons/ ||
234 die "failed to install icon files"
235
236 domenu "${HOME}"/.local/share/applications/*.desktop ||
237 die "failed to install .desktop menu files"
238
239 dobashcomp "${ED}"usr/etc/bash_completion.d/calibre
240 rm -r "${ED}"usr/etc/bash_completion.d
241 find "${ED}"usr/etc -type d -empty -delete
242
243 cd "${ED}"/usr/share/calibre/fonts/liberation || die
244 local x
245 for x in * ; do
246 [[ -f ${EROOT}usr/share/fonts/liberation-fonts/${x} ]] || continue
247 ln -sf "../../../fonts/liberation-fonts/${x}" "${x}" || die
248 done
249
250 einfo "Converting python shebangs"
251 while read -r -d $'\0' ; do
252 local shebang=$(head -n1 "$REPLY")
253 if [[ ${shebang} == "#!"*python* ]] ; then
254 sed -i -e "1s:.*:#!${EPREFIX}/usr/bin/python2.7:" "$REPLY" || \
255 die "sed failed"
256 fi
257 done < <(find "${ED}" -type f -print0)
258
259 einfo "Compiling python modules"
260 "${EPREFIX}"/usr/bin/python2.7 -m compileall -q -f \
261 -d "${EPREFIX}"/usr/lib/calibre "${ED}"usr/lib/calibre || die
262
263 newinitd "${FILESDIR}"/calibre-server.init calibre-server
264 newconfd "${FILESDIR}"/calibre-server.conf calibre-server
265 }
266
267 pkg_postinst() {
268 fdo-mime_desktop_database_update
269 fdo-mime_mime_database_update
270 }