/[gentoo-x86]/dev-python/cvxopt/cvxopt-1.1.6-r2.ebuild
Gentoo

Contents of /dev-python/cvxopt/cvxopt-1.1.6-r2.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations) (download)
Wed Apr 8 08:04:53 2015 UTC (3 years, 2 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/cvxopt/cvxopt-1.1.6-r2.ebuild,v 1.2 2014/11/28 10:09:59 pacho Exp $
4
5 EAPI=5
6
7 PYTHON_COMPAT=( python{2_7,3_3,3_4} )
8
9 inherit distutils-r1 toolchain-funcs eutils
10
11 DESCRIPTION="Python package for convex optimization"
12 HOMEPAGE="http://cvxopt.org/"
13 SRC_URI="https://github.com/${PN}/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
14
15 LICENSE="GPL-3"
16 SLOT="0"
17 KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
18 IUSE="doc +dsdp examples fftw +glpk gsl"
19
20 RDEPEND="
21 virtual/blas
22 virtual/cblas
23 virtual/lapack
24 sci-libs/cholmod:0=
25 sci-libs/umfpack:0=
26 dsdp? ( sci-libs/dsdp:0= )
27 fftw? ( sci-libs/fftw:3.0= )
28 glpk? ( sci-mathematics/glpk:0= )
29 gsl? ( sci-libs/gsl:0= )"
30 DEPEND="${RDEPEND}
31 virtual/pkgconfig
32 doc? ( dev-python/sphinx )"
33
34 python_prepare_all(){
35 epatch "${FILESDIR}"/${PN}-1.1.6-setup.patch
36
37 has_version ">=sci-mathematics/glpk-4.49" && \
38 epatch "${FILESDIR}"/${PN}-1.1.6-glpk449.patch
39
40 rm -r src/C/SuiteSparse*/ || die
41
42 pkg_lib() {
43 local pkg=$(echo $1 | tr '[:lower:]' '[:upper:]')
44 local libs="$($(tc-getPKG_CONFIG) --libs-only-l $1 | \
45 sed -e 's:[ ]-l*\(pthread\|m\)\([ ]\|$\)::g' -e 's:[ ]*$::' | \
46 tr ' ' '\n' | sort -u | sed -e "s:^-l\(.*\):'\1':g" | \
47 tr '\n' ',' | sed -e 's:,$::')"
48 local libdir="$($(tc-getPKG_CONFIG) --libs-only-L $1 | \
49 sed -e 's:[ ]*$::' | \
50 tr ' ' '\n' | sort -u | sed -e "s:^-L\(.*\):'\1':g" | \
51 tr '\n' ',' | sed -e 's:,$::')"
52 local incdir="$($(tc-getPKG_CONFIG) --cflags-only-I $1 | \
53 sed -e 's:[ ]*$::' | \
54 tr ' ' '\n' | sort -u | sed -e "s:^-L\(.*\):'\1':g" | \
55 tr '\n' ',' | sed -e 's:,$::')"
56 sed -i \
57 -e "/${pkg}_LIB[ ]*=/s:\(.*[ ]*=[ ]*\[\).*${1}.*:\1${libs}\]:" \
58 -e "s:\(${pkg}_INC_DIR[ ]*=\).*$:\1 ${incdir}:" \
59 -e "s:\[ BLAS_LIB_DIR \]:\[ ${libdir} \]:g" \
60 setup.py || die
61 }
62
63 use_cvx() {
64 if use $1 ; then
65 sed -i \
66 -e "s/\(BUILD_${1^^} =\) 0/\1 1/" \
67 setup.py || die
68 fi
69 }
70
71 pkg_lib blas
72 pkg_lib lapack
73
74 use_cvx gsl
75 use_cvx fftw
76 use_cvx glpk
77 use_cvx dsdp
78
79 distutils-r1_python_prepare_all
80 }
81
82 python_compile_all() {
83 use doc && export VARTEXFONTS="${T}/fonts" && emake -C doc -B html
84 }
85
86 python_test() {
87 cd examples/doc/chap8
88 "${EPYTHON}" lp.py || die
89 }
90
91 python_install_all() {
92 use doc && HTML_DOCS=( doc/build/html/. )
93 insinto /usr/share/doc/${PF}
94 use examples && doins -r examples
95 distutils-r1_python_install_all
96 }

  ViewVC Help
Powered by ViewVC 1.1.20