depot/third_party/nixpkgs/pkgs/development/python-modules/symengine/default.nix
Default email 8a45d4525b Project import generated by Copybara.
GitOrigin-RevId: 710fed5a2483f945b14f4a58af2cd3676b42d8c8
2022-03-30 11:31:56 +02:00

55 lines
1.2 KiB
Nix

{ lib
, buildPythonPackage
, fetchFromGitHub
, cython
, cmake
, symengine
, pytest
, sympy
, python
}:
buildPythonPackage rec {
pname = "symengine";
version = "0.9.2";
src = fetchFromGitHub {
owner = "symengine";
repo = "symengine.py";
rev = "v${version}";
sha256 = "sha256-ZHplYEG97foy/unOdSokFFkDl4LK5TI4kypHSLpcCM4=";
};
postConfigure = ''
substituteInPlace setup.py \
--replace "\"cmake\"" "\"${cmake}/bin/cmake\"" \
--replace "'cython>=0.29.24'" "'cython'"
substituteInPlace cmake/FindCython.cmake \
--replace "SET(CYTHON_BIN cython" "SET(CYTHON_BIN ${cython}/bin/cython"
'';
nativeBuildUnputs = [ cmake ];
buildInputs = [ cython ];
checkInputs = [ pytest sympy ];
setupPyBuildFlags = [
"--symengine-dir=${symengine}/"
"--define=\"CYTHON_BIN=${cython}/bin/cython\""
];
checkPhase = ''
mkdir empty
cd empty
${python.interpreter} ../bin/test_python.py
'';
meta = with lib; {
description = "Python library providing wrappers to SymEngine";
homepage = "https://github.com/symengine/symengine.py";
license = licenses.mit;
maintainers = [ maintainers.costrouc ];
};
}