diff options
Diffstat (limited to 'dev-python/gmpy')
-rw-r--r-- | dev-python/gmpy/Manifest | 4 | ||||
-rw-r--r-- | dev-python/gmpy/files/gmpy-2.0.8-test-exit-status.patch | 41 | ||||
-rw-r--r-- | dev-python/gmpy/gmpy-2.0.8-r1.ebuild | 68 | ||||
-rw-r--r-- | dev-python/gmpy/gmpy-2.0.8.ebuild | 24 |
4 files changed, 128 insertions, 9 deletions
diff --git a/dev-python/gmpy/Manifest b/dev-python/gmpy/Manifest index a1dc99c11c04..3c30993b8a14 100644 --- a/dev-python/gmpy/Manifest +++ b/dev-python/gmpy/Manifest @@ -1,4 +1,6 @@ AUX gmpy-2.0.8-fix-mpir-types.patch 636 BLAKE2B 3f9a73390cab39ac02c9cdbf6c78381a14e861b15c4e0194e9727b3e801817111b6ece399a2479c0880f84d542816b2e388ad15e8f9786e2ab63b5e893f31cc1 SHA512 701e985b1d8f1d3ed0efa48a9ee225bfb9a06f5a19f53a8a1ec6c525e74fb2b6fd006f1bba28188926f77faec6cbc456985b810b7c774aef1699a0ab2c07896d +AUX gmpy-2.0.8-test-exit-status.patch 1482 BLAKE2B 5fce4170ce1993cf7e44077b81ecf45b4c8d3b779cb8744c6deef6444cc728a4cf7831aac0cc31a0b6315518bead442ce232e0052e72229f397691c21afb5890 SHA512 bbb708c0323167cf86c60ef6d398a588adc9a7ccc96eb1cee9d36c38b34c69c896a7df99f50611b29ba6ccb79f77408d274074bd4878e86b8f3bfc38675b74d6 DIST gmpy2-2.0.8.zip 280551 BLAKE2B b73c48b739ae6972231672ad28598c09e00db6348cd281d190c6dfcf49b0e977563baabe84825658d78bf1e2ac4927ad1882787b6d4efd19f28a4f7fd6a061b4 SHA512 090f449641f378c73eb166831b1d956c6cee3da83e42fde8741f18aa0fa687e37927fc3b045d4b35e3a3b75570e6b1074150d8bc29d16119ab5c717bcfcf9fb4 -EBUILD gmpy-2.0.8.ebuild 1547 BLAKE2B eff9402ef787f2b8437654e5db66bde80f7fa112fe7fcde206b138d6db57a2a2f982d14bdbd23869b3b3787a4aaf36ed249a7dd9faefa9f67ab51885a41676b4 SHA512 fb49ab93c934a2b506518b91508a4769100165a758e7c44785249c4dbac24b25a1e60d8d3fd42d83812ec53d05d23a1199bc2f7dc3b3fa52ee09237487b28597 +EBUILD gmpy-2.0.8-r1.ebuild 1540 BLAKE2B 300fe0934b18e9d263b100cd7ca1ca83b5c7b10fb13c6c81147289680ff6bdfd486b44eeccb0544a4f46e4af2809ff0993bf2e8240a3dab701311793f2f7198a SHA512 738ca24b2b960a4574408bf9ad4d85a43e3a13842c60ec75af47e972f97d71c85a757885c82eff009f99386f64340c75cf27614c52a34a25d70a23ea76df384e +EBUILD gmpy-2.0.8.ebuild 1827 BLAKE2B a9715787ab247684dd59a34a90387a1f9503572699790605e539d375682e0222d0d22b8270ef4182fe422f3c475118a1edb36a26fdb00c28423cc63a5282595b SHA512 7e56d0de64797c50863c6782fefcbd2d751d91b8578028942976a3ec5c8479c78c372d728b5dbd6468bb2b82336d0b0128dfe2f7789d605c6f87cbcfa51e466e MISC metadata.xml 795 BLAKE2B df987c466b2666db915c405dea507c17f90181c2e2948885292a6de44ba0c4bec640fe25bea3b8b8105d035c3ff999750b747cfd7f4caaab561f459056823eb5 SHA512 e7f8324cdacceed22f28e27a224668f59955fb5a639d26376da037b0d21437ef57708c7c325e00c771df9e11050be8dc423a3d4b631599da2cc1ef3f97cf3795 diff --git a/dev-python/gmpy/files/gmpy-2.0.8-test-exit-status.patch b/dev-python/gmpy/files/gmpy-2.0.8-test-exit-status.patch new file mode 100644 index 000000000000..ab4128ff55ca --- /dev/null +++ b/dev-python/gmpy/files/gmpy-2.0.8-test-exit-status.patch @@ -0,0 +1,41 @@ +diff -dupr a/test2/gmpy_test.py b/test2/gmpy_test.py +--- a/test2/gmpy_test.py 2019-11-22 09:21:42.313037873 +0100 ++++ b/test2/gmpy_test.py 2013-08-20 22:17:52.000000000 +0200 +@@ -34,11 +34,15 @@ writeln(" Caching Values: (Number) + writeln(" Caching Values: (Size, limbs) {0}".format(_g.get_cache()[1])) + + pf, pt = 0, 0 ++ret = 0 + for x in test_modules: + testit = x._test() + failures, tests = testit + if tests == 0: continue ++ if failures > 0: ret = 1 + writeln("%s %3d tests, %d failures" % (x.__name__, tests-pt, failures-pf)) + pf, pt = failures, tests + + doctest.master.summarize(1) ++ ++sys.exit(ret) +diff -dupr a/test3/gmpy_test.py b/test3/gmpy_test.py +--- a/test3/gmpy_test.py 2019-11-22 09:21:30.421908749 +0100 ++++ b/test3/gmpy_test.py 2013-08-20 22:17:52.000000000 +0200 +@@ -28,10 +28,12 @@ print(" Caching Values: (Number) { + print(" Caching Values: (Size, limbs) {0}".format(_g.get_cache()[1])) + + pf, pt = 0, 0 ++ret = 0 + for x in test_modules: + testit = x._test() + failures, tests = testit + if tests == 0: continue ++ if failures > 0: ret = 1 + print("%s %3d tests, %d failures" % (x.__name__, tests-pt, failures-pf)) + pf, pt = failures, tests + +@@ -41,3 +43,5 @@ if sys.version_info < (3,1,1): + print("There is a known bug with Fraction == mpq for versions of Python") + print("less than 3.1.1. Please upgrade if you rely on comparisons between") + print("Python's Fraction and gmpy2's mpq.") ++ ++sys.exit(ret) diff --git a/dev-python/gmpy/gmpy-2.0.8-r1.ebuild b/dev-python/gmpy/gmpy-2.0.8-r1.ebuild new file mode 100644 index 000000000000..206a2329c1f9 --- /dev/null +++ b/dev-python/gmpy/gmpy-2.0.8-r1.ebuild @@ -0,0 +1,68 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +PYTHON_COMPAT=( python2_7 python3_{5,6,7,8} ) + +inherit distutils-r1 + +MY_PN="${PN}2" +MY_P="${MY_PN}-${PV}" + +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}.zip" +S="${WORKDIR}"/${MY_P} + +LICENSE="LGPL-3+" +SLOT="2" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos" +IUSE="mpir" + +RDEPEND=" + >=dev-libs/mpc-1.0.2:= + >=dev-libs/mpfr-3.1.2:= + !mpir? ( dev-libs/gmp:0= ) + mpir? ( sci-libs/mpir:= )" +DEPEND="${RDEPEND}" +BDEPEND=" + app-arch/unzip" + +PATCHES=( + "${FILESDIR}"/${P}-fix-mpir-types.patch + "${FILESDIR}"/gmpy-2.0.8-test-exit-status.patch +) + +distutils_enable_sphinx docs + +python_prepare_all() { + distutils-r1_python_prepare_all + + # rm non std test file + rm test*/gmpy_test_thr.py || die + # testing for contents of __dir__ is really silly, and fails + sed -i -e '/__dir__/,+1d' test3/*.py || die +} + +python_configure_all() { + mydistutilsargs=( + $(usex mpir --mpir --gmp) + ) +} + +python_compile() { + python_is_python3 || local -x CFLAGS="${CFLAGS} -fno-strict-aliasing" + distutils-r1_python_compile +} + +python_test() { + cd test || die + "${EPYTHON}" runtests.py || die "tests failed under ${EPYTHON}" + if python_is_python3; then + cd ../test3 || die + else + cd ../test2 || die + fi + "${EPYTHON}" gmpy_test.py || die "tests failed under ${EPYTHON}" +} diff --git a/dev-python/gmpy/gmpy-2.0.8.ebuild b/dev-python/gmpy/gmpy-2.0.8.ebuild index 2538dfd438f4..f4e4508c5246 100644 --- a/dev-python/gmpy/gmpy-2.0.8.ebuild +++ b/dev-python/gmpy/gmpy-2.0.8.ebuild @@ -3,7 +3,7 @@ EAPI=5 -PYTHON_COMPAT=( python2_7 python3_{5,6,7} ) +PYTHON_COMPAT=( python2_7 python3_{5,6,7,8} ) inherit distutils-r1 @@ -13,6 +13,7 @@ MY_P="${MY_PN}-${PV}" 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}.zip" +S="${WORKDIR}"/${MY_P} LICENSE="LGPL-2.1" SLOT="2" @@ -26,24 +27,31 @@ RDEPEND=" mpir? ( sci-libs/mpir:= )" DEPEND="${RDEPEND} app-arch/unzip - doc? ( dev-python/sphinx[${PYTHON_USEDEP}] )" - -S="${WORKDIR}"/${MY_P} + doc? ( $(python_gen_any_dep 'dev-python/sphinx[${PYTHON_USEDEP}]') )" PATCHES=( "${FILESDIR}"/${P}-fix-mpir-types.patch + "${FILESDIR}"/gmpy-2.0.8-test-exit-status.patch ) +python_check_deps() { + use doc || return 0 + has_version "dev-python/sphinx[${PYTHON_USEDEP}]" +} + python_prepare_all() { + distutils-r1_python_prepare_all + # rm non std test file rm test*/gmpy_test_thr.py || die - distutils-r1_python_prepare_all + # testing for contents of __dir__ is really silly, and fails + sed -i -e '/__dir__/,+1d' test3/*.py || die } python_configure_all() { mydistutilsargs=( $(usex mpir --mpir --gmp) - ) + ) } python_compile() { @@ -57,13 +65,13 @@ python_compile_all() { python_test() { cd test || die - "${PYTHON}" runtests.py || die "tests failed under ${EPYTHON}" + "${EPYTHON}" runtests.py || die "tests failed under ${EPYTHON}" if python_is_python3; then cd ../test3 || die else cd ../test2 || die fi - "${PYTHON}" gmpy_test.py || die "tests failed under ${EPYTHON}" + "${EPYTHON}" gmpy_test.py || die "tests failed under ${EPYTHON}" } python_install_all() { |