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

Contents of /dev-python/wxpython/wxpython-3.0.0.0.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


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

  ViewVC Help
Powered by ViewVC 1.1.20