Gentoo Archives: gentoo-commits

From: "Ben de Groot (yngwin)" <yngwin@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in app-text/calibre: calibre-1.46.ebuild ChangeLog
Date: Mon, 28 Jul 2014 12:14:31
Message-Id: 20140728121425.8E3762004E@flycatcher.gentoo.org
1 yngwin 14/07/28 12:14:25
2
3 Modified: ChangeLog
4 Added: calibre-1.46.ebuild
5 Log:
6 Version bump. Adjust location of bash completion. Fixes bug #517636.
7
8 (Portage version: 2.2.10/cvs/Linux x86_64, signed Manifest commit with key 0x0F9C590B7FF324F6!)
9
10 Revision Changes Path
11 1.328 app-text/calibre/ChangeLog
12
13 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-text/calibre/ChangeLog?rev=1.328&view=markup
14 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-text/calibre/ChangeLog?rev=1.328&content-type=text/plain
15 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-text/calibre/ChangeLog?r1=1.327&r2=1.328
16
17 Index: ChangeLog
18 ===================================================================
19 RCS file: /var/cvsroot/gentoo-x86/app-text/calibre/ChangeLog,v
20 retrieving revision 1.327
21 retrieving revision 1.328
22 diff -u -r1.327 -r1.328
23 --- ChangeLog 24 Jul 2014 11:05:51 -0000 1.327
24 +++ ChangeLog 28 Jul 2014 12:14:25 -0000 1.328
25 @@ -1,6 +1,11 @@
26 # ChangeLog for app-text/calibre
27 # Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
28 -# $Header: /var/cvsroot/gentoo-x86/app-text/calibre/ChangeLog,v 1.327 2014/07/24 11:05:51 ssuominen Exp $
29 +# $Header: /var/cvsroot/gentoo-x86/app-text/calibre/ChangeLog,v 1.328 2014/07/28 12:14:25 yngwin Exp $
30 +
31 +*calibre-1.46 (28 Jul 2014)
32 +
33 + 28 Jul 2014; Ben de Groot <yngwin@g.o> +calibre-1.46.ebuild:
34 + Version bump. Adjust location of bash completion. Fixes bug #517636.
35
36 24 Jul 2014; Samuli Suominen <ssuominen@g.o> metadata.xml:
37 Remove description for USE="udisks" which is a global USE flag now.
38
39
40
41 1.1 app-text/calibre/calibre-1.46.ebuild
42
43 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-text/calibre/calibre-1.46.ebuild?rev=1.1&view=markup
44 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-text/calibre/calibre-1.46.ebuild?rev=1.1&content-type=text/plain
45
46 Index: calibre-1.46.ebuild
47 ===================================================================
48 # Copyright 1999-2014 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.46.ebuild,v 1.1 2014/07/28 12:14:25 yngwin 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 LICENSE="
62 GPL-3+
63 GPL-3
64 GPL-2+
65 GPL-2
66 GPL-1+
67 LGPL-3+
68 LGPL-2.1+
69 LGPL-2.1
70 BSD
71 MIT
72 Old-MIT
73 Apache-2.0
74 public-domain
75 || ( Artistic GPL-1+ )
76 CC-BY-3.0
77 OFL-1.1
78 PSF-2
79 unRAR
80 "
81
82 KEYWORDS="~amd64 ~arm ~x86"
83 SLOT="0"
84 IUSE="+udisks"
85
86 COMMON_DEPEND="
87 >=app-text/podofo-0.8.2:=
88 >=app-text/poppler-0.20.2:=[qt4,xpdf-headers(+)]
89 >=dev-lang/python-2.7.1:2.7[sqlite,ssl]
90 >=dev-libs/chmlib-0.40:=
91 >=dev-libs/icu-4.4:=
92 >=dev-python/apsw-3.7.17[python_targets_python2_7(-)]
93 >=dev-python/beautifulsoup-3.0.5:python-2[python_targets_python2_7(-)]
94 dev-python/netifaces[python_targets_python2_7(-)]
95 >=dev-python/dnspython-1.6.0[python_targets_python2_7(-)]
96 >=dev-python/cssselect-0.7.1[python_targets_python2_7(-)]
97 >=dev-python/cssutils-0.9.9[python_targets_python2_7(-)]
98 >=dev-python/dbus-python-0.82.2[python_targets_python2_7(-)]
99 >=dev-python/lxml-3.2.1[python_targets_python2_7(-)]
100 >=dev-python/mechanize-0.1.11[python_targets_python2_7(-)]
101 >=dev-python/python-dateutil-1.4.1[python_targets_python2_7(-)]
102 >=dev-python/PyQt4-4.9.6[X,svg,webkit,python_targets_python2_7(-)]
103 dev-qt/qtdbus:4=
104 dev-qt/qtsvg:4=
105 media-fonts/liberation-fonts
106 >=media-gfx/imagemagick-6.5.9[jpeg,png]
107 >=media-libs/freetype-2:=
108 >=media-libs/libwmf-0.2.8
109 >=media-libs/libmtp-1.1.5:=
110 virtual/libusb:1=
111 virtual/python-imaging[python_targets_python2_7(-)]
112 >=x11-misc/xdg-utils-1.0.2-r2"
113
114 RDEPEND="${COMMON_DEPEND}
115 udisks? ( || ( sys-fs/udisks:2 sys-fs/udisks:0 ) )"
116
117 DEPEND="${COMMON_DEPEND}
118 >=dev-python/setuptools-0.6_rc5"
119
120 S=${WORKDIR}/${PN}
121
122 src_prepare() {
123 # Fix outdated version constant.
124 #sed -e "s#\\(^numeric_version =\\).*#\\1 (${PV//./, })#" \
125 # -i src/calibre/constants.py || \
126 # die "sed failed to patch constants.py"
127
128 # Avoid sandbox violation in /usr/share/gnome/apps when linux.py
129 # calls xdg-* (bug #258938).
130 sed -e "s|'xdg-desktop-menu', 'install'|\\0, '--mode', 'user'|" \
131 -e "s|check_call(\\['xdg-desktop-menu', 'forceupdate'\\])|#\\0|" \
132 -e "s|\\(CurrentDir(tdir)\\), \\\\\$|\\1:|" \
133 -e "s|PreserveMIMEDefaults():||" \
134 -e "s|xdg-icon-resource install|\\0 --mode user|" \
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/extensions.py || die "sed failed to patch extensions.py"
150
151 # use system beautifulsoup, instead of bundled
152 rm -f "${S}"/src/calibre/ebooks/BeautifulSoup.py || die "could not remove bundled beautifulsoup"
153 find "${S}" -type f -name \*.py -exec \
154 sed -e 's/calibre.ebooks.BeautifulSoup/BeautifulSoup/' -i {} + \
155 || die "could not sed bundled beautifulsoup out of the source tree"
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 # C locale: if LC_ALL=C do not raise an exception when locale cannot be canonicalized
160 epatch \
161 "${FILESDIR}/${PN}-1.34-no_updates_dialog.patch" \
162 "${FILESDIR}/${PN}-disable_plugins.patch"
163 }
164
165 src_install() {
166 # Bypass kbuildsycoca and update-mime-database in order to
167 # avoid sandbox violations if xdg-mime tries to call them.
168 cat - > "${T}/kbuildsycoca" <<-EOF
169 #!${BASH}
170 exit 0
171 EOF
172
173 cp "${T}"/{kbuildsycoca,update-mime-database}
174 chmod +x "${T}"/{kbuildsycoca,update-mime-database}
175
176 # Unset DISPLAY in order to prevent xdg-mime from triggering a sandbox
177 # violation with kbuildsycoca as in bug #287067, comment #13.
178 export -n DISPLAY
179
180 # Bug #352625 - Some LANGUAGE values can trigger the following ValueError:
181 # File "/usr/lib/python2.6/locale.py", line 486, in getdefaultlocale
182 # return _parse_localename(localename)
183 # File "/usr/lib/python2.6/locale.py", line 418, in _parse_localename
184 # raise ValueError, 'unknown locale: %s' % localename
185 #ValueError: unknown locale: 46
186 export -n LANGUAGE
187
188 # Bug #295672 - Avoid sandbox violation in ~/.config by forcing
189 # variables to point to our fake temporary $HOME.
190 export HOME="${T}/fake_homedir"
191 export XDG_CONFIG_HOME="${HOME}/.config"
192 export XDG_DATA_HOME="${HOME}/.local/share"
193 export CALIBRE_CONFIG_DIRECTORY="${XDG_CONFIG_HOME}/calibre"
194 mkdir -p "${XDG_CONFIG_HOME}" "${CALIBRE_CONFIG_DIRECTORY}"
195
196 tc-export CC CXX
197 # Bug #334243 - respect LDFLAGS when building extensions
198 export OVERRIDE_CFLAGS="$CFLAGS" OVERRIDE_LDFLAGS="$LDFLAGS"
199 local libdir=$(get_libdir)
200 [[ -n $libdir ]] || die "get_libdir returned an empty string"
201
202 # Bug #472690 - Avoid sandbox violation for /dev/dri/card0.
203 local x
204 for x in /dev/dri/card[0-9] ; do
205 [[ -e ${x} ]] && addpredict ${x}
206 done
207
208 dodir "/usr/$(get_libdir)/python2.7/site-packages" # for init_calibre.py
209 PATH=${T}:${PATH} PYTHONPATH=${S}/src${PYTHONPATH:+:}${PYTHONPATH} \
210 "${EPREFIX}"/usr/bin/python2.7 setup.py install \
211 --root="${D}" \
212 --prefix="${EPREFIX}/usr" \
213 --libdir="${EPREFIX}/usr/${libdir}" \
214 --staging-root="${ED}usr" \
215 --staging-libdir="${ED}usr/${libdir}" || die
216
217 grep -rlZ "${ED}" "${ED}" | xargs -0 sed -e "s:${D}:/:g" -i ||
218 die "failed to fix harcoded \$D in paths"
219
220 # The menu entries end up here due to '--mode user' being added to
221 # xdg-* options in src_prepare.
222 dodir /usr/share/mime/packages
223 chmod -fR a+rX,u+w,g-w,o-w "${HOME}"/.local
224 mv "${HOME}"/.local/share/mime/packages/* "${ED}"usr/share/mime/packages/ ||
225 die "failed to register mime types"
226 dodir /usr/share/icons
227 mv "${HOME}"/.local/share/icons/* "${ED}"usr/share/icons/ ||
228 die "failed to install icon files"
229
230 domenu "${HOME}"/.local/share/applications/*.desktop ||
231 die "failed to install .desktop menu files"
232
233 dobashcomp "${ED}"usr/share/bash-completion/completions/calibre
234 rm -r "${ED}"usr/share/bash-completion
235 find "${ED}"usr/share -type d -empty -delete
236
237 cd "${ED}"/usr/share/calibre/fonts/liberation || die
238 local x
239 for x in * ; do
240 [[ -f ${EROOT}usr/share/fonts/liberation-fonts/${x} ]] || continue
241 ln -sf "../../../fonts/liberation-fonts/${x}" "${x}" || die
242 done
243
244 einfo "Converting python shebangs"
245 while read -r -d $'\0' ; do
246 local shebang=$(head -n1 "$REPLY")
247 if [[ ${shebang} == "#!"*python* ]] ; then
248 sed -i -e "1s:.*:#!${EPREFIX}/usr/bin/python2.7:" "$REPLY" || \
249 die "sed failed"
250 fi
251 done < <(find "${ED}" -type f -print0)
252
253 einfo "Compiling python modules"
254 "${EPREFIX}"/usr/bin/python2.7 -m compileall -q -f \
255 -d "${EPREFIX}"/usr/lib/calibre "${ED}"usr/lib/calibre || die
256
257 newinitd "${FILESDIR}"/calibre-server.init calibre-server
258 newconfd "${FILESDIR}"/calibre-server.conf calibre-server
259 }
260
261 pkg_postinst() {
262 fdo-mime_desktop_database_update
263 fdo-mime_mime_database_update
264 }