From de55bc75f392eeadb0e1b5eec84058c42a9d205e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= Date: Thu, 14 Dec 2023 09:08:28 -0300 Subject: [PATCH 1/5] New package: python3-conway-polynomials-0.9 --- srcpkgs/python3-conway-polynomials/template | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 srcpkgs/python3-conway-polynomials/template diff --git a/srcpkgs/python3-conway-polynomials/template b/srcpkgs/python3-conway-polynomials/template new file mode 100644 index 00000000000000..11766521e26db7 --- /dev/null +++ b/srcpkgs/python3-conway-polynomials/template @@ -0,0 +1,16 @@ +# Template file for 'python3-conway-polynomials' +pkgname=python3-conway-polynomials +version=0.9 +revision=1 +build_style=python3-pep517 +make_check_args="--doctest-modules --doctest-glob=README.rst" +hostmakedepends="python3-setuptools python3-wheel" +depends="python3" +checkdepends="python3-pytest" +short_desc="Python interface to Frank Lübeck's Conway polynomial database" +maintainer="Gonzalo Tornaría " +license="Public Domain, GPL-3.0-or-later" +homepage="https://github.com/sagemath/conway-polynomials" +changelog="https://github.com/sagemath/conway-polynomials/raw/master/NEWS" +distfiles="${PYPI_SITE}/c/conway-polynomials/conway-polynomials-${version}.tar.gz" +checksum=6ed2300609bce79f0175d5b8546858eec02854f8be3237db8d1449ccccc1c581 From 9192a13b453c6461016f53567df4476f55a1715b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= Date: Sun, 25 Feb 2024 18:33:49 -0300 Subject: [PATCH 2/5] flintlib: update to 3.1.0. --- common/shlibs | 2 +- ...a0f98f9964c101f3bd1043dff41667f152df.patch | 22 +++++++++++++++++++ srcpkgs/flintlib/template | 6 ++--- 3 files changed, 26 insertions(+), 4 deletions(-) create mode 100644 srcpkgs/flintlib/patches/0e2fa0f98f9964c101f3bd1043dff41667f152df.patch diff --git a/common/shlibs b/common/shlibs index dfd3ae4875c93b..0fc12d648a1370 100644 --- a/common/shlibs +++ b/common/shlibs @@ -3974,7 +3974,7 @@ libgtkdatabox.so.1 gtkdatabox3-1.0.0_1 libxcvt.so.0 libxcvt-0.1.1_1 libgf2x.so.3 gf2x-1.3.0_1 libntl.so.44 ntl-11.5.1_1 -libflint.so.18 flintlib-3.0.0_1 +libflint.so.19 flintlib-3.1.0_1 libec.so.10 eclib-20220621_1 libsymmetrica.so.2 symmetrica-3.0.1_1 libLfunction.so.1 lcalc-2.0.4_1 diff --git a/srcpkgs/flintlib/patches/0e2fa0f98f9964c101f3bd1043dff41667f152df.patch b/srcpkgs/flintlib/patches/0e2fa0f98f9964c101f3bd1043dff41667f152df.patch new file mode 100644 index 00000000000000..57fb3390fa3664 --- /dev/null +++ b/srcpkgs/flintlib/patches/0e2fa0f98f9964c101f3bd1043dff41667f152df.patch @@ -0,0 +1,22 @@ +From 0e2fa0f98f9964c101f3bd1043dff41667f152df Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Albin=20Ahlb=C3=A4ck?= +Date: Tue, 27 Feb 2024 10:28:39 +0100 +Subject: [PATCH] Add padic_types.h to headers in Makefile + +Thanks to @tornaria for bringing this up +--- + Makefile.in | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/Makefile.in b/Makefile.in +index 5705f8343f..9675fc80fc 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -263,6 +263,7 @@ SINGLE_HEADERS := \ + fmpz_types.h fmpq_types.h \ + fmpz_mod_types.h fq_nmod_types.h \ + fq_zech_types.h fq_types.h \ ++ padic_types.h \ + n_poly_types.h mpoly_types.h \ + arf_types.h acf_types.h \ + arb_types.h acb_types.h \ diff --git a/srcpkgs/flintlib/template b/srcpkgs/flintlib/template index 254d18c42f5b3e..ae283a1602c6c4 100644 --- a/srcpkgs/flintlib/template +++ b/srcpkgs/flintlib/template @@ -1,9 +1,9 @@ # Template file for 'flintlib' pkgname=flintlib -version=3.0.1 +version=3.1.0 revision=1 build_style=gnu-configure -configure_args="--prefix=/usr $(vopt_with ntl) +configure_args="--prefix=/usr ax_cv_check_cflags___march_native=no $(vopt_with ntl) $(vopt_if openblas --with-blas-include=${XBPS_CROSS_BASE}/usr/include/openblas)" makedepends="mpfr-devel $(vopt_if ntl ntl-devel) $(vopt_if openblas openblas-devel)" @@ -13,7 +13,7 @@ license="LGPL-2.1-or-later" homepage="https://flintlib.org" changelog="https://raw.githubusercontent.com/wbhart/flint2/trunk/NEWS" distfiles="https://flintlib.org/flint-${version}.tar.gz" -checksum=7b311a00503a863881eb8177dbeb84322f29399f3d7d72f3b1a4c9ba1d5794b4 +checksum=b30df05fa81de49c20d460edccf8c410279d1cf8410f2d425f707b48280a2be2 build_options="ntl openblas" desc_option_ntl="enable NTL support" From c9c312fba1a59b333fc5ed72acf9b3c6c8a47ed5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= Date: Sun, 25 Feb 2024 19:08:21 -0300 Subject: [PATCH 3/5] eclib: revbump for flintlib --- srcpkgs/eclib/template | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/srcpkgs/eclib/template b/srcpkgs/eclib/template index 672e0b3a99b25d..9043aa465a9ff5 100644 --- a/srcpkgs/eclib/template +++ b/srcpkgs/eclib/template @@ -1,7 +1,7 @@ # Template file for 'eclib' pkgname=eclib version=20231212 -revision=1 +revision=2 build_style=gnu-configure configure_args="--with-flint --with-boost" makedepends="pari-devel ntl-devel flintlib-devel boost-devel" From fc4b5c1c14980bd8d3e88e3cca71d849076f84cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= Date: Mon, 26 Feb 2024 22:35:11 -0300 Subject: [PATCH 4/5] singular: patch for flintlib 3.1 --- ...599cf3baf0d4ced85ca8a2a7adf327823c43.patch | 25 +++++++++++++ ...f3b042bab767d4d359d27fd798e0b7e48179.patch | 37 +++++++++++++++++++ srcpkgs/singular/template | 4 +- srcpkgs/singular/update | 1 + 4 files changed, 65 insertions(+), 2 deletions(-) create mode 100644 srcpkgs/singular/patches/flint-3.0-bafd599cf3baf0d4ced85ca8a2a7adf327823c43.patch create mode 100644 srcpkgs/singular/patches/flint-3.1-772cf3b042bab767d4d359d27fd798e0b7e48179.patch create mode 100644 srcpkgs/singular/update diff --git a/srcpkgs/singular/patches/flint-3.0-bafd599cf3baf0d4ced85ca8a2a7adf327823c43.patch b/srcpkgs/singular/patches/flint-3.0-bafd599cf3baf0d4ced85ca8a2a7adf327823c43.patch new file mode 100644 index 00000000000000..480da5e47cf3d0 --- /dev/null +++ b/srcpkgs/singular/patches/flint-3.0-bafd599cf3baf0d4ced85ca8a2a7adf327823c43.patch @@ -0,0 +1,25 @@ +From bafd599cf3baf0d4ced85ca8a2a7adf327823c43 Mon Sep 17 00:00:00 2001 +From: Hans Schoenemann +Date: Wed, 24 Jan 2024 14:05:05 +0100 +Subject: [PATCH] more FLINT 3.0 includes + +--- + factory/FLINTconvert.h | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/factory/FLINTconvert.h b/factory/FLINTconvert.h +index ec5a56c309..3908d77fcb 100644 +--- a/factory/FLINTconvert.h ++++ b/factory/FLINTconvert.h +@@ -47,6 +47,11 @@ extern "C" + #include + #include + #endif ++#if ( __FLINT_RELEASE >= 30000) ++#include ++#include ++#include ++#endif + #endif + + EXTERN_VAR flint_rand_t FLINTrandom; diff --git a/srcpkgs/singular/patches/flint-3.1-772cf3b042bab767d4d359d27fd798e0b7e48179.patch b/srcpkgs/singular/patches/flint-3.1-772cf3b042bab767d4d359d27fd798e0b7e48179.patch new file mode 100644 index 00000000000000..0413722eee3ee1 --- /dev/null +++ b/srcpkgs/singular/patches/flint-3.1-772cf3b042bab767d4d359d27fd798e0b7e48179.patch @@ -0,0 +1,37 @@ +From 772cf3b042bab767d4d359d27fd798e0b7e48179 Mon Sep 17 00:00:00 2001 +From: Antonio Rojas +Date: Tue, 27 Feb 2024 10:03:17 +0100 +Subject: [PATCH] Fix build with flint 3.1 (#1209) + +--- + factory/cfModGcd.cc | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/factory/cfModGcd.cc b/factory/cfModGcd.cc +index 8388f8e5e2..482f55898d 100644 +--- a/factory/cfModGcd.cc ++++ b/factory/cfModGcd.cc +@@ -1806,7 +1806,11 @@ gaussianElimFq (CFMatrix& M, CFArray& L, const Variable& alpha) + fq_nmod_mat_t FLINTN; + convertFacCFMatrix2Fq_nmod_mat_t (FLINTN, ctx, *N); + // rank ++ #if __FLINT_RELEASE >= 30100 ++ long rk= fq_nmod_mat_rref (FLINTN,FLINTN,ctx); ++ #else + long rk= fq_nmod_mat_rref (FLINTN,ctx); ++ #endif + // clean up + fq_nmod_mat_clear (FLINTN,ctx); + fq_nmod_ctx_clear(ctx); +@@ -1912,7 +1916,11 @@ solveSystemFq (const CFMatrix& M, const CFArray& L, const Variable& alpha) + fq_nmod_mat_t FLINTN; + convertFacCFMatrix2Fq_nmod_mat_t (FLINTN, ctx, *N); + // rank ++ #if __FLINT_RELEASE >= 30100 ++ long rk= fq_nmod_mat_rref (FLINTN,FLINTN,ctx); ++ #else + long rk= fq_nmod_mat_rref (FLINTN,ctx); ++ #endif + #elif defined(HAVE_NTL) + int p= getCharacteristic (); + if (fac_NTL_char != p) diff --git a/srcpkgs/singular/template b/srcpkgs/singular/template index beb0e6d30118e7..d635f6cb99ff0d 100644 --- a/srcpkgs/singular/template +++ b/srcpkgs/singular/template @@ -1,7 +1,7 @@ # Template file for 'singular' pkgname=singular version=4.3.2p10 -revision=1 +revision=2 _majver=${version%p*} build_style=gnu-configure configure_args="--with-readline=ncurses @@ -16,7 +16,7 @@ configure_args="--with-readline=ncurses hostmakedepends="perl tar" makedepends="flintlib-devel cddlib-devel readline-devel" short_desc="Computer algebra system for polynomial computations" -maintainer="dkwo " +maintainer="dkwo , Gonzalo Tornaría " license="GPL-2.0-or-later" homepage="https://www.singular.uni-kl.de" distfiles="https://www.singular.uni-kl.de/ftp/pub/Math/Singular/SOURCES/${_majver//./-}/singular-${version}.tar.gz" diff --git a/srcpkgs/singular/update b/srcpkgs/singular/update new file mode 100644 index 00000000000000..5fdfcd0f668ad9 --- /dev/null +++ b/srcpkgs/singular/update @@ -0,0 +1 @@ +pattern='/archive/refs/tags/(singular|Release)?-?\K[-.p\d]+(?=\.tar\.gz")' From fa2952e9e071fb492926bee05f785496aa4c73ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= Date: Sat, 9 Dec 2023 11:21:58 -0300 Subject: [PATCH 5/5] sagemath: update to 10.3.rc0. --- srcpkgs/sagemath/files/sage_conf.py | 2 +- .../sagemath/patches/35848-flintlib_3.0.patch | 1867 ----------------- .../patches/36769-fix_jmol_detect.patch | 92 - .../patches/36862-giac_1.9.0-73.patch | 15 - ...fix_save_session_when_cython_changes.patch | 182 -- .../sagemath/patches/37123-scipy_1.12.patch | 26 - .../sagemath/patches/37484-flint_3.1.patch | 204 ++ srcpkgs/sagemath/patches/get_patches | 10 +- srcpkgs/sagemath/template | 17 +- srcpkgs/sagemath/update | 6 +- 10 files changed, 220 insertions(+), 2201 deletions(-) delete mode 100644 srcpkgs/sagemath/patches/35848-flintlib_3.0.patch delete mode 100644 srcpkgs/sagemath/patches/36769-fix_jmol_detect.patch delete mode 100644 srcpkgs/sagemath/patches/36862-giac_1.9.0-73.patch delete mode 100644 srcpkgs/sagemath/patches/37004-fix_save_session_when_cython_changes.patch delete mode 100644 srcpkgs/sagemath/patches/37123-scipy_1.12.patch create mode 100644 srcpkgs/sagemath/patches/37484-flint_3.1.patch diff --git a/srcpkgs/sagemath/files/sage_conf.py b/srcpkgs/sagemath/files/sage_conf.py index b5b2360311844e..d9ff901ac40e54 100644 --- a/srcpkgs/sagemath/files/sage_conf.py +++ b/srcpkgs/sagemath/files/sage_conf.py @@ -1,4 +1,4 @@ # configuration for sage on void linux SAGE_SHARE = "/usr/share/sagemath" -GAP_SHARE_DIR = "/usr/share/gap" JMOL_DIR = "/usr/share/jmol" +THREEJS_DIR = "/usr/share/sagemath/threejs-sage" diff --git a/srcpkgs/sagemath/patches/35848-flintlib_3.0.patch b/srcpkgs/sagemath/patches/35848-flintlib_3.0.patch deleted file mode 100644 index 2cad28134f6e6d..00000000000000 --- a/srcpkgs/sagemath/patches/35848-flintlib_3.0.patch +++ /dev/null @@ -1,1867 +0,0 @@ -diff --git a/build/pkgs/antic/SPKG.rst b/build/pkgs/antic/SPKG.rst -deleted file mode 100644 -index d6c32377957..00000000000 ---- a/build/pkgs/antic/SPKG.rst -+++ /dev/null -@@ -1,18 +0,0 @@ --antic: Algebraic Number Theory In C --=================================== -- --Description ------------- -- --Algebraic Number Theory In C -- --License --------- -- --LGPL 2.1 -- --Upstream Contact ------------------ -- --https://github.com/wbhart/antic -- -diff --git a/build/pkgs/antic/checksums.ini b/build/pkgs/antic/checksums.ini -deleted file mode 100644 -index fc8711ecd13..00000000000 ---- a/build/pkgs/antic/checksums.ini -+++ /dev/null -@@ -1,5 +0,0 @@ --tarball=antic-VERSION.tar.gz --sha1=940d8ea2c3512b9d49ee3101cf043f777764bd8f --md5=4e896420dd6344b53b307871efb2cbb4 --cksum=1938565125 --upstream_url=https://github.com/wbhart/antic/archive/refs/tags/vVERSION.tar.gz -diff --git a/build/pkgs/antic/dependencies b/build/pkgs/antic/dependencies -deleted file mode 100644 -index c95d2836ce5..00000000000 ---- a/build/pkgs/antic/dependencies -+++ /dev/null -@@ -1,4 +0,0 @@ --$(MP_LIBRARY) mpfr flint -- ------------ --All lines of this file are ignored except the first. -diff --git a/build/pkgs/antic/distros/arch.txt b/build/pkgs/antic/distros/arch.txt -deleted file mode 100644 -index 83c7cab14e4..00000000000 ---- a/build/pkgs/antic/distros/arch.txt -+++ /dev/null -@@ -1 +0,0 @@ --antic -diff --git a/build/pkgs/antic/distros/conda.txt b/build/pkgs/antic/distros/conda.txt -deleted file mode 100644 -index 83c7cab14e4..00000000000 ---- a/build/pkgs/antic/distros/conda.txt -+++ /dev/null -@@ -1 +0,0 @@ --antic -diff --git a/build/pkgs/antic/distros/debian.txt b/build/pkgs/antic/distros/debian.txt -deleted file mode 100644 -index 8fdcd3e5721..00000000000 ---- a/build/pkgs/antic/distros/debian.txt -+++ /dev/null -@@ -1 +0,0 @@ --libantic-dev -diff --git a/build/pkgs/antic/distros/fedora.txt b/build/pkgs/antic/distros/fedora.txt -deleted file mode 100644 -index 1b16da9f64b..00000000000 ---- a/build/pkgs/antic/distros/fedora.txt -+++ /dev/null -@@ -1 +0,0 @@ --antic-devel -diff --git a/build/pkgs/antic/distros/freebsd.txt b/build/pkgs/antic/distros/freebsd.txt -deleted file mode 100644 -index 116ff3a26f3..00000000000 ---- a/build/pkgs/antic/distros/freebsd.txt -+++ /dev/null -@@ -1 +0,0 @@ --math/antic -diff --git a/build/pkgs/antic/distros/opensuse.txt b/build/pkgs/antic/distros/opensuse.txt -deleted file mode 100644 -index 1b16da9f64b..00000000000 ---- a/build/pkgs/antic/distros/opensuse.txt -+++ /dev/null -@@ -1 +0,0 @@ --antic-devel -diff --git a/build/pkgs/antic/distros/repology.txt b/build/pkgs/antic/distros/repology.txt -deleted file mode 100644 -index 83c7cab14e4..00000000000 ---- a/build/pkgs/antic/distros/repology.txt -+++ /dev/null -@@ -1 +0,0 @@ --antic -diff --git a/build/pkgs/antic/package-version.txt b/build/pkgs/antic/package-version.txt -deleted file mode 100644 -index 3a4036fb450..00000000000 ---- a/build/pkgs/antic/package-version.txt -+++ /dev/null -@@ -1 +0,0 @@ --0.2.5 -diff --git a/build/pkgs/antic/spkg-install.in b/build/pkgs/antic/spkg-install.in -deleted file mode 100644 -index c57fa884a20..00000000000 ---- a/build/pkgs/antic/spkg-install.in -+++ /dev/null -@@ -1,19 +0,0 @@ --cd src -- --# Copied from build/pkgs/flint/spkg-install.in: --# Trac #29607: We must always supply --with-gmp, --with-mpfr, --# --with-ntl because otherwise FLINT's configure script uses --# /usr/local, which is always wrong. --# This is why we do not use $SAGE_CONFIGURE_GMP etc. here. --# The value $SAGE_LOCAL is always a safe choice even if the library --# is coming from the system and is found using what is in --# LIBRARY_PATH or LDFLAGS etc. --./configure \ -- --disable-static \ -- --prefix="$SAGE_LOCAL" \ -- --with-gmp="$SAGE_LOCAL" \ -- --with-mpfr="$SAGE_LOCAL" \ -- --with-flint="$SAGE_LOCAL" || sdh_die "Error: Failed to configure antic." -- --sdh_make verbose --sdh_make_install -diff --git a/build/pkgs/antic/type b/build/pkgs/antic/type -deleted file mode 100644 -index 134d9bc32d5..00000000000 ---- a/build/pkgs/antic/type -+++ /dev/null -@@ -1 +0,0 @@ --optional -diff --git a/build/pkgs/arb/SPKG.rst b/build/pkgs/arb/SPKG.rst -deleted file mode 100644 -index cff49ddb95b..00000000000 ---- a/build/pkgs/arb/SPKG.rst -+++ /dev/null -@@ -1,27 +0,0 @@ --arb: Arbitrary-precision floating-point ball arithmetic --======================================================= -- --Description ------------- -- --Arb is a C library for arbitrary-precision floating-point ball --arithmetic, developed by Fredrik Johansson --(fredrik.johansson@gmail.com). It supports efficient high-precision --computation with polynomials, power series, matrices and special --functions over the real and complex numbers, with automatic, rigorous --error control. -- --License --------- -- --GNU General Public License v2+ -- -- --Upstream Contact ------------------ -- -- - Fredrik Johansson: fredrik.johansson@gmail.com -- -- - https://arblib.org/ -- -- - http://github.com/fredrik-johansson/arb/ -diff --git a/build/pkgs/arb/checksums.ini b/build/pkgs/arb/checksums.ini -deleted file mode 100644 -index 80ef43dad5d..00000000000 ---- a/build/pkgs/arb/checksums.ini -+++ /dev/null -@@ -1,5 +0,0 @@ --tarball=arb-VERSION.tar.gz --sha1=a1efe035dd3af3613dd685971a156f652b86ff63 --md5=9b369e29f93cdf2d4f90b57a92526cce --cksum=64252121 --upstream_url=https://github.com/fredrik-johansson/arb/archive/VERSION.tar.gz -diff --git a/build/pkgs/arb/dependencies b/build/pkgs/arb/dependencies -deleted file mode 100644 -index c95d2836ce5..00000000000 ---- a/build/pkgs/arb/dependencies -+++ /dev/null -@@ -1,4 +0,0 @@ --$(MP_LIBRARY) mpfr flint -- ------------ --All lines of this file are ignored except the first. -diff --git a/build/pkgs/arb/distros/arch.txt b/build/pkgs/arb/distros/arch.txt -deleted file mode 100644 -index 86c41dbaa5f..00000000000 ---- a/build/pkgs/arb/distros/arch.txt -+++ /dev/null -@@ -1 +0,0 @@ --arb -diff --git a/build/pkgs/arb/distros/conda.txt b/build/pkgs/arb/distros/conda.txt -deleted file mode 100644 -index 86c41dbaa5f..00000000000 ---- a/build/pkgs/arb/distros/conda.txt -+++ /dev/null -@@ -1 +0,0 @@ --arb -diff --git a/build/pkgs/arb/distros/debian.txt b/build/pkgs/arb/distros/debian.txt -deleted file mode 100644 -index 9fe71110712..00000000000 ---- a/build/pkgs/arb/distros/debian.txt -+++ /dev/null -@@ -1 +0,0 @@ --libflint-arb-dev -diff --git a/build/pkgs/arb/distros/fedora.txt b/build/pkgs/arb/distros/fedora.txt -deleted file mode 100644 -index 76794404627..00000000000 ---- a/build/pkgs/arb/distros/fedora.txt -+++ /dev/null -@@ -1 +0,0 @@ --arb arb-devel -diff --git a/build/pkgs/arb/distros/freebsd.txt b/build/pkgs/arb/distros/freebsd.txt -deleted file mode 100644 -index 2ef8c7cec0f..00000000000 ---- a/build/pkgs/arb/distros/freebsd.txt -+++ /dev/null -@@ -1 +0,0 @@ --math/arb -diff --git a/build/pkgs/arb/distros/gentoo.txt b/build/pkgs/arb/distros/gentoo.txt -deleted file mode 100644 -index 58e3d4f8008..00000000000 ---- a/build/pkgs/arb/distros/gentoo.txt -+++ /dev/null -@@ -1 +0,0 @@ --sci-mathematics/arb -diff --git a/build/pkgs/arb/distros/homebrew.txt b/build/pkgs/arb/distros/homebrew.txt -deleted file mode 100644 -index 86c41dbaa5f..00000000000 ---- a/build/pkgs/arb/distros/homebrew.txt -+++ /dev/null -@@ -1 +0,0 @@ --arb -diff --git a/build/pkgs/arb/distros/nix.txt b/build/pkgs/arb/distros/nix.txt -deleted file mode 100644 -index 86c41dbaa5f..00000000000 ---- a/build/pkgs/arb/distros/nix.txt -+++ /dev/null -@@ -1 +0,0 @@ --arb -diff --git a/build/pkgs/arb/distros/opensuse.txt b/build/pkgs/arb/distros/opensuse.txt -deleted file mode 100644 -index 3319855150c..00000000000 ---- a/build/pkgs/arb/distros/opensuse.txt -+++ /dev/null -@@ -1 +0,0 @@ --arb-devel -diff --git a/build/pkgs/arb/distros/repology.txt b/build/pkgs/arb/distros/repology.txt -deleted file mode 100644 -index 179c9d507e1..00000000000 ---- a/build/pkgs/arb/distros/repology.txt -+++ /dev/null -@@ -1 +0,0 @@ --arb-fp -diff --git a/build/pkgs/arb/distros/void.txt b/build/pkgs/arb/distros/void.txt -deleted file mode 100644 -index 3319855150c..00000000000 ---- a/build/pkgs/arb/distros/void.txt -+++ /dev/null -@@ -1 +0,0 @@ --arb-devel -diff --git a/build/pkgs/arb/package-version.txt b/build/pkgs/arb/package-version.txt -deleted file mode 100644 -index e9763f6bfed..00000000000 ---- a/build/pkgs/arb/package-version.txt -+++ /dev/null -@@ -1 +0,0 @@ --2.23.0 -diff --git a/build/pkgs/arb/spkg-check.in b/build/pkgs/arb/spkg-check.in -deleted file mode 100644 -index 27cd9419538..00000000000 ---- a/build/pkgs/arb/spkg-check.in -+++ /dev/null -@@ -1,2 +0,0 @@ --cd src --$MAKE check -diff --git a/build/pkgs/arb/spkg-configure.m4 b/build/pkgs/arb/spkg-configure.m4 -deleted file mode 100644 -index ef2dd0aac4a..00000000000 ---- a/build/pkgs/arb/spkg-configure.m4 -+++ /dev/null -@@ -1,23 +0,0 @@ --SAGE_SPKG_CONFIGURE([arb], [ -- AC_REQUIRE([SAGE_SPKG_CONFIGURE_FLINT]) -- SAGE_ARB_LIBRARY="arb" -- AC_MSG_CHECKING([installing flint? ]) -- if test x$sage_spkg_install_flint = xyes; then -- AC_MSG_RESULT([yes; install arb as well]) -- sage_spkg_install_arb=yes -- else -- AC_CHECK_HEADER(arb.h, [ -- dnl below function added in version 2.16 of arb -- AC_CHECK_LIB([arb], [acb_mat_eig_simple], [], -- [dnl in Debian the name of dylib is different. -- AC_CHECK_LIB([flint-arb], [acb_mat_eig_simple], -- [SAGE_ARB_LIBRARY="flint-arb"], [sage_spkg_install_arb=yes])]) -- ], [sage_spkg_install_arb=yes]) -- fi --], [], [], [ -- if test x$sage_spkg_install_arb = xyes; then -- AC_SUBST(SAGE_ARB_LIBRARY,["arb"]) -- else -- AC_SUBST(SAGE_ARB_LIBRARY,[$SAGE_ARB_LIBRARY]) -- fi --]) -diff --git a/build/pkgs/arb/spkg-install.in b/build/pkgs/arb/spkg-install.in -deleted file mode 100644 -index 9322f04c912..00000000000 ---- a/build/pkgs/arb/spkg-install.in -+++ /dev/null -@@ -1,17 +0,0 @@ --cd src -- --# Trac #29607: We must always supply --with-gmp, --with-mpfr, --# --with-flint because otherwise ARB's configure script uses --# /usr/local, which is always wrong. --# This is why we do not use $SAGE_CONFIGURE_GMP etc. here. --# The value $SAGE_LOCAL is always a safe choice even if the library --# is coming from the system and is found using what is in --# LIBRARY_PATH or LDFLAGS etc. --./configure --disable-static --prefix="$SAGE_LOCAL" \ -- --with-gmp="$SAGE_LOCAL" \ -- --with-mpfr="$SAGE_LOCAL" \ -- --with-flint="$SAGE_LOCAL" || \ -- sdh_die "Error configuring arb." -- --sdh_make verbose --sdh_make_install -diff --git a/build/pkgs/arb/type b/build/pkgs/arb/type -deleted file mode 100644 -index a6a7b9cd726..00000000000 ---- a/build/pkgs/arb/type -+++ /dev/null -@@ -1 +0,0 @@ --standard -diff --git a/build/pkgs/e_antic/dependencies b/build/pkgs/e_antic/dependencies -index fea1ffbda45..8e977a55c13 100644 ---- a/build/pkgs/e_antic/dependencies -+++ b/build/pkgs/e_antic/dependencies -@@ -1,4 +1,4 @@ --$(MP_LIBRARY) flint arb antic boost_cropped -+$(MP_LIBRARY) flint boost_cropped - - ---------- - All lines of this file are ignored except the first. -diff --git a/build/pkgs/flint/SPKG.rst b/build/pkgs/flint/SPKG.rst -index f91de70d1ff..d9dcea0903b 100644 ---- a/build/pkgs/flint/SPKG.rst -+++ b/build/pkgs/flint/SPKG.rst -@@ -4,8 +4,8 @@ flint: Fast Library for Number Theory - Description - ----------- - --FLINT is a C library for doing number theory, maintained by William --Hart. -+FLINT is a C library for doing number theory, maintained by -+Fredrik Johansson. - - Website: http://www.flintlib.org - -@@ -20,4 +20,4 @@ Upstream Contact - - - flint-devel Gougle Group - (http://groups.google.co.uk/group/flint-devel) --- William Hart -+- Fredrik Johansson -diff --git a/build/pkgs/flint/checksums.ini b/build/pkgs/flint/checksums.ini -index 3d449d98064..ab836606657 100644 ---- a/build/pkgs/flint/checksums.ini -+++ b/build/pkgs/flint/checksums.ini -@@ -1,5 +1,5 @@ - tarball=flint-VERSION.tar.gz --sha1=63d90f8242c8f8ab4011fbcfb44b86c154f43abd --md5=c2d3cec326438f159a530c66eb07fafe --cksum=4244948341 --upstream_url=http://flintlib.org/flint-VERSION.tar.gz -+sha1=65be9297c06edd7e24f20874b7bd6130cee56723 -+md5=5189f67b0ec12e4a54d6782851642b81 -+cksum=172350473 -+upstream_url=https://github.com/flintlib/flint/releases/download/vVERSION/flint-VERSION.tar.gz -diff --git a/build/pkgs/flint/dependencies b/build/pkgs/flint/dependencies -index 385df4faa7d..1108dc4fb21 100644 ---- a/build/pkgs/flint/dependencies -+++ b/build/pkgs/flint/dependencies -@@ -1,4 +1,4 @@ --$(MP_LIBRARY) mpfr ntl -+$(MP_LIBRARY) mpfr - - ---------- - All lines of this file are ignored except the first. -diff --git a/build/pkgs/flint/package-version.txt b/build/pkgs/flint/package-version.txt -index c8e38b61405..cb2b00e4f7a 100644 ---- a/build/pkgs/flint/package-version.txt -+++ b/build/pkgs/flint/package-version.txt -@@ -1 +1 @@ --2.9.0 -+3.0.1 -diff --git a/build/pkgs/flint/patches/0001-Makefile.in-fix-handling-of-DESTDIR.patch b/build/pkgs/flint/patches/0001-Makefile.in-fix-handling-of-DESTDIR.patch -new file mode 100644 -index 00000000000..48a32f5d894 ---- /dev/null -+++ b/build/pkgs/flint/patches/0001-Makefile.in-fix-handling-of-DESTDIR.patch -@@ -0,0 +1,106 @@ -+From 54277f054f13254898c9a57c2c7eb869877e1252 Mon Sep 17 00:00:00 2001 -+From: Marc Mezzarobba -+Date: Mon, 13 Nov 2023 10:23:54 +0100 -+Subject: [PATCH] Makefile.in: fix handling of $DESTDIR -+ -+--- -+ Makefile.in | 54 ++++++++++++++++++++++++++--------------------------- -+ 1 file changed, 27 insertions(+), 27 deletions(-) -+ -+diff --git a/Makefile.in b/Makefile.in -+index 08db6837c..2827b9da1 100644 -+--- a/Makefile.in -++++ b/Makefile.in -+@@ -34,9 +34,9 @@ FLINT_SOLIB:=@FLINT_SOLIB@ -+ prefix:=@prefix@ -+ exec_prefix:=@exec_prefix@ -+ -+-INCLUDEDIR:=$(DESTDIR)@includedir@ -+-LIBDIR:=$(DESTDIR)@libdir@ -+-BINDIR:=$(DESTDIR)@bindir@ -++INCLUDEDIR:=@includedir@ -++LIBDIR:=@libdir@ -++BINDIR:=@bindir@ -+ PKGCONFIGDIR:=$(LIBDIR)/pkgconfig -+ -+ HOST_OS:=@host_os@ -+@@ -202,10 +202,10 @@ BUILD_DIRS += \ -+ endif -+ -+ INSTALL_DIRS := \ -+- $(LIBDIR) $(INCLUDEDIR)/flint \ -+- $(PKGCONFIGDIR) -++ $(DESTDIR)$(LIBDIR) $(DESTDIR)$(INCLUDEDIR)/flint \ -++ $(DESTDIR)$(PKGCONFIGDIR) -+ ifneq ($(FLINT_DLLLIB),0) -+-INSTALL_DIRS += $(BINDIR) -++INSTALL_DIRS += $(DESTDIR)$(BINDIR) -+ endif -+ -+ ################################################################################ -+@@ -722,41 +722,41 @@ distclean: clean -+ ################################################################################ -+ -+ install: library | $(INSTALL_DIRS) -+- $(CP) flint.pc $(PKGCONFIGDIR)/flint.pc -++ $(CP) flint.pc $(DESTDIR)$(PKGCONFIGDIR)/flint.pc -+ ifneq ($(SHARED), 0) -+ ifneq ($(FLINT_DLLLIB),0) -+- $(CP_A) $(FLINT_DIR)/$(FLINT_LIB) $(BINDIR) -+- $(CP_A) $(FLINT_DIR)/$(FLINT_LIB_MAJOR) $(BINDIR) -+- $(CP_A) $(FLINT_DIR)/$(FLINT_LIB_FULL) $(BINDIR) -+- $(CP) $(FLINT_DIR)/$(FLINT_IMPLIB) $(LIBDIR) -++ $(CP_A) $(FLINT_DIR)/$(FLINT_LIB) $(DESTDIR)$(BINDIR) -++ $(CP_A) $(FLINT_DIR)/$(FLINT_LIB_MAJOR) $(DESTDIR)$(BINDIR) -++ $(CP_A) $(FLINT_DIR)/$(FLINT_LIB_FULL) $(DESTDIR)$(BINDIR) -++ $(CP) $(FLINT_DIR)/$(FLINT_IMPLIB) $(DESTDIR)$(LIBDIR) -+ else -+- $(CP_A) $(FLINT_DIR)/$(FLINT_LIB) $(LIBDIR) -+- $(CP_A) $(FLINT_DIR)/$(FLINT_LIB_MAJOR) $(LIBDIR) -+- $(CP_A) $(FLINT_DIR)/$(FLINT_LIB_FULL) $(LIBDIR) -++ $(CP_A) $(FLINT_DIR)/$(FLINT_LIB) $(DESTDIR)$(LIBDIR) -++ $(CP_A) $(FLINT_DIR)/$(FLINT_LIB_MAJOR) $(DESTDIR)$(LIBDIR) -++ $(CP_A) $(FLINT_DIR)/$(FLINT_LIB_FULL) $(DESTDIR)$(LIBDIR) -+ endif -+ ifneq ($(FLINT_DYLIB),0) -+- install_name_tool -id $(LIBDIR)/$(FLINT_LIB_FULL) $(LIBDIR)/$(FLINT_LIB) -++ install_name_tool -id $(LIBDIR)/$(FLINT_LIB_FULL) $(DESTDIR)$(LIBDIR)/$(FLINT_LIB) -+ endif -+ endif -+ ifneq ($(STATIC), 0) -+- $(CP) $(FLINT_DIR)/$(FLINT_LIB_STATIC) $(LIBDIR) -++ $(CP) $(FLINT_DIR)/$(FLINT_LIB_STATIC) $(DESTDIR)$(LIBDIR) -+ endif -+- $(CP) $(HEADERS) $(INCLUDEDIR)/flint -++ $(CP) $(HEADERS) $(DESTDIR)$(INCLUDEDIR)/flint -+ -+ uninstall: -+- $(RM_F) $(PKGCONFIGDIR)/flint.pc -++ $(RM_F) $(DESTDIR)$(PKGCONFIGDIR)/flint.pc -+ ifneq ($(FLINT_DLLLIB),0) -+- $(RM_F) $(BINDIR)/$(FLINT_LIB) -+- $(RM_F) $(BINDIR)/$(FLINT_LIB_MAJOR) -+- $(RM_F) $(BINDIR)/$(FLINT_LIB_FULL) -+- $(RM_F) $(LIBDIR)/$(FLINT_IMPLIB) -++ $(RM_F) $(DESTDIR)$(BINDIR)/$(FLINT_LIB) -++ $(RM_F) $(DESTDIR)$(BINDIR)/$(FLINT_LIB_MAJOR) -++ $(RM_F) $(DESTDIR)$(BINDIR)/$(FLINT_LIB_FULL) -++ $(RM_F) $(DESTDIR)$(LIBDIR)/$(FLINT_IMPLIB) -+ else -+- $(RM_F) $(LIBDIR)/$(FLINT_LIB) -+- $(RM_F) $(LIBDIR)/$(FLINT_LIB_MAJOR) -+- $(RM_F) $(LIBDIR)/$(FLINT_LIB_FULL) -++ $(RM_F) $(DESTDIR)$(LIBDIR)/$(FLINT_LIB) -++ $(RM_F) $(DESTDIR)$(LIBDIR)/$(FLINT_LIB_MAJOR) -++ $(RM_F) $(DESTDIR)$(LIBDIR)/$(FLINT_LIB_FULL) -+ endif -+- $(RM_F) $(LIBDIR)/$(FLINT_LIB_STATIC) -+- $(RM_RF) $(INCLUDEDIR)/flint -++ $(RM_F) $(DESTDIR)$(LIBDIR)/$(FLINT_LIB_STATIC) -++ $(RM_RF) $(DESTDIR)$(INCLUDEDIR)/flint -+ -+ ################################################################################ -+ # maintainer stuff -+-- -+2.42.0 -+ -diff --git a/build/pkgs/flint/spkg-build.in b/build/pkgs/flint/spkg-build.in -new file mode 100644 -index 00000000000..ffb822c8a97 ---- /dev/null -+++ b/build/pkgs/flint/spkg-build.in -@@ -0,0 +1,3 @@ -+cd src -+sdh_configure -+sdh_make -diff --git a/build/pkgs/flint/spkg-configure.m4 b/build/pkgs/flint/spkg-configure.m4 -index a58108c9d6e..9576e4cc1e9 100644 ---- a/build/pkgs/flint/spkg-configure.m4 -+++ b/build/pkgs/flint/spkg-configure.m4 -@@ -1,25 +1,8 @@ - SAGE_SPKG_CONFIGURE([flint], [ -- SAGE_SPKG_DEPCHECK([mpfr ntl], [ -+ SAGE_SPKG_DEPCHECK([mpfr], [ - AC_CHECK_HEADER(flint/flint.h, [ -- dnl flint_parallel_binary_splitting appears in Flint 2.9.0, needed by arb 2.23 -- AC_SEARCH_LIBS([flint_parallel_binary_splitting], [flint], [ -- dnl check that NTL is linked in -- AC_SEARCH_LIBS([fmpz_poly_get_ZZX], [flint], [ -- -- AC_MSG_CHECKING([that GC is not enabled in Flint... ]) -- AC_RUN_IFELSE([ -- AC_LANG_PROGRAM([[#include ]], [ -- [#ifdef HAVE_GC] -- [return HAVE_GC;] -- [#else] -- [return 0;] -- [#endif]])], -- [AC_MSG_RESULT([GC not enabled. Good.])], -- [AC_MSG_RESULT([GC enabled. Incompatible with Sage.]) -- sage_spkg_install_flint=yes], -- [AC_MSG_RESULT(["cross compiling. assuming GC is not enabled"])]) -- ], [sage_spkg_install_flint=yes]) -- ], [sage_spkg_install_flint=yes]) -+ dnl gr_get_fexpr appears in Flint 3.0 -+ AC_SEARCH_LIBS([gr_get_fexpr], [flint], [], [sage_spkg_install_flint=yes]) - ], [sage_spkg_install_flint=yes]) - ]) - ], [], [], [ -diff --git a/build/pkgs/flint/spkg-install.in b/build/pkgs/flint/spkg-install.in -index eacd7b6e491..3ea8c053669 100644 ---- a/build/pkgs/flint/spkg-install.in -+++ b/build/pkgs/flint/spkg-install.in -@@ -1,36 +1,2 @@ --############################################################################### --# --# FLINT Sage install script --# --############################################################################### --if [ "$SAGE_DEBUG" = "yes" ]; then -- echo "Building a debug version of FLINT." -- FLINT_TUNE=" $FLINT_TUNE"; export FLINT_TUNE -- FLINT_CONFIGURE="--enable-assert $FLINT_CONFIGURE" --fi -- - cd src -- --echo "Configuring FLINT." --# Trac #29607: We must always supply --with-gmp, --with-mpfr, --# --with-ntl because otherwise FLINT's configure script uses --# /usr/local, which is always wrong. --# This is why we do not use $SAGE_CONFIGURE_GMP etc. here. --# The value $SAGE_LOCAL is always a safe choice even if the library --# is coming from the system and is found using what is in --# LIBRARY_PATH or LDFLAGS etc. --./configure \ -- --disable-static \ -- --prefix="$SAGE_LOCAL" \ -- --with-gmp="$SAGE_LOCAL" \ -- --with-mpfr="$SAGE_LOCAL" \ -- --with-ntl="$SAGE_LOCAL" \ -- $FLINT_CONFIGURE || sdh_die "Error: Failed to configure FLINT." -- --sdh_make verbose -- --echo "Deleting old FLINT files." --rm -f $SAGE_LOCAL/lib/libflint* --rm -rf $SAGE_LOCAL/include/flint -- - sdh_make_install -diff --git a/build/pkgs/gmp/spkg-configure.m4 b/build/pkgs/gmp/spkg-configure.m4 -index 61d7c5f3b2f..4000200db2c 100644 ---- a/build/pkgs/gmp/spkg-configure.m4 -+++ b/build/pkgs/gmp/spkg-configure.m4 -@@ -2,8 +2,10 @@ SAGE_SPKG_CONFIGURE([gmp], [ - sage_spkg_install_gmp=no - AC_CHECK_HEADER(gmp.h, [], [sage_spkg_install_gmp=yes]) - AC_CHECK_HEADER(gmpxx.h, [], [sage_spkg_install_gmp=yes]) -- dnl mpq_cmp_z appeared in GMP 6.1.0 and is used by pynac -- AC_SEARCH_LIBS([__gmpq_cmp_z], [gmp], [], -+ dnl mpn_gcd_11 appeared in GMP 6.2.1 -+ dnl It is undocumented but is used by Flint when built with default -+ dnl flags. -+ AC_SEARCH_LIBS([__gmpn_gcd_11], [gmp], [], - [sage_spkg_install_gmp=yes]) - ], [], [], [ - if test x$sage_spkg_install_gmp = xyes; then -diff --git a/build/pkgs/msolve/patches/0001-Make-msolve-build-with-flint3.patch b/build/pkgs/msolve/patches/0001-Make-msolve-build-with-flint3.patch -new file mode 100644 -index 00000000000..27a642a13b0 ---- /dev/null -+++ b/build/pkgs/msolve/patches/0001-Make-msolve-build-with-flint3.patch -@@ -0,0 +1,53 @@ -+From fe730579476de0b2d4181a38efa7f63dff9c81d7 Mon Sep 17 00:00:00 2001 -+From: Marc Mezzarobba -+Date: Tue, 12 Sep 2023 08:23:08 +0200 -+Subject: [PATCH] Make msolve build with flint3 -+ -+--- -+ src/fglm/berlekamp_massey.c | 3 +++ -+ src/fglm/data_fglm.c | 7 +++++-- -+ 2 files changed, 8 insertions(+), 2 deletions(-) -+ -+diff --git a/src/fglm/berlekamp_massey.c b/src/fglm/berlekamp_massey.c -+index b0f2052..998af1c 100644 -+--- a/src/fglm/berlekamp_massey.c -++++ b/src/fglm/berlekamp_massey.c -+@@ -30,6 +30,9 @@ -+ */ -+ -+ #include -++#if __FLINT_VERSION >= 3 -++# include -++#endif -+ //#include "nmod_poly.h" -+ //#include "mpn_extras.h" -+ -+diff --git a/src/fglm/data_fglm.c b/src/fglm/data_fglm.c -+index 0726760..0e1da6f 100644 -+--- a/src/fglm/data_fglm.c -++++ b/src/fglm/data_fglm.c -+@@ -24,6 +24,7 @@ -+ #include -+ #include -+ #include -++#include -+ -+ -+ typedef uint32_t szmat_t; -+@@ -299,9 +300,11 @@ static inline void nmod_poly_set_prime(nmod_poly_t poly, -+ mp_limb_t ninv = n_preinvert_limb(prime); -+ poly->mod.n = prime; -+ poly->mod.ninv = ninv; -++#if __FLINT_VERSION < 3 -+ count_leading_zeros(poly->mod.norm, prime); -+- /* poly->mod.norm = flint_clz(prime); */ -+- -++#else -++ poly->mod.norm = flint_clz(prime); -++#endif -+ } -+ -+ static inline void fglm_param_set_prime(param_t *param, mp_limb_t prime){ -+-- -+2.40.1 -+ -diff --git a/build/pkgs/sagelib/dependencies b/build/pkgs/sagelib/dependencies -index 5dc2efe1d31..fa6e98df7db 100644 ---- a/build/pkgs/sagelib/dependencies -+++ b/build/pkgs/sagelib/dependencies -@@ -1,4 +1,4 @@ --FORCE $(SCRIPTS) arb boost_cropped $(BLAS) brial cliquer cypari cysignals cython ecl eclib ecm flint libgd gap giac givaro glpk gmpy2 gsl iml importlib_metadata importlib_resources jupyter_core lcalc lrcalc_python libbraiding libhomfly libpng linbox m4ri m4rie memory_allocator mpc mpfi mpfr $(MP_LIBRARY) ntl numpy pari pip pkgconfig planarity ppl pplpy primesieve primecount primecountpy pycygwin $(PYTHON) requests rw sage_conf singular symmetrica typing_extensions $(PCFILES) | $(PYTHON_TOOLCHAIN) sage_setup $(PYTHON) pythran -+FORCE $(SCRIPTS) boost_cropped $(BLAS) brial cliquer cypari cysignals cython ecl eclib ecm flint libgd gap giac givaro glpk gmpy2 gsl iml importlib_metadata importlib_resources jupyter_core lcalc lrcalc_python libbraiding libhomfly libpng linbox m4ri m4rie memory_allocator mpc mpfi mpfr $(MP_LIBRARY) ntl numpy pari pip pkgconfig planarity ppl pplpy primesieve primecount primecountpy pycygwin $(PYTHON) requests rw sage_conf singular symmetrica typing_extensions $(PCFILES) | $(PYTHON_TOOLCHAIN) sage_setup $(PYTHON) pythran - - ---------- - All lines of this file are ignored except the first. -diff --git a/build/pkgs/symengine/dependencies b/build/pkgs/symengine/dependencies -index 1fc34963eda..7795d486018 100644 ---- a/build/pkgs/symengine/dependencies -+++ b/build/pkgs/symengine/dependencies -@@ -1,4 +1,4 @@ --$(MP_LIBRARY) arb ecm flint mpc mpfr | cmake -+$(MP_LIBRARY) ecm flint mpc mpfr | cmake - - ---------- - All lines of this file are ignored except the first. -diff --git a/pkgs/sage-conf/_sage_conf/_conf.py.in b/pkgs/sage-conf/_sage_conf/_conf.py.in -index 87b27ca05cb..895d6572d1e 100644 ---- a/pkgs/sage-conf/_sage_conf/_conf.py.in -+++ b/pkgs/sage-conf/_sage_conf/_conf.py.in -@@ -19,8 +19,6 @@ MAXIMA_FAS = "@SAGE_MAXIMA_FAS@".replace('${prefix}', SAGE_LOCAL) - # Delete this line if your ECL can load Kenzo without further prodding. - KENZO_FAS = "@SAGE_KENZO_FAS@".replace('${prefix}', SAGE_LOCAL) - --ARB_LIBRARY = "@SAGE_ARB_LIBRARY@" -- - NTL_INCDIR = "@NTL_INCDIR@" - NTL_LIBDIR = "@NTL_LIBDIR@" - -diff --git a/src/sage/env.py b/src/sage/env.py -index 4515e90e912..9ab6b1e1864 100644 ---- a/src/sage/env.py -+++ b/src/sage/env.py -@@ -223,7 +223,6 @@ def var(key: str, *fallbacks: Optional[str], force: bool = False) -> Optional[st - FOURTITWO_PPI = var("FOURTITWO_PPI") - FOURTITWO_CIRCUITS = var("FOURTITWO_CIRCUITS") - FOURTITWO_GROEBNER = var("FOURTITWO_GROEBNER") --ARB_LIBRARY = var("ARB_LIBRARY", "arb") - CBLAS_PC_MODULES = var("CBLAS_PC_MODULES", "cblas:openblas:blas") - ECL_CONFIG = var("ECL_CONFIG", "ecl-config") - NTL_INCDIR = var("NTL_INCDIR") -@@ -356,8 +355,7 @@ def cython_aliases(required_modules=None, - sage: cython_aliases() - {...} - sage: sorted(cython_aliases().keys()) -- ['ARB_LIBRARY', -- 'CBLAS_CFLAGS', -+ ['CBLAS_CFLAGS', - ..., - 'ZLIB_LIBRARIES'] - sage: cython_aliases(required_modules=('module-that-is-assumed-to-not-exist')) -@@ -475,8 +473,6 @@ def uname_specific(name, value, alternative): - if "LINBOX_CFLAGS" in aliases: - aliases["LINBOX_CFLAGS"].append("-std=gnu++11") - -- aliases["ARB_LIBRARY"] = ARB_LIBRARY -- - # TODO: Remove Cygwin hack by installing a suitable cblas.pc - if os.path.exists('/usr/lib/libblas.dll.a'): - aliases["CBLAS_LIBS"] = ['gslcblas'] -diff --git a/src/sage/features/sagemath.py b/src/sage/features/sagemath.py -index bc34d35dd1c..4097d3512b9 100644 ---- a/src/sage/features/sagemath.py -+++ b/src/sage/features/sagemath.py -@@ -777,7 +777,7 @@ class sage__rings__number_field(JoinFeature): - A :class:`~sage.features.Feature` describing the presence of :mod:`sage.rings.number_field`. - - Number fields are implemented in Sage using a complicated mixture of various libraries, -- including :ref:`arb `, :ref:`FLINT `, :ref:`GAP `, -+ including :ref:`FLINT `, :ref:`GAP `, - :ref:`MPFI `, :ref:`NTL `, and :ref:`PARI `. - - EXAMPLES: -diff --git a/src/sage/libs/arb/acb.pxd b/src/sage/libs/arb/acb.pxd -index 5148dc43991..851488d803a 100644 ---- a/src/sage/libs/arb/acb.pxd -+++ b/src/sage/libs/arb/acb.pxd -@@ -1,4 +1,4 @@ --# distutils: libraries = gmp flint ARB_LIBRARY -+# distutils: libraries = gmp flint - # distutils: depends = acb.h - - from sage.libs.arb.types cimport * -@@ -152,10 +152,6 @@ cdef extern from "arb_wrap.h": - void acb_sech(acb_t s, const acb_t z, long prec) - void acb_csch(acb_t c, const acb_t z, long prec) - -- void acb_rising_ui_bs(acb_t z, const acb_t x, unsigned long n, long prec) -- void acb_rising_ui_rs(acb_t z, const acb_t x, unsigned long n, unsigned long step, long prec) -- void acb_rising_ui_rec(acb_t z, const acb_t x, unsigned long n, long prec) -- void acb_rising_ui(acb_t z, const acb_t x, unsigned long n, long prec) - void acb_rising(acb_t z, const acb_t x, const acb_t n, long prec) - - void acb_gamma(acb_t y, const acb_t x, long prec) -diff --git a/src/sage/libs/arb/acb_calc.pxd b/src/sage/libs/arb/acb_calc.pxd -index a5dbf360b5e..67bd2ed57dc 100644 ---- a/src/sage/libs/arb/acb_calc.pxd -+++ b/src/sage/libs/arb/acb_calc.pxd -@@ -1,4 +1,4 @@ --# distutils: libraries = gmp flint ARB_LIBRARY -+# distutils: libraries = gmp flint - # distutils: depends = acb_calc.h - - from sage.libs.arb.types cimport * -diff --git a/src/sage/libs/arb/acb_elliptic.pxd b/src/sage/libs/arb/acb_elliptic.pxd -index 176f68df00e..e3480e9f73b 100644 ---- a/src/sage/libs/arb/acb_elliptic.pxd -+++ b/src/sage/libs/arb/acb_elliptic.pxd -@@ -1,4 +1,4 @@ --# distutils: libraries = gmp flint ARB_LIBRARY -+# distutils: libraries = gmp flint - # distutils: depends = acb_elliptic.h - - from sage.libs.arb.types cimport * -diff --git a/src/sage/libs/arb/acb_hypgeom.pxd b/src/sage/libs/arb/acb_hypgeom.pxd -index 418e766f10d..c43e5c0623b 100644 ---- a/src/sage/libs/arb/acb_hypgeom.pxd -+++ b/src/sage/libs/arb/acb_hypgeom.pxd -@@ -1,4 +1,4 @@ --# distutils: libraries = gmp flint ARB_LIBRARY -+# distutils: libraries = gmp flint - # distutils: depends = acb_hypgeom.h - - from sage.libs.arb.types cimport * -diff --git a/src/sage/libs/arb/acb_modular.pxd b/src/sage/libs/arb/acb_modular.pxd -index c708e9bf97d..cdc413c92da 100644 ---- a/src/sage/libs/arb/acb_modular.pxd -+++ b/src/sage/libs/arb/acb_modular.pxd -@@ -1,4 +1,4 @@ --# distutils: libraries = gmp flint ARB_LIBRARY -+# distutils: libraries = gmp flint - # distutils: depends = acb_modular.h - - from sage.libs.arb.types cimport * -diff --git a/src/sage/libs/arb/acb_poly.pxd b/src/sage/libs/arb/acb_poly.pxd -index 69f4320055b..ae02757ffd9 100644 ---- a/src/sage/libs/arb/acb_poly.pxd -+++ b/src/sage/libs/arb/acb_poly.pxd -@@ -1,4 +1,4 @@ --# distutils: libraries = gmp flint ARB_LIBRARY -+# distutils: libraries = gmp flint - # distutils: depends = acb_poly.h - - from sage.libs.arb.types cimport * -@@ -79,24 +79,10 @@ cdef extern from "arb_wrap.h": - void _acb_poly_divrem(acb_ptr Q, acb_ptr R, acb_srcptr A, long lenA, acb_srcptr B, long lenB, long prec) - bint acb_poly_divrem(acb_poly_t Q, acb_poly_t R, const acb_poly_t A, const acb_poly_t B, long prec) - void _acb_poly_div_root(acb_ptr Q, acb_t R, acb_srcptr A, long len, const acb_t c, long prec) -- void _acb_poly_taylor_shift_horner(acb_ptr g, const acb_t c, long n, long prec) -- void acb_poly_taylor_shift_horner(acb_poly_t g, const acb_poly_t f, const acb_t c, long prec) -- void _acb_poly_taylor_shift_divconquer(acb_ptr g, const acb_t c, long n, long prec) -- void acb_poly_taylor_shift_divconquer(acb_poly_t g, const acb_poly_t f, const acb_t c, long prec) -- void _acb_poly_taylor_shift_convolution(acb_ptr g, const acb_t c, long n, long prec) -- void acb_poly_taylor_shift_convolution(acb_poly_t g, const acb_poly_t f, const acb_t c, long prec) - void _acb_poly_taylor_shift(acb_ptr g, const acb_t c, long n, long prec) - void acb_poly_taylor_shift(acb_poly_t g, const acb_poly_t f, const acb_t c, long prec) -- void _acb_poly_compose_horner(acb_ptr res, acb_srcptr poly1, long len1, acb_srcptr poly2, long len2, long prec) -- void acb_poly_compose_horner(acb_poly_t res, const acb_poly_t poly1, const acb_poly_t poly2, long prec) -- void _acb_poly_compose_divconquer(acb_ptr res, acb_srcptr poly1, long len1, acb_srcptr poly2, long len2, long prec) -- void acb_poly_compose_divconquer(acb_poly_t res, const acb_poly_t poly1, const acb_poly_t poly2, long prec) - void _acb_poly_compose(acb_ptr res, acb_srcptr poly1, long len1, acb_srcptr poly2, long len2, long prec) - void acb_poly_compose(acb_poly_t res, const acb_poly_t poly1, const acb_poly_t poly2, long prec) -- void _acb_poly_compose_series_horner(acb_ptr res, acb_srcptr poly1, long len1, acb_srcptr poly2, long len2, long n, long prec) -- void acb_poly_compose_series_horner(acb_poly_t res, const acb_poly_t poly1, const acb_poly_t poly2, long n, long prec) -- void _acb_poly_compose_series_brent_kung(acb_ptr res, acb_srcptr poly1, long len1, acb_srcptr poly2, long len2, long n, long prec) -- void acb_poly_compose_series_brent_kung(acb_poly_t res, const acb_poly_t poly1, const acb_poly_t poly2, long n, long prec) - void _acb_poly_compose_series(acb_ptr res, acb_srcptr poly1, long len1, acb_srcptr poly2, long len2, long n, long prec) - void acb_poly_compose_series(acb_poly_t res, const acb_poly_t poly1, const acb_poly_t poly2, long n, long prec) - void _acb_poly_revert_series_lagrange(acb_ptr h, acb_srcptr f, long flen, long n, long prec) -@@ -161,10 +147,6 @@ cdef extern from "arb_wrap.h": - void acb_poly_exp_series_basecase(acb_poly_t f, const acb_poly_t h, long n, long prec) - void _acb_poly_exp_series(acb_ptr f, acb_srcptr h, long hlen, long n, long prec) - void acb_poly_exp_series(acb_poly_t f, const acb_poly_t h, long n, long prec) -- void _acb_poly_sin_cos_series_basecase(acb_ptr s, acb_ptr c, acb_srcptr h, long hlen, long n, long prec, int times_pi) -- void acb_poly_sin_cos_series_basecase(acb_poly_t s, acb_poly_t c, const acb_poly_t h, long n, long prec, int times_pi) -- void _acb_poly_sin_cos_series_tangent(acb_ptr s, acb_ptr c, acb_srcptr h, long hlen, long n, long prec, int times_pi) -- void acb_poly_sin_cos_series_tangent(acb_poly_t s, acb_poly_t c, const acb_poly_t h, long n, long prec, int times_pi) - void _acb_poly_sin_cos_series(acb_ptr s, acb_ptr c, acb_srcptr h, long hlen, long n, long prec) - void acb_poly_sin_cos_series(acb_poly_t s, acb_poly_t c, const acb_poly_t h, long n, long prec) - void _acb_poly_sin_series(acb_ptr s, acb_srcptr h, long hlen, long n, long prec) -diff --git a/src/sage/libs/arb/arb.pxd b/src/sage/libs/arb/arb.pxd -index c82b94de30f..acd232ab816 100644 ---- a/src/sage/libs/arb/arb.pxd -+++ b/src/sage/libs/arb/arb.pxd -@@ -1,4 +1,4 @@ --# distutils: libraries = gmp flint ARB_LIBRARY -+# distutils: libraries = gmp flint - # distutils: depends = arb.h - - from sage.libs.arb.types cimport * -@@ -224,15 +224,8 @@ cdef extern from "arb_wrap.h": - - void arb_lambertw(arb_t res, const arb_t x, int flags, long prec) - -- void arb_rising_ui_bs(arb_t z, const arb_t x, unsigned long n, long prec) -- void arb_rising_ui_rs(arb_t z, const arb_t x, unsigned long n, unsigned long step, long prec) -- void arb_rising_ui_rec(arb_t z, const arb_t x, unsigned long n, long prec) -- void arb_rising_ui(arb_t z, const arb_t x, unsigned long n, long prec) - void arb_rising(arb_t z, const arb_t x, const arb_t n, long prec) - void arb_rising_fmpq_ui(arb_t z, const fmpq_t x, unsigned long n, long prec) -- void arb_rising2_ui_bs(arb_t u, arb_t v, const arb_t x, unsigned long n, long prec) -- void arb_rising2_ui_rs(arb_t u, arb_t v, const arb_t x, unsigned long n, unsigned long step, long prec) -- void arb_rising2_ui(arb_t u, arb_t v, const arb_t x, unsigned long n, long prec) - void arb_fac_ui(arb_t z, unsigned long n, long prec) - void arb_bin_ui(arb_t z, const arb_t n, unsigned long k, long prec) - void arb_bin_uiui(arb_t z, unsigned long n, unsigned long k, long prec) -diff --git a/src/sage/libs/arb/arb_fmpz_poly.pxd b/src/sage/libs/arb/arb_fmpz_poly.pxd -index 079f76e9d9e..55daa705238 100644 ---- a/src/sage/libs/arb/arb_fmpz_poly.pxd -+++ b/src/sage/libs/arb/arb_fmpz_poly.pxd -@@ -1,4 +1,4 @@ --# distutils: libraries = gmp flint ARB_LIBRARY -+# distutils: libraries = gmp flint - # distutils: depends = arb_fmpz_poly.h - - from sage.libs.arb.types cimport * -@@ -22,5 +22,4 @@ cdef extern from "arb_wrap.h": - unsigned long arb_fmpz_poly_deflation(const fmpz_poly_t poly) - void arb_fmpz_poly_deflate(fmpz_poly_t res, const fmpz_poly_t poly, unsigned long deflation) - void arb_fmpz_poly_complex_roots(acb_ptr roots, const fmpz_poly_t poly, int flags, long prec) -- void arb_fmpz_poly_cos_minpoly(fmpz_poly_t res, unsigned long n) - void arb_fmpz_poly_gauss_period_minpoly(fmpz_poly_t res, unsigned long q, unsigned long n) -diff --git a/src/sage/libs/arb/arb_hypgeom.pxd b/src/sage/libs/arb/arb_hypgeom.pxd -index fb1c40ddaa8..139b987d669 100644 ---- a/src/sage/libs/arb/arb_hypgeom.pxd -+++ b/src/sage/libs/arb/arb_hypgeom.pxd -@@ -1,4 +1,4 @@ --# distutils: libraries = gmp flint ARB_LIBRARY -+# distutils: libraries = gmp flint - # distutils: depends = arb_hypgeom.h - - from sage.libs.flint.types cimport fmpz_t -diff --git a/src/sage/libs/arb/arb_wrap.h b/src/sage/libs/arb/arb_wrap.h -index 49997075ee5..488bb376d5e 100644 ---- a/src/sage/libs/arb/arb_wrap.h -+++ b/src/sage/libs/arb/arb_wrap.h -@@ -5,25 +5,27 @@ - * by arb, most of which rely on flint's ulong and slong defines. - */ - -+#include -+ - #undef ulong - #undef slong - - #define ulong mp_limb_t - #define slong mp_limb_signed_t - --#include --#include --#include --#include --#include --#include --#include --#include --#include --#include --#include --#include --#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include - - #undef ulong - #undef slong -diff --git a/src/sage/libs/arb/arf.pxd b/src/sage/libs/arb/arf.pxd -index b8b83fefcdc..84778fe9f09 100644 ---- a/src/sage/libs/arb/arf.pxd -+++ b/src/sage/libs/arb/arf.pxd -@@ -1,4 +1,4 @@ --# distutils: libraries = gmp flint ARB_LIBRARY -+# distutils: libraries = gmp flint - # distutils: depends = arf.h - - from sage.libs.arb.types cimport * -@@ -30,7 +30,6 @@ cdef extern from "arb_wrap.h": - void arf_set_ui(arf_t y, unsigned long x) - void arf_set_si(arf_t y, long x) - void arf_set_mpfr(arf_t y, const mpfr_t x) -- # void arf_set_fmpr(arf_t y, const fmpr_t x) - void arf_set_d(arf_t y, double x) - void arf_swap(arf_t y, arf_t x) - void arf_init_set_ui(arf_t y, unsigned long x) -@@ -46,7 +45,6 @@ cdef extern from "arb_wrap.h": - int arf_set_round_fmpz_2exp(arf_t y, const fmpz_t x, const fmpz_t e, long prec, arf_rnd_t rnd) - void arf_get_fmpz_2exp(fmpz_t m, fmpz_t e, const arf_t x) - double arf_get_d(const arf_t x, arf_rnd_t rnd) -- # void arf_get_fmpr(fmpr_t y, const arf_t x) - int arf_get_mpfr(mpfr_t y, const arf_t x, mpfr_rnd_t rnd) - void arf_get_fmpz(fmpz_t z, const arf_t x, arf_rnd_t rnd) - long arf_get_si(const arf_t x, arf_rnd_t rnd) -diff --git a/src/sage/libs/arb/bernoulli.pxd b/src/sage/libs/arb/bernoulli.pxd -index f859ebfb8d7..95a84dd5179 100644 ---- a/src/sage/libs/arb/bernoulli.pxd -+++ b/src/sage/libs/arb/bernoulli.pxd -@@ -1,4 +1,4 @@ --# distutils: libraries = gmp flint ARB_LIBRARY -+# distutils: libraries = gmp flint - # distutils: depends = bernoulli.h - - from sage.libs.flint.types cimport fmpq_t, ulong -diff --git a/src/sage/libs/arb/mag.pxd b/src/sage/libs/arb/mag.pxd -index d5d8693ea8f..69dfb990ae0 100644 ---- a/src/sage/libs/arb/mag.pxd -+++ b/src/sage/libs/arb/mag.pxd -@@ -1,4 +1,4 @@ --# distutils: libraries = gmp flint ARB_LIBRARY -+# distutils: libraries = gmp flint - # distutils: depends = mag.h - - from sage.libs.arb.types cimport * -@@ -27,13 +27,11 @@ cdef extern from "arb_wrap.h": - # void mag_randtest(mag_t x, flint_rand_t state, long expbits) - # void mag_randtest_special(mag_t x, flint_rand_t state, long expbits) - void mag_set_d(mag_t y, double x) -- # void mag_set_fmpr(mag_t y, const fmpr_t x) - void mag_set_ui(mag_t y, unsigned long x) - void mag_set_fmpz(mag_t y, const fmpz_t x) - void mag_set_d_2exp_fmpz(mag_t z, double x, const fmpz_t y) - void mag_set_fmpz_2exp_fmpz(mag_t z, const fmpz_t x, const fmpz_t y) - void mag_set_ui_2exp_si(mag_t z, unsigned long x, long y) -- # void mag_get_fmpr(fmpr_t y, const mag_t x) - void mag_get_fmpq(fmpq_t y, const mag_t x) - void mag_set_ui_lower(mag_t z, unsigned long x) - void mag_set_fmpz_lower(mag_t z, const fmpz_t x) -diff --git a/src/sage/libs/flint/flint_wrap.h b/src/sage/libs/flint/flint_wrap.h -index 266535c3835..4db72b97660 100644 ---- a/src/sage/libs/flint/flint_wrap.h -+++ b/src/sage/libs/flint/flint_wrap.h -@@ -15,6 +15,7 @@ - */ - - #include -+#include - - /* Save previous definition of ulong if any, as pari also uses it */ - /* Should work on GCC, clang, MSVC */ -@@ -33,6 +34,7 @@ - - #include - #include -+#include - #include - #include - #include -@@ -47,6 +49,7 @@ - #include - #include - #include -+#include - #include - #include - #include -diff --git a/src/sage/libs/flint/fmpq.pxd b/src/sage/libs/flint/fmpq.pxd -index 5e64c82102f..0616c0a7408 100644 ---- a/src/sage/libs/flint/fmpq.pxd -+++ b/src/sage/libs/flint/fmpq.pxd -@@ -12,6 +12,8 @@ cdef extern from "flint_wrap.h": - fmpz * fmpq_denref(fmpq_t) - void fmpq_init(fmpq_t) - void fmpq_clear(fmpq_t) -+ void fmpq_init_set_readonly(fmpq_t, const mpq_t) -+ void fmpq_clear_readonly(fmpq_t) - void fmpq_one(fmpq_t) - void fmpq_zero(fmpq_t) - bint fmpq_is_zero(fmpq_t) -diff --git a/src/sage/libs/flint/fmpq_poly.pxd b/src/sage/libs/flint/fmpq_poly.pxd -index 6050c487835..afa16e5bbdd 100644 ---- a/src/sage/libs/flint/fmpq_poly.pxd -+++ b/src/sage/libs/flint/fmpq_poly.pxd -@@ -30,6 +30,9 @@ cdef extern from "flint_wrap.h": - void fmpq_poly_canonicalise(fmpq_poly_t) - int fmpq_poly_is_canonical(const fmpq_poly_t) - -+ void _fmpq_poly_set_length(fmpq_poly_t, slong) -+ void _fmpq_poly_normalise(fmpq_poly_t) -+ - # Polynomial parameters - slong fmpq_poly_degree(const fmpq_poly_t) - ulong fmpq_poly_length(const fmpq_poly_t) -@@ -46,10 +49,7 @@ cdef extern from "flint_wrap.h": - void fmpq_poly_set_ui(fmpq_poly_t, ulong) - void fmpq_poly_set_fmpz(fmpq_poly_t, const fmpz_t) - void fmpq_poly_set_fmpq(fmpq_poly_t, const fmpq_t) -- void fmpq_poly_set_mpz(fmpq_poly_t, const mpz_t) -- void fmpq_poly_set_mpq(fmpq_poly_t, const mpq_t) - void fmpq_poly_set_fmpz_poly(fmpq_poly_t, const fmpz_poly_t) -- void fmpq_poly_set_array_mpq(fmpq_poly_t, const mpq_t *, slong) - - void fmpq_poly_set_str(fmpq_poly_t, const char *) - char *fmpq_poly_get_str(const fmpq_poly_t) -@@ -67,7 +67,6 @@ cdef extern from "flint_wrap.h": - void fmpq_poly_reverse(fmpq_poly_t, const fmpq_poly_t, slong) - - void fmpq_poly_get_coeff_fmpq(fmpq_t, const fmpq_poly_t, slong) -- void fmpq_poly_get_coeff_mpq(mpq_t, const fmpq_poly_t, slong) - void fmpq_poly_get_coeff_si(slong, const fmpq_poly_t, slong) - void fmpq_poly_get_coeff_ui(ulong, const fmpq_poly_t, slong) - -@@ -75,8 +74,6 @@ cdef extern from "flint_wrap.h": - void fmpq_poly_set_coeff_ui(fmpq_poly_t, slong, ulong) - void fmpq_poly_set_coeff_fmpz(fmpq_poly_t, slong, const fmpz_t) - void fmpq_poly_set_coeff_fmpq(fmpq_poly_t, slong, const fmpq_t) -- void fmpq_poly_set_coeff_mpz(fmpq_poly_t, slong, const mpz_t) -- void fmpq_poly_set_coeff_mpq(fmpq_poly_t, slong, const mpq_t) - - # Comparison - int fmpq_poly_equal(const fmpq_poly_t, const fmpq_poly_t) -@@ -100,8 +97,6 @@ cdef extern from "flint_wrap.h": - fmpq_poly_t, const fmpq_poly_t, const fmpz_t) - void fmpq_poly_scalar_mul_fmpq( - fmpq_poly_t, const fmpq_poly_t, const fmpq_t) -- void fmpq_poly_scalar_mul_mpz(fmpq_poly_t, const fmpq_poly_t, const mpz_t) -- void fmpq_poly_scalar_mul_mpq(fmpq_poly_t, const fmpq_poly_t, const mpq_t) - - void fmpq_poly_scalar_div_si(fmpq_poly_t, const fmpq_poly_t, slong) - void fmpq_poly_scalar_div_ui(fmpq_poly_t, const fmpq_poly_t, ulong) -@@ -109,8 +104,6 @@ cdef extern from "flint_wrap.h": - fmpq_poly_t, const fmpq_poly_t, const fmpz_t) - void fmpq_poly_scalar_div_fmpq( - fmpq_poly_t, const fmpq_poly_t, const fmpq_t) -- void fmpq_poly_scalar_div_mpz(fmpq_poly_t, const fmpq_poly_t, const mpz_t) -- void fmpq_poly_scalar_div_mpq(fmpq_poly_t, const fmpq_poly_t, const mpq_t) - - # Multiplication - void fmpq_poly_mul(fmpq_poly_t, const fmpq_poly_t, const fmpq_poly_t) -@@ -155,8 +148,6 @@ cdef extern from "flint_wrap.h": - # Evaluation - void fmpq_poly_evaluate_fmpz(fmpq_t, const fmpq_poly_t, const fmpz_t) - void fmpq_poly_evaluate_fmpq(fmpq_t, const fmpq_poly_t, const fmpq_t) -- void fmpq_poly_evaluate_mpz(mpq_t, const fmpq_poly_t, const mpz_t) -- void fmpq_poly_evaluate_mpq(mpq_t, const fmpq_poly_t, const mpq_t) - - # Composition - void fmpq_poly_compose(fmpq_poly_t, const fmpq_poly_t, const fmpq_poly_t) -@@ -189,3 +180,11 @@ cdef extern from "flint_wrap.h": - # since the fmpq_poly header seems to be lacking this inline function - cdef inline sage_fmpq_poly_max_limbs(const fmpq_poly_t poly) noexcept: - return _fmpz_vec_max_limbs(fmpq_poly_numref(poly), fmpq_poly_length(poly)) -+ -+# functions removed from flint but still needed in sage -+cdef void fmpq_poly_scalar_mul_mpz(fmpq_poly_t, const fmpq_poly_t, const mpz_t) -+cdef void fmpq_poly_scalar_mul_mpq(fmpq_poly_t, const fmpq_poly_t, const mpq_t) -+cdef void fmpq_poly_set_coeff_mpq(fmpq_poly_t, slong, const mpq_t) -+cdef void fmpq_poly_get_coeff_mpq(mpq_t, const fmpq_poly_t, slong) -+cdef void fmpq_poly_set_mpz(fmpq_poly_t, const mpz_t) -+cdef void fmpq_poly_set_mpq(fmpq_poly_t, const mpq_t) -diff --git a/src/sage/libs/flint/fmpq_poly.pyx b/src/sage/libs/flint/fmpq_poly.pyx -new file mode 100644 -index 00000000000..3b8a0cf0c51 ---- /dev/null -+++ b/src/sage/libs/flint/fmpq_poly.pyx -@@ -0,0 +1,45 @@ -+# Functions removed from flint but still needed in Sage. Code adapted from -+# earlier versions of flint. -+ -+from sage.libs.gmp.mpq cimport * -+from sage.libs.flint.fmpz cimport * -+from sage.libs.flint.fmpq cimport * -+ -+cdef void fmpq_poly_scalar_mul_mpz(fmpq_poly_t rop, const fmpq_poly_t op, const mpz_t c): -+ cdef fmpz_t f -+ fmpz_init_set_readonly(f, c) -+ fmpq_poly_scalar_mul_fmpz(rop, op, f) -+ fmpz_clear_readonly(f) -+ -+cdef void fmpq_poly_scalar_mul_mpq(fmpq_poly_t rop, const fmpq_poly_t op, const mpq_t c): -+ cdef fmpq_t f -+ fmpq_init_set_readonly(f, c) -+ fmpq_poly_scalar_mul_fmpq(rop, op, f) -+ fmpq_clear_readonly(f) -+ -+cdef void fmpq_poly_set_coeff_mpq(fmpq_poly_t poly, slong n, const mpq_t x): -+ cdef fmpq_t t -+ fmpq_init_set_readonly(t, x) -+ fmpq_poly_set_coeff_fmpq(poly, n, t) -+ fmpq_clear_readonly(t) -+ -+cdef void fmpq_poly_get_coeff_mpq(mpq_t x, const fmpq_poly_t poly, slong n): -+ cdef fmpq_t t -+ fmpq_init(t) -+ fmpq_poly_get_coeff_fmpq(t, poly, n) -+ fmpq_get_mpq(x, t) -+ fmpq_clear(t) -+ -+cdef void fmpq_poly_set_mpq(fmpq_poly_t poly, const mpq_t x): -+ fmpq_poly_fit_length(poly, 1) -+ fmpz_set_mpz(fmpq_poly_numref(poly), mpq_numref(x)) -+ fmpz_set_mpz(fmpq_poly_denref(poly), mpq_denref(x)) -+ _fmpq_poly_set_length(poly, 1) -+ _fmpq_poly_normalise(poly) -+ -+cdef void fmpq_poly_set_mpz(fmpq_poly_t poly, const mpz_t x): -+ fmpq_poly_fit_length(poly, 1) -+ fmpz_set_mpz(fmpq_poly_numref(poly), x) -+ fmpz_one(fmpq_poly_denref(poly)) -+ _fmpq_poly_set_length(poly, 1) -+ _fmpq_poly_normalise(poly) -diff --git a/src/sage/libs/flint/fmpz.pxd b/src/sage/libs/flint/fmpz.pxd -index 01058d0f130..b97fbe1eae0 100644 ---- a/src/sage/libs/flint/fmpz.pxd -+++ b/src/sage/libs/flint/fmpz.pxd -@@ -16,6 +16,9 @@ cdef extern from "flint_wrap.h": - void fmpz_init_set(fmpz_t, fmpz_t) - void fmpz_init_set_ui(fmpz_t, ulong) - -+ void fmpz_init_set_readonly(fmpz_t, const mpz_t) -+ void fmpz_clear_readonly(fmpz_t) -+ - # Conversion - void fmpz_set(fmpz_t f, fmpz_t g) - void fmpz_set_ui(fmpz_t, ulong) -diff --git a/src/sage/libs/flint/fmpz_mod_poly.pxd b/src/sage/libs/flint/fmpz_mod_poly.pxd -index 24b653eb3b7..2727246da98 100644 ---- a/src/sage/libs/flint/fmpz_mod_poly.pxd -+++ b/src/sage/libs/flint/fmpz_mod_poly.pxd -@@ -67,13 +67,6 @@ cdef extern from "flint_wrap.h": - void fmpz_mod_poly_get_coeff_fmpz(fmpz_t x, const fmpz_mod_poly_t poly, - slong n, const fmpz_mod_ctx_t ctx) - -- void fmpz_mod_poly_set_coeff_mpz(fmpz_mod_poly_t poly, -- slong n, const mpz_t x, const fmpz_mod_ctx_t ctx) -- -- void fmpz_mod_poly_get_coeff_mpz(mpz_t x, -- const fmpz_mod_poly_t poly, slong n, const fmpz_mod_ctx_t ctx) -- -- - void _fmpz_mod_poly_shift_left(fmpz * res, const fmpz * poly, - slong len, slong n) - -@@ -194,14 +187,6 @@ cdef extern from "flint_wrap.h": - const fmpz_mod_poly_t A, const fmpz_mod_poly_t B, - const fmpz_mod_ctx_t ctx) - -- void fmpz_mod_poly_div_basecase(fmpz_mod_poly_t Q, -- const fmpz_mod_poly_t A, const fmpz_mod_poly_t B, -- const fmpz_mod_ctx_t ctx) -- -- void fmpz_mod_poly_div_newton_n_preinv(fmpz_mod_poly_t Q, -- const fmpz_mod_poly_t A, const fmpz_mod_poly_t B, -- const fmpz_mod_poly_t Binv, const fmpz_mod_ctx_t ctx) -- - void fmpz_mod_poly_divrem_newton_n_preinv(fmpz_mod_poly_t Q, - fmpz_mod_poly_t R, const fmpz_mod_poly_t A, const fmpz_mod_poly_t B, - const fmpz_mod_poly_t Binv, const fmpz_mod_ctx_t ctx) -@@ -213,10 +198,6 @@ cdef extern from "flint_wrap.h": - const fmpz_mod_poly_t A, const fmpz_mod_poly_t B, - const fmpz_mod_ctx_t ctx) - -- void fmpz_mod_poly_divrem_divconquer(fmpz_mod_poly_t Q, -- fmpz_mod_poly_t R, const fmpz_mod_poly_t A, const fmpz_mod_poly_t B, -- const fmpz_mod_ctx_t ctx) -- - void fmpz_mod_poly_divrem(fmpz_mod_poly_t Q, fmpz_mod_poly_t R, - const fmpz_mod_poly_t A, const fmpz_mod_poly_t B, const fmpz_mod_ctx_t ctx) - -@@ -254,40 +235,13 @@ cdef extern from "flint_wrap.h": - void fmpz_mod_poly_make_monic_f(fmpz_t f, fmpz_mod_poly_t res, - const fmpz_mod_poly_t poly, const fmpz_mod_ctx_t ctx) - -- void fmpz_mod_poly_gcd_euclidean(fmpz_mod_poly_t G, -- const fmpz_mod_poly_t A, const fmpz_mod_poly_t B, -- const fmpz_mod_ctx_t ctx) -- -- void fmpz_mod_poly_gcd_euclidean_f(fmpz_t f, fmpz_mod_poly_t G, -- const fmpz_mod_poly_t A, const fmpz_mod_poly_t B, -- const fmpz_mod_ctx_t ctx) -- - void fmpz_mod_poly_gcd_f(fmpz_t f, fmpz_mod_poly_t G, const fmpz_mod_poly_t A, - const fmpz_mod_poly_t B, const fmpz_mod_ctx_t ctx) - -- void fmpz_mod_poly_gcd_hgcd(fmpz_mod_poly_t G, -- const fmpz_mod_poly_t A, const fmpz_mod_poly_t B, -- const fmpz_mod_ctx_t ctx) -- -- - void fmpz_mod_poly_gcd(fmpz_mod_poly_t G, const fmpz_mod_poly_t A, - const fmpz_mod_poly_t B, const fmpz_mod_ctx_t ctx) - - -- void fmpz_mod_poly_xgcd_euclidean(fmpz_mod_poly_t G, -- fmpz_mod_poly_t S, fmpz_mod_poly_t T, -- const fmpz_mod_poly_t A, const fmpz_mod_poly_t B, -- const fmpz_mod_ctx_t ctx) -- -- void fmpz_mod_poly_xgcd_euclidean_f(fmpz_t f, fmpz_mod_poly_t G, -- fmpz_mod_poly_t S, fmpz_mod_poly_t T, -- const fmpz_mod_poly_t A, const fmpz_mod_poly_t B, -- const fmpz_mod_ctx_t ctx) -- -- void fmpz_mod_poly_xgcd_hgcd(fmpz_mod_poly_t G, fmpz_mod_poly_t S, -- fmpz_mod_poly_t T, const fmpz_mod_poly_t A, const fmpz_mod_poly_t B, -- const fmpz_mod_ctx_t ctx) -- - void fmpz_mod_poly_xgcd(fmpz_mod_poly_t G, fmpz_mod_poly_t S, fmpz_mod_poly_t T, - const fmpz_mod_poly_t A, const fmpz_mod_poly_t B, - const fmpz_mod_ctx_t ctx) -@@ -361,14 +315,6 @@ cdef extern from "flint_wrap.h": - const fmpz_mod_poly_t poly, const fmpz * xs, slong n, - const fmpz_mod_ctx_t ctx) - -- void fmpz_mod_poly_compose_horner(fmpz_mod_poly_t res, -- const fmpz_mod_poly_t poly1, const fmpz_mod_poly_t poly2, -- const fmpz_mod_ctx_t ctx) -- -- void fmpz_mod_poly_compose_divconquer(fmpz_mod_poly_t res, -- const fmpz_mod_poly_t poly1, const fmpz_mod_poly_t poly2, -- const fmpz_mod_ctx_t ctx) -- - void fmpz_mod_poly_compose(fmpz_mod_poly_t res, const fmpz_mod_poly_t poly1, - const fmpz_mod_poly_t poly2, const fmpz_mod_ctx_t ctx) - -diff --git a/src/sage/libs/flint/fmpz_poly.pxd b/src/sage/libs/flint/fmpz_poly.pxd -index 18b36672d30..c8bc6d3ca0a 100644 ---- a/src/sage/libs/flint/fmpz_poly.pxd -+++ b/src/sage/libs/flint/fmpz_poly.pxd -@@ -28,7 +28,6 @@ cdef extern from "flint_wrap.h": - void fmpz_poly_set_ui(fmpz_poly_t, ulong) - void fmpz_poly_set_si(fmpz_poly_t, slong) - void fmpz_poly_set_fmpz(fmpz_poly_t, const fmpz_t) -- void fmpz_poly_set_mpz(fmpz_poly_t, const mpz_t) - int fmpz_poly_set_str(fmpz_poly_t, const char *) - - char *fmpz_poly_get_str(const fmpz_poly_t) -@@ -70,7 +69,6 @@ cdef extern from "flint_wrap.h": - # Scalar multiplication and division - void fmpz_poly_scalar_mul_fmpz( - fmpz_poly_t, const fmpz_poly_t, const fmpz_t) -- void fmpz_poly_scalar_mul_mpz(fmpz_poly_t, const fmpz_poly_t, const mpz_t) - void fmpz_poly_scalar_mul_si(fmpz_poly_t, const fmpz_poly_t, slong) - void fmpz_poly_scalar_mul_ui(fmpz_poly_t, const fmpz_poly_t, ulong) - void fmpz_poly_scalar_mul_2exp(fmpz_poly_t, const fmpz_poly_t, ulong) -@@ -310,12 +308,14 @@ cdef extern from "flint_wrap.h": - fmpz_poly_t, - const fmpz_poly_t, const fmpz_t, const nmod_poly_t, int) - -- # Some functions for backwards compatibility -- void fmpz_poly_scalar_mul_mpz(fmpz_poly_t, const fmpz_poly_t, const mpz_t) -- void fmpz_poly_scalar_divexact_mpz(fmpz_poly_t, const fmpz_poly_t, const mpz_t) -- void fmpz_poly_scalar_fdiv_mpz(fmpz_poly_t, const fmpz_poly_t, const mpz_t) -- void fmpz_poly_set_coeff_mpz(fmpz_poly_t, slong, const mpz_t) -- void fmpz_poly_get_coeff_mpz(mpz_t, const fmpz_poly_t, slong) -+ -+# functions removed from flint but still needed in sage -+cdef void fmpz_poly_scalar_mul_mpz(fmpz_poly_t, const fmpz_poly_t, const mpz_t) -+cdef void fmpz_poly_scalar_divexact_mpz(fmpz_poly_t, const fmpz_poly_t, const mpz_t) -+cdef void fmpz_poly_scalar_fdiv_mpz(fmpz_poly_t, const fmpz_poly_t, const mpz_t) -+cdef void fmpz_poly_set_coeff_mpz(fmpz_poly_t, slong, const mpz_t) -+cdef void fmpz_poly_get_coeff_mpz(mpz_t, const fmpz_poly_t, slong) -+cdef void fmpz_poly_set_mpz(fmpz_poly_t, const mpz_t) - - - # Wrapper Cython class -diff --git a/src/sage/libs/flint/fmpz_poly.pyx b/src/sage/libs/flint/fmpz_poly.pyx -index 74915b37612..cfcbea9090c 100644 ---- a/src/sage/libs/flint/fmpz_poly.pyx -+++ b/src/sage/libs/flint/fmpz_poly.pyx -@@ -25,10 +25,10 @@ from cysignals.memory cimport sig_free - - from sage.arith.long cimport pyobject_to_long - from sage.cpython.string cimport char_to_str, str_to_bytes -+from sage.libs.flint.fmpz cimport * - from sage.structure.sage_object cimport SageObject - from sage.rings.integer cimport Integer - -- - cdef class Fmpz_poly(SageObject): - - def __cinit__(self): -@@ -455,3 +455,44 @@ cdef class Fmpz_poly(SageObject): - """ - from sage.rings.integer_ring import ZZ - return ZZ[var](self.list()) -+ -+ -+# Functions removed from flint but still needed in Sage. Code adapted from -+# earlier versions of flint. -+ -+cdef void fmpz_poly_scalar_mul_mpz(fmpz_poly_t rop, const fmpz_poly_t op, const mpz_t c): -+ cdef fmpz_t f -+ fmpz_init_set_readonly(f, c) -+ fmpz_poly_scalar_mul_fmpz(rop, op, f) -+ fmpz_clear_readonly(f) -+ -+cdef void fmpz_poly_scalar_divexact_mpz(fmpz_poly_t rop, const fmpz_poly_t op, const mpz_t c): -+ cdef fmpz_t f -+ fmpz_init_set_readonly(f, c) -+ fmpz_poly_scalar_divexact_fmpz(rop, op, f) -+ fmpz_clear_readonly(f) -+ -+cdef void fmpz_poly_scalar_fdiv_mpz(fmpz_poly_t rop, const fmpz_poly_t op, const mpz_t c): -+ cdef fmpz_t f -+ fmpz_init_set_readonly(f, c) -+ fmpz_poly_scalar_fdiv_fmpz(rop, op, f) -+ fmpz_clear_readonly(f) -+ -+cdef void fmpz_poly_set_coeff_mpz(fmpz_poly_t poly, slong n, const mpz_t x): -+ cdef fmpz_t t -+ fmpz_init_set_readonly(t, x) -+ fmpz_poly_set_coeff_fmpz(poly, n, t) -+ fmpz_clear_readonly(t) -+ -+cdef void fmpz_poly_get_coeff_mpz(mpz_t x, const fmpz_poly_t poly, slong n): -+ cdef fmpz_t t -+ fmpz_init(t) -+ fmpz_poly_get_coeff_fmpz(t, poly, n) -+ fmpz_get_mpz(x, t) -+ fmpz_clear(t) -+ -+cdef void fmpz_poly_set_mpz(fmpz_poly_t poly, const mpz_t x): -+ fmpz_poly_fit_length(poly, 1) -+ fmpz_set_mpz(poly.coeffs, x) -+ _fmpz_poly_set_length(poly, 1) -+ _fmpz_poly_normalise(poly) -diff --git a/src/sage/libs/flint/fmpz_poly_q.pxd b/src/sage/libs/flint/fmpz_poly_q.pxd -index 846542dc0d8..63c13355bf6 100644 ---- a/src/sage/libs/flint/fmpz_poly_q.pxd -+++ b/src/sage/libs/flint/fmpz_poly_q.pxd -@@ -49,11 +49,7 @@ cdef extern from "flint_wrap.h": - - #* Scalar multiplication and division ****************************************/ - void fmpz_poly_q_scalar_mul_si(fmpz_poly_q_t rop, const fmpz_poly_q_t op, long x) -- void fmpz_poly_q_scalar_mul_mpz(fmpz_poly_q_t rop, const fmpz_poly_q_t op, const mpz_t x) -- void fmpz_poly_q_scalar_mul_mpq(fmpz_poly_q_t rop, const fmpz_poly_q_t op, const mpq_t x) - void fmpz_poly_q_scalar_div_si(fmpz_poly_q_t rop, const fmpz_poly_q_t op, long x) -- void fmpz_poly_q_scalar_div_mpz(fmpz_poly_q_t rop, const fmpz_poly_q_t op, const mpz_t x) -- void fmpz_poly_q_scalar_div_mpq(fmpz_poly_q_t rop, const fmpz_poly_q_t op, const mpq_t x) - - #* Multiplication and division ***********************************************/ - void fmpz_poly_q_mul(fmpz_poly_q_t rop, -@@ -67,9 +63,6 @@ cdef extern from "flint_wrap.h": - #* Derivative ****************************************************************/ - void fmpz_poly_q_derivative(fmpz_poly_q_t rop, const fmpz_poly_q_t op) - -- #* Evaluation ****************************************************************/ -- int fmpz_poly_q_evaluate(mpq_t rop, const fmpz_poly_q_t f, const mpq_t a) -- - #* Input and output **********************************************************/ - int fmpz_poly_q_set_str(fmpz_poly_q_t rop, const char *s) - char * fmpz_poly_q_get_str(const fmpz_poly_q_t op) -diff --git a/src/sage/libs/linbox/linbox_flint_interface.pyx b/src/sage/libs/linbox/linbox_flint_interface.pyx -index 1979ac0f0a4..37a340c457f 100644 ---- a/src/sage/libs/linbox/linbox_flint_interface.pyx -+++ b/src/sage/libs/linbox/linbox_flint_interface.pyx -@@ -33,6 +33,7 @@ and C. Pernet. The functions available are: - # https://www.gnu.org/licenses/ - # **************************************************************************** - -+from sage.libs.gmp.types cimport mpz_t - from sage.libs.flint.types cimport fmpz_t - from sage.libs.flint.fmpz cimport fmpz_get_mpz, fmpz_set_mpz - from sage.libs.flint.fmpz_mat cimport fmpz_mat_entry, fmpz_mat_nrows, fmpz_mat_ncols -@@ -80,11 +81,13 @@ cdef void fmpz_poly_set_linbox(fmpz_poly_t p, PolynomialRing_integer.Element& q) - (the .pxd file) in order to keep the header C-compatible - """ - cdef size_t i -+ cdef mpz_t tmp - - fmpz_poly_fit_length(p, q.size()) - - for i in range(q.size()): -- fmpz_poly_set_coeff_mpz(p, i, q[i].get_mpz_const()) -+ tmp = q[i].get_mpz_const() -+ fmpz_poly_set_coeff_mpz(p, i, tmp) - - _fmpz_poly_set_length(p, q.size()) - -diff --git a/src/sage/matrix/matrix_complex_ball_dense.pyx b/src/sage/matrix/matrix_complex_ball_dense.pyx -index e5414abdd9e..2f0131f4064 100644 ---- a/src/sage/matrix/matrix_complex_ball_dense.pyx -+++ b/src/sage/matrix/matrix_complex_ball_dense.pyx -@@ -1,4 +1,4 @@ --# distutils: libraries = ARB_LIBRARY -+# distutils: libraries = flint - r""" - Arbitrary precision complex ball matrices using Arb - -diff --git a/src/sage/matrix/matrix_integer_sparse.pyx b/src/sage/matrix/matrix_integer_sparse.pyx -index 27f5cdfac0f..6c5c20dbc6b 100644 ---- a/src/sage/matrix/matrix_integer_sparse.pyx -+++ b/src/sage/matrix/matrix_integer_sparse.pyx -@@ -847,6 +847,7 @@ cdef class Matrix_integer_sparse(Matrix_sparse): - sage: matrix(ZZ, 1, 1, sparse=True)._charpoly_linbox() - x - """ -+ cdef mpz_t tmp - if self._nrows != self._ncols: - raise ArithmeticError('only valid for square matrix') - -@@ -869,7 +870,8 @@ cdef class Matrix_integer_sparse(Matrix_sparse): - cdef size_t i - fmpz_poly_fit_length(g._poly, p.size()) - for i in range(p.size()): -- fmpz_poly_set_coeff_mpz(g._poly, i, p[0][i].get_mpz_const()) -+ tmp = p[0][i].get_mpz_const() -+ fmpz_poly_set_coeff_mpz(g._poly, i, tmp) - _fmpz_poly_set_length(g._poly, p.size()) - - del M -@@ -966,9 +968,11 @@ cdef class Matrix_integer_sparse(Matrix_sparse): - sig_off() - - cdef size_t i -+ cdef mpz_t tmp - fmpz_poly_fit_length(g._poly, p.size()) - for i in range(p.size()): -- fmpz_poly_set_coeff_mpz(g._poly, i, p[0][i].get_mpz_const()) -+ tmp = p[0][i].get_mpz_const() -+ fmpz_poly_set_coeff_mpz(g._poly, i, tmp) - _fmpz_poly_set_length(g._poly, p.size()) - - del M -diff --git a/src/sage/rings/complex_arb.pyx b/src/sage/rings/complex_arb.pyx -index 1e3085c9215..0786de7fc81 100644 ---- a/src/sage/rings/complex_arb.pyx -+++ b/src/sage/rings/complex_arb.pyx -@@ -1360,12 +1360,13 @@ cdef class ComplexBall(RingElement): - sage: CBF100(-3r) - -3.000000000000000000000000000000 - -- sage: ComplexBall(CBF100, 10^100) -- 1.000000000000000000000000000000e+100 - sage: ComplexBall(CBF100, CIF(1, 2)) - 1.000000000000000000000000000000 + 2.000000000000000000000000000000*I - sage: ComplexBall(CBF100, RBF(1/3), RBF(1)) - [0.3333333333333333 +/- ...e-17] + 1.000000000000000000000000000000*I -+ sage: ComplexBall(CBF100, 10^100) -+ [1.000000000000000000000000000000e+100 +/- ...] -+ - sage: NF. = QuadraticField(-1, embedding=CC(0, -1)) - sage: CBF(a) - -1.000000000000000*I -@@ -3009,7 +3010,7 @@ cdef class ComplexBall(RingElement): - sage: CBF(1).rising_factorial(2**64) - [+/- ...e+347382171326740403407] - sage: ComplexBallField(128)(1).rising_factorial(2**64) -- [2.343691126796861348e+347382171305201285713 +/- ...e+347382171305201285694] -+ [2.34369112679686134...e+347382171305201285713 +/- ...] - sage: CBF(1/2).rising_factorial(CBF(2,3)) # abs tol 1e-15 - [-0.123060451458124 +/- 3.06e-16] + [0.0406412631676552 +/- 7.57e-17]*I - -diff --git a/src/sage/rings/polynomial/polynomial_rational_flint.pyx b/src/sage/rings/polynomial/polynomial_rational_flint.pyx -index 04eaefc9fed..d99f0d3b98c 100644 ---- a/src/sage/rings/polynomial/polynomial_rational_flint.pyx -+++ b/src/sage/rings/polynomial/polynomial_rational_flint.pyx -@@ -222,7 +222,7 @@ cdef class Polynomial_rational_flint(Polynomial): - cdef unsigned long n - cdef Rational c - cdef list L1 -- cdef mpq_t * L2 -+ cdef fmpq_t q - - Polynomial.__init__(self, parent, is_gen=is_gen) - -@@ -253,14 +253,11 @@ cdef class Polynomial_rational_flint(Polynomial): - L1 = [e if isinstance(e, Rational) else Rational(e) for e in x] - n = len(x) - sig_on() -- L2 = check_allocarray(n, sizeof(mpq_t)) -+ fmpq_poly_fit_length(self._poly, n) - for deg from 0 <= deg < n: -- mpq_init(L2[deg]) -- mpq_set(L2[deg], ( L1[deg]).value) -- fmpq_poly_set_array_mpq(self._poly, L2, n) -- for deg from 0 <= deg < n: -- mpq_clear(L2[deg]) -- sig_free(L2) -+ fmpq_init_set_readonly(q, ( L1[deg]).value) -+ fmpq_poly_set_coeff_fmpq(self._poly, deg, q) -+ fmpq_clear_readonly(q) - sig_off() - - # deg = 0 -@@ -435,6 +432,7 @@ cdef class Polynomial_rational_flint(Polynomial): - utmost care. - """ - cdef bint do_sig = _do_sig(self._poly) -+ cdef fmpz_t tmpfz - - if isinstance(value, int): - if do_sig: sig_str("FLINT exception") -@@ -442,7 +440,9 @@ cdef class Polynomial_rational_flint(Polynomial): - if do_sig: sig_off() - elif isinstance(value, Integer): - if do_sig: sig_str("FLINT exception") -- fmpq_poly_set_coeff_mpz(self._poly, n, ( value).value) -+ fmpz_init_set_readonly(tmpfz, ( value).value) -+ fmpq_poly_set_coeff_fmpz(self._poly, n, tmpfz) -+ fmpz_clear_readonly(tmpfz) - if do_sig: sig_off() - elif isinstance(value, Rational): - if do_sig: sig_str("FLINT exception") -@@ -492,7 +492,7 @@ cdef class Polynomial_rational_flint(Polynomial): - cdef Polynomial_rational_flint f - cdef Rational r - cdef fmpz_t tmpfz -- cdef fmpq_t tmpfq -+ cdef fmpq_t tmpfq, tmpfq1 - cdef RealBall arb_a, arb_z - cdef ComplexBall acb_a, acb_z - -@@ -508,13 +508,23 @@ cdef class Polynomial_rational_flint(Polynomial): - elif isinstance(a, Rational): - r = Rational.__new__(Rational) - sig_str("FLINT exception") -- fmpq_poly_evaluate_mpq(r.value, self._poly, ( a).value) -+ fmpq_init_set_readonly(tmpfq, ( a).value) -+ fmpq_init(tmpfq1) -+ fmpq_poly_evaluate_fmpq(tmpfq1, self._poly, tmpfq) -+ fmpq_get_mpq(r.value, tmpfq1) -+ fmpq_clear(tmpfq1) -+ fmpq_clear_readonly(tmpfq) - sig_off() - return r - elif isinstance(a, Integer): - r = Rational.__new__(Rational) - sig_str("FLINT exception") -- fmpq_poly_evaluate_mpz(r.value, self._poly, ( a).value) -+ fmpz_init_set_readonly(tmpfz, ( a).value) -+ fmpq_init(tmpfq) -+ fmpq_poly_evaluate_fmpz(tmpfq, self._poly, tmpfz) -+ fmpq_get_mpq(r.value, tmpfq) -+ fmpq_clear(tmpfq) -+ fmpz_clear_readonly(tmpfz) - sig_off() - return r - elif isinstance(a, int): -@@ -1321,6 +1331,7 @@ cdef class Polynomial_rational_flint(Polynomial): - """ - cdef Polynomial_rational_flint res - cdef bint do_sig -+ cdef fmpq_t tmpfq - - if right == 0: - raise ZeroDivisionError("division by zero polynomial") -@@ -1331,8 +1342,9 @@ cdef class Polynomial_rational_flint(Polynomial): - do_sig = _do_sig(self._poly) - - if do_sig: sig_str("FLINT exception") -- fmpq_poly_scalar_div_mpq(res._poly, self._poly, -- ( QQ(right)).value) -+ fmpq_init_set_readonly(tmpfq, ( QQ(right)).value) -+ fmpq_poly_scalar_div_fmpq(res._poly, self._poly, tmpfq) -+ fmpq_clear_readonly(tmpfq) - if do_sig: sig_off() - return res - -diff --git a/src/sage/rings/polynomial/polynomial_zmod_flint.pyx b/src/sage/rings/polynomial/polynomial_zmod_flint.pyx -index 6e7f7498329..3a66198d568 100644 ---- a/src/sage/rings/polynomial/polynomial_zmod_flint.pyx -+++ b/src/sage/rings/polynomial/polynomial_zmod_flint.pyx -@@ -658,6 +658,11 @@ cdef class Polynomial_zmod_flint(Polynomial_template): - ... - NotImplementedError: square free factorization of polynomials over rings with composite characteristic is not implemented - -+ :trac:`20003`:: -+ -+ sage: P. = GF(7)[] -+ sage: (6*x+3).squarefree_decomposition() -+ (6) * (x + 4) - """ - if not self.base_ring().is_field(): - raise NotImplementedError("square free factorization of polynomials over rings with composite characteristic is not implemented") -diff --git a/src/sage/rings/real_arb.pyx b/src/sage/rings/real_arb.pyx -index 17961ac36b2..8509b19cc66 100644 ---- a/src/sage/rings/real_arb.pyx -+++ b/src/sage/rings/real_arb.pyx -@@ -898,7 +898,7 @@ class RealBallField(UniqueRepresentation, sage.rings.abc.RealBallField): - sage: RBF.gamma(5) - 24.00000000000000 - sage: RBF.gamma(10**20) -- [+/- ...e+1956570552410610660600] -+ [1.932849514310098...+1956570551809674817225 +/- ...] - sage: RBF.gamma(1/3) - [2.678938534707747 +/- ...e-16] - sage: RBF.gamma(-5) -@@ -1102,7 +1102,7 @@ class RealBallField(UniqueRepresentation, sage.rings.abc.RealBallField): - 15.00000000000000, - 48.00000000000000] - sage: RBF.double_factorial(2**20) -- [1.4483729903e+2928836 +/- ...e+2928825] -+ [1.448372990...e+2928836 +/- ...] - sage: RBF.double_factorial(2**1000) - Traceback (most recent call last): - ... -diff --git a/src/sage/schemes/plane_conics/con_rational_function_field.py b/src/sage/schemes/plane_conics/con_rational_function_field.py -index 05d24e78a85..581102b5c5b 100644 ---- a/src/sage/schemes/plane_conics/con_rational_function_field.py -+++ b/src/sage/schemes/plane_conics/con_rational_function_field.py -@@ -198,38 +198,6 @@ def has_rational_point(self, point=False, algorithm='default', - Fraction Field of Univariate Polynomial Ring in u over Rational - Field with modulus v^2 - u^3 - 1 - -- ``has_rational_point`` fails for some conics over function fields -- over finite fields, due to :trac:`20003`:: -- -- sage: K. = PolynomialRing(GF(7)) -- sage: C = Conic([5*t^2 + 4, t^2 + 3*t + 3, 6*t^2 + 3*t + 2, -- ....: 5*t^2 + 5, 4*t + 3, 4*t^2 + t + 5]) -- sage: C.has_rational_point() # needs sage.libs.singular -- Traceback (most recent call last): -- ... -- TypeError: self (=Scheme morphism: -- From: Projective Conic Curve over Fraction Field of Univariate -- Polynomial Ring in t over Finite Field of size 7 defined by -- (-2*t^2 - 3)*x^2 + (-t^3 + 3*t^2 - 2*t - 2)/(t + 3)*y^2 + (-t^6 + 3*t^5 + t^3 - t^2 - t + 2)/(t^4 + t^3 - 3*t^2 + 3*t + 1)*z^2 -- To: Projective Conic Curve over Fraction Field of Univariate -- Polynomial Ring in t over Finite Field of size 7 defined by -- (-2*t^2 - 3)*x^2 + (t^2 + 3*t + 3)*x*y + (-2*t^2 - 2)*y^2 + (-t^2 + 3*t + 2)*x*z + (-3*t + 3)*y*z + (-3*t^2 + t - 2)*z^2 -- Defn: Defined on coordinates by sending (x : y : z) to -- (x + (2*t - 2)/(t + 3)*y + (3*t^4 + 2*t^3 - 2*t^2 - 2*t + 3)/(t^4 + t^3 - 3*t^2 + 3*t + 1)*z -- : y + (-t^3 - t^2 + 3*t - 1)/(t^3 - 3*t^2 + 2*t + 2)*z : z)) -- domain must equal right (=Scheme morphism: -- From: Projective Conic Curve over Fraction Field of Univariate -- Polynomial Ring in t over Finite Field of size 7 defined by -- (-2*t^3 - t^2 + 3*t + 3)*x^2 + (t - 3)*y^2 + (-t^7 + 2*t^5 + t^4 + 2*t^3 + 3*t^2 - t - 1)*z^2 -- To: Projective Conic Curve over Fraction Field of Univariate -- Polynomial Ring in t over Finite Field of size 7 defined by -- -2/(t^3 - 3*t^2 + 2*t + 2)*x^2 + 1/(t^3 + 3*t^2 - 2*t + 1)*y^2 + (-t^6 + 3*t^5 + t^3 - t^2 - t + 2)/(t^9 - 2*t^8 + t^7 - t^6 + 3*t^5 - 3*t^3 + t^2 - 2*t + 3)*z^2 -- Defn: Defined on coordinates by sending (x : y : z) to -- ((t^3 - 3*t^2 + 2*t + 2)*x : (t^2 - 2)*y : (t^5 - 3*t^4 + t^2 + 3*t + 3)*z)) -- codomain -- -- -- - TESTS:: - - sage: K. = FractionField(PolynomialRing(QQ, 't')) -@@ -250,6 +218,16 @@ def has_rational_point(self, point=False, algorithm='default', - sage: C.has_rational_point(point=True) # long time (4 seconds) # needs sage.libs.singular - (True, - ((-2/117*t^8 + 304/1053*t^7 + 40/117*t^6 - 1/27*t^5 - 110/351*t^4 - 2/195*t^3 + 11/351*t^2 + 1/117)/(t^4 + 2/39*t^3 + 4/117*t^2 + 2/39*t + 14/39) : -5/3*t^4 + 19*t^3 : 1)) -+ -+ ``has_rational_point`` used to fail for some conics over function fields -+ over finite fields, due to :trac:`20003`:: -+ -+ sage: K. = PolynomialRing(GF(7)) -+ sage: C = Conic([5*t^2 + 4, t^2 + 3*t + 3, 6*t^2 + 3*t + 2, -+ ....: 5*t^2 + 5, 4*t + 3, 4*t^2 + t + 5]) -+ sage: C.has_rational_point() -+ True -+ - """ - from .constructor import Conic - -diff --git a/src/sage/symbolic/ginac/inifcns_orthopoly.cpp b/src/sage/symbolic/ginac/inifcns_orthopoly.cpp -index a591cb4cd7c..a90f2050c59 100644 ---- a/src/sage/symbolic/ginac/inifcns_orthopoly.cpp -+++ b/src/sage/symbolic/ginac/inifcns_orthopoly.cpp -@@ -20,6 +20,7 @@ - #include "utils.h" - - #include "gmp.h" -+#include "flint/fmpz_poly.h" - #include "flint/fmpq_poly.h" - #include "flint/fmpq.h" - -@@ -63,7 +64,7 @@ static ex chebyt_eval(const ex& n_, const ex& x) - for (int i = 0; i= 7 - -+ def jmolpath(self): -+ """ -+ Return the path to the jar file. -+ -+ EXAMPLES:: -+ -+ sage: from sage.interfaces.jmoldata import JmolData -+ sage: JData = JmolData() -+ sage: JData.jmolpath() -+ '.../JmolData.jar' -+ -+ """ -+ jmolpath = os.path.join(JMOL_DIR, "JmolData.jar") -+ -+ if sys.platform == 'cygwin': -+ import cygwin -+ jmolpath = cygwin.cygpath(jmolpath, 'w') -+ -+ return jmolpath -+ -+ def is_jmol_available(self): -+ """ -+ Returns True if jmol is available and False if not. -+ -+ EXAMPLES: -+ -+ Check that it returns a boolean:: -+ -+ sage: from sage.interfaces.jmoldata import JmolData -+ sage: JData = JmolData() -+ sage: type(JData.is_jmol_available()) -+ <... 'bool'> -+ """ -+ if not os.path.isfile(self.jmolpath()): -+ return False -+ -+ if not self.is_jvm_available(): -+ return False -+ -+ return True -+ - def export_image(self, - targetfile, - datafile, #name (path) of data file Jmol can read or script file telling it what to read or load -@@ -154,12 +195,11 @@ def export_image(self, - sage: archive.close() - """ - # Set up paths, file names and scripts -- jmolpath = os.path.join(JMOL_DIR, "JmolData.jar") -+ jmolpath = self.jmolpath() - target_native = targetfile - - if sys.platform == 'cygwin': - import cygwin -- jmolpath = cygwin.cygpath(jmolpath, 'w') - target_native = cygwin.cygpath(target_native, 'w') - if datafile_cmd != 'script': - datafile = cygwin.cygpath(datafile, 'w') -diff --git a/src/sage/plot/plot3d/base.pyx b/src/sage/plot/plot3d/base.pyx -index 253f152130c..7588cde2e27 100644 ---- a/src/sage/plot/plot3d/base.pyx -+++ b/src/sage/plot/plot3d/base.pyx -@@ -278,7 +278,7 @@ cdef class Graphics3d(SageObject): - T.export_jmol(scene_zip, **opts) - from sage.interfaces.jmoldata import JmolData - jdata = JmolData() -- if not jdata.is_jvm_available(): -+ if not jdata.is_jmol_available(): - # We can only use JMol to generate preview if a jvm is installed - from sage.repl.rich_output.output_graphics import OutputImagePng - tachyon = self._rich_repr_tachyon(OutputImagePng, **opts) -diff --git a/src/sage/repl/rich_output/backend_ipython.py b/src/sage/repl/rich_output/backend_ipython.py -index 69e63b76d60..10ccdc0c2c8 100644 ---- a/src/sage/repl/rich_output/backend_ipython.py -+++ b/src/sage/repl/rich_output/backend_ipython.py -@@ -369,7 +369,7 @@ def launch_jmol(self, output_jmol, plain_text): - from sage.doctest import DOCTEST_MODE - from sage.interfaces.jmoldata import JmolData - jdata = JmolData() -- if not jdata.is_jvm_available() and not DOCTEST_MODE: -+ if not jdata.is_jmol_available() and not DOCTEST_MODE: - raise RuntimeError('jmol cannot run, no suitable java version found') - launch_script = output_jmol.launch_script_filename() - jmol_cmd = 'jmol' diff --git a/srcpkgs/sagemath/patches/36862-giac_1.9.0-73.patch b/srcpkgs/sagemath/patches/36862-giac_1.9.0-73.patch deleted file mode 100644 index 8eb2c20a34c52a..00000000000000 --- a/srcpkgs/sagemath/patches/36862-giac_1.9.0-73.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff --git a/src/sage/calculus/calculus.py b/src/sage/calculus/calculus.py -index dfaafb4353f..8d62ade24c8 100644 ---- a/src/sage/calculus/calculus.py -+++ b/src/sage/calculus/calculus.py -@@ -568,8 +568,8 @@ def symbolic_sum(expression, v, a, b, algorithm='maxima', hold=False): - - An example of this summation with Giac:: - -- sage: symbolic_sum(1/(1+k^2), k, -oo, oo, algorithm='giac') -- (pi*e^(2*pi) - pi*e^(-2*pi))/(e^(2*pi) + e^(-2*pi) - 2) -+ sage: symbolic_sum(1/(1+k^2), k, -oo, oo, algorithm='giac').factor() -+ pi*(e^(2*pi) + 1)/((e^pi + 1)*(e^pi - 1)) - - The same summation is solved by SymPy:: - diff --git a/srcpkgs/sagemath/patches/37004-fix_save_session_when_cython_changes.patch b/srcpkgs/sagemath/patches/37004-fix_save_session_when_cython_changes.patch deleted file mode 100644 index c3e6c055026217..00000000000000 --- a/srcpkgs/sagemath/patches/37004-fix_save_session_when_cython_changes.patch +++ /dev/null @@ -1,182 +0,0 @@ -diff --git a/src/sage/doctest/forker.py b/src/sage/doctest/forker.py -index efd28d10abe..56a9fe5e8f6 100644 ---- a/src/sage/doctest/forker.py -+++ b/src/sage/doctest/forker.py -@@ -2477,19 +2477,6 @@ class DocTestTask(): - ['cputime', 'err', 'failures', 'optionals', 'tests', 'walltime', 'walltime_skips'] - """ - -- extra_globals = {} -- """ -- Extra objects to place in the global namespace in which tests are run. -- Normally this should be empty but there are special cases where it may -- be useful. -- -- For example, in Sage versions 9.1 and earlier, on Python 3 add -- ``long`` as an alias for ``int`` so that tests that use the -- ``long`` built-in (of which there are many) still pass. We did -- this so that the test suite could run on Python 3 while Python 2 -- was still the default. -- """ -- - def __init__(self, source): - """ - Initialization. -@@ -2614,10 +2601,6 @@ def _run(self, runner, options, results): - # Remove '__package__' item from the globals since it is not - # always in the globals in an actual Sage session. - dict_all.pop('__package__', None) -- -- # Add any other special globals for testing purposes only -- dict_all.update(self.extra_globals) -- - sage_namespace = RecordingDict(dict_all) - sage_namespace['__name__'] = '__main__' - doctests, extras = self.source.create_doctests(sage_namespace) -diff --git a/src/sage/misc/session.pyx b/src/sage/misc/session.pyx -index 31454dac993..53b732309da 100644 ---- a/src/sage/misc/session.pyx -+++ b/src/sage/misc/session.pyx -@@ -27,7 +27,7 @@ This saves a dictionary with ``w`` as one of the keys:: - - sage: z = load(os.path.join(d.name, 'session')) - sage: list(z) -- ['d', 'w'] -+ ['w', 'd'] - sage: z['w'] - 2/3 - -@@ -68,11 +68,12 @@ AUTHOR: - import builtins - import types - --# We want the caller's locals, but locals() is emulated in Cython --cdef caller_locals = builtins.locals -- - # Sage imports - from sage.misc.persist import load, save, loads, dumps -+from sage.misc.lazy_import import LazyImport -+ -+# We want the caller's locals, but locals() is emulated in Cython -+cdef caller_locals = builtins.locals - - # This module-scope variables is used to save the - # global state of the sage environment at the moment -@@ -80,7 +81,6 @@ from sage.misc.persist import load, save, loads, dumps - - state_at_init = None - --CythonFunctionType = type(lambda: None) - - def init(state=None): - """ -@@ -163,9 +163,13 @@ def _is_new_var(x, v, hidden): - # definitely new. - if x not in state_at_init: - return True -+ # A lazy import that was there at init time is not new -+ if isinstance(v, LazyImport): -+ return False - # A variable could also be new even if it was there at init, say if - # its value changed. -- return x not in state_at_init or state_at_init[x] is not v -+ return state_at_init[x] is not v -+ - - def show_identifiers(hidden=False): - r""" -@@ -196,7 +200,7 @@ def show_identifiers(hidden=False): - sage: a = 10 - sage: factor = 20 - sage: show_identifiers() -- ['a', 'factor'] -+ ['factor', 'a'] - - To get the actual value of a variable from the list, use the - :func:`globals()` function.:: -@@ -210,7 +214,7 @@ def show_identifiers(hidden=False): - - sage: _hello = 10 - sage: show_identifiers() -- ['a', 'factor'] -+ ['factor', 'a'] - sage: '_hello' in show_identifiers(hidden=True) - True - -@@ -218,19 +222,13 @@ def show_identifiers(hidden=False): - least in command line mode.:: - - sage: show_identifiers(hidden=True) # random output -- ['__', '_i', '_6', '_4', '_3', '_1', '_ii', '__doc__', '__builtins__', '___', '_9', '__name__', '_', 'a', '_i12', '_i14', 'factor', '__file__', '_hello', '_i13', '_i11', '_i10', '_i15', '_i5', '_13', '_10', '_iii', '_i9', '_i8', '_i7', '_i6', '_i4', '_i3', '_i2', '_i1', '_init_cmdline', '_14'] -+ ['__builtin__', '_ih', '_oh', '_dh', 'exit', 'quit', '_', '__', '___', -+ '_i', '_ii', '_iii', '_i1', 'factor', '_i2', '_2', '_i3', 'a', '_i4', -+ '_i5', '_5', '_i6', '_6', '_i7', '_hello', '_i8', '_8', '_i9', '_9', -+ '_i10'] - """ -- from sage.doctest.forker import DocTestTask - state = caller_locals() -- # Ignore extra variables injected into the global namespace by the doctest -- # runner -- _none = object() -- -- def _in_extra_globals(name, val): -- return val == DocTestTask.extra_globals.get(name, _none) -- -- return sorted([x for x, v in state.items() if _is_new_var(x, v, hidden) -- and not _in_extra_globals(x, v)]) -+ return [x for x, v in state.items() if _is_new_var(x, v, hidden)] - - - def save_session(name='sage_session', verbose=False): -@@ -293,28 +291,44 @@ def save_session(name='sage_session', verbose=False): - sage: f = lambda x : x^2 - sage: save_session(tmp_f) - sage: save_session(tmp_f, verbose=True) -- Saving... -- Not saving f: f is a function, method, class or type - ... -+ Not saving f: f is a function or method - - Something similar happens for cython-defined functions:: - - sage: g = cython_lambda('double x', 'x*x + 1.5') - sage: save_session(tmp_f, verbose=True) -- Saving... -- Not saving g: g is a function, method, class or type - ... -+ Not saving g: g is a cython function or method -+ -+ And the same for a lazy import:: -+ -+ sage: from sage.misc.lazy_import import LazyImport -+ sage: lazy_ZZ = LazyImport('sage.rings.integer_ring', 'ZZ') -+ sage: save_session(tmp_f, verbose=True) -+ ... -+ Not saving lazy_ZZ: lazy_ZZ is a lazy import - """ - state = caller_locals() - # This dict D will contain the session -- as a dict -- that we will save to disk. - D = {} - # We iterate only over the new variables that were defined in this - # session, since those are the only ones we will save. -- for k in show_identifiers(hidden = True): -+ for k in show_identifiers(hidden=True): - try: - x = state[k] -- if isinstance(x, (types.FunctionType, types.BuiltinFunctionType, types.BuiltinMethodType, CythonFunctionType, type)): -- raise TypeError('{} is a function, method, class or type'.format(k)) -+ -+ if isinstance(x, type): -+ raise TypeError('{} is a class or type'.format(k)) -+ -+ if isinstance(x, (types.FunctionType, types.BuiltinFunctionType, types.BuiltinMethodType)): -+ raise TypeError('{} is a function or method'.format(k)) -+ -+ if getattr(type(x), '__name__', None) == 'cython_function_or_method': -+ raise TypeError('{} is a cython function or method'.format(k)) -+ -+ if isinstance(x, LazyImport): -+ raise TypeError('{} is a lazy import'.format(k)) - - # We attempt to pickle *and* unpickle every variable to - # make *certain* that we can pickled D at the end below. diff --git a/srcpkgs/sagemath/patches/37123-scipy_1.12.patch b/srcpkgs/sagemath/patches/37123-scipy_1.12.patch deleted file mode 100644 index 3973b55cdbd51f..00000000000000 --- a/srcpkgs/sagemath/patches/37123-scipy_1.12.patch +++ /dev/null @@ -1,26 +0,0 @@ -diff --git a/src/sage/matrix/matrix_double_dense.pyx b/src/sage/matrix/matrix_double_dense.pyx -index 5d19067f2ed..97e50fb2616 100644 ---- a/src/sage/matrix/matrix_double_dense.pyx -+++ b/src/sage/matrix/matrix_double_dense.pyx -@@ -867,7 +867,7 @@ cdef class Matrix_double_dense(Matrix_numpy_dense): - # set cutoff as RDF element - if eps == 'auto': - if scipy is None: import scipy -- eps = 2*max(self._nrows, self._ncols)*scipy.finfo(float).eps*sv[0] -+ eps = 2*max(self._nrows, self._ncols)*numpy.finfo(float).eps*sv[0] - eps = RDF(eps) - # locate non-zero entries - rank = 0 -diff --git a/src/sage/numerical/optimize.py b/src/sage/numerical/optimize.py -index 708d440a205..9f973c6bd69 100644 ---- a/src/sage/numerical/optimize.py -+++ b/src/sage/numerical/optimize.py -@@ -426,7 +426,7 @@ def minimize(func, x0, gradient=None, hessian=None, algorithm="default", - hess = func.hessian() - hess_fast = [ [fast_callable(a, vars=var_names, domain=float) for a in row] for row in hess] - hessian = lambda p: [[a(*p) for a in row] for row in hess_fast] -- from scipy import dot -+ from numpy import dot - hessian_p = lambda p,v: dot(numpy.array(hessian(p)),v) - min = optimize.fmin_ncg(f, [float(_) for _ in x0], fprime=gradient, - fhess=hessian, fhess_p=hessian_p, disp=verbose, **args) diff --git a/srcpkgs/sagemath/patches/37484-flint_3.1.patch b/srcpkgs/sagemath/patches/37484-flint_3.1.patch new file mode 100644 index 00000000000000..d96095c1366785 --- /dev/null +++ b/srcpkgs/sagemath/patches/37484-flint_3.1.patch @@ -0,0 +1,204 @@ +diff --git a/src/.relint.yml b/src/.relint.yml +index 97bf2ac1dbc..61dcf109c88 100644 +--- a/src/.relint.yml ++++ b/src/.relint.yml +@@ -71,4 +71,4 @@ + magic doctest comments should appear on the "sage:" line, not "....:" lines + # see optional_regex in src/sage/doctest/parsing.py + # "indirect doctest" is from src/bin/sage-coverage +- pattern: '^[ ]*[.][.][.][.]:.*#.*(arb216|arb218|py2|py3|long time|not implemented|not tested|known bug|optional|indirect doctest)' ++ pattern: '^[ ]*[.][.][.][.]:.*#.*(py2|py3|long time|not implemented|not tested|known bug|optional|indirect doctest)' +diff --git a/src/sage/doctest/control.py b/src/sage/doctest/control.py +index 2973e9f6c64..58d4d53dbb9 100644 +--- a/src/sage/doctest/control.py ++++ b/src/sage/doctest/control.py +@@ -58,14 +58,6 @@ + + auto_optional_tags = set() + +-try: +- from sage.libs.arb.arb_version import version as arb_vers +- arb_tag = 'arb2' + arb_vers().split('.')[1] +- auto_optional_tags.add(arb_tag) +-except ImportError: +- pass +- +- + class DocTestDefaults(SageObject): + """ + This class is used for doctesting the Sage doctest module. +diff --git a/src/sage/doctest/parsing.py b/src/sage/doctest/parsing.py +index 3e5b0a98975..31c27ddd4f2 100644 +--- a/src/sage/doctest/parsing.py ++++ b/src/sage/doctest/parsing.py +@@ -95,7 +95,7 @@ def fake_RIFtol(*args): + ansi_escape_sequence = re.compile(r"(\x1b[@-Z\\-~]|\x1b\[.*?[@-~]|\x9b.*?[@-~])") + + special_optional_regex = ( +- "arb216|arb218|py2|long time|not implemented|not tested|optional|needs|known bug" ++ "py2|long time|not implemented|not tested|optional|needs|known bug" + ) + tag_with_explanation_regex = r"((?:\w|[.])*)\s*(?:\((?P.*?)\))?" + optional_regex = re.compile( +@@ -136,8 +136,6 @@ def parse_optional_tags( + - ``'not tested'`` + - ``'known bug'`` (possible values are ``None``, ``linux`` and ``macos``) + - ``'py2'`` +- - ``'arb216'`` +- - ``'arb218'`` + - ``'optional - FEATURE...'`` or ``'needs FEATURE...'`` -- + the dictionary will just have the key ``'FEATURE'`` + +diff --git a/src/sage/libs/arb/arb_version.pyx b/src/sage/libs/arb/arb_version.pyx +deleted file mode 100644 +index b8ab4d725e5..00000000000 +--- a/src/sage/libs/arb/arb_version.pyx ++++ /dev/null +@@ -1,23 +0,0 @@ +-# -*- coding: utf-8 +-from sage.cpython.string cimport char_to_str +- +- +-cdef extern from "arb_wrap.h": +- char * arb_version +- +- +-def version(): +- """ +- Get arb version +- +- TESTS:: +- +- sage: from sage.libs.arb.arb_version import version +- sage: version().split('.')[0] +- '2' +- """ +- try: +- py_string = char_to_str(arb_version) +- finally: +- pass +- return py_string +diff --git a/src/sage/libs/flint/flint_wrap.h b/src/sage/libs/flint/flint_wrap.h +index fcfe660a1f6..1302973779e 100644 +--- a/src/sage/libs/flint/flint_wrap.h ++++ b/src/sage/libs/flint/flint_wrap.h +@@ -136,8 +136,6 @@ + #include + #include + #include +-#include +-#include + #include + #include + #include +diff --git a/src/sage/libs/flint/fmpq.pxd b/src/sage/libs/flint/fmpq.pxd +index 41f075326fe..61ebabac2b0 100644 +--- a/src/sage/libs/flint/fmpq.pxd ++++ b/src/sage/libs/flint/fmpq.pxd +@@ -41,14 +41,12 @@ cdef extern from "flint_wrap.h": + void fmpq_height(fmpz_t height, const fmpq_t x) noexcept + flint_bitcnt_t fmpq_height_bits(const fmpq_t x) noexcept + void fmpq_set_fmpz_frac(fmpq_t res, const fmpz_t p, const fmpz_t q) noexcept +- void fmpq_get_mpz_frac(mpz_t a, mpz_t b, fmpq_t c) noexcept + void fmpq_set_si(fmpq_t res, slong p, ulong q) noexcept + void _fmpq_set_si(fmpz_t rnum, fmpz_t rden, slong p, ulong q) noexcept + void fmpq_set_ui(fmpq_t res, ulong p, ulong q) noexcept + void _fmpq_set_ui(fmpz_t rnum, fmpz_t rden, ulong p, ulong q) noexcept + void fmpq_set_mpq(fmpq_t dest, const mpq_t src) noexcept + int fmpq_set_str(fmpq_t dest, const char * s, int base) noexcept +- void fmpq_init_set_mpz_frac_readonly(fmpq_t z, const mpz_t p, const mpz_t q) noexcept + double fmpq_get_d(const fmpq_t f) noexcept + void fmpq_get_mpq(mpq_t dest, const fmpq_t src) noexcept + int fmpq_get_mpfr(mpfr_t dest, const fmpq_t src, mpfr_rnd_t rnd) noexcept +diff --git a/src/sage/rings/complex_arb.pyx b/src/sage/rings/complex_arb.pyx +index b7384f628dc..31d1baf0f38 100644 +--- a/src/sage/rings/complex_arb.pyx ++++ b/src/sage/rings/complex_arb.pyx +@@ -4792,18 +4792,14 @@ cdef class ComplexBall(RingElement): + + sage: n = CBF(1,1) + sage: m = CBF(-2/3, 3/5) +- sage: n.elliptic_pi_inc(CBF.pi()/2, m) # arb216 +- [0.8934793755173 +/- ...e-14] + [0.95707868710750 +/- ...e-15]*I +- sage: n.elliptic_pi_inc(CBF.pi()/2, m) # arb218 - this is a regression, see :trac:28623 ++ sage: n.elliptic_pi_inc(CBF.pi()/2, m) # this is a regression, see :trac:28623 + nan + nan*I + sage: n.elliptic_pi(m) + [0.8934793755173...] + [0.957078687107...]*I + + sage: n = CBF(2, 3/7) + sage: m = CBF(-1/3, 2/9) +- sage: n.elliptic_pi_inc(CBF.pi()/2, m) # arb216 +- [0.2969588746419 +/- ...e-14] + [1.3188795332738 +/- ...e-14]*I +- sage: n.elliptic_pi_inc(CBF.pi()/2, m) # arb218 - this is a regression, see :trac:28623 ++ sage: n.elliptic_pi_inc(CBF.pi()/2, m) # this is a regression, see :trac:28623 + nan + nan*I + sage: n.elliptic_pi(m) + [0.296958874641...] + [1.318879533273...]*I +diff --git a/src/sage/rings/real_arb.pyx b/src/sage/rings/real_arb.pyx +index 8509b19cc66..5769123c6d2 100644 +--- a/src/sage/rings/real_arb.pyx ++++ b/src/sage/rings/real_arb.pyx +@@ -294,11 +294,7 @@ cdef int arb_to_mpfi(mpfi_t target, arb_t source, const long precision) except - + + EXAMPLES:: + +- sage: RIF(RBF(2)**(2**100)) # arb216 # indirect doctest +- Traceback (most recent call last): +- ... +- ArithmeticError: Error converting arb to mpfi. Overflow? +- sage: RIF(RBF(2)**(2**100)) # arb218 # indirect doctest ++ sage: RIF(RBF(2)**(2**100)) + [5.8756537891115869e1388255822130839282 .. +infinity] # 64-bit + [2.098... .. +infinity] # 32-bit + +@@ -1729,11 +1725,7 @@ cdef class RealBall(RingElement): + :: + + sage: b = RBF(2)^(2^1000) +- sage: b.mid() # arb216 +- Traceback (most recent call last): +- ... +- RuntimeError: unable to convert to MPFR (exponent out of range?) +- sage: b.mid() # arb218 ++ sage: b.mid() + +infinity + + .. SEEALSO:: :meth:`rad`, :meth:`squash` +diff --git a/src/sage/symbolic/ginac/useries-flint.h b/src/sage/symbolic/ginac/useries-flint.h +index 7ecd4d50107..08847273e2e 100644 +--- a/src/sage/symbolic/ginac/useries-flint.h ++++ b/src/sage/symbolic/ginac/useries-flint.h +@@ -27,9 +27,6 @@ + #include "flint/fmpq_poly.h" + #include "flint/fmpq.h" + +-extern "C" void fmpq_get_mpz_frac(mpz_t a, mpz_t b, fmpq_t c); +-extern "C" void fmpq_init_set_mpz_frac_readonly(fmpq_t z, const mpz_t p, const mpz_t q); +- + #include + + +diff --git a/src/sage/symbolic/ginac/useries.cpp b/src/sage/symbolic/ginac/useries.cpp +index b9a8b867648..7649e36b49a 100644 +--- a/src/sage/symbolic/ginac/useries.cpp ++++ b/src/sage/symbolic/ginac/useries.cpp +@@ -550,14 +550,16 @@ void power::useries(flint_series_t& fp, int order) const + mpz_t cnum, cden; + mpz_init(cnum); + mpz_init(cden); +- fmpq_get_mpz_frac(cnum, cden, c); ++ fmpz_get_mpz(cnum, fmpq_numref(c)); ++ fmpz_get_mpz(cden, fmpq_denref(c)); + if (not mpz_perfect_square_p(cnum) + or not mpz_perfect_square_p(cden)) + throw flint_error(); + mpz_sqrt(cnum, cnum); + mpz_sqrt(cden, cden); + fmpq_t cc; +- fmpq_init_set_mpz_frac_readonly(cc, cnum, cden); ++ fmpz_init_set_readonly(fmpq_numref(cc), cnum); ++ fmpz_init_set_readonly(fmpq_denref(cc), cden); + mpz_clear(cnum); + mpz_clear(cden); + diff --git a/srcpkgs/sagemath/patches/get_patches b/srcpkgs/sagemath/patches/get_patches index b7836e27910d5b..11ed4e288ca4b4 100755 --- a/srcpkgs/sagemath/patches/get_patches +++ b/srcpkgs/sagemath/patches/get_patches @@ -20,11 +20,7 @@ get_pr() { # run from patches dir cd $(dirname "$0") -# all merged in 10.3.beta6 or before -get_pr 35848 "flintlib 3.0" -get_pr 36769 "fix jmol detect" -get_pr 36862 "giac 1.9.0-73" -get_pr 37004 "fix save_session when cython changes" - # positive review -get_pr 37123 "scipy 1.12" + +# needs review +get_pr 37484 "flint 3.1" diff --git a/srcpkgs/sagemath/template b/srcpkgs/sagemath/template index 7bc92e7c107351..d8df8e85a17fa7 100644 --- a/srcpkgs/sagemath/template +++ b/srcpkgs/sagemath/template @@ -1,7 +1,7 @@ # Template file for 'sagemath' pkgname=sagemath -version=10.2 -revision=2 +version=10.3.rc0 +revision=1 build_wrksrc=pkgs/sagemath-standard build_style=python3-module _bindir=/usr/lib/sagemath/$version/bin @@ -24,7 +24,7 @@ depends="eclib-devel fflas-ffpack flintlib-devel gcc-fortran meson gd-devel python3-memory_allocator python3-networkx python3-pip python3-pkgconfig python3-pplpy python3-primecountpy python3-requests python3-scipy python3-sympy python3-traitlets sage-data-combinatorial_designs - sage-data-conway_polynomials sage-data-elliptic_curves sage-data-graphs + python3-conway-polynomials sage-data-elliptic_curves sage-data-graphs sage-data-polytopes_db sympow tachyon threejs-sage" checkdepends="$depends pythran python3-Sphinx" short_desc="Open source mathematics software" @@ -33,16 +33,18 @@ license="GPL-2.0-or-later" homepage="https://www.sagemath.org/" changelog="https://github.com/sagemath/sage/releases" distfiles="https://github.com/sagemath/sage/archive/refs/tags/$version.tar.gz" -checksum=e7125f13495e1068edab73735aca7f9b2c655688096e9d109e628c023e76411f +checksum=529de6649900bdc8190dbd0aaa2cc404d651bfc126ff72d9683515d8344ecc79 nocross="due to ntl (eclib, singular), fflas-ffpack, givaro, linbox, sympow, maxima" post_patch() { # git tree needs bootstrapping $wrksrc/bootstrap sagelib + + # we need sage_setup here + ln -s ../../src/sage_setup . } pre_build() { - export PYTHONPATH=../sage-setup export PYTHONDONTWRITEBYTECODE=yes export SAGE_NUM_THREADS="$XBPS_MAKEJOBS" } @@ -52,12 +54,11 @@ post_build() { _scripts=$(cd build/scripts* && pwd) # configuration files - cp ${FILESDIR}/sage_conf.py $_lib + #cp ${FILESDIR}/sage_conf.py $_lib cp ${FILESDIR}/sage-env-config $_scripts } pre_install() { - export PYTHONPATH=../sage-setup export PYTHONDONTWRITEBYTECODE=yes export SAGE_NUM_THREADS="$XBPS_MAKEJOBS" } @@ -77,7 +78,7 @@ post_install() { # we don't have docs here rm ${DESTDIR}/usr/share/jupyter/kernels/sagemath/doc # this symlink is shipped in threejs-sage pkg - rm ${DESTDIR}/usr/share/jupyter/nbextensions/threejs-sage + rm -f ${DESTDIR}/usr/share/jupyter/nbextensions/threejs-sage # symlink main binary vmkdir usr/bin diff --git a/srcpkgs/sagemath/update b/srcpkgs/sagemath/update index 1a4e4049af0251..f34bbdf5ec69b0 100644 --- a/srcpkgs/sagemath/update +++ b/srcpkgs/sagemath/update @@ -1,6 +1,6 @@ pkgname="sage" -site="https://mirrors.mit.edu/sage/src/" -if [[ "$version" == *[abr]* ]]; then - site+=" +site="https://mirrors.mit.edu/sage/src/ https://mirrors.mit.edu/sage/devel/" +if [[ "$version" != *[abr]* ]]; then + ignore="*[abr]*" fi