at 22.05-pre 2.2 kB view raw
1{ lib 2, buildPythonPackage 3, fetchPypi 4, isPyPy 5, python 6, blas, lapack # build segfaults with 64-bit blas 7, suitesparse 8, glpk ? null 9, gsl ? null 10, fftw ? null 11, withGlpk ? true 12, withGsl ? true 13, withFftw ? true 14}: 15 16assert (!blas.isILP64) && (!lapack.isILP64); 17 18buildPythonPackage rec { 19 pname = "cvxopt"; 20 version = "1.2.7"; 21 22 disabled = isPyPy; # hangs at [translation:info] 23 24 src = fetchPypi { 25 inherit pname version; 26 sha256 = "3f9db1f4d4e820aaea81d6fc21054c89dc6327c84f935dd5a1eda1af11e1d504"; 27 }; 28 29 buildInputs = [ blas lapack ]; 30 31 # similar to Gsl, glpk, fftw there is also a dsdp interface 32 # but dsdp is not yet packaged in nixpkgs 33 preConfigure = '' 34 export CVXOPT_BLAS_LIB=blas 35 export CVXOPT_LAPACK_LIB=lapack 36 export CVXOPT_SUITESPARSE_LIB_DIR=${lib.getLib suitesparse}/lib 37 export CVXOPT_SUITESPARSE_INC_DIR=${lib.getDev suitesparse}/include 38 '' + lib.optionalString withGsl '' 39 export CVXOPT_BUILD_GSL=1 40 export CVXOPT_GSL_LIB_DIR=${gsl}/lib 41 export CVXOPT_GSL_INC_DIR=${gsl}/include 42 '' + lib.optionalString withGlpk '' 43 export CVXOPT_BUILD_GLPK=1 44 export CVXOPT_GLPK_LIB_DIR=${glpk}/lib 45 export CVXOPT_GLPK_INC_DIR=${glpk}/include 46 '' + lib.optionalString withFftw '' 47 export CVXOPT_BUILD_FFTW=1 48 export CVXOPT_FFTW_LIB_DIR=${fftw}/lib 49 export CVXOPT_FFTW_INC_DIR=${fftw.dev}/include 50 ''; 51 52 checkPhase = '' 53 ${python.interpreter} -m unittest discover -s tests 54 ''; 55 56 meta = with lib; { 57 homepage = "http://cvxopt.org/"; 58 description = "Python Software for Convex Optimization"; 59 longDescription = '' 60 CVXOPT is a free software package for convex optimization based on the 61 Python programming language. It can be used with the interactive 62 Python interpreter, on the command line by executing Python scripts, 63 or integrated in other software via Python extension modules. Its main 64 purpose is to make the development of software for convex optimization 65 applications straightforward by building on Python's extensive 66 standard library and on the strengths of Python as a high-level 67 programming language. 68 ''; 69 maintainers = with maintainers; [ edwtjo ]; 70 license = licenses.gpl3Plus; 71 }; 72}