Gentoo Archives: gentoo-commits

From: Justin Lecher <jlec@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/cvxopt/files/, dev-python/cvxopt/
Date: Mon, 14 Dec 2015 09:11:50
Message-Id: 1450084297.10671eba99fe5fac143fcd8f452a1eb731be54f7.jlec@gentoo
1 commit: 10671eba99fe5fac143fcd8f452a1eb731be54f7
2 Author: Justin Lecher <jlec <AT> gentoo <DOT> org>
3 AuthorDate: Mon Dec 14 09:11:32 2015 +0000
4 Commit: Justin Lecher <jlec <AT> gentoo <DOT> org>
5 CommitDate: Mon Dec 14 09:11:37 2015 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=10671eba
7
8 dev-python/cvxopt: Version Bump
9
10 Gentoo-Bug: https://bugs.gentoo.org/show_bug.cgi?id=521210
11
12 Package-Manager: portage-2.2.26
13 Signed-off-by: Justin Lecher <jlec <AT> gentoo.org>
14
15 dev-python/cvxopt/Manifest | 1 +
16 dev-python/cvxopt/cvxopt-1.1.8.ebuild | 107 ++++++++++++++++++
17 dev-python/cvxopt/files/cvxopt-1.1.8-setup.patch | 136 +++++++++++++++++++++++
18 3 files changed, 244 insertions(+)
19
20 diff --git a/dev-python/cvxopt/Manifest b/dev-python/cvxopt/Manifest
21 index 4f7f06c..b57d8cf 100644
22 --- a/dev-python/cvxopt/Manifest
23 +++ b/dev-python/cvxopt/Manifest
24 @@ -1 +1,2 @@
25 DIST cvxopt-1.1.6.tar.gz 3352996 SHA256 7b4ccf3ed896dde6624623431c0b1f5e32d874384329ed716f51babcbf416227 SHA512 b9f5fd7870412423b60068d205efb99d3630012509cb659fb67a10d6175906768846d7c906cf2fcac4be29afd558619b71e2dca730041329195a2365dd1d722c WHIRLPOOL d43cf090ee0396a77851fb71e6e34c980152bccdd5fdb3ecc53d0a464a505ac87a1e7198d313ec669443970bcf8a2d616f03c2f861b7df2f620bd583a97ea140
26 +DIST cvxopt-1.1.8.tar.gz 5354013 SHA256 c96f8d01ae31a5bdec36a65b0587f50cfbf8139335adb70442350a8042da2025 SHA512 fdf047f203275e687c51b88575639ab0383207f8748969939ecf2939f9a2acc9f5d0e97c68377466fce81eb979b5eb058834f75134cc56df5dbb01805cb98c93 WHIRLPOOL 65c8a246e03a7136c2bce3c7ef831f9f82c4cc84b7a1e5db6a2643127ea9164c35782fb1013c0eaf7ac190d036887a131c705fa56b78bda179792eca9d016d8b
27
28 diff --git a/dev-python/cvxopt/cvxopt-1.1.8.ebuild b/dev-python/cvxopt/cvxopt-1.1.8.ebuild
29 new file mode 100644
30 index 0000000..9861448
31 --- /dev/null
32 +++ b/dev-python/cvxopt/cvxopt-1.1.8.ebuild
33 @@ -0,0 +1,107 @@
34 +# Copyright 1999-2015 Gentoo Foundation
35 +# Distributed under the terms of the GNU General Public License v2
36 +# $Id$
37 +
38 +EAPI=5
39 +
40 +PYTHON_COMPAT=( python2_7 python3_{3,4,5} )
41 +
42 +inherit distutils-r1 eutils toolchain-funcs
43 +
44 +DESCRIPTION="Python package for convex optimization"
45 +HOMEPAGE="http://cvxopt.org/"
46 +SRC_URI="https://github.com/${PN}/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
47 +
48 +LICENSE="GPL-3"
49 +SLOT="0"
50 +KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
51 +IUSE="doc +dsdp examples fftw +glpk gsl"
52 +
53 +RDEPEND="
54 + virtual/blas
55 + virtual/cblas
56 + virtual/lapack
57 + sci-libs/amd:0=
58 + sci-libs/cholmod:0=
59 + sci-libs/colamd:0=
60 + sci-libs/suitesparseconfig:0=
61 + sci-libs/umfpack:0=
62 + dsdp? ( sci-libs/dsdp:0= )
63 + fftw? ( sci-libs/fftw:3.0= )
64 + glpk? ( sci-mathematics/glpk:0= )
65 + gsl? ( sci-libs/gsl:0= )"
66 +DEPEND="${RDEPEND}
67 + virtual/pkgconfig
68 + doc? ( dev-python/sphinx )"
69 +
70 +python_prepare_all(){
71 + epatch "${FILESDIR}"/${P}-setup.patch
72 +
73 + has_version ">=sci-mathematics/glpk-4.49" && \
74 + epatch "${FILESDIR}"/${PN}-1.1.6-glpk449.patch
75 +
76 + rm -r src/C/SuiteSparse*/ || die
77 +
78 + pkg_lib() {
79 + local pkg=$(echo $1 | tr '[:lower:]' '[:upper:]')
80 + local libs="$($(tc-getPKG_CONFIG) --libs-only-l $1 | \
81 + sed -e 's:[ ]-l*\(pthread\|m\)\([ ]\|$\)::g' -e 's:[ ]*$::' | \
82 + tr ' ' '\n' | sort -u | sed -e "s:^-l\(.*\):'\1':g" | \
83 + tr '\n' ',' | sed -e 's:,$::')"
84 + local libdir="$($(tc-getPKG_CONFIG) --libs-only-L $1 | \
85 + sed -e 's:[ ]*$::' | \
86 + tr ' ' '\n' | sort -u | sed -e "s:^-L\(.*\):'\1':g" | \
87 + tr '\n' ',' | sed -e 's:,$::')"
88 + local incdir="$($(tc-getPKG_CONFIG) --cflags-only-I $1 | \
89 + sed -e 's:[ ]*$::' | \
90 + tr ' ' '\n' | sort -u | sed -e "s:^-L\(.*\):'\1':g" | \
91 + tr '\n' ',' | sed -e 's:,$::')"
92 + sed -i \
93 + -e "/${pkg}_LIB[ ]*=/s:\(.*[ ]*=[ ]*\[\).*${1}.*:\1${libs}\]:" \
94 + -e "s:\(${pkg}_INC_DIR[ ]*=\).*$:\1 ${incdir}:" \
95 + -e "s:\[ BLAS_LIB_DIR \]:\[ ${libdir} \]:g" \
96 + setup.py || die
97 + }
98 +
99 + use_cvx() {
100 + local flag=$1
101 + if use ${flag} ; then
102 + # Switch to ^^ when we switch to EAPI=6.
103 + #local uflag=${flag^^}
104 + local uflag=$(tr '[:lower:]' '[:upper:]' <<<"${flag}")
105 + sed -i \
106 + -e "s/\(BUILD_${uflag} =\) 0/\1 1/" \
107 + setup.py || die
108 + fi
109 + }
110 +
111 + pkg_lib blas
112 + pkg_lib lapack
113 +
114 + use_cvx gsl
115 + use_cvx fftw
116 + use_cvx glpk
117 + use_cvx dsdp
118 +
119 + sed \
120 + -e '/SUITESPARSE_EXT_LIB/s:0:1:g' \
121 + -i setup.py || die
122 +
123 + distutils-r1_python_prepare_all
124 +}
125 +
126 +python_compile_all() {
127 + use doc && export VARTEXFONTS="${T}/fonts" && emake -C doc -B html
128 +}
129 +
130 +python_test() {
131 + cd examples/doc/chap8
132 + "${EPYTHON}" lp.py || die
133 +}
134 +
135 +python_install_all() {
136 + use doc && HTML_DOCS=( doc/build/html/. )
137 + insinto /usr/share/doc/${PF}
138 + use examples && EXAMPLES=( examples/. )
139 + distutils-r1_python_install_all
140 +}
141
142 diff --git a/dev-python/cvxopt/files/cvxopt-1.1.8-setup.patch b/dev-python/cvxopt/files/cvxopt-1.1.8-setup.patch
143 new file mode 100644
144 index 0000000..1b53f75
145 --- /dev/null
146 +++ b/dev-python/cvxopt/files/cvxopt-1.1.8-setup.patch
147 @@ -0,0 +1,136 @@
148 + setup.py | 45 +++++++++++++++++++--------------------------
149 + 1 file changed, 19 insertions(+), 26 deletions(-)
150 +
151 +diff --git a/setup.py b/setup.py
152 +index 031ad53..e5c56af 100644
153 +--- a/setup.py
154 ++++ b/setup.py
155 +@@ -6,7 +6,7 @@ from glob import glob
156 + import os
157 +
158 + # Modifiy this if BLAS and LAPACK libraries are not in /usr/lib.
159 +-BLAS_LIB_DIR = '/usr/lib'
160 ++BLAS_LIB_DIR = ''
161 +
162 + # Default names of BLAS and LAPACK libraries
163 + BLAS_LIB = ['blas']
164 +@@ -22,37 +22,37 @@ BLAS_NOUNDERSCORES = False
165 + BUILD_GSL = 0
166 +
167 + # Directory containing libgsl (used only when BUILD_GSL = 1).
168 +-GSL_LIB_DIR = '/usr/lib'
169 ++GSL_LIB_DIR = ''
170 +
171 + # Directory containing the GSL header files (used only when BUILD_GSL = 1).
172 +-GSL_INC_DIR = '/usr/include/gsl'
173 ++GSL_INC_DIR = ''
174 +
175 + # Set to 1 if you are installing the fftw module.
176 + BUILD_FFTW = 0
177 +
178 + # Directory containing libfftw3 (used only when BUILD_FFTW = 1).
179 +-FFTW_LIB_DIR = '/usr/lib'
180 ++FFTW_LIB_DIR = ''
181 +
182 + # Directory containing fftw.h (used only when BUILD_FFTW = 1).
183 +-FFTW_INC_DIR = '/usr/include'
184 ++FFTW_INC_DIR = ''
185 +
186 + # Set to 1 if you are installing the glpk module.
187 + BUILD_GLPK = 0
188 +
189 + # Directory containing libglpk (used only when BUILD_GLPK = 1).
190 +-GLPK_LIB_DIR = '/usr/lib'
191 ++GLPK_LIB_DIR = ''
192 +
193 + # Directory containing glpk.h (used only when BUILD_GLPK = 1).
194 +-GLPK_INC_DIR = '/usr/include'
195 ++GLPK_INC_DIR = ''
196 +
197 + # Set to 1 if you are installing the DSDP module.
198 + BUILD_DSDP = 0
199 +
200 + # Directory containing libdsdp (used only when BUILD_DSDP = 1).
201 +-DSDP_LIB_DIR = '/usr/lib'
202 ++DSDP_LIB_DIR = ''
203 +
204 + # Directory containing dsdp5.h (used only when BUILD_DSDP = 1).
205 +-DSDP_INC_DIR = '/usr/include/dsdp'
206 ++DSDP_INC_DIR = ''
207 +
208 + # Set to 1 to use external SuiteSparse library
209 + SUITESPARSE_EXT_LIB = 0
210 +@@ -98,39 +98,32 @@ if BLAS_NOUNDERSCORES: MACROS.append(('BLAS_NO_UNDERSCORE',''))
211 + # optional modules
212 +
213 + if BUILD_GSL:
214 +- gsl = Extension('gsl', libraries = ['m', 'gsl'] + BLAS_LIB,
215 +- include_dirs = [ GSL_INC_DIR ],
216 +- library_dirs = [ GSL_LIB_DIR, BLAS_LIB_DIR ],
217 +- extra_link_args = BLAS_EXTRA_LINK_ARGS,
218 ++ gsl = Extension('gsl', libraries = ['gsl'],
219 ++ library_dirs = [ GSL_LIB_DIR ],
220 + sources = ['src/C/gsl.c'] )
221 + extmods += [gsl];
222 +
223 + if BUILD_FFTW:
224 +- fftw = Extension('fftw', libraries = ['fftw3'] + BLAS_LIB,
225 +- include_dirs = [ FFTW_INC_DIR ],
226 +- library_dirs = [ FFTW_LIB_DIR, BLAS_LIB_DIR ],
227 +- extra_link_args = BLAS_EXTRA_LINK_ARGS,
228 ++ fftw = Extension('fftw', libraries = ['fftw3'],
229 ++ library_dirs = [ FFTW_LIB_DIR ],
230 + sources = ['src/C/fftw.c'] )
231 + extmods += [fftw];
232 +
233 + if BUILD_GLPK:
234 + glpk = Extension('glpk', libraries = ['glpk'],
235 +- include_dirs = [ GLPK_INC_DIR ],
236 + library_dirs = [ GLPK_LIB_DIR ],
237 + sources = ['src/C/glpk.c'] )
238 + extmods += [glpk];
239 +
240 + if BUILD_DSDP:
241 +- dsdp = Extension('dsdp', libraries = ['dsdp'] + LAPACK_LIB + BLAS_LIB,
242 +- include_dirs = [ DSDP_INC_DIR ],
243 +- library_dirs = [ DSDP_LIB_DIR, BLAS_LIB_DIR ],
244 +- extra_link_args = BLAS_EXTRA_LINK_ARGS,
245 ++ dsdp = Extension('dsdp', libraries = ['dsdp'] + LAPACK_LIB,
246 ++ library_dirs = [ DSDP_LIB_DIR ],
247 + sources = ['src/C/dsdp.c'] )
248 + extmods += [dsdp];
249 +
250 + # Required modules
251 +
252 +-base = Extension('base', libraries = ['m'] + LAPACK_LIB + BLAS_LIB,
253 ++base = Extension('base', libraries = ['m'] + LAPACK_LIB,
254 + library_dirs = [ BLAS_LIB_DIR ],
255 + define_macros = MACROS,
256 + extra_link_args = BLAS_EXTRA_LINK_ARGS,
257 +@@ -142,7 +135,7 @@ blas = Extension('blas', libraries = BLAS_LIB,
258 + extra_link_args = BLAS_EXTRA_LINK_ARGS,
259 + sources = ['src/C/blas.c'] )
260 +
261 +-lapack = Extension('lapack', libraries = LAPACK_LIB + BLAS_LIB,
262 ++lapack = Extension('lapack', libraries = LAPACK_LIB,
263 + library_dirs = [ BLAS_LIB_DIR ],
264 + define_macros = MACROS,
265 + extra_link_args = BLAS_EXTRA_LINK_ARGS,
266 +@@ -177,7 +170,7 @@ if sys.maxsize > 2**31: MACROS += [('DLONG',None)]
267 +
268 + if SUITESPARSE_EXT_LIB:
269 + cholmod = Extension('cholmod',
270 +- libraries = ['amd','colamd','suitesparseconfig','cholmod'],
271 ++ libraries = ['amd','colamd','suitesparseconfig','cholmod'] + LAPACK_LIB,
272 + include_dirs = [SUITESPARSE_INC_DIR],
273 + library_dirs = [SUITESPARSE_LIB_DIR],
274 + sources = [ 'src/C/cholmod.c' ])
275 +@@ -218,7 +211,7 @@ else:
276 + glob('src/C/SuiteSparse/AMD/Source/*.c') )
277 +
278 + misc_solvers = Extension('misc_solvers',
279 +- libraries = LAPACK_LIB + BLAS_LIB,
280 ++ libraries = ['m'] + LAPACK_LIB,
281 + library_dirs = [ BLAS_LIB_DIR ],
282 + define_macros = MACROS,
283 + extra_link_args = BLAS_EXTRA_LINK_ARGS,