Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 192785
Collapse All | Expand All

(-)sympy-0.5.10.ebuild (-43 / +18 lines)
Lines 4-12 Link Here
4
4
5
NEED_PYTHON=2.4
5
NEED_PYTHON=2.4
6
6
7
inherit distutils python multilib
7
inherit eutils distutils python multilib
8
8
9
DESCRIPTION="Python library for symbolic mathematics"
9
DESCRIPTION="Python library for symbolic mathematics."
10
HOMEPAGE="http://code.google.com/p/sympy/"
10
HOMEPAGE="http://code.google.com/p/sympy/"
11
SRC_URI="http://sympy.googlecode.com/files/${P}.tar.gz"
11
SRC_URI="http://sympy.googlecode.com/files/${P}.tar.gz"
12
12
Lines 14-34 Link Here
14
14
15
LICENSE="BSD"
15
LICENSE="BSD"
16
KEYWORDS="~amd64 ~x86"
16
KEYWORDS="~amd64 ~x86"
17
IUSE="examples mathml gtk latex plot test"
17
IUSE="examples math gtk latex plot test"
18
18
19
RDEPEND="mathml? (
19
RDEPEND="math? (
20
		dev-libs/libxml2
20
		dev-libs/libxml2
21
		dev-libs/libxslt
21
		dev-libs/libxslt
22
	)
22
		gtk? ( x11-libs/gtkmathview )
23
	gtk? (
24
		!mathml? (
25
			dev-libs/libxml2
26
			dev-libs/libxslt
27
		)
28
		x11-libs/gtkmathview
29
	)
23
	)
30
	latex? (
24
	latex? (
31
		virtual/tetex
25
		virtual/latex-base
32
		app-text/dvipng
26
		app-text/dvipng
33
		>=dev-python/pexpect-2.0
27
		>=dev-python/pexpect-2.0
34
	)
28
	)
Lines 40-49 Link Here
40
DEPEND="test? ( >=dev-python/py-0.9.0 )
34
DEPEND="test? ( >=dev-python/py-0.9.0 )
41
	${RDEPEND}"
35
	${RDEPEND}"
42
36
43
PYTHON_MODNAME="sympy"
44
45
pkg_setup() {
37
pkg_setup() {
46
	if use mathml || use gtk ; then
38
	if use math ; then
47
		if ! built_with_use "dev-libs/libxml2" python ; then
39
		if ! built_with_use "dev-libs/libxml2" python ; then
48
			eerror "dev-libs/libxml2 has to be compiled with 'python' USE-flag."
40
			eerror "dev-libs/libxml2 has to be compiled with 'python' USE-flag."
49
			die "Needed USE-flag for dev-libs/libxml2 not found."
41
			die "Needed USE-flag for dev-libs/libxml2 not found."
Lines 53-68 Link Here
53
			eerror "dev-libs/libxslt has to be compiled with 'python' USE-flag."
45
			eerror "dev-libs/libxslt has to be compiled with 'python' USE-flag."
54
			die "Needed USE-flag for dev-libs/libxslt not found."
46
			die "Needed USE-flag for dev-libs/libxslt not found."
55
		fi
47
		fi
56
	fi
57
48
58
	if use gtk ; then
49
		if use gtk && ! built_with_use "x11-libs/gtkmathview" gtk ; then
59
		if ! built_with_use "x11-libs/gtkmathview" gtk ; then
60
			eerror "x11-libs/gtkmathview has to be compiled with 'gtk' USE-flag."
50
			eerror "x11-libs/gtkmathview has to be compiled with 'gtk' USE-flag."
61
			die "Needed USE-flag for x11-libs/gtkmathview not found."
51
			die "Needed USE-flag for x11-libs/gtkmathview not found."
62
		fi
52
		fi
63
	fi
53
	fi
64
}
54
}
65
55
56
src_test() {
57
	PYTHONPATH=build/lib/ "${python}" setup.py test || die "Unit tests failed!"
58
}
59
66
src_install() {
60
src_install() {
67
	distutils_src_install
61
	distutils_src_install
68
62
Lines 78-116 Link Here
78
	doins -r sympy/thirdparty/pyglet
72
	doins -r sympy/thirdparty/pyglet
79
}
73
}
80
74
81
src_test() {
82
	PYTHONPATH=build/lib/ "${python}" setup.py test || die "Unit tests failed!"
83
}
84
85
pkg_postinst() {
75
pkg_postinst() {
86
	python_version
87
88
	python_mod_optimize ${ROOT}usr/$(get_libdir)/python${PYVER}/site-packages/sympy/
89
90
	if ! has_version ">=dev-python/ipython-0.7.2" ; then
76
	if ! has_version ">=dev-python/ipython-0.7.2" ; then
91
		elog
77
		elog
92
		elog "IPython 0.7.2 (or better) wasn't found on your system. It is"
78
		elog "IPython 0.7.2 (or better) wasn't found on your system. It is"
93
		elog "highly recommended that you install this package to optimize"
79
		elog "highly recommended to install this package to optimize your"
94
		elog "your work with SymPy. To do so, you can run:"
80
		elog "work with SymPy. To do so, you can run:"
95
		elog
81
		elog
96
		elog " emerge '>=dev-python/ipython-0.7.2'"
82
		elog " emerge '>=dev-python/ipython-0.7.2'"
83
		elog
97
	fi
84
	fi
98
99
	elog
100
	elog "SymPy comes with a console that is a simple wrapper around the"
101
	elog "classic python console (or ipython when available) that loads"
102
	elog "the sympy namespace and executes some common commands for you."
103
	elog
104
	elog "To start it, issue:"
105
	elog
106
	elog " isympy"
107
	elog
108
	elog "For a brief introduction to SymPy visit:"
109
	elog
110
	elog " http://code.google.com/p/sympy/wiki/Tutorial"
111
	elog
112
}
85
}
113
86
114
pkg_postrm() {
87
pkg_postrm() {
115
	python_mod_cleanup
88
	if use examples ; then
89
		python_mod_cleanup /usr/share/doc/${PF}
90
	fi
116
}
91
}

Return to bug 192785