/[gentoo-x86]/dev-python/oosuite/oosuite-0.45.ebuild
Gentoo

Contents of /dev-python/oosuite/oosuite-0.45.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Wed Apr 8 08:05:16 2015 UTC (5 years, 3 months ago) by mgorny
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +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/oosuite/oosuite-0.45.ebuild,v 1.1 2013/03/18 21:48:25 bicatali Exp $
4
5 EAPI=5
6
7 PYTHON_COMPAT=( python2_7 )
8 PYTHON_REQ_USE='tk?'
9
10 inherit distutils-r1 eutils
11
12 MYPN="OOSuite"
13 MYPID="f/f3"
14
15 DESCRIPTION="OpenOpt suite of Python modules for numerical optimization"
16 HOMEPAGE="http://openopt.org/"
17 SRC_URI="http://openopt.org/images/${MYPID}/${MYPN}.zip -> ${MYPN}-${PV}.zip"
18
19 LICENSE="BSD"
20 SLOT="0"
21 KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
22 IUSE="examples minimal tk"
23
24 RDEPEND="
25 dev-python/numpy[${PYTHON_USEDEP}]
26 !minimal? (
27 dev-python/cvxopt[glpk,${PYTHON_USEDEP}]
28 dev-python/lp_solve[${PYTHON_USEDEP}]
29 dev-python/matplotlib[${PYTHON_USEDEP}]
30 dev-python/setproctitle[${PYTHON_USEDEP}]
31 sci-libs/nlopt[python]
32 sci-libs/scipy[${PYTHON_USEDEP}] )"
33 DEPEND="
34 app-arch/unzip
35 dev-python/numpy[${PYTHON_USEDEP}]
36 dev-python/setuptools[${PYTHON_USEDEP}]"
37
38 S="${WORKDIR}/PythonPackages"
39
40 OO_DIRS="DerApproximator FuncDesigner OpenOpt SpaceFuncs"
41
42 python_prepare() {
43 # reorganize SpaceFuncs
44 pushd SpaceFuncs > /dev/null
45 mkdir SpaceFuncs
46 cp __version__.py SpaceFuncs || die
47 mv SpaceFuncs.py __init__.py kernel SpaceFuncs || die
48 popd > /dev/null
49 local d
50 for d in ${OO_DIRS}; do
51 pushd ${d} > /dev/null
52 find . -name "*COPYING*" -delete
53 find . -type d -name examples -or -name tests -or -name doc \
54 -exec rm -r '{}' +
55 distutils-r1_python_prepare
56 popd > /dev/null
57 done
58 }
59
60 src_prepare() {
61 distutils-r1_src_prepare
62 # move all examples and tests to ease installation in proper directory
63 mkdir "${WORKDIR}/examples"
64 local d e
65 for d in ${OO_DIRS}; do
66 mkdir "${WORKDIR}/examples/${d}" || die
67 for e in $(find ${d} -type d -name examples -or -name tests -or -name doc); do
68 mv ${e} "${WORKDIR}/examples/${d}/" || die
69 done
70 done
71 }
72
73 python_compile() {
74 local d
75 for d in ${OO_DIRS}; do
76 pushd ${d} > /dev/null
77 distutils-r1_python_compile
78 popd > /dev/null
79 done
80 }
81
82 python_test() {
83 local d t oldpath=${PYTHONPATH}
84 for d in ${OO_DIRS}; do
85 PYTHONPATH="${BUILD_DIR}/${d}/build/lib:${PYTHONPATH}"
86 done
87 export PYTHONPATH
88 cd "${WORKDIR}"/examples
89 # limit the tests, other need more dependencies
90 for t in \
91 DerApproximator/tests/t_check.py \
92 FuncDesigner/examples/sle1.py \
93 OpenOpt/examples/nlp_1.py \
94 SpaceFuncs/examples/triangle.py
95 do
96 "${PYTHON}" ${t} || die "test ${t} failed"
97 done
98 export PYTHONPATH=${oldpath}
99 }
100
101 python_install() {
102 local d
103 for d in ${OO_DIRS}; do
104 pushd ${d} > /dev/null
105 distutils-r1_python_install
106 popd > /dev/null
107 done
108 use examples && EXAMPLES="${WORKDIR}"/examples
109 }

  ViewVC Help
Powered by ViewVC 1.1.20