Gentoo Archives: gentoo-commits

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