summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'dev-python/gmpy')
-rw-r--r--dev-python/gmpy/Manifest5
-rw-r--r--dev-python/gmpy/files/gmpy-2.1.0_beta5-test-input.patch12
-rw-r--r--dev-python/gmpy/files/gmpy-2.1.5-mpfr-4.2.1.patch31
-rw-r--r--dev-python/gmpy/gmpy-2.1.1.ebuild38
-rw-r--r--dev-python/gmpy/gmpy-2.1.2.ebuild38
-rw-r--r--dev-python/gmpy/gmpy-2.1.5-r2.ebuild51
6 files changed, 85 insertions, 90 deletions
diff --git a/dev-python/gmpy/Manifest b/dev-python/gmpy/Manifest
index dba6d2f97e73..545491749d8f 100644
--- a/dev-python/gmpy/Manifest
+++ b/dev-python/gmpy/Manifest
@@ -1,2 +1,3 @@
-DIST gmpy2-2.1.1.tar.gz 258607 BLAKE2B 3c070d101066fb0ba5da61b8c1eacf6bbd334aed987161091f31bccc1e836430cb844e0fdcb5017718341761f54c0fc3290e37ace28a5c4fc07930a194e77256 SHA512 37a08b546476f1b49cdfdb04b3a6d4da266615f789eb03896d5e2dd326c91f0fb9523504414b0de30e7265840e2ef77362a5ff011906952100c8b1da4d88d709
-DIST gmpy2-2.1.2.tar.gz 258445 BLAKE2B 5fd89478bb7c48c317a7af74fd872e5a9c1141f8f23c110aba7298d1a325caa13e24f1a2e601d6b3c6f6af30d60505f9161a03def16df59dddabe611fb600ef4 SHA512 abfeb0d8a155235e3aa797ca7b34ab6947f0714273e9d381167a9f6273bad34689e1985c139080b146e072b5bfbb4fa2b937566a14f4b94cc09ed21b3f2082b7
+DIST gmpy-2.1.5-cache.patch 19769 BLAKE2B 72d61ea00fda608ae92c5319828cb5c0003a69cd4be4bf3cde62574a93987b2316df5334d290eca7d48e44e423227d0b5a22c142c4a95b42aebb4560c3bf7ea6 SHA512 f16dbd78a99f27c6f588b814bb9b307429927eae9828fcea04225f163c1cd28968c2994689c4802dc0b619cdfd7c50401d1ec06c220756268af17499613fda1b
+DIST gmpy-2.1.5-py3.12.patch.gz 1817 BLAKE2B cbea3a9c662d52c5bfddb82ab5e920474a52c1dd715b3b9fecf55e5ee097297168ddb7961b6156e4c1f902e911890c77252d119c3651f345f01cad144ed44127 SHA512 26195e8e9a87147a05fd07fa325f262c2004fcba2b8857dbc87ca7a1e9e5e64b4a47d35be77edc263829e5df1db6a0acda6904307d01529eba832feb4f0f3f71
+DIST gmpy2-2.1.5.tar.gz 261709 BLAKE2B 50958868866fadc49c97534780fa491fadfaaea902f3fd4bd51f4e76a94602a6d030a1ee6685aac742e25b5fbe4865e1419307f7215c8fb553b166761d63607a SHA512 92e16359ee1df63faaeae4a3cbefe8cdbbc576d8eda377f08d59f12b70dfe9337a299686e85d1efee6c2f5b41fc4583643fecc68ea38a500c7f876c56fc169e7
diff --git a/dev-python/gmpy/files/gmpy-2.1.0_beta5-test-input.patch b/dev-python/gmpy/files/gmpy-2.1.0_beta5-test-input.patch
deleted file mode 100644
index 16705d917c93..000000000000
--- a/dev-python/gmpy/files/gmpy-2.1.0_beta5-test-input.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff --git a/test/runtests.py b/test/runtests.py
-index 5e5842d..7d64e52 100644
---- a/test/runtests.py
-+++ b/test/runtests.py
-@@ -81,7 +81,6 @@ if sys.version.startswith('3.1.'):
- print("with Python 3.1. The doctest module in Python 3.2 and later does not")
- print("have this issue.")
- print()
-- input("Press ENTER to continue.. ")
- print()
-
- mpz_doctests = ["test_mpz_create.txt", "test_mpz.txt", "test_mpz_io.txt",
diff --git a/dev-python/gmpy/files/gmpy-2.1.5-mpfr-4.2.1.patch b/dev-python/gmpy/files/gmpy-2.1.5-mpfr-4.2.1.patch
new file mode 100644
index 000000000000..4bbc9097824e
--- /dev/null
+++ b/dev-python/gmpy/files/gmpy-2.1.5-mpfr-4.2.1.patch
@@ -0,0 +1,31 @@
+From 68a6b489c3d8d95b2658a1ed884fb99f4bd955c1 Mon Sep 17 00:00:00 2001
+From: Sergey B Kirpichev <skirpichev@gmail.com>
+Date: Sun, 3 Sep 2023 02:35:19 +0300
+Subject: [PATCH] Exclude MPFR workaround for MPFR >= 4.2.1
+
+Co-authored-by: Vincent Lefevre <vincent@vinc17.net>
+
+Closes #418
+---
+ src/gmpy2_format.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/src/gmpy2_format.c b/src/gmpy2_format.c
+index 3e450c96..303bb7bf 100644
+--- a/src/gmpy2_format.c
++++ b/src/gmpy2_format.c
+@@ -592,12 +592,14 @@ GMPy_MPC_Format(PyObject *self, PyObject *args)
+ if (mpcstyle)
+ strcat(tempbuf, " ");
+ else {
++#if MPFR_VERSION < MPFR_VERSION_NUM(4,2,1)
+ /* Need to insert + if imag is nan or +inf. */
+ if (mpfr_nan_p(mpc_imagref(MPC(self))) ||
+ (mpfr_inf_p(mpc_imagref(MPC(self))) &&
+ mpfr_sgn(mpc_imagref(MPC(self))) > 0)) {
+ strcat(tempbuf, "+");
+ }
++#endif
+ }
+ strcat(tempbuf, imagbuf);
+ if (strlen(imagbuf) < 50 &&
diff --git a/dev-python/gmpy/gmpy-2.1.1.ebuild b/dev-python/gmpy/gmpy-2.1.1.ebuild
deleted file mode 100644
index 0e73fa850314..000000000000
--- a/dev-python/gmpy/gmpy-2.1.1.ebuild
+++ /dev/null
@@ -1,38 +0,0 @@
-# Copyright 1999-2022 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-PYTHON_COMPAT=( python3_{8..10} )
-inherit distutils-r1
-
-MY_PN="${PN}2"
-MY_P="${MY_PN}-${PV/_beta/b}"
-
-DESCRIPTION="Python bindings for GMP, MPC, MPFR and MPIR libraries"
-HOMEPAGE="https://github.com/aleaxit/gmpy"
-SRC_URI="mirror://pypi/${PN:0:1}/${MY_PN}/${MY_P}.tar.gz"
-S="${WORKDIR}"/${MY_P}
-
-LICENSE="LGPL-3+"
-SLOT="2"
-KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos"
-
-RDEPEND="
- >=dev-libs/mpc-1.0.2:=
- >=dev-libs/mpfr-3.1.2:=
- dev-libs/gmp:0=
-"
-DEPEND="${RDEPEND}"
-
-PATCHES=(
- # The tests program asks for input when running, disable that
- "${FILESDIR}"/gmpy-2.1.0_beta5-test-input.patch
-)
-
-distutils_enable_sphinx docs
-
-python_test() {
- cd test || die
- "${EPYTHON}" runtests.py || die "tests failed under ${EPYTHON}"
-}
diff --git a/dev-python/gmpy/gmpy-2.1.2.ebuild b/dev-python/gmpy/gmpy-2.1.2.ebuild
deleted file mode 100644
index 2ef96fbfc3bf..000000000000
--- a/dev-python/gmpy/gmpy-2.1.2.ebuild
+++ /dev/null
@@ -1,38 +0,0 @@
-# Copyright 1999-2022 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-PYTHON_COMPAT=( python3_{8..10} )
-inherit distutils-r1
-
-MY_PN="${PN}2"
-MY_P="${MY_PN}-${PV/_beta/b}"
-
-DESCRIPTION="Python bindings for GMP, MPC, MPFR and MPIR libraries"
-HOMEPAGE="https://github.com/aleaxit/gmpy"
-SRC_URI="mirror://pypi/${PN:0:1}/${MY_PN}/${MY_P}.tar.gz"
-S="${WORKDIR}"/${MY_P}
-
-LICENSE="LGPL-3+"
-SLOT="2"
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos"
-
-RDEPEND="
- >=dev-libs/mpc-1.0.2:=
- >=dev-libs/mpfr-3.1.2:=
- dev-libs/gmp:0=
-"
-DEPEND="${RDEPEND}"
-
-PATCHES=(
- # The tests program asks for input when running, disable that
- "${FILESDIR}"/gmpy-2.1.0_beta5-test-input.patch
-)
-
-distutils_enable_sphinx docs
-
-python_test() {
- cd test || die
- "${EPYTHON}" runtests.py || die "tests failed under ${EPYTHON}"
-}
diff --git a/dev-python/gmpy/gmpy-2.1.5-r2.ebuild b/dev-python/gmpy/gmpy-2.1.5-r2.ebuild
new file mode 100644
index 000000000000..1516736e6849
--- /dev/null
+++ b/dev-python/gmpy/gmpy-2.1.5-r2.ebuild
@@ -0,0 +1,51 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_EXT=1
+DISTUTILS_USE_PEP517=setuptools
+PYPI_PN="gmpy2"
+PYTHON_COMPAT=( python3_{10..12} )
+
+inherit distutils-r1 pypi
+
+DESCRIPTION="Python bindings for GMP, MPC, MPFR and MPIR libraries"
+HOMEPAGE="
+ https://github.com/aleaxit/gmpy/
+ https://pypi.org/project/gmpy2/
+"
+SRC_URI+="
+ https://dev.gentoo.org/~grozin/${P}-py3.12.patch.gz
+ https://github.com/tornaria/void-packages/raw/722b32aa405804b79a74256708de6a511e255b4b/srcpkgs/python3-gmpy2/patches/cleanup-object-caching.patch
+ -> ${P}-cache.patch
+"
+
+LICENSE="LGPL-3+"
+SLOT="2"
+KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos"
+
+DEPEND="
+ >=dev-libs/mpc-1.0.2:=
+ >=dev-libs/mpfr-3.1.2:=
+ dev-libs/gmp:0=
+"
+RDEPEND="
+ ${DEPEND}
+"
+
+distutils_enable_sphinx docs
+
+PATCHES=(
+ "${WORKDIR}/${P}-py3.12.patch"
+ # https://github.com/aleaxit/gmpy/commit/7351e2eb1abf4b37a47a822eb3f3f29f90c7f854
+ # rebased by Void; needed for mpfr 4.2.1
+ "${DISTDIR}/${P}-cache.patch"
+ # https://github.com/aleaxit/gmpy/commit/68a6b489c3d8d95b2658a1ed884fb99f4bd955c1
+ "${FILESDIR}/${P}-mpfr-4.2.1.patch"
+)
+
+python_test() {
+ cd test || die
+ "${EPYTHON}" runtests.py || die "tests failed under ${EPYTHON}"
+}