diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2020-05-17 14:32:10 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2020-05-17 14:32:10 +0100 |
commit | 51c50bd4c895ebf56d81fecae8e45ec3b5fc3efa (patch) | |
tree | 753b6b08624c34d1ed8414bbe22c45409f7741b9 /dev-python/cvxopt | |
parent | be9d77d3ac6af8f4ead98d89706f356b65578c93 (diff) | |
parent | deba8115d2c2af26df42966b91ef04ff4dd79cde (diff) |
Merge branch 'edge' into next
Diffstat (limited to 'dev-python/cvxopt')
-rw-r--r-- | dev-python/cvxopt/Manifest | 1 | ||||
-rw-r--r-- | dev-python/cvxopt/cvxopt-1.2.5-r1.ebuild | 174 |
2 files changed, 175 insertions, 0 deletions
diff --git a/dev-python/cvxopt/Manifest b/dev-python/cvxopt/Manifest index 287aef723ba8..62f622f2841e 100644 --- a/dev-python/cvxopt/Manifest +++ b/dev-python/cvxopt/Manifest @@ -1,3 +1,4 @@ DIST cvxopt-1.2.5.tar.gz 6742389 BLAKE2B 32e872d13624250610e7eecf2a5755b7b2adbf98dd9b7d1b0d6e236d62677fcdef7c08a2365d7b511f755a38b34a29ff78b280fb7e92ec6256a71c63e022e003 SHA512 d21d9977941140e76d1619a1239fab5d93a3467c4cbeacca2003168c96e1bbec9698563dba07107f6e0a84a0af92124d5c868af599bd049b64f47a3cd3753afc +EBUILD cvxopt-1.2.5-r1.ebuild 5534 BLAKE2B c2a6da2d4ed13e71233cc759d27e33306577c0c52e6b439e02d790529ad22a95b5f06e685891c7c36306dd014809868d068151d6f957d5766b7c6a889889f07e SHA512 c83625f8a004cec9068815363b1e47b2ee93a5cd1d4cbb65b1737c143a65d2061ffe50bd7c86a71394bda45f807763a645e76bc2389f772e4b8c55f7e0809238 EBUILD cvxopt-1.2.5.ebuild 2963 BLAKE2B 449a65f303b77cb5c92e0819b49bfec7c828bcf46601a280dde0ec708c783fead5a05ee597a2579ef01660b41d51d75ab7bf34b0186e01a37042dcb98274c1eb SHA512 05433f0bffe2e55a9fb547f5a176886a10f4e8797dc292d1ad84bebf85153772df80c236f131fa3b38324760e5742c135d2e5ada4ddefcf5a53000bb4c93468d MISC metadata.xml 805 BLAKE2B cfeb4a97635e28a1fe93b26897950dfe13268aef349647c5ca7455597e679ab7e79d21daf1b54f4c8855624abb8286676aff2da381782dd3b42b0a587f9396b2 SHA512 52bdd0bdc12807d7a3d2d820af3167b0768225167377bdf42e5f7218d5154deab2bee8bbcfdd173301e4b1d87f268bfb4bf6c1f884113c2d1f3fbf7fa1dc2ab6 diff --git a/dev-python/cvxopt/cvxopt-1.2.5-r1.ebuild b/dev-python/cvxopt/cvxopt-1.2.5-r1.ebuild new file mode 100644 index 000000000000..c4670120832c --- /dev/null +++ b/dev-python/cvxopt/cvxopt-1.2.5-r1.ebuild @@ -0,0 +1,174 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +PYTHON_COMPAT=( python3_6 python3_7 python3_8 ) + +inherit distutils-r1 toolchain-funcs + +DESCRIPTION="Python package for convex optimization" +HOMEPAGE="http://cvxopt.org/ https://github.com/cvxopt/cvxopt" +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 test" +RESTRICT="!test? ( test )" + +DEPEND=" + virtual/blas + 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-4.49:0= ) + gsl? ( sci-libs/gsl:0= )" + +RDEPEND="${DEPEND}" + +BDEPEND="virtual/pkgconfig + doc? ( dev-python/sphinx ) + test? ( ${RDEPEND} dev-python/nose[${PYTHON_USEDEP}] )" + +# The BLAS_LIB and LAPACK_LIB variables (among others) in cvxopt's +# setup.py are passed in as colon-delimited strings. So, for example, +# if your blas "l" flags are "-lblas -lcblas", then cvxopt wants +# "blas;cblas" for BLAS_LIB. +# +# The following function takes a flag type ("l", "L", or "I") as its +# first argument and a list of packages as its remaining arguments. It +# outputs a list of libraries, library paths, or include paths, +# respectively, for the given packages, retrieved using pkg-config and +# deduplicated, in the appropriate format. +# +cvxopt_output() { + local FLAGNAME="${1}" + shift + local PACKAGES="${@}" + + local PKGCONFIG_MODE + case "${FLAGNAME}" in + l) PKGCONFIG_MODE="--libs-only-l";; + L) PKGCONFIG_MODE="--libs-only-L";; + I) PKGCONFIG_MODE="--cflags-only-I";; + *) echo "invalid flag name: ${FLAGNAME}"; exit 1;; + esac + + local CVXOPT_OUTPUT="" + local PKGCONFIG_ITEM + for PKGCONFIG_ITEM in $($(tc-getPKG_CONFIG) ${PKGCONFIG_MODE} ${PACKAGES}) + do + # First strip off the leading "-l", "-L", or "-I", and replace + # it with a semicolon... + PKGCONFIG_ITEM=";${PKGCONFIG_ITEM#-${FLAGNAME}}" + + # Now check to see if this element is already present in the + # list, and skip it if it is. This eliminates multiple entries + # from winding up in the list when multiple package arguments are + # passed to this function. + if [[ "${CVXOPT_OUTPUT}" != "${CVXOPT_OUTPUT%${PKGCONFIG_ITEM}}" ]] + then + # It was already the last entry in the list, so skip it. + continue + elif [[ "${CVXOPT_OUTPUT}" != "${CVXOPT_OUTPUT%${PKGCONFIG_ITEM};*}" ]] + then + # It was an earlier entry in the list. These two cases are + # separate to ensure that we can e.g. find ";m" at the end + # of the list, but that we don't find ";metis" in the process. + continue + fi + + # It isn't in the list yet, so append it. + CVXOPT_OUTPUT+="${PKGCONFIG_ITEM}" + done + + # Strip the leading ";" from ";foo;bar" before output. + echo "${CVXOPT_OUTPUT#;}" +} + +python_prepare_all() { + # Mandatory dependencies. + export CVXOPT_BLAS_LIB="$(cvxopt_output l blas)" + export CVXOPT_BLAS_LIB_DIR="${EPREFIX}/usr/$(get_libdir);$(cvxopt_output L blas)" + export CVXOPT_LAPACK_LIB="$(cvxopt_output l lapack)" + export CVXOPT_SUITESPARSE_LIB_DIR="${EPREFIX}/usr/$(get_libdir);$(cvxopt_output L umfpack cholmod amd colamd suitesparseconfig)" + + # Most of these CVXOPT_* variables can be blank or have "empty" + # entries and the resulting command-line with e.g. "-L -L/some/path" + # won't hurt anything. The INC_DIR variables, however, cause + # problems, because at least gcc doesn't like a bare "-I". We + # pre-populate these variable with something safe so that setup.py + # doesn't look in the wrong place if pkg-config doesn't return any + # extra -I directories. This is + # + # https://github.com/cvxopt/cvxopt/issues/167 + # + CVXOPT_SUITESPARSE_INC_DIR="${EPREFIX}/usr/include" + local SUITESPARSE_LOCAL_INCS="$(cvxopt_output I umfpack cholmod amd colamd suitesparseconfig)" + if [[ -n "${SUITESPARSE_LOCAL_INCS}" ]]; then + CVXOPT_SUITESPARSE_INC_DIR+=";${SUITESPARSE_LOCAL_INCS}" + fi + export CVXOPT_SUITESPARSE_INC_DIR + + # optional dependencies + if use dsdp; then + # no pkg-config file at the moment + export CVXOPT_BUILD_DSDP=1 + export CVXOPT_DSDP_LIB_DIR="${EPREFIX}/usr/$(get_libdir)" + export CVXOPT_DSDP_INC_DIR="${EPREFIX}/usr/include" + fi + + if use fftw; then + export CVXOPT_BUILD_FFTW=1 + export CVXOPT_FFTW_LIB_DIR="${EPREFIX}/usr/$(get_libdir);$(cvxopt_output L fftw3)" + CVXOPT_FFTW_INC_DIR="${EPREFIX}/usr/include" + FFTW_LOCAL_INCS="$(cvxopt_output I fftw3)" + if [[ -n "${FFTW_LOCAL_INCS}" ]]; then + CVXOPT_FFTW_INC_DIR+=";${FFTW_LOCAL_INCS}" + fi + export CVXOPT_FFTW_INC_DIR + fi + + if use glpk; then + # no pkg-config file at the moment + export CVXOPT_BUILD_GLPK=1 + export CVXOPT_GLPK_LIB_DIR="${EPREFIX}/usr/$(get_libdir)" + export CVXOPT_GLPK_INC_DIR="${EPREFIX}/usr/include" + fi + + if use gsl; then + export CVXOPT_BUILD_GSL=1 + export CVXOPT_GSL_LIB_DIR="${EPREFIX}/usr/$(get_libdir);$(cvxopt_output L gsl)" + CVXOPT_GSL_INC_DIR="${EPREFIX}/usr/include" + GSL_LOCAL_INCS="$(cvxopt_output I gsl)" + if [[ -n "${GSL_LOCAL_INCS}" ]]; then + CVXOPT_GSL_INC_DIR+=";${GSL_LOCAL_INCS}" + fi + export CVXOPT_GSL_INC_DIR + fi + + distutils-r1_python_prepare_all +} + +python_compile_all() { + use doc && VARTEXFONTS="${T}/fonts" emake -C doc -B html +} + +python_test() { + PYTHONPATH="${BUILD_DIR}"/lib nosetests -v || die +} + +python_install_all() { + use doc && HTML_DOCS=( doc/build/html/. ) + distutils-r1_python_install_all + if use examples; then + dodoc -r examples + docompress -x "/usr/share/doc/${PF}/examples" + fi +} |