2024-05-15 15:35:15 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
pythonOlder,
|
|
|
|
|
|
|
|
setuptools,
|
|
|
|
cmake,
|
|
|
|
nanobind,
|
|
|
|
ninja,
|
|
|
|
pcpp,
|
|
|
|
scikit-build,
|
|
|
|
isl,
|
|
|
|
|
|
|
|
pytestCheckHook,
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "islpy";
|
2024-06-05 15:53:02 +00:00
|
|
|
version = "2024.1";
|
2024-05-15 15:35:15 +00:00
|
|
|
pyproject = true;
|
2024-01-13 08:15:51 +00:00
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
disabled = pythonOlder "3.8";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "inducer";
|
|
|
|
repo = "islpy";
|
2024-06-05 15:53:02 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
|
|
|
hash = "sha256-N5XI6V3BvNobCh7NAvtzVejtDMnlcb31S5gseyab1T0=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace pyproject.toml \
|
|
|
|
--replace-fail "setuptools>=42,<64;python_version<'3.12'" "setuptools>=42"
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
build-system = [
|
|
|
|
setuptools
|
|
|
|
cmake
|
|
|
|
nanobind
|
|
|
|
ninja
|
|
|
|
pcpp
|
|
|
|
scikit-build
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [ isl ];
|
|
|
|
|
|
|
|
dontUseCmakeConfigure = true;
|
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
python ./configure.py \
|
|
|
|
--no-use-shipped-isl \
|
|
|
|
--isl-inc-dir=${lib.getDev isl}/include \
|
|
|
|
'';
|
|
|
|
|
|
|
|
# Force resolving the package from $out to make generated ext files usable by tests
|
|
|
|
preCheck = ''
|
|
|
|
mv islpy islpy.hidden
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [ pytestCheckHook ];
|
2024-05-15 15:35:15 +00:00
|
|
|
|
2020-10-07 09:15:18 +00:00
|
|
|
pythonImportsCheck = [ "islpy" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
meta = {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Python wrapper around isl, an integer set library";
|
|
|
|
homepage = "https://github.com/inducer/islpy";
|
2024-05-15 15:35:15 +00:00
|
|
|
license = lib.licenses.mit;
|
|
|
|
maintainers = with lib.maintainers; [ tomasajt ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|