dev-python/cvxopt: Version Bump

Gentoo-Bug: https://bugs.gentoo.org/show_bug.cgi?id=521210

Package-Manager: portage-2.2.26
Signed-off-by: Justin Lecher <jlec@gentoo.org>
This commit is contained in:
Justin Lecher
2015-12-14 10:11:32 +01:00
parent 68e0aa7f7b
commit 10671eba99
3 changed files with 244 additions and 0 deletions

View File

@@ -1 +1,2 @@
DIST cvxopt-1.1.6.tar.gz 3352996 SHA256 7b4ccf3ed896dde6624623431c0b1f5e32d874384329ed716f51babcbf416227 SHA512 b9f5fd7870412423b60068d205efb99d3630012509cb659fb67a10d6175906768846d7c906cf2fcac4be29afd558619b71e2dca730041329195a2365dd1d722c WHIRLPOOL d43cf090ee0396a77851fb71e6e34c980152bccdd5fdb3ecc53d0a464a505ac87a1e7198d313ec669443970bcf8a2d616f03c2f861b7df2f620bd583a97ea140
DIST cvxopt-1.1.8.tar.gz 5354013 SHA256 c96f8d01ae31a5bdec36a65b0587f50cfbf8139335adb70442350a8042da2025 SHA512 fdf047f203275e687c51b88575639ab0383207f8748969939ecf2939f9a2acc9f5d0e97c68377466fce81eb979b5eb058834f75134cc56df5dbb01805cb98c93 WHIRLPOOL 65c8a246e03a7136c2bce3c7ef831f9f82c4cc84b7a1e5db6a2643127ea9164c35782fb1013c0eaf7ac190d036887a131c705fa56b78bda179792eca9d016d8b

View File

@@ -0,0 +1,107 @@
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
EAPI=5
PYTHON_COMPAT=( python2_7 python3_{3,4,5} )
inherit distutils-r1 eutils toolchain-funcs
DESCRIPTION="Python package for convex optimization"
HOMEPAGE="http://cvxopt.org/"
SRC_URI="https://github.com/${PN}/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
LICENSE="GPL-3"
SLOT="0"
KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
IUSE="doc +dsdp examples fftw +glpk gsl"
RDEPEND="
virtual/blas
virtual/cblas
virtual/lapack
sci-libs/amd:0=
sci-libs/cholmod:0=
sci-libs/colamd:0=
sci-libs/suitesparseconfig:0=
sci-libs/umfpack:0=
dsdp? ( sci-libs/dsdp:0= )
fftw? ( sci-libs/fftw:3.0= )
glpk? ( sci-mathematics/glpk:0= )
gsl? ( sci-libs/gsl:0= )"
DEPEND="${RDEPEND}
virtual/pkgconfig
doc? ( dev-python/sphinx )"
python_prepare_all(){
epatch "${FILESDIR}"/${P}-setup.patch
has_version ">=sci-mathematics/glpk-4.49" && \
epatch "${FILESDIR}"/${PN}-1.1.6-glpk449.patch
rm -r src/C/SuiteSparse*/ || die
pkg_lib() {
local pkg=$(echo $1 | tr '[:lower:]' '[:upper:]')
local libs="$($(tc-getPKG_CONFIG) --libs-only-l $1 | \
sed -e 's:[ ]-l*\(pthread\|m\)\([ ]\|$\)::g' -e 's:[ ]*$::' | \
tr ' ' '\n' | sort -u | sed -e "s:^-l\(.*\):'\1':g" | \
tr '\n' ',' | sed -e 's:,$::')"
local libdir="$($(tc-getPKG_CONFIG) --libs-only-L $1 | \
sed -e 's:[ ]*$::' | \
tr ' ' '\n' | sort -u | sed -e "s:^-L\(.*\):'\1':g" | \
tr '\n' ',' | sed -e 's:,$::')"
local incdir="$($(tc-getPKG_CONFIG) --cflags-only-I $1 | \
sed -e 's:[ ]*$::' | \
tr ' ' '\n' | sort -u | sed -e "s:^-L\(.*\):'\1':g" | \
tr '\n' ',' | sed -e 's:,$::')"
sed -i \
-e "/${pkg}_LIB[ ]*=/s:\(.*[ ]*=[ ]*\[\).*${1}.*:\1${libs}\]:" \
-e "s:\(${pkg}_INC_DIR[ ]*=\).*$:\1 ${incdir}:" \
-e "s:\[ BLAS_LIB_DIR \]:\[ ${libdir} \]:g" \
setup.py || die
}
use_cvx() {
local flag=$1
if use ${flag} ; then
# Switch to ^^ when we switch to EAPI=6.
#local uflag=${flag^^}
local uflag=$(tr '[:lower:]' '[:upper:]' <<<"${flag}")
sed -i \
-e "s/\(BUILD_${uflag} =\) 0/\1 1/" \
setup.py || die
fi
}
pkg_lib blas
pkg_lib lapack
use_cvx gsl
use_cvx fftw
use_cvx glpk
use_cvx dsdp
sed \
-e '/SUITESPARSE_EXT_LIB/s:0:1:g' \
-i setup.py || die
distutils-r1_python_prepare_all
}
python_compile_all() {
use doc && export VARTEXFONTS="${T}/fonts" && emake -C doc -B html
}
python_test() {
cd examples/doc/chap8
"${EPYTHON}" lp.py || die
}
python_install_all() {
use doc && HTML_DOCS=( doc/build/html/. )
insinto /usr/share/doc/${PF}
use examples && EXAMPLES=( examples/. )
distutils-r1_python_install_all
}

