From 4702a9175cf7028d240fb8580d1cec9509194833ebe4e748e3a7b99f1357542a Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Sun, 22 Oct 2023 04:21:04 +0000 Subject: [PATCH] - Add flint3.diff to have the build succeed with flint-3. OBS-URL: https://build.opensuse.org/package/show/science/cm?expand=0&rev=11 --- cm.changes | 5 +++++ cm.spec | 3 ++- flint3.diff | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 flint3.diff diff --git a/cm.changes b/cm.changes index 716fe3d..176c0b8 100644 --- a/cm.changes +++ b/cm.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Sun Oct 22 04:06:43 UTC 2023 - Jan Engelhardt + +- Add flint3.diff to have the build succeed with flint-3. + ------------------------------------------------------------------- Sat Jun 24 14:42:15 UTC 2023 - Jan Engelhardt diff --git a/cm.spec b/cm.spec index 693faac..f952802 100644 --- a/cm.spec +++ b/cm.spec @@ -27,7 +27,8 @@ URL: https://www.multiprecision.org/cm/ Source: http://www.multiprecision.org/downloads/%name-%version.tar.gz Source2: http://www.multiprecision.org/downloads/%name-%version.tar.gz.asc Source3: %name.keyring -BuildRequires: flint-devel +Patch1: flint3.diff +BuildRequires: flint-devel >= 3 BuildRequires: gmp-devel >= 4.3.2 BuildRequires: libtool BuildRequires: makeinfo diff --git a/flint3.diff b/flint3.diff new file mode 100644 index 0000000..6feaa0f --- /dev/null +++ b/flint3.diff @@ -0,0 +1,57 @@ +From: Jan Engelhardt +Date: 2023-10-22 06:05:56.005185292 +0200 + +Copy functions from FLINT 2.9 [13042307357192c09630d276f0e7bf2abb9ffd39] +which have been removed in FLINT 3.0. +--- + lib/flint.c | 23 +++++++++++++++++++++-- + 1 file changed, 21 insertions(+), 2 deletions(-) + +Index: cm-0.4.2/lib/flint.c +=================================================================== +--- cm-0.4.2.orig/lib/flint.c ++++ cm-0.4.2/lib/flint.c +@@ -30,6 +30,25 @@ Foundation, Inc., 59 Temple Place - Suit + /* */ + /*****************************************************************************/ + ++static void fmpz_mod_poly_get_coeff_mpz1(mpz_t x, ++ const fmpz_mod_poly_t poly, slong n, const fmpz_mod_ctx_t ctx) ++{ ++ fmpz_t t; ++ fmpz_init(t); ++ fmpz_mod_poly_get_coeff_fmpz(t, poly, n, ctx); ++ fmpz_get_mpz(x, t); ++ fmpz_clear(t); ++} ++ ++static void fmpz_mod_poly_set_coeff_mpz1(fmpz_mod_poly_t poly, ++ slong n, const mpz_t x, const fmpz_mod_ctx_t ctx) ++{ ++ fmpz_t t; ++ fmpz_init_set_readonly(t, x); ++ fmpz_mod_poly_set_coeff_fmpz(poly, n, t, ctx); ++ fmpz_clear_readonly(t); ++} ++ + void mpzx_set_fmpz_mod_poly (mpzx_ptr f, fmpz_mod_poly_t ff, + const fmpz_mod_ctx_t ctx) + { +@@ -38,7 +57,7 @@ void mpzx_set_fmpz_mod_poly (mpzx_ptr f, + deg = fmpz_mod_poly_degree (ff, ctx); + mpzx_set_deg (f, deg); + for (i = 0; i <= deg; i++) +- fmpz_mod_poly_get_coeff_mpz (f->coeff [i], ff, i, ctx); ++ fmpz_mod_poly_get_coeff_mpz1(f->coeff [i], ff, i, ctx); + } + + /*****************************************************************************/ +@@ -51,7 +70,7 @@ void fmpz_mod_poly_set_mpzx (fmpz_mod_po + deg = f->deg; + fmpz_mod_poly_realloc (ff, deg + 1, ctx); + for (i = 0; i <= deg; i++) +- fmpz_mod_poly_set_coeff_mpz (ff, i, f->coeff [i], ctx); ++ fmpz_mod_poly_set_coeff_mpz1(ff, i, f->coeff [i], ctx); + } + + #endif