2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
isPyPy,
|
|
|
|
pythonAtLeast,
|
|
|
|
setuptools,
|
|
|
|
gmp,
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
buildPythonPackage rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "gmpy";
|
|
|
|
version = "1.17";
|
2024-06-05 15:53:02 +00:00
|
|
|
pyproject = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
# Python 3.11 has finally made changes to its C API for which gmpy 1.17,
|
|
|
|
# published in 2013, would require patching. It seems unlikely that any
|
|
|
|
# patches will be forthcoming.
|
|
|
|
disabled = isPyPy || pythonAtLeast "3.11";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "aleaxit";
|
|
|
|
repo = "gmpy";
|
|
|
|
rev = "refs/tags/gmpy_${lib.replaceStrings [ "." ] [ "_" ] version}";
|
|
|
|
hash = "sha256-kMidOjhKJlDRu2qaiq9c+XcwD1tNAoPhRTvvGcOJe8I=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
build-system = [ setuptools ];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs = [ gmp ];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "gmpy" ];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = {
|
|
|
|
description = "GMP or MPIR interface to Python 2.4+ and 3.x";
|
|
|
|
homepage = "https://github.com/aleaxit/gmpy/";
|
2024-06-05 15:53:02 +00:00
|
|
|
license = lib.licenses.lgpl21Plus;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|