commit:     cafe8af137d1a9e2bfa62e9ebfb20df5cb6e2831
Author:     François Bissey <frp.bissey <AT> gmail <DOT> com>
AuthorDate: Tue Oct 27 00:32:14 2020 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Jan 22 04:28:24 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cafe8af1

sci-mathematics/gmp-ecm: fix #732032, #750716 and update HOME and SRC_URI

Package-Manager: Portage-3.0.8, Repoman-3.0.2
Closes: https://bugs.gentoo.org/732032
Closes: https://bugs.gentoo.org/750716
Signed-off-by: François René Pierre Bissey <frp.bissey <AT> gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/18044
Signed-off-by: Sam James <sam <AT> gentoo.org>

 sci-mathematics/gmp-ecm/Manifest                   |  1 +
 .../gmp-ecm/files/gmp-ecm-7.0.4-openmp.patch       | 25 ++++++++++
 sci-mathematics/gmp-ecm/gmp-ecm-7.0.4-r3.ebuild    | 57 ++++++++++++++++++++++
 3 files changed, 83 insertions(+)

diff --git a/sci-mathematics/gmp-ecm/Manifest b/sci-mathematics/gmp-ecm/Manifest
index d960832dd1a..f0a304c3ece 100644
--- a/sci-mathematics/gmp-ecm/Manifest
+++ b/sci-mathematics/gmp-ecm/Manifest
@@ -1 +1,2 @@
+DIST ecm-7.0.4.tar.gz 1101899 BLAKE2B 
6d52364d9c752aee66510a7f6b273559bf1b7de0032fbbeff74e229ed68fd0cd1c236b480f8fc25bcad6435740e3e22b3099c8f018912918ab8f4b33dc7b8b3c
 SHA512 
b863b9bfd26df26c3c4243686036a69110e69ca3eec5b31d4550fe713e2fac4ce70cd1d80f0614899793aa44710531aa4a21abc0fa1b99eb17f62bd92b971350
 DIST gmp-ecm-7.0.4.tar.gz 1101899 BLAKE2B 
6d52364d9c752aee66510a7f6b273559bf1b7de0032fbbeff74e229ed68fd0cd1c236b480f8fc25bcad6435740e3e22b3099c8f018912918ab8f4b33dc7b8b3c
 SHA512 
b863b9bfd26df26c3c4243686036a69110e69ca3eec5b31d4550fe713e2fac4ce70cd1d80f0614899793aa44710531aa4a21abc0fa1b99eb17f62bd92b971350

diff --git a/sci-mathematics/gmp-ecm/files/gmp-ecm-7.0.4-openmp.patch 
b/sci-mathematics/gmp-ecm/files/gmp-ecm-7.0.4-openmp.patch
new file mode 100644
index 00000000000..e382bf4ed28
--- /dev/null
+++ b/sci-mathematics/gmp-ecm/files/gmp-ecm-7.0.4-openmp.patch
@@ -0,0 +1,25 @@
+# fix for https://bugs.gentoo.org/732032 merged upstream
+diff --git a/pm1fs2.c b/pm1fs2.c
+index 4471bf6..89f8077 100644
+--- a/pm1fs2.c
++++ b/pm1fs2.c
+@@ -1562,17 +1562,16 @@ list_scale_V (listz_t R, const listz_t F, const 
mpres_t Q,
+ #pragma omp parallel if (deg > 1000)
+   {
+     mpmod_t modulus_local;
+-    long i; /* OpenMP insists on signed loop iteration var :( */
+     
+     mpmod_init_set (modulus_local, modulus);
+     
+ #pragma omp for
+-    for (i = 0; (unsigned long) i <= 2 * deg - 2; i++)
++    for (i = 0; i <= 2 * deg - 2; i++)
+       mpres_mul_z_to_z (H[i], Vt, H[i], modulus_local);
+     mpmod_clear (modulus_local);
+   }
+ #else
+-  for (i = 0; (unsigned long) i <= 2 * deg - 2; i++)
++  for (i = 0; i <= 2 * deg - 2; i++)
+     mpres_mul_z_to_z (H[i], Vt, H[i], modulus);
+ #endif
+ 

diff --git a/sci-mathematics/gmp-ecm/gmp-ecm-7.0.4-r3.ebuild 
b/sci-mathematics/gmp-ecm/gmp-ecm-7.0.4-r3.ebuild
new file mode 100644
index 00000000000..acc3febe501
--- /dev/null
+++ b/sci-mathematics/gmp-ecm/gmp-ecm-7.0.4-r3.ebuild
@@ -0,0 +1,57 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit flag-o-matic toolchain-funcs
+
+MY_PN="ecm"
+MY_P="${MY_PN}-${PV}"
+DESCRIPTION="Elliptic Curve Method for Integer Factorization"
+HOMEPAGE="https://gitlab.inria.fr/zimmerma/ecm";
+SRC_URI="https://gitlab.inria.fr/zimmerma/ecm/uploads/9cd422ec80268f8a885e499e17f98056/${MY_P}.tar.gz";
+
+LICENSE="GPL-3 LGPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~ppc-macos ~x64-macos"
+IUSE="+custom-tune openmp static-libs cpu_flags_x86_sse2"
+
+DEPEND="dev-libs/gmp:="
+RDEPEND="${DEPEND}"
+
+PATCHES=(
+       "${FILESDIR}"/${PN}-7.0.4-openmp.patch
+)
+
+S="${WORKDIR}/${MY_P}"
+
+pkg_pretend() {
+       use openmp && tc-check-openmp
+}
+
+src_compile() {
+       default
+       if use custom-tune; then
+               # One "emake" was needed to build the library. Now we can find
+               # the best set of parameters, and then run "emake" one more time
+               # to rebuild the library with the custom parameters. See the
+               # project's README or INSTALL-ecm. The build targets don't 
depend
+               # on ecm-params.h, so we need to "make clean" to force a 
rebuild.
+               emake ecm-params && emake clean && emake
+       fi
+}
+src_configure() {
+       econf \
+               --enable-shared \
+               $(use_enable static-libs static) \
+               $(use_enable openmp) \
+               $(use_enable cpu_flags_x86_sse2 sse2) \
+               $(use_enable custom-tune asm-redc)
+}
+
+src_install() {
+       default
+
+       # remove .la file
+       find "${ED}" -name '*.la' -delete || die
+}

Reply via email to