From 88e15c49bda325d7baf9cf4377a987383b0fea49 Mon Sep 17 00:00:00 2001 From: TomaSajt <62384384+TomaSajt@users.noreply.github.com> Date: Tue, 14 May 2024 10:11:00 +0200 Subject: [PATCH] python310Packages.gmpy: use pyproject=true, clean up --- .../python-modules/gmpy/default.nix | 31 +++++++++++++------ 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/pkgs/development/python-modules/gmpy/default.nix b/pkgs/development/python-modules/gmpy/default.nix index 072ef985dc01..d68f038ec3b9 100644 --- a/pkgs/development/python-modules/gmpy/default.nix +++ b/pkgs/development/python-modules/gmpy/default.nix @@ -1,28 +1,39 @@ -{ buildPythonPackage, fetchurl, isPyPy, gmp, pythonAtLeast } : +{ + lib, + buildPythonPackage, + fetchFromGitHub, + isPyPy, + pythonAtLeast, + setuptools, + gmp, +}: -let +buildPythonPackage rec { pname = "gmpy"; version = "1.17"; - format = "setuptools"; -in - -buildPythonPackage { - inherit pname version; + 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 = fetchurl { - url = "mirror://pypi/g/gmpy/${pname}-${version}.zip"; - sha256 = "1a79118a5332b40aba6aa24b051ead3a31b9b3b9642288934da754515da8fa14"; + 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; }; }