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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (show annotations) (download)
Wed Apr 8 08:05:07 2015 UTC (3 years, 2 months ago) by mgorny
Branch: MAIN
CVS Tags: HEAD
Changes since 1.3: +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.9.4.1-r2.ebuild,v 1.3 2013/12/12 12:57:30 jlec Exp $
4
5 EAPI=5
6
7 PYTHON_COMPAT=( python2_7 )
8 WX_GTK_VER="2.9"
9
10 inherit alternatives distutils-r1 eutils fdo-mime flag-o-matic wxwidgets
11
12 MY_PN="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_PN}-2.9.4.0.tar.bz2
18 examples? ( mirror://sourceforge/wxpython/wxPython-demo-2.9.4.0.tar.bz2 )
19 mirror://sourceforge/wxpython/${MY_PN}-2.9.4.1.patch"
20
21 LICENSE="wxWinLL-3"
22 SLOT="2.9"
23 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sh ~sparc ~x86 ~x86-fbsd"
24 IUSE="cairo examples opengl"
25
26 RDEPEND="
27 dev-lang/python-exec:2[${PYTHON_USEDEP}]
28 >=x11-libs/wxGTK-${PV}:${WX_GTK_VER}[opengl?,tiff,X]
29 dev-libs/glib:2
30 dev-python/setuptools[${PYTHON_USEDEP}]
31 media-libs/libpng:0=
32 media-libs/tiff:0
33 virtual/jpeg
34 x11-libs/gtk+:2
35 x11-libs/pango[X]
36 cairo? ( >=dev-python/pycairo-1.8.4[${PYTHON_USEDEP}] )
37 opengl? ( dev-python/pyopengl[${PYTHON_USEDEP}] )"
38
39 DEPEND="${RDEPEND}
40 virtual/pkgconfig"
41
42 S="${WORKDIR}/${MY_PN}-2.9.4.0/wxPython"
43 DOC_S="${WORKDIR}/wxPython-2.9.4.0"
44
45 # The hacky build system seems to be broken with out-of-source builds,
46 # and installs 'wx' package globally.
47 DISTUTILS_IN_SOURCE_BUILD=1
48
49 python_prepare_all() {
50 sed -i "s:cflags.append('-O3'):pass:" config.py || die "sed failed"
51
52 cd .. || die
53 epatch "${DISTDIR}"/${MY_PN}-${PV}.patch
54
55 if use examples; then
56 cd "${DOC_S}"
57 epatch "${FILESDIR}"/${PN}-${SLOT}-wxversion-demo.patch
58 fi
59
60 cd "${S}" || die
61 local PATCHES=(
62 "${FILESDIR}"/${P}-wxversion-scripts.patch
63 # drop editra - we have it as a separate package now
64 "${FILESDIR}"/${PN}-2.8.11-drop-editra.patch
65 "${FILESDIR}"/${PN}-2.8-no-preservatives-added.patch
66 # fix handling egg_info command
67 "${FILESDIR}"/${PN}-2.8.12.1-disable-egging-mode.patch
68 )
69
70 distutils-r1_python_prepare_all
71 }
72
73 src_configure() {
74 append-flags -fno-strict-aliasing
75 need-wxwidgets unicode
76
77 mydistutilsargs=(
78 WX_CONFIG="${WX_CONFIG}"
79 WXPORT=gtk2
80 UNICODE=1
81 BUILD_GLCANVAS=$(usex opengl 1 0)
82 )
83 }
84
85 python_compile() {
86 # We need to have separate libdirs due to hackery, bug #455332.
87 distutils-r1_python_compile \
88 build --build-purelib "${BUILD_DIR}"/lib.common
89 }
90
91 python_install() {
92 distutils-r1_python_install \
93 build --build-purelib "${BUILD_DIR}"/lib.common
94
95 # adjust the filenames for wxPython slots.
96 local file
97 for file in "${D}$(python_get_sitedir)"/wx{version.*,.pth}; do
98 mv "${file}" "${file}-${SLOT}" || die
99 done
100 cd "${ED}"usr/lib/python-exec/"${EPYTHON}" || die
101 for file in *; do
102 mv "${file}" "${file}-${SLOT}" || die
103
104 # wrappers are common to all impls, so a parallel run may
105 # move it for us. ln+rm is more failure-proof.
106 ln -fs ../lib/python-exec/python-exec2 "${ED}usr/bin/${file}-${SLOT}" || die
107 rm -f "${ED}usr/bin/${file}"
108 done
109 }
110
111 python_install_all() {
112 dodoc docs/{CHANGES,PyManual,README,wxPackage,wxPythonManual}.txt
113
114 for x in {Py{AlaMode,Crust,Shell},XRCed}; do
115 newmenu distrib/${x}.desktop ${x}-${SLOT}.desktop
116 done
117 newicon wx/py/PyCrust_32.png PyCrust-${SLOT}.png
118 newicon wx/py/PySlices_32.png PySlices-${SLOT}.png
119 newicon wx/tools/XRCed/XRCed_32.png XRCed-${SLOT}.png
120
121 if use examples; then
122 docinto demo
123 dodoc -r "${DOC_S}"/demo/.
124 docinto samples
125 dodoc -r "${DOC_S}"/samples/.
126
127 [[ -e ${docdir}/samples/embedded/embedded ]] \
128 && rm -f "${docdir}"/samples/embedded/embedded
129
130 docompress -x /usr/share/doc/${PF}/{demo,samples}
131 fi
132 distutils-r1_python_install_all
133 }
134
135 pkg_postinst() {
136 fdo-mime_desktop_database_update
137
138 create_symlinks() {
139 alternatives_auto_makesym "$(python_get_sitedir)/wx.pth" "$(python_get_sitedir)/wx.pth-[0-9].[0-9]"
140 alternatives_auto_makesym "$(python_get_sitedir)/wxversion.py" "$(python_get_sitedir)/wxversion.py-[0-9].[0-9]"
141 }
142 python_foreach_impl create_symlinks
143
144 echo
145 elog "Gentoo uses the Multi-version method for SLOT'ing."
146 elog "Developers, see this site for instructions on using"
147 elog "2.8 or 2.9 with your apps:"
148 elog "http://wiki.wxpython.org/index.cgi/MultiVersionInstalls"
149 if use examples; then
150 echo
151 elog "The demo.py app which contains demo modules with"
152 elog "documentation and source code has been installed at"
153 elog "/usr/share/doc/${PF}/demo/demo.py"
154 echo
155 elog "More example apps and modules can be found in"
156 elog "/usr/share/doc/${PF}/samples/"
157 fi
158 }
159
160 pkg_postrm() {
161 fdo-mime_desktop_database_update
162
163 update_symlinks() {
164 alternatives_auto_makesym "$(python_get_sitedir)/wx.pth" "$(python_get_sitedir)/wx.pth-[0-9].[0-9]"
165 alternatives_auto_makesym "$(python_get_sitedir)/wxversion.py" "$(python_get_sitedir)/wxversion.py-[0-9].[0-9]"
166 }
167 python_foreach_impl update_symlinks
168 }

  ViewVC Help
Powered by ViewVC 1.1.20