1{ lib
2, fetchFromGitHub
3, buildPythonPackage
4, eigen
5, nlopt
6, ipopt
7, boost
8, pagmo2
9, numpy
10, cloudpickle
11, ipyparallel
12, numba
13, python
14}:
15
16let
17 propagatedBuildInputs = [ numpy cloudpickle ipyparallel numba ];
18
19 pagmo2WithPython = pagmo2.overrideAttrs (oldAttrs: {
20 cmakeFlags = oldAttrs.cmakeFlags ++ [
21 "-DPAGMO_BUILD_PYGMO=yes"
22 "-DPAGMO_BUILD_PAGMO=no"
23 "-DPagmo_DIR=${pagmo2}"
24 ];
25 buildInputs = [ eigen nlopt ipopt boost pagmo2 ] ++ propagatedBuildInputs;
26 postInstall = ''
27 mv wheel $out
28 '';
29 });
30
31in buildPythonPackage rec {
32 pname = "pygmo";
33 version = pagmo2WithPython.version;
34
35 inherit propagatedBuildInputs;
36
37 src = pagmo2WithPython;
38
39 preBuild = ''
40 mv ${python.sitePackages}/pygmo wheel
41 cd wheel
42 '';
43
44 # dont do tests
45 doCheck = false;
46
47 meta = with lib; {
48 description = "Parallel optimisation for Python";
49 homepage = https://esa.github.io/pagmo2/;
50 license = licenses.gpl3Plus;
51 maintainers = [ maintainers.costrouc ];
52 };
53}