Gentoo Archives: gentoo-commits

From: Michael Orlitzky <mjo@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sci-mathematics/flint/files/, sci-mathematics/flint/
Date: Fri, 28 Feb 2020 17:23:06
Message-Id: 1582910443.39b65a3d5ad4c68459f3d7ce63556937099ac93a.mjo@gentoo
1 commit: 39b65a3d5ad4c68459f3d7ce63556937099ac93a
2 Author: Michael Orlitzky <mjo <AT> gentoo <DOT> org>
3 AuthorDate: Fri Feb 28 16:31:58 2020 +0000
4 Commit: Michael Orlitzky <mjo <AT> gentoo <DOT> org>
5 CommitDate: Fri Feb 28 17:20:43 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=39b65a3d
7
8 sci-mathematics/flint: new EAPI=7 revision.
9
10 This new revision is based off François Bissey's ebuild in the
11 sage-on-gentoo overlay, which has accrued some fixes not present in
12 the ::gentoo version. Of note, it fixes an open build bug, and an
13 unreported issue where 32-bit libraries are detected on a 64-bit
14 system.
15
16 The update to EAPI=7 required only moving the LaTeX dependencies to
17 BDEPEND. In the process, I updated the LICENSE to LGPL-2.1+ because
18 upstream has done the same. I also looked long and hard for a reason
19 why we have RESTRICT=mirror in the ebuild. Finding none, I have
20 removed the restriction.
21
22 Closes: https://bugs.gentoo.org/470732
23 Closes: https://bugs.gentoo.org/688674
24 Package-Manager: Portage-2.3.84, Repoman-2.3.20
25 Signed-off-by: Michael Orlitzky <mjo <AT> gentoo.org>
26
27 .../flint/files/flint-2.5.2-memory_message.patch | 16 +++++
28 sci-mathematics/flint/files/flint-2.5.2-pie.patch | 78 ++++++++++++++++++++++
29 sci-mathematics/flint/files/flint-2.5.2-utf8.patch | 13 ++++
30 sci-mathematics/flint/files/flintxx-include.patch | 19 ++++++
31 sci-mathematics/flint/flint-2.5.2-r1.ebuild | 74 ++++++++++++++++++++
32 5 files changed, 200 insertions(+)
33
34 diff --git a/sci-mathematics/flint/files/flint-2.5.2-memory_message.patch b/sci-mathematics/flint/files/flint-2.5.2-memory_message.patch
35 new file mode 100644
36 index 00000000000..65638aa7790
37 --- /dev/null
38 +++ b/sci-mathematics/flint/files/flint-2.5.2-memory_message.patch
39 @@ -0,0 +1,16 @@
40 +This fixes a Python 3 doctest failure in
41 +rings/polynomial/polynomial_integer_dense_flint.pyx: see #28334.
42 +See https://github.com/wbhart/flint2/pull/585 for upstream PR
43 +
44 +diff --git a/memory_manager.c b/memory_manager.c
45 +index 04abf8a..bece9f5 100644
46 +--- a/memory_manager.c
47 ++++ b/memory_manager.c
48 +@@ -41,6 +41,7 @@ pthread_mutex_t register_lock;
49 + static void flint_memory_error()
50 + {
51 + flint_printf("Exception (FLINT memory_manager). Unable to allocate memory.\n");
52 ++ fflush(stdout);
53 + abort();
54 + }
55 +
56
57 diff --git a/sci-mathematics/flint/files/flint-2.5.2-pie.patch b/sci-mathematics/flint/files/flint-2.5.2-pie.patch
58 new file mode 100644
59 index 00000000000..442d0254e82
60 --- /dev/null
61 +++ b/sci-mathematics/flint/files/flint-2.5.2-pie.patch
62 @@ -0,0 +1,78 @@
63 +In newer binutils, ld options -r and -pie conflict.
64 +Patch due to Jörg-Volker Peetz
65 +(source : https://groups.google.com/d/msg/sage-devel/TduebNoZuBE/sEULolL0BQAJ),
66 +packaged by Emmanuel Charpentier
67 +
68 +diff -ru flint-2.5.2-orig/fq/Makefile flint-2.5.2-new/fq/Makefile
69 +--- flint-2.5.2-orig/fq/Makefile 2015-08-13 18:16:22.000000000 +0200
70 ++++ flint-2.5.2-new/fq/Makefile 2016-11-07 18:41:09.148996528 +0100
71 +@@ -35,7 +35,7 @@
72 + $(CC) $(CFLAGS) -c $(INCS) $< -o $@
73 +
74 + $(MOD_LOBJ): $(LOBJS)
75 +- $(CC) $(ABI_FLAG) -Wl,-r $^ -o $@ -nostdlib
76 ++ $(CC) $(ABI_FLAG) -r $^ -o $@ -nostdlib
77 +
78 + $(BUILD_DIR)/%.lo: %.c
79 + $(CC) $(PICFLAG) $(CFLAGS) $(INCS) -c $< -o $@
80 +diff -ru flint-2.5.2-orig/fq_poly/Makefile flint-2.5.2-new/fq_poly/Makefile
81 +--- flint-2.5.2-orig/fq_poly/Makefile 2015-08-13 18:16:22.000000000 +0200
82 ++++ flint-2.5.2-new/fq_poly/Makefile 2016-11-07 18:41:09.148996528 +0100
83 +@@ -35,7 +35,7 @@
84 + $(CC) $(CFLAGS) -c $(INCS) $< -o $@
85 +
86 + $(MOD_LOBJ): $(LOBJS)
87 +- $(CC) $(ABI_FLAG) -Wl,-r $^ -o $@ -nostdlib
88 ++ $(CC) $(ABI_FLAG) -r $^ -o $@ -nostdlib
89 +
90 + $(BUILD_DIR)/%.lo: %.c
91 + $(CC) $(PICFLAG) $(CFLAGS) $(INCS) -c $< -o $@
92 +diff -ru flint-2.5.2-orig/Makefile.subdirs flint-2.5.2-new/Makefile.subdirs
93 +--- flint-2.5.2-orig/Makefile.subdirs 2015-08-13 18:16:22.000000000 +0200
94 ++++ flint-2.5.2-new/Makefile.subdirs 2016-11-07 18:41:09.144996522 +0100
95 +@@ -59,7 +59,7 @@
96 + $(QUIET_CC) $(CC) $(CFLAGS) $(INCS) -c $< -o $@ -MMD -MP -MF "$(BUILD_DIR)/$(MOD_DIR)_$*.d" -MT "$(BUILD_DIR)/$(MOD_DIR)_$*.d" -MT "$@"
97 +
98 + $(MOD_LOBJ): $(LOBJS)
99 +- $(QUIET_CC) $(CC) $(ABI_FLAG) -Wl,-r $^ -o $@ -nostdlib
100 ++ $(QUIET_CC) $(CC) $(ABI_FLAG) -r $^ -o $@ -nostdlib
101 +
102 + -include $(LOBJS:.lo=.d)
103 +
104 +Seulement dans flint-2.5.2-new/: Makefile.subdirs.orig
105 +diff -ru flint-2.5.2-orig/padic_mat/Makefile flint-2.5.2-new/padic_mat/Makefile
106 +--- flint-2.5.2-orig/padic_mat/Makefile 2015-08-13 18:16:22.000000000 +0200
107 ++++ flint-2.5.2-new/padic_mat/Makefile 2016-11-07 18:41:09.148996528 +0100
108 +@@ -35,7 +35,7 @@
109 + $(CC) $(CFLAGS) -c $(INCS) $< -o $@
110 +
111 + $(MOD_LOBJ): $(LOBJS)
112 +- $(CC) $(ABI_FLAG) -Wl,-r $^ -o $@ -nostdlib
113 ++ $(CC) $(ABI_FLAG) -r $^ -o $@ -nostdlib
114 +
115 + $(BUILD_DIR)/%.lo: %.c
116 + $(CC) $(PICFLAG) $(CFLAGS) $(INCS) -c $< -o $@
117 +diff -ru flint-2.5.2-orig/padic_poly/Makefile flint-2.5.2-new/padic_poly/Makefile
118 +--- flint-2.5.2-orig/padic_poly/Makefile 2015-08-13 18:16:22.000000000 +0200
119 ++++ flint-2.5.2-new/padic_poly/Makefile 2016-11-07 18:41:09.148996528 +0100
120 +@@ -35,7 +35,7 @@
121 + $(CC) $(CFLAGS) -c $(INCS) $< -o $@
122 +
123 + $(MOD_LOBJ): $(LOBJS)
124 +- $(CC) $(ABI_FLAG) -Wl,-r $^ -o $@ -nostdlib
125 ++ $(CC) $(ABI_FLAG) -r $^ -o $@ -nostdlib
126 +
127 + $(BUILD_DIR)/%.lo: %.c
128 + $(CC) $(PICFLAG) $(CFLAGS) $(INCS) -c $< -o $@
129 +diff -ru flint-2.5.2-orig/qadic/Makefile flint-2.5.2-new/qadic/Makefile
130 +--- flint-2.5.2-orig/qadic/Makefile 2015-08-13 18:16:22.000000000 +0200
131 ++++ flint-2.5.2-new/qadic/Makefile 2016-11-07 18:41:09.148996528 +0100
132 +@@ -35,7 +35,7 @@
133 + $(CC) $(CFLAGS) -c $(INCS) $< -o $@
134 +
135 + $(MOD_LOBJ): $(LOBJS)
136 +- $(CC) $(ABI_FLAG) -Wl,-r $^ -o $@ -nostdlib
137 ++ $(CC) $(ABI_FLAG) -r $^ -o $@ -nostdlib
138 +
139 + $(BUILD_DIR)/%.lo: %.c
140 + $(CC) $(PICFLAG) $(CFLAGS) $(INCS) -c $< -o $@
141
142 diff --git a/sci-mathematics/flint/files/flint-2.5.2-utf8.patch b/sci-mathematics/flint/files/flint-2.5.2-utf8.patch
143 new file mode 100644
144 index 00000000000..de82fc49dd3
145 --- /dev/null
146 +++ b/sci-mathematics/flint/files/flint-2.5.2-utf8.patch
147 @@ -0,0 +1,13 @@
148 +diff --git a/fmpz_mat/doc/fmpz_mat.txt b/fmpz_mat/doc/fmpz_mat.txt
149 +index 2f07624..d741899 100644
150 +--- a/fmpz_mat/doc/fmpz_mat.txt
151 ++++ b/fmpz_mat/doc/fmpz_mat.txt
152 +@@ -1114,7 +1114,7 @@ void fmpz_mat_gram(fmpz_mat_t B, const fmpz_mat_t A)
153 +
154 + Sets \code{B} to the Gram matrix of the $m$-dimensional lattice \code{L} in
155 + $n$-dimensional Euclidean space $R^n$ spanned by the rows of
156 +- the $m$ × $n$ matrix \code{A}. Dimensions must be compatible.
157 ++ the $m \times n$ matrix \code{A}. Dimensions must be compatible.
158 + \code{A} and \code{B} are allowed to be the same object if \code{A} is a
159 + square matrix.
160 +
161
162 diff --git a/sci-mathematics/flint/files/flintxx-include.patch b/sci-mathematics/flint/files/flintxx-include.patch
163 new file mode 100644
164 index 00000000000..cb6744e2364
165 --- /dev/null
166 +++ b/sci-mathematics/flint/files/flintxx-include.patch
167 @@ -0,0 +1,19 @@
168 +Fix include errors with flintxx
169 +
170 +https://github.com/wbhart/flint2/commit/c0768dc54b5ece38252857f8e7423d5ce81a43f7
171 +
172 +
173 +
174 +diff --git a/flintxx/flint_classes.h b/flintxx/flint_classes.h
175 +index eac2d1a..6baa392 100644
176 +--- a/flintxx/flint_classes.h
177 ++++ b/flintxx/flint_classes.h
178 +@@ -27,7 +27,7 @@
179 + // Contrary to other parts of this library, they are tailored very
180 + // specifically towards FLINT.
181 +
182 +-#include "flint.h"
183 ++#include "../flint.h"
184 + #include "mp.h"
185 + #include "expression.h"
186 + #include "expression_traits.h"
187
188 diff --git a/sci-mathematics/flint/flint-2.5.2-r1.ebuild b/sci-mathematics/flint/flint-2.5.2-r1.ebuild
189 new file mode 100644
190 index 00000000000..795bf6e90c6
191 --- /dev/null
192 +++ b/sci-mathematics/flint/flint-2.5.2-r1.ebuild
193 @@ -0,0 +1,74 @@
194 +# Copyright 1999-2020 Gentoo Authors
195 +# Distributed under the terms of the GNU General Public License v2
196 +
197 +EAPI=7
198 +
199 +inherit toolchain-funcs
200 +
201 +DESCRIPTION="Fast Library for Number Theory"
202 +HOMEPAGE="http://www.flintlib.org/"
203 +SRC_URI="http://www.flintlib.org/${P}.tar.gz"
204 +
205 +LICENSE="LGPL-2.1+"
206 +SLOT="0/13"
207 +KEYWORDS="~amd64 ~arm ~x86"
208 +IUSE="doc gc ntl static-libs"
209 +
210 +BDEPEND="doc? (
211 + app-text/texlive-core
212 + dev-texlive/texlive-latex
213 + dev-texlive/texlive-latexextra
214 +)"
215 +DEPEND="dev-libs/gmp:=
216 + dev-libs/mpfr:=
217 + gc? ( dev-libs/boehm-gc )
218 + ntl? ( dev-libs/ntl:= )"
219 +RDEPEND="${DEPEND}"
220 +
221 +PATCHES=(
222 + "${FILESDIR}/flintxx-include.patch"
223 + "${FILESDIR}/${PN}-2.5.2-pie.patch"
224 + "${FILESDIR}/${PN}-2.5.2-utf8.patch"
225 + "${FILESDIR}/${PN}-2.5.2-memory_message.patch"
226 +)
227 +
228 +src_prepare(){
229 + default
230 +
231 + # The autodetection finds "lib" first, which may e.g. contain 32-bit
232 + # libs during a 64-bit build.
233 + sed -e "s:{GMP_DIR}/lib\":{GMP_DIR}/$(get_libdir)\":g" \
234 + -e "s:{MPFR_DIR}/lib\":{MPFR_DIR}/$(get_libdir)\":g" \
235 + -e "s:{NTL_DIR}/lib\":{NTL_DIR}/$(get_libdir)\":g" \
236 + -e "s:{GC_DIR}/lib\":{GC_DIR}/$(get_libdir)\":g" \
237 + -i configure || die
238 +}
239 +
240 +src_configure() {
241 + ./configure \
242 + --prefix="${EPREFIX}/usr" \
243 + --with-gmp="${EPREFIX}/usr" \
244 + --with-mpfr="${EPREFIX}/usr" \
245 + $(usex ntl "--with-ntl=${EPREFIX}/usr" "") \
246 + $(use_enable static-libs static) \
247 + $(usex gc "--with-gc=${EPREFIX}/usr" "") \
248 + CC="$(tc-getCC)" \
249 + CXX="$(tc-getCXX)" \
250 + AR="$(tc-getAR)" \
251 + || die
252 +}
253 +
254 +src_compile() {
255 + emake verbose
256 + use doc && emake -C doc/latex
257 +}
258 +
259 +src_test() {
260 + emake AT= QUIET_CC= QUIET_CXX= QUIET_AR= check
261 +}
262 +
263 +src_install() {
264 + emake DESTDIR="${D}" LIBDIR="$(get_libdir)" install
265 + einstalldocs
266 + use doc && dodoc doc/latex/flint-manual.pdf
267 +}