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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (show annotations) (download)
Wed Mar 26 00:04:00 2014 UTC (4 years, 6 months ago) by bicatali
Branch: MAIN
CVS Tags: HEAD
Changes since 1.3: +1 -1 lines
FILE REMOVED
Make it work for multiple library directories and more generic blas/lapack library dependencies

(Portage version: 2.2.8-prefix/cvs/Linux x86_64, signed Manifest commit with key 0x13CB1360)

1 # Copyright 1999-2014 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.ebuild,v 1.3 2014/01/16 18:44:31 bicatali Exp $
4
5 EAPI=5
6
7 PYTHON_COMPAT=( python{2_6,2_7,3_2,3_3} )
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
25 sci-libs/umfpack
26 dsdp? ( sci-libs/dsdp )
27 fftw? ( sci-libs/fftw:3.0 )
28 glpk? ( sci-mathematics/glpk:= )
29 gsl? ( sci-libs/gsl )"
30 DEPEND="${RDEPEND}
31 virtual/pkgconfig
32 doc? ( dev-python/sphinx )"
33
34 python_prepare_all(){
35 local PATCHES=( "${FILESDIR}"/${PN}-1.1.6-setup.patch )
36 has_version ">=sci-mathematics/glpk-4.49" && \
37 epatch "${FILESDIR}"/${PN}-1.1.6-glpk.patch
38 rm -r src/C/SuiteSparse*/ || die
39
40 distutils-r1_python_prepare_all
41
42 pkg_lib() {
43 local pylib=\'$($(tc-getPKG_CONFIG) --libs-only-l ${1} | sed \
44 -e 's/^-l//' \
45 -e "s/ -l/\',\'/g" \
46 -e 's/.,.pthread//g' \
47 -e "s:[[:space:]]::g")\'
48 sed -i -e "/_LIB = /s:\(.*\)'${1}'\(.*\):\1${pylib}\2:" setup.py || die
49 }
50
51 use_cvx() {
52 if use ${1}; then
53 sed -i \
54 -e "s/\(BUILD_${1^^} =\) 0/\1 1/" \
55 setup.py || die
56 fi
57 }
58
59 pkg_lib blas
60 pkg_lib lapack
61
62 # Deal with blas/lapck libraries that are not in /usr/lib{64}
63 local lapackdir=\'$($(tc-getPKG_CONFIG) --libs-only-L lapack | sed \
64 -e 's/^-L//' \
65 -e "s/ -L/\',\'/g" \
66 -e "s:[[:space:]]::g")\'
67 sed -i -e "s:BLAS_LIB_DIR = '':BLAS_LIB_DIR = ${lapackdir}:" setup.py || die
68
69 use_cvx gsl
70 use_cvx fftw
71 use_cvx glpk
72 use_cvx dsdp
73 }
74
75 python_compile_all() {
76 use doc && export VARTEXFONTS="${T}/fonts" && emake -C doc -B html
77 }
78
79 python_test() {
80 cd examples/doc/chap8
81 "${EPYTHON}" lp.py || die
82 }
83
84 python_install_all() {
85 use doc && HTML_DOCS=( doc/build/html/. )
86 insinto /usr/share/doc/${PF}
87 use examples && doins -r examples
88 distutils-r1_python_install_all
89 }

  ViewVC Help
Powered by ViewVC 1.1.20