Skip to content

Commit

Permalink
Merge pull request #2 from jeanfrancisroy/master
Browse files Browse the repository at this point in the history
Adding the CVXOPT package
  • Loading branch information
Martin Scholz committed Jul 25, 2011
2 parents 89084d7 + 26564b1 commit 60b7df0
Show file tree
Hide file tree
Showing 5 changed files with 192 additions and 0 deletions.
22 changes: 22 additions & 0 deletions dev-python/cvxopt/ChangeLog
@@ -0,0 +1,22 @@
# ChangeLog for dev-python/cvxopt
# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
# $Header: $

24 Jun 2011; Justin Lecher <jlec@gentoo.org> cvxopt-1.1.3.ebuild:
Sort inherit and/or USE

20 Jun 2011; François Bissey <francois.bissey@canterbury.ac.nz>
cvxopt-1.1.3.ebuild, +files/cvxopt-1.1.3-blas.patch, metadata.xml:
Add useflag description in metadata

20 Jun 2011; François Bissey <francois.bissey@canterbury.ac.nz>
cvxopt-1.1.3.ebuild, +files/cvxopt-1.1.3-blas.patch:
Make cvxopt use pkg-config for BLAS/LAPACK

03 May 2011; Justin Lecher <jlec@gentoo.org> cvxopt-1.1.3.ebuild:
Smaller reorganization of the ebuild

29 Dec 2010; François Bissey <f.r.bissey@massey.ac.nz> cvxopt-1.1.3.ebuild:
Add a changelog :), synchronize with the version in sage-on-gentoo overlay
and discussions on bug #230457

15 changes: 15 additions & 0 deletions dev-python/cvxopt/Manifest
@@ -0,0 +1,15 @@
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

AUX cvxopt-1.1.3-blas.patch 2833 RMD160 5c247a60c42a2b0507eed17410f7f9cff9b79464 SHA1 628b178c5f617217fcdac2f0e3f49cb5ab5a652b SHA256 4794ef677e984bcd564f7c426bdaa6361aa2bfe3cce83bbd1a88647551bca698
DIST cvxopt-1.1.3.tar.gz 2927536 RMD160 cd0fdf51db957b388803b305f43ff323415b2252 SHA1 fe048bd21bb33eb99adb2759eda6f06d7520aa31 SHA256 c9563f04a31516e7b042d9e25344ae24bf6bc3e905c53ed077f9974c0efd9a7a
EBUILD cvxopt-1.1.3.ebuild 1398 RMD160 f1889166a77437d26c23e2c6dd31980d89c8f2f9 SHA1 c2fcfa76df27134976b7d62e9852d66a3f8c2a3b SHA256 9d1ca6849bc2d14fcb5e4502a1c727057eb1472e82daeef4e6cb6c6f3a8d2371
MISC ChangeLog 854 RMD160 38714bb41cf4e7476c72e811aa07ebdf737bdb94 SHA1 246c56f28f6324fbbdad9b099338253e33e091b3 SHA256 a6ddba47f963efd6e556a59dde9f840bedbd77d97912ec5ee24acc429d7dedd3
MISC metadata.xml 773 RMD160 0896f77a40bd838a9543fae42d240d7e47fbdaf2 SHA1 5ca51919cac1aabbaafe560fc4689fa83202ae1b SHA256 6e7d1cf0e53dcfb136d3cdc183671ecf3d9fb121eb6e28651e48325dc2b4c40c
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (GNU/Linux)

iEYEARECAAYFAk4Efy8ACgkQgAnW8HDreRYiXACgjGvWiQFDWTIl6ZvOXHj3yZbt
WD0AoKryiOU0zArNbqsEPjFkYZ6IT7un
=l34+
-----END PGP SIGNATURE-----
67 changes: 67 additions & 0 deletions dev-python/cvxopt/cvxopt-1.1.3.ebuild
@@ -0,0 +1,67 @@
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

EAPI=3
PYTHON_DEPEND=2:2.5
SUPPORT_PYTHON_ABIS=1
RESTRICT_PYTHON_ABIS="2.4 3.*"
DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES=1

inherit distutils eutils python

DESCRIPTION="A Python Package for Convex Optimization"
HOMEPAGE="http://abel.ee.ucla.edu/cvxopt"
SRC_URI="http://abel.ee.ucla.edu/${PN}/${P}.tar.gz"

RESTRICT="mirror"

LICENSE="GPL-3"
SLOT="0"
KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
IUSE="fftw glpk gsl"

DEPEND="virtual/blas
virtual/lapack
virtual/cblas
fftw? ( sci-libs/fftw )
glpk? ( sci-mathematics/glpk )
gsl? ( sci-libs/gsl )"
RDEPEND="${DEPEND}"

S=${WORKDIR}/${P}/src

src_prepare(){
epatch "${FILESDIR}/${PN}"-1.1.3-blas.patch

BLAS=\'$(pkg-config --libs-only-l blas | sed \
-e 's/^-l//' \
-e "s/ -l/\',\'/g" \
-e 's/,.pthread//g' \
-e "s: ::")\'
LAPACK=\'$(pkg-config --libs-only-l lapack | sed \
-e 's/^-l//' \
-e "s/ -l/\',\'/g" \
-e 's/,.pthread//g' \
-e "s: ::")\'

