Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/cvxopt/
Date: Mon, 20 Sep 2021 21:19:37
Message-Id: 1632172452.ca879cd47e63cea701bf18ca40bc0c22ad961b23.mgorny@gentoo
1 commit: ca879cd47e63cea701bf18ca40bc0c22ad961b23
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Mon Sep 20 21:14:12 2021 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Mon Sep 20 21:14:12 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ca879cd4
7
8 dev-python/cvxopt: Bump to 1.2.7
9
10 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
11
12 dev-python/cvxopt/Manifest | 1 +
13 dev-python/cvxopt/cvxopt-1.2.7.ebuild | 164 ++++++++++++++++++++++++++++++++++
14 2 files changed, 165 insertions(+)
15
16 diff --git a/dev-python/cvxopt/Manifest b/dev-python/cvxopt/Manifest
17 index 9c78ac8c374..d3ca327d12f 100644
18 --- a/dev-python/cvxopt/Manifest
19 +++ b/dev-python/cvxopt/Manifest
20 @@ -1,2 +1,3 @@
21 DIST cvxopt-1.2.5.tar.gz 6742389 BLAKE2B 32e872d13624250610e7eecf2a5755b7b2adbf98dd9b7d1b0d6e236d62677fcdef7c08a2365d7b511f755a38b34a29ff78b280fb7e92ec6256a71c63e022e003 SHA512 d21d9977941140e76d1619a1239fab5d93a3467c4cbeacca2003168c96e1bbec9698563dba07107f6e0a84a0af92124d5c868af599bd049b64f47a3cd3753afc
22 DIST cvxopt-1.2.6.tar.gz 4114036 BLAKE2B d7516c06c00907a42bbcfa99611febd87fa8480ddb812b7abc0a3b6c5a642c87756fa36d6434b4933797a03d4d94bb2838341da6f00143b9f058710e8f625447 SHA512 7b1c092d970e726b262bb5b07d9c8ca6a7081902707a812a6b196e7cb76523bd67b346024b96087622d39d564f4f095485d4f875c88dcc8921ec2185734b0969
23 +DIST cvxopt-1.2.7.tar.gz 4115486 BLAKE2B 6db890b271d99709f433269190461291702a95874dd13b218d1529e02da80eee43385397c5dcc31099666441b51207557bc0a91c403c75aa11f04334358eefd4 SHA512 09b92e33eb69dccd4ce1ff8f63eb81973cce15804bbdede91c1f81d146d9a643d8a29315f324774f02fa0f0fed2edfd698ba9a1a7345aeae1f5a25d24b776274
24
25 diff --git a/dev-python/cvxopt/cvxopt-1.2.7.ebuild b/dev-python/cvxopt/cvxopt-1.2.7.ebuild
26 new file mode 100644
27 index 00000000000..2f9c0c1b5b4
28 --- /dev/null
29 +++ b/dev-python/cvxopt/cvxopt-1.2.7.ebuild
30 @@ -0,0 +1,164 @@
31 +# Copyright 1999-2021 Gentoo Authors
32 +# Distributed under the terms of the GNU General Public License v2
33 +
34 +EAPI=8
35 +
36 +PYTHON_COMPAT=( python3_{8..10} )
37 +
38 +inherit distutils-r1 toolchain-funcs
39 +
40 +DESCRIPTION="Python package for convex optimization"
41 +HOMEPAGE="https://cvxopt.org/ https://github.com/cvxopt/cvxopt"
42 +SRC_URI="https://github.com/${PN}/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
43 +
44 +LICENSE="GPL-3"
45 +SLOT="0"
46 +KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
47 +IUSE="+dsdp examples fftw +glpk gsl"
48 +RESTRICT="!test? ( test )"
49 +
50 +DEPEND="
51 + virtual/blas
52 + virtual/lapack
53 + sci-libs/amd:0=
54 + sci-libs/cholmod:0=
55 + sci-libs/colamd:0=
56 + sci-libs/suitesparseconfig:0=
57 + sci-libs/umfpack:0=
58 + dsdp? ( sci-libs/dsdp:0= )
59 + fftw? ( sci-libs/fftw:3.0= )
60 + glpk? ( >=sci-mathematics/glpk-4.49:0= )
61 + gsl? ( sci-libs/gsl:0= )"
62 +RDEPEND="${DEPEND}"
63 +BDEPEND="virtual/pkgconfig"
64 +
65 +distutils_enable_sphinx doc/source --no-autodoc
66 +distutils_enable_tests pytest
67 +
68 +# The BLAS_LIB and LAPACK_LIB variables (among others) in cvxopt's
69 +# setup.py are passed in as colon-delimited strings. So, for example,
70 +# if your blas "l" flags are "-lblas -lcblas", then cvxopt wants
71 +# "blas;cblas" for BLAS_LIB.
72 +#
73 +# The following function takes a flag type ("l", "L", or "I") as its
74 +# first argument and a list of packages as its remaining arguments. It
75 +# outputs a list of libraries, library paths, or include paths,
76 +# respectively, for the given packages, retrieved using pkg-config and
77 +# deduplicated, in the appropriate format.
78 +#
79 +cvxopt_output() {
80 + local FLAGNAME="${1}"
81 + shift
82 + local PACKAGES="${@}"
83 +
84 + local PKGCONFIG_MODE
85 + case "${FLAGNAME}" in
86 + l) PKGCONFIG_MODE="--libs-only-l";;
87 + L) PKGCONFIG_MODE="--libs-only-L";;
88 + I) PKGCONFIG_MODE="--cflags-only-I";;
89 + *) echo "invalid flag name: ${FLAGNAME}"; exit 1;;
90 + esac
91 +
92 + local CVXOPT_OUTPUT=""
93 + local PKGCONFIG_ITEM
94 + for PKGCONFIG_ITEM in $($(tc-getPKG_CONFIG) ${PKGCONFIG_MODE} ${PACKAGES})
95 + do
96 + # First strip off the leading "-l", "-L", or "-I", and replace
97 + # it with a semicolon...
98 + PKGCONFIG_ITEM=";${PKGCONFIG_ITEM#-${FLAGNAME}}"
99 +
100 + # Now check to see if this element is already present in the
101 + # list, and skip it if it is. This eliminates multiple entries
102 + # from winding up in the list when multiple package arguments are
103 + # passed to this function.
104 + if [[ "${CVXOPT_OUTPUT}" != "${CVXOPT_OUTPUT%${PKGCONFIG_ITEM}}" ]]
105 + then
106 + # It was already the last entry in the list, so skip it.
107 + continue
108 + elif [[ "${CVXOPT_OUTPUT}" != "${CVXOPT_OUTPUT%${PKGCONFIG_ITEM};*}" ]]
109 + then
110 + # It was an earlier entry in the list. These two cases are
111 + # separate to ensure that we can e.g. find ";m" at the end
112 + # of the list, but that we don't find ";metis" in the process.
113 + continue
114 + fi
115 +
116 + # It isn't in the list yet, so append it.
117 + CVXOPT_OUTPUT+="${PKGCONFIG_ITEM}"
118 + done
119 +
120 + # Strip the leading ";" from ";foo;bar" before output.
121 + echo "${CVXOPT_OUTPUT#;}"
122 +}
123 +
124 +python_prepare_all() {
125 + # Mandatory dependencies.
126 + export CVXOPT_BLAS_LIB="$(cvxopt_output l blas)"
127 + export CVXOPT_BLAS_LIB_DIR="${EPREFIX}/usr/$(get_libdir);$(cvxopt_output L blas)"
128 + export CVXOPT_LAPACK_LIB="$(cvxopt_output l lapack)"
129 + export CVXOPT_SUITESPARSE_LIB_DIR="${EPREFIX}/usr/$(get_libdir);$(cvxopt_output L umfpack cholmod amd colamd suitesparseconfig)"
130 +
131 + # Most of these CVXOPT_* variables can be blank or have "empty"
132 + # entries and the resulting command-line with e.g. "-L -L/some/path"
133 + # won't hurt anything. The INC_DIR variables, however, cause
134 + # problems, because at least gcc doesn't like a bare "-I". We
135 + # pre-populate these variable with something safe so that setup.py
136 + # doesn't look in the wrong place if pkg-config doesn't return any
137 + # extra -I directories. This is
138 + #
139 + # https://github.com/cvxopt/cvxopt/issues/167
140 + #
141 + CVXOPT_SUITESPARSE_INC_DIR="${EPREFIX}/usr/include"
142 + local SUITESPARSE_LOCAL_INCS="$(cvxopt_output I umfpack cholmod amd colamd suitesparseconfig)"
143 + if [[ -n "${SUITESPARSE_LOCAL_INCS}" ]]; then
144 + CVXOPT_SUITESPARSE_INC_DIR+=";${SUITESPARSE_LOCAL_INCS}"
145 + fi
146 + export CVXOPT_SUITESPARSE_INC_DIR
147 +
148 + # optional dependencies
149 + if use dsdp; then
150 + # no pkg-config file at the moment
151 + export CVXOPT_BUILD_DSDP=1
152 + export CVXOPT_DSDP_LIB_DIR="${EPREFIX}/usr/$(get_libdir)"
153 + export CVXOPT_DSDP_INC_DIR="${EPREFIX}/usr/include"
154 + fi
155 +
156 + if use fftw; then
157 + export CVXOPT_BUILD_FFTW=1
158 + export CVXOPT_FFTW_LIB_DIR="${EPREFIX}/usr/$(get_libdir);$(cvxopt_output L fftw3)"
159 + CVXOPT_FFTW_INC_DIR="${EPREFIX}/usr/include"
160 + FFTW_LOCAL_INCS="$(cvxopt_output I fftw3)"
161 + if [[ -n "${FFTW_LOCAL_INCS}" ]]; then
162 + CVXOPT_FFTW_INC_DIR+=";${FFTW_LOCAL_INCS}"
163 + fi
164 + export CVXOPT_FFTW_INC_DIR
165 + fi
166 +
167 + if use glpk; then
168 + # no pkg-config file at the moment
169 + export CVXOPT_BUILD_GLPK=1
170 + export CVXOPT_GLPK_LIB_DIR="${EPREFIX}/usr/$(get_libdir)"
171 + export CVXOPT_GLPK_INC_DIR="${EPREFIX}/usr/include"
172 + fi
173 +
174 + if use gsl; then
175 + export CVXOPT_BUILD_GSL=1
176 + export CVXOPT_GSL_LIB_DIR="${EPREFIX}/usr/$(get_libdir);$(cvxopt_output L gsl)"
177 + CVXOPT_GSL_INC_DIR="${EPREFIX}/usr/include"
178 + GSL_LOCAL_INCS="$(cvxopt_output I gsl)"
179 + if [[ -n "${GSL_LOCAL_INCS}" ]]; then
180 + CVXOPT_GSL_INC_DIR+=";${GSL_LOCAL_INCS}"
181 + fi
182 + export CVXOPT_GSL_INC_DIR
183 + fi
184 +
185 + distutils-r1_python_prepare_all
186 +}
187 +
188 +python_install_all() {
189 + distutils-r1_python_install_all
190 + if use examples; then
191 + dodoc -r examples
192 + docompress -x "/usr/share/doc/${PF}/examples"
193 + fi
194 +}