View File

@@ -0,0 +1,136 @@
setup.py | 45 +++++++++++++++++++--------------------------
1 file changed, 19 insertions(+), 26 deletions(-)
diff --git a/setup.py b/setup.py
index 031ad53..e5c56af 100644
--- a/setup.py
+++ b/setup.py
@@ -6,7 +6,7 @@ from glob import glob
import os
# Modifiy this if BLAS and LAPACK libraries are not in /usr/lib.
-BLAS_LIB_DIR = '/usr/lib'
+BLAS_LIB_DIR = ''
# Default names of BLAS and LAPACK libraries
BLAS_LIB = ['blas']
@@ -22,37 +22,37 @@ BLAS_NOUNDERSCORES = False
BUILD_GSL = 0
# Directory containing libgsl (used only when BUILD_GSL = 1).
-GSL_LIB_DIR = '/usr/lib'
+GSL_LIB_DIR = ''
# Directory containing the GSL header files (used only when BUILD_GSL = 1).
-GSL_INC_DIR = '/usr/include/gsl'
+GSL_INC_DIR = ''
# Set to 1 if you are installing the fftw module.
BUILD_FFTW = 0
# Directory containing libfftw3 (used only when BUILD_FFTW = 1).
-FFTW_LIB_DIR = '/usr/lib'
+FFTW_LIB_DIR = ''
# Directory containing fftw.h (used only when BUILD_FFTW = 1).
-FFTW_INC_DIR = '/usr/include'
+FFTW_INC_DIR = ''
# Set to 1 if you are installing the glpk module.
BUILD_GLPK = 0
# Directory containing libglpk (used only when BUILD_GLPK = 1).
-GLPK_LIB_DIR = '/usr/lib'
+GLPK_LIB_DIR = ''
# Directory containing glpk.h (used only when BUILD_GLPK = 1).
-GLPK_INC_DIR = '/usr/include'
+GLPK_INC_DIR = ''
# Set to 1 if you are installing the DSDP module.
BUILD_DSDP = 0
# Directory containing libdsdp (used only when BUILD_DSDP = 1).
-DSDP_LIB_DIR = '/usr/lib'
+DSDP_LIB_DIR = ''
# Directory containing dsdp5.h (used only when BUILD_DSDP = 1).
-DSDP_INC_DIR = '/usr/include/dsdp'
+DSDP_INC_DIR = ''
# Set to 1 to use external SuiteSparse library
SUITESPARSE_EXT_LIB = 0
@@ -98,39 +98,32 @@ if BLAS_NOUNDERSCORES: MACROS.append(('BLAS_NO_UNDERSCORE',''))
# optional modules
if BUILD_GSL:
- gsl = Extension('gsl', libraries = ['m', 'gsl'] + BLAS_LIB,
- include_dirs = [ GSL_INC_DIR ],
- library_dirs = [ GSL_LIB_DIR, BLAS_LIB_DIR ],
- extra_link_args = BLAS_EXTRA_LINK_ARGS,
+ gsl = Extension('gsl', libraries = ['gsl'],
+ library_dirs = [ GSL_LIB_DIR ],
sources = ['src/C/gsl.c'] )
extmods += [gsl];
if BUILD_FFTW:
- fftw = Extension('fftw', libraries = ['fftw3'] + BLAS_LIB,
- include_dirs = [ FFTW_INC_DIR ],
- library_dirs = [ FFTW_LIB_DIR, BLAS_LIB_DIR ],
- extra_link_args = BLAS_EXTRA_LINK_ARGS,
+ fftw = Extension('fftw', libraries = ['fftw3'],
+ library_dirs = [ FFTW_LIB_DIR ],
sources = ['src/C/fftw.c'] )
extmods += [fftw];
if BUILD_GLPK:
glpk = Extension('glpk', libraries = ['glpk'],
- include_dirs = [ GLPK_INC_DIR ],
library_dirs = [ GLPK_LIB_DIR ],
sources = ['src/C/glpk.c'] )
extmods += [glpk];
if BUILD_DSDP:
- dsdp = Extension('dsdp', libraries = ['dsdp'] + LAPACK_LIB + BLAS_LIB,
- include_dirs = [ DSDP_INC_DIR ],
- library_dirs = [ DSDP_LIB_DIR, BLAS_LIB_DIR ],
- extra_link_args = BLAS_EXTRA_LINK_ARGS,
+ dsdp = Extension('dsdp', libraries = ['dsdp'] + LAPACK_LIB,
+ library_dirs = [ DSDP_LIB_DIR ],
sources = ['src/C/dsdp.c'] )
extmods += [dsdp];
# Required modules
-base = Extension('base', libraries = ['m'] + LAPACK_LIB + BLAS_LIB,
+base = Extension('base', libraries = ['m'] + LAPACK_LIB,
library_dirs = [ BLAS_LIB_DIR ],
define_macros = MACROS,
extra_link_args = BLAS_EXTRA_LINK_ARGS,
@@ -142,7 +135,7 @@ blas = Extension('blas', libraries = BLAS_LIB,
extra_link_args = BLAS_EXTRA_LINK_ARGS,
sources = ['src/C/blas.c'] )
-lapack = Extension('lapack', libraries = LAPACK_LIB + BLAS_LIB,
+lapack = Extension('lapack', libraries = LAPACK_LIB,
library_dirs = [ BLAS_LIB_DIR ],
define_macros = MACROS,
extra_link_args = BLAS_EXTRA_LINK_ARGS,
@@ -177,7 +170,7 @@ if sys.maxsize > 2**31: MACROS += [('DLONG',None)]
if SUITESPARSE_EXT_LIB:
cholmod = Extension('cholmod',
- libraries = ['amd','colamd','suitesparseconfig','cholmod'],
+ libraries = ['amd','colamd','suitesparseconfig','cholmod'] + LAPACK_LIB,
include_dirs = [SUITESPARSE_INC_DIR],
library_dirs = [SUITESPARSE_LIB_DIR],
sources = [ 'src/C/cholmod.c' ])
@@ -218,7 +211,7 @@ else:
glob('src/C/SuiteSparse/AMD/Source/*.c') )
misc_solvers = Extension('misc_solvers',
- libraries = LAPACK_LIB + BLAS_LIB,
+ libraries = ['m'] + LAPACK_LIB,
library_dirs = [ BLAS_LIB_DIR ],
define_macros = MACROS,
extra_link_args = BLAS_EXTRA_LINK_ARGS,