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