sed -i \
-e "s:@GENTOO_BLAS:${BLAS}:" \
-e "s:@GENTOO_LAPACK:${LAPACK}:" \
setup.py

distutils_src_prepare

prepare_builddir() {
set_flag() {
if use ${1}; then
sed -i -e "s/\(BUILD_${2} =\) 0/\1 1/" setup.py || die
fi
}

set_flag gsl GSL
set_flag fftw FFTW
set_flag glpk GLPK
}
python_execute_function -s prepare_builddir
}
76 changes: 76 additions & 0 deletions dev-python/cvxopt/files/cvxopt-1.1.3-blas.patch
@@ -0,0 +1,76 @@
--- setup.py.orig 2011-06-20 15:32:19.584436452 +1200
+++ setup.py 2011-06-20 15:35:14.962030823 +1200
@@ -46,14 +48,14 @@
# optional modules

if BUILD_GSL:
- gsl = Extension('gsl', libraries = ['m', 'gsl', 'blas'],
+ gsl = Extension('gsl', libraries = ['m', 'gsl', @GENTOO_BLAS],
include_dirs = [ GSL_INC_DIR ],
library_dirs = [ GSL_LIB_DIR ],
sources = ['C/gsl.c'] )
extmods += [gsl];

if BUILD_FFTW:
- fftw = Extension('fftw', libraries = ['fftw3', 'blas'],
+ fftw = Extension('fftw', libraries = ['fftw3', @GENTOO_BLAS],
include_dirs = [ FFTW_INC_DIR ],
library_dirs = [ FFTW_LIB_DIR, ATLAS_LIB_DIR ],
sources = ['C/fftw.c'] )
@@ -67,7 +69,7 @@
extmods += [glpk];

if BUILD_DSDP:
- dsdp = Extension('dsdp', libraries = ['dsdp', 'blas', 'lapack'],
+ dsdp = Extension('dsdp', libraries = ['dsdp', @GENTOO_LAPACK],
include_dirs = [ DSDP_INC_DIR ],
library_dirs = [ DSDP_LIB_DIR, ATLAS_LIB_DIR ],
sources = ['C/dsdp.c'] )
@@ -85,17 +87,17 @@
else:
MACROS = []

-base = Extension('base', libraries = ['m','lapack','blas'],
+base = Extension('base', libraries = ['m', @GENTOO_LAPACK],
library_dirs = [ ATLAS_LIB_DIR ],
define_macros = MACROS,
sources = ['C/base.c','C/dense.c','C/sparse.c'])

-blas = Extension('blas', libraries = ['blas'],
+blas = Extension('blas', libraries = [@GENTOO_BLAS],
library_dirs = [ ATLAS_LIB_DIR ],
define_macros = MACROS,
sources = ['C/blas.c'] )

-lapack = Extension('lapack', libraries = ['lapack','blas'],
+lapack = Extension('lapack', libraries = [@GENTOO_LAPACK],
library_dirs = [ ATLAS_LIB_DIR ],
define_macros = MACROS,
sources = ['C/lapack.c'] )
@@ -106,7 +108,7 @@
'C/SuiteSparse/UFconfig' ],
library_dirs = [ ATLAS_LIB_DIR ],
define_macros = MACROS,
- libraries = [ 'blas', 'lapack'],
+ libraries = [@GENTOO_LAPACK],
sources = [ 'C/umfpack.c',
'C/SuiteSparse/UMFPACK/Source/umfpack_global.c',
'C/SuiteSparse/UMFPACK/Source/umfpack_tictoc.c' ] +
@@ -118,7 +120,7 @@

cholmod = Extension('cholmod',
library_dirs = [ ATLAS_LIB_DIR ],
- libraries = ['lapack', 'blas'],
+ libraries = [@GENTOO_LAPACK],
include_dirs = [ 'C/SuiteSparse/CHOLMOD/Include',
'C/SuiteSparse/COLAMD', 'C/SuiteSparse/AMD/Include',
'C/SuiteSparse/UFconfig', 'C/SuiteSparse/COLAMD/Include' ],
@@ -139,7 +141,7 @@
define_macros = MACROS,
sources = [ 'C/amd.c' ] + glob('C/SuiteSparse/AMD/Source/*.c') )

-misc_solvers = Extension('misc_solvers', libraries = ['lapack', 'blas'],
+misc_solvers = Extension('misc_solvers', libraries = [@GENTOO_LAPACK],
library_dirs = [ ATLAS_LIB_DIR ],
define_macros = MACROS,
sources = ['C/misc_solvers.c'] )
12 changes: 12 additions & 0 deletions dev-python/cvxopt/metadata.xml
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<herd>sci</herd>
<longdescription lang="en">
CVXOPT is a free software package for convex optimization based on the Python programming language. It can be used with the interactive Python interpreter, on the command line by executing Python scripts, or integrated in other software via Python extension modules. Its main purpose is to make the development of software for convex optimization applications straightforward by building on Python's extensive standard library and on the strengths of Python as a high-level programming language.
</longdescription>
<use>
<flag name='glpk'>Use GNU Linear Programming Kit</flag>
</use>
</pkgmetadata>

0 comments on commit 60b7df0

Please sign in to comment.