/[gentoo-x86]/dev-python/wxpython/wxpython-2.8.12.1-r2.ebuild
Gentoo

Contents of /dev-python/wxpython/wxpython-2.8.12.1-r2.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.13 - (show annotations) (download)
Wed Apr 8 08:05:07 2015 UTC (3 years, 1 month ago) by mgorny
Branch: MAIN
CVS Tags: HEAD
Changes since 1.12: +3 -3 lines
Drop old Python implementations

(Portage version: 2.2.18/cvs/Linux x86_64, signed Manifest commit with key EFB4464E!)

1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/dev-python/wxpython/wxpython-2.8.12.1-r2.ebuild,v 1.12 2014/03/19 16:14:13 ago Exp $
4
5 EAPI=5
6
7 PYTHON_COMPAT=( python2_7 )
8 WX_GTK_VER="2.8"
9
10 inherit alternatives distutils-r1 eutils fdo-mime flag-o-matic wxwidgets
11
12 MY_P="${P/wxpython-/wxPython-src-}"
13
14 DESCRIPTION="A blending of the wxWindows C++ class library with Python"
15 HOMEPAGE="http://www.wxpython.org/"
16 SRC_URI="
17 mirror://sourceforge/wxpython/${MY_P}.tar.bz2
18 doc? (
19 mirror://sourceforge/wxpython/wxPython-docs-${PV}.tar.bz2
20 mirror://sourceforge/wxpython/wxPython-newdocs-2.8.9.2.tar.bz2 )
21 examples? ( mirror://sourceforge/wxpython/wxPython-demo-${PV}.tar.bz2 )"
22
23 LICENSE="wxWinLL-3"
24 SLOT="2.8"
25 KEYWORDS="alpha amd64 arm hppa ia64 ppc ppc64 ~sh sparc x86 ~amd64-fbsd ~x86-fbsd"
26 IUSE="cairo doc examples opengl"
27
28 RDEPEND="
29 dev-lang/python-exec:2[${PYTHON_USEDEP}]
30 >=x11-libs/wxGTK-${PV}:${WX_GTK_VER}[opengl?,tiff,X]
31 dev-libs/glib:2
32 dev-python/setuptools[${PYTHON_USEDEP}]
33 media-libs/libpng:0=
34 media-libs/tiff:0
35 virtual/jpeg
36 x11-libs/gtk+:2
37 x11-libs/pango[X]
38 cairo? ( >=dev-python/pycairo-1.8.4[${PYTHON_USEDEP}] )
39 opengl? ( dev-python/pyopengl[${PYTHON_USEDEP}] )"
40
41 DEPEND="${RDEPEND}
42 virtual/pkgconfig"
43
44 S="${WORKDIR}/${MY_P}/wxPython"
45 DOC_S="${WORKDIR}/wxPython-${PV}"
46
47 # The hacky build system seems to be broken with out-of-source builds,
48 # and installs 'wx' package globally.
49 DISTUTILS_IN_SOURCE_BUILD=1
50
51 python_prepare_all() {
52 sed -i "s:cflags.append('-O3'):pass:" config.py || die "sed failed"
53
54 if use doc; then
55 cd "${DOC_S}" || die
56 epatch "${FILESDIR}"/${PN}-${SLOT}-cache-writable.patch
57 fi
58
59 if use examples; then
60 cd "${DOC_S}" || die
61 epatch "${FILESDIR}"/${PN}-${SLOT}-wxversion-demo.patch
62 fi
63
64 cd "${S}" || die
65
66 local PATCHES=(
67 "${FILESDIR}"/${PN}-2.8.9-wxversion-scripts.patch
68 # drop editra - we have it as a separate package now
69 "${FILESDIR}"/${PN}-2.8.12-drop-editra.patch
70 "${FILESDIR}"/${PN}-2.8.12-drop-categories.patch
71 "${FILESDIR}"/${PN}-2.8-no-preservatives-added.patch
72 # fix handling egg_info command
73 "${FILESDIR}"/${PN}-2.8.12.1-disable-egging-mode.patch
74 )
75
76 distutils-r1_python_prepare_all
77 }
78
79 python_configure_all() {
80 append-flags -fno-strict-aliasing
81 # Workaround, buildsystem uses CFLAGS as CXXFLAGS
82 export CFLAGS="${CXXFLAGS}"
83 need-wxwidgets unicode
84
85 mydistutilsargs=(
86 WX_CONFIG="${WX_CONFIG}"
87 WXPORT=gtk2
88 UNICODE=1
89 BUILD_GLCANVAS=$(usex opengl 1 0)
90 )
91 }
92
93 python_compile() {
94 # We need to have separate libdirs due to hackery, bug #455332.
95 distutils-r1_python_compile \
96 build --build-purelib "${BUILD_DIR}"/lib.common
97 }
98
99 python_install() {
100 distutils-r1_python_install \
101 build --build-purelib "${BUILD_DIR}"/lib.common
102
103 # adjust the filenames for wxPython slots.
104 local file
105 for file in "${D}$(python_get_sitedir)"/wx{version.*,.pth}; do
106 mv "${file}" "${file}-${SLOT}" || die
107 done
108 cd "${ED}"usr/lib/python-exec/"${EPYTHON}" || die
109 for file in *; do
110 mv "${file}" "${file}-${SLOT}" || die
111
112 # wrappers are common to all impls, so a parallel run may
113 # move it for us. ln+rm is more failure-proof.
114 ln -fs ../lib/python-exec/python-exec2 "${ED}usr/bin/${file}-${SLOT}" || die
115 rm -f "${ED}usr/bin/${file}"
116 done
117 }
118
119 python_install_all() {
120 dodoc docs/{CHANGES,PyManual,README,wxPackage,wxPythonManual}.txt
121
122 domenu distrib/{Py{AlaMode,Crust,Shell},XRCed}.desktop
123 newicon wx/py/PyCrust_32.png PyCrust.png
124 newicon wx/tools/XRCed/XRCed_32.png XRCed.png
125
126 docdir=${D}usr/share/doc/${PF}
127
128 if use doc; then
129 docinto docs
130 dodoc -r "${DOC_S}"/docs/.
131 # For some reason newer API docs aren't available so use 2.8.9.2's
132 dodoc -r "${WORKDIR}"/wxPython-2.8.9.2/docs/.
133
134 docompress -x /usr/share/doc/${PF}/docs
135 fi
136
137 if use examples; then
138 docinto demo
139 dodoc -r "${DOC_S}"/demo/.
140 docinto samples
141 dodoc -r "${DOC_S}"/samples/.
142
143 [[ -e ${docdir}/samples/embedded/embedded ]] \
144 && rm -f "${docdir}"/samples/embedded/embedded
145
146 docompress -x /usr/share/doc/${PF}/{demo,samples}
147 fi
148 distutils-r1_python_install_all
149 }
150
151 pkg_postinst() {
152 fdo-mime_desktop_database_update
153
154 create_symlinks() {
155 alternatives_auto_makesym "$(python_get_sitedir)/wx.pth" "$(python_get_sitedir)/wx.pth-[0-9].[0-9]"
156 alternatives_auto_makesym "$(python_get_sitedir)/wxversion.py" "$(python_get_sitedir)/wxversion.py-[0-9].[0-9]"
157 }
158 python_foreach_impl create_symlinks
159
160 echo
161 elog "Gentoo uses the Multi-version method for SLOT'ing."
162 elog "Developers, see this site for instructions on using"
163 elog "2.6 or 2.8 with your apps:"
164 elog "http://wiki.wxpython.org/index.cgi/MultiVersionInstalls"
165 if use doc; then
166 echo
167 elog "To access the general wxWidgets documentation, run"
168 elog "/usr/share/doc/${PF}/docs/viewdocs.py"
169 echo
170 elog "wxPython documentation is available by pointing a browser"
171 elog "at /usr/share/doc/${PF}/docs/api/index.html"
172 fi
173 if use examples; then
174 echo
175 elog "The demo.py app which contains hundreds of demo modules"
176 elog "with documentation and source code has been installed at"
177 elog "/usr/share/doc/${PF}/demo/demo.py"
178 echo
179 elog "Many more example apps and modules can be found in"
180 elog "/usr/share/doc/${PF}/samples/"
181 fi
182 echo
183 elog "Editra is not packaged with wxpython in Gentoo."
184 elog "You can find it in the tree as app-editors/editra"
185 }
186
187 pkg_postrm() {
188 fdo-mime_desktop_database_update
189
190 update_symlinks() {
191 alternatives_auto_makesym "$(python_get_sitedir)/wx.pth" "$(python_get_sitedir)/wx.pth-[0-9].[0-9]"
192 alternatives_auto_makesym "$(python_get_sitedir)/wxversion.py" "$(python_get_sitedir)/wxversion.py-[0-9].[0-9]"
193 }
194 python_foreach_impl update_symlinks
195 }

  ViewVC Help
Powered by ViewVC 1.1.20