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