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