Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ 2 lib, 3 buildPythonPackage, 4 fetchPypi, 5 isPyPy, 6 python, 7 blas, 8 lapack, 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 # similar to Gsl, glpk, fftw there is also a dsdp interface 39 # but dsdp is not yet packaged in nixpkgs 40 env = 41 { 42 CVXOPT_BLAS_LIB = "blas"; 43 CVXOPT_LAPACK_LIB = "lapack"; 44 CVXOPT_BUILD_DSDP = "0"; 45 CVXOPT_SUITESPARSE_LIB_DIR = "${lib.getLib suitesparse}/lib"; 46 CVXOPT_SUITESPARSE_INC_DIR = "${lib.getDev suitesparse}/include"; 47 } 48 // lib.optionalAttrs withGsl { 49 CVXOPT_BUILD_GSL = "1"; 50 CVXOPT_GSL_LIB_DIR = "${lib.getLib gsl}/lib"; 51 CVXOPT_GSL_INC_DIR = "${lib.getDev gsl}/include"; 52 } 53 // lib.optionalAttrs withGlpk { 54 CVXOPT_BUILD_GLPK = "1"; 55 CVXOPT_GLPK_LIB_DIR = "${lib.getLib glpk}/lib"; 56 CVXOPT_GLPK_INC_DIR = "${lib.getDev glpk}/include"; 57 } 58 // lib.optionalAttrs withFftw { 59 CVXOPT_BUILD_FFTW = "1"; 60 CVXOPT_FFTW_LIB_DIR = "${lib.getLib fftw}/lib"; 61 CVXOPT_FFTW_INC_DIR = "${lib.getDev fftw}/include"; 62 }; 63 64 nativeCheckInputs = [ unittestCheckHook ]; 65 66 unittestFlagsArray = [ 67 "-s" 68 "tests" 69 ]; 70 71 meta = with lib; { 72 homepage = "https://cvxopt.org/"; 73 description = "Python Software for Convex Optimization"; 74 longDescription = '' 75 CVXOPT is a free software package for convex optimization based on the 76 Python programming language. It can be used with the interactive 77 Python interpreter, on the command line by executing Python scripts, 78 or integrated in other software via Python extension modules. Its main 79 purpose is to make the development of software for convex optimization 80 applications straightforward by building on Python's extensive 81 standard library and on the strengths of Python as a high-level 82 programming language. 83 ''; 84 maintainers = with maintainers; [ edwtjo ]; 85 license = licenses.gpl3Plus; 86 }; 87}