pythonPackages.pygmo: 2.8 -> 2.9 refactor fix broken package
Introduce a `pagmo2WithPython` which overrides the pagmo2 expression and enables the pygmo build. Then hand it over to `buildPythonPackage` by making it the src to produce a usable package.
This commit is contained in:
parent
3eb461dedb
commit
19d077a157
@ -1,7 +1,6 @@
|
|||||||
{ lib
|
{ lib
|
||||||
, fetchFromGitHub
|
, fetchFromGitHub
|
||||||
, buildPythonPackage
|
, buildPythonPackage
|
||||||
, cmake
|
|
||||||
, eigen
|
, eigen
|
||||||
, nlopt
|
, nlopt
|
||||||
, ipopt
|
, ipopt
|
||||||
@ -11,38 +10,44 @@
|
|||||||
, cloudpickle
|
, cloudpickle
|
||||||
, ipyparallel
|
, ipyparallel
|
||||||
, numba
|
, numba
|
||||||
|
, python
|
||||||
}:
|
}:
|
||||||
|
|
||||||
buildPythonPackage rec {
|
let
|
||||||
pname = "pygmo";
|
|
||||||
version = "2.8";
|
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
|
||||||
owner = "esa";
|
|
||||||
repo = "pagmo2";
|
|
||||||
rev = "v${version}";
|
|
||||||
sha256 = "1xwxamcn3fkwr62jn6bkanrwy0cvsksf75hfwx4fvl56awnbz41z";
|
|
||||||
};
|
|
||||||
|
|
||||||
buildInputs = [ cmake eigen nlopt ipopt boost pagmo2 ];
|
|
||||||
propagatedBuildInputs = [ numpy cloudpickle ipyparallel numba ];
|
propagatedBuildInputs = [ numpy cloudpickle ipyparallel numba ];
|
||||||
|
|
||||||
preBuild = ''
|
pagmo2WithPython = pagmo2.overrideAttrs (oldAttrs: {
|
||||||
cp -v -r $src/* .
|
cmakeFlags = oldAttrs.cmakeFlags ++ [
|
||||||
cmake -DCMAKE_INSTALL_PREFIX=$out -DPAGMO_BUILD_TESTS=no -DCMAKE_SYSTEM_NAME=Linux -DPagmo_DIR=${pagmo2} -DPAGMO_BUILD_PYGMO=yes -DPAGMO_BUILD_PAGMO=no -DPAGMO_WITH_EIGEN3=yes -DPAGMO_WITH_NLOPT=yes -DNLOPT_LIBRARY=${nlopt}/lib/libnlopt_cxx.so -DPAGMO_WITH_IPOPT=yes -DIPOPT=${ipopt}
|
"-DPAGMO_BUILD_PYGMO=yes"
|
||||||
|
"-DPAGMO_BUILD_PAGMO=no"
|
||||||
|
"-DPagmo_DIR=${pagmo2}"
|
||||||
|
];
|
||||||
|
buildInputs = [ eigen nlopt ipopt boost pagmo2 ] ++ propagatedBuildInputs;
|
||||||
|
postInstall = ''
|
||||||
|
mv wheel $out
|
||||||
|
'';
|
||||||
|
});
|
||||||
|
|
||||||
make install
|
in buildPythonPackage rec {
|
||||||
mv $out/lib/python*/site-packages/pygmo wheel
|
pname = "pygmo";
|
||||||
|
version = pagmo2WithPython.version;
|
||||||
|
|
||||||
|
inherit propagatedBuildInputs;
|
||||||
|
|
||||||
|
src = pagmo2WithPython;
|
||||||
|
|
||||||
|
preBuild = ''
|
||||||
|
mv ${python.sitePackages}/pygmo wheel
|
||||||
cd wheel
|
cd wheel
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# dont do tests
|
# dont do tests
|
||||||
doCheck = false;
|
doCheck = false;
|
||||||
|
|
||||||
meta = {
|
meta = with lib; {
|
||||||
description = "Parallel optimisation for Python";
|
description = "Parallel optimisation for Python";
|
||||||
homepage = https://esa.github.io/pagmo2/;
|
homepage = https://esa.github.io/pagmo2/;
|
||||||
license = lib.licenses.gpl3Plus;
|
license = licenses.gpl3Plus;
|
||||||
maintainers = with lib.maintainers; [ costrouc ];
|
maintainers = [ maintainers.costrouc ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user