about summary refs log tree commit diff
path: root/pkgs/development/python-modules/gmpy/default.nix
blob: d68f038ec3b96b67d10db195a5df9c647212f462 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  isPyPy,
  pythonAtLeast,
  setuptools,
  gmp,
}:

buildPythonPackage rec {
  pname = "gmpy";
  version = "1.17";
  pyproject = true;

  # 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";

  src = fetchFromGitHub {
    owner = "aleaxit";
    repo = "gmpy";
    rev = "refs/tags/gmpy_${lib.replaceStrings [ "." ] [ "_" ] version}";
    hash = "sha256-kMidOjhKJlDRu2qaiq9c+XcwD1tNAoPhRTvvGcOJe8I=";
  };

  build-system = [ setuptools ];

  buildInputs = [ gmp ];

  pythonImportsCheck = [ "gmpy" ];

  meta = {
    description = "GMP or MPIR interface to Python 2.4+ and 3.x";
    homepage = "https://github.com/aleaxit/gmpy/";
    license = lib.licenses.lgpl21Plus;
  };
}