From 90213500c0df57ebf0952ce3026f8217b33b4198 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= Date: Thu, 28 Dec 2023 12:16:59 -0300 Subject: [PATCH 1/5] python3-ipython: use upstream proposed patch --- .../patches/14274-fix-sagemath-prompt.patch | 82 +++++++++++++++++++ .../patches/fix-sagemath-prompt.patch | 15 ---- srcpkgs/python3-ipython/template | 2 +- 3 files changed, 83 insertions(+), 16 deletions(-) create mode 100644 srcpkgs/python3-ipython/patches/14274-fix-sagemath-prompt.patch delete mode 100644 srcpkgs/python3-ipython/patches/fix-sagemath-prompt.patch diff --git a/srcpkgs/python3-ipython/patches/14274-fix-sagemath-prompt.patch b/srcpkgs/python3-ipython/patches/14274-fix-sagemath-prompt.patch new file mode 100644 index 0000000000000..625ba89749c6d --- /dev/null +++ b/srcpkgs/python3-ipython/patches/14274-fix-sagemath-prompt.patch @@ -0,0 +1,82 @@ +See: https://github.com/ipython/ipython/pull/14223#issuecomment-1869776898 + +From 96afe65f22e2640efb102f6fa0d4fb6f1188fe21 Mon Sep 17 00:00:00 2001 +From: Matthias Bussonnier +Date: Wed, 27 Dec 2023 17:10:15 +0100 +Subject: [PATCH] Inspect continuation prompt signature and pass only viable + arguments. + +Closes #14273 +--- + IPython/terminal/interactiveshell.py | 23 ++++++++++++++++++++--- + docs/source/config/details.rst | 2 +- + 2 files changed, 21 insertions(+), 4 deletions(-) + +diff --git a/IPython/terminal/interactiveshell.py b/IPython/terminal/interactiveshell.py +index 532287f5e7..5af2ffa948 100644 +--- a/IPython/terminal/interactiveshell.py ++++ b/IPython/terminal/interactiveshell.py +@@ -3,6 +3,7 @@ + import asyncio + import os + import sys ++import inspect + from warnings import warn + from typing import Union as UnionType, Optional + +@@ -66,8 +67,8 @@ + PTK3 = ptk_version.startswith('3.') + + +-class _NoStyle(Style): pass +- ++class _NoStyle(Style): ++ pass + + + _style_overrides_light_bg = { +@@ -84,6 +85,20 @@ class _NoStyle(Style): pass + Token.OutPromptNum: '#ansired bold', + } + ++ ++def _backward_compat_continuation_prompt_tokens(method, width: int, *, lineno: int): ++ """ ++ Sagemath use custom prompt and we broke them in 8.19. ++ """ ++ sig = inspect.signature(method) ++ if "lineno" in inspect.signature(method).parameters or any( ++ [p.kind == p.VAR_KEYWORD for p in sig.parameters.values()] ++ ): ++ return method(width, lineno=lineno) ++ else: ++ return method(width) ++ ++ + def get_default_editor(): + try: + return os.environ['EDITOR'] +@@ -764,7 +779,9 @@ def get_message(): + "message": get_message, + "prompt_continuation": ( + lambda width, lineno, is_soft_wrap: PygmentsTokens( +- self.prompts.continuation_prompt_tokens(width, lineno=lineno) ++ _backward_compat_continuation_prompt_tokens( ++ self.prompts.continuation_prompt_tokens, width, lineno=lineno ++ ) + ) + ), + "multiline": True, +diff --git a/docs/source/config/details.rst b/docs/source/config/details.rst +index 6ba9855567..2e7e5be45a 100644 +--- a/docs/source/config/details.rst ++++ b/docs/source/config/details.rst +@@ -34,7 +34,7 @@ which defines the defaults. The required interface is like this: + :class:`~.TerminalInteractiveShell` instance. + + .. method:: in_prompt_tokens(cli=None) +- continuation_prompt_tokens(self, cli=None, width=None) ++ continuation_prompt_tokens(self, width=None) + rewrite_prompt_tokens() + out_prompt_tokens() + diff --git a/srcpkgs/python3-ipython/patches/fix-sagemath-prompt.patch b/srcpkgs/python3-ipython/patches/fix-sagemath-prompt.patch deleted file mode 100644 index 5b7089156ac60..0000000000000 --- a/srcpkgs/python3-ipython/patches/fix-sagemath-prompt.patch +++ /dev/null @@ -1,15 +0,0 @@ -See: https://github.com/ipython/ipython/pull/14223#issuecomment-1869776898 - -diff --git a/IPython/terminal/interactiveshell.py b/IPython/terminal/interactiveshell.py -index 532287f5e..d92d6b7b2 100644 ---- a/IPython/terminal/interactiveshell.py -+++ b/IPython/terminal/interactiveshell.py -@@ -764,7 +764,7 @@ def get_message(): - "message": get_message, - "prompt_continuation": ( - lambda width, lineno, is_soft_wrap: PygmentsTokens( -- self.prompts.continuation_prompt_tokens(width, lineno=lineno) -+ self.prompts.continuation_prompt_tokens(width) - ) - ), - "multiline": True, diff --git a/srcpkgs/python3-ipython/template b/srcpkgs/python3-ipython/template index 5719ae4a9a717..c684800f3d3e9 100644 --- a/srcpkgs/python3-ipython/template +++ b/srcpkgs/python3-ipython/template @@ -1,7 +1,7 @@ # Template file for 'python3-ipython' pkgname=python3-ipython version=8.19.0 -revision=2 +revision=3 build_style=python3-pep517 hostmakedepends="python3-setuptools python3-wheel" depends="python3-jedi python3-decorator python3-pickleshare From 393966b2f833e3d5d4a67d6bf38c14a68e75c7c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= Date: Wed, 3 Jan 2024 12:25:56 -0300 Subject: [PATCH 2/5] openblas: update to 0.3.26. --- srcpkgs/openblas/template | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/srcpkgs/openblas/template b/srcpkgs/openblas/template index 22009896ec2fd..6164389ac5914 100644 --- a/srcpkgs/openblas/template +++ b/srcpkgs/openblas/template @@ -1,6 +1,6 @@ # Template file for 'openblas' pkgname=openblas -version=0.3.25 +version=0.3.26 revision=1 build_style=gnu-makefile make_build_args="HOSTCC=gcc USE_OPENMP=1" @@ -13,7 +13,7 @@ license="BSD-3-Clause" homepage="https://www.openblas.net/" changelog="https://raw.githubusercontent.com/xianyi/OpenBLAS/develop/Changelog.txt" distfiles="https://github.com/xianyi/OpenBLAS/archive/v${version}.tar.gz" -checksum=4c25cb30c4bb23eddca05d7d0a85997b8db6144f5464ba7f8c09ce91e2f35543 +checksum=4e6e4f5cb14c209262e33e6816d70221a2fe49eb69eaf0a06f065598ac602c68 case "$XBPS_TARGET_MACHINE" in ppc64*) ;; From 237548f5d46d27442f5afae8317fcbe066dbf08e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= Date: Wed, 3 Jan 2024 12:26:00 -0300 Subject: [PATCH 3/5] python3-numpy: update to 1.26.3. --- srcpkgs/python3-numpy/template | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/srcpkgs/python3-numpy/template b/srcpkgs/python3-numpy/template index 5a82530390982..e438ab97c522f 100644 --- a/srcpkgs/python3-numpy/template +++ b/srcpkgs/python3-numpy/template @@ -1,6 +1,6 @@ # Template file for 'python3-numpy' pkgname=python3-numpy -version=1.26.2 +version=1.26.3 revision=1 build_style=python3-pep517 build_helper="meson qemu" @@ -17,9 +17,9 @@ short_desc="Fast and sophisticated array facility to Python3" maintainer="Andrew J. Hesford " license="BSD-3-Clause" homepage="https://www.numpy.org/" -changelog="https://numpy.org/doc/stable/release.html" +changelog="https://github.com/numpy/numpy/releases" distfiles="${PYPI_SITE}/n/numpy/numpy-${version}.tar.gz" -checksum=f65738447676ab5777f11e6bbbdb8ce11b785e105f690bc45966574816b6d3ea +checksum=697df43e2b6310ecc9d95f05d5ef20eacc09c7c4ecc9da3f235d39e71b7da1e4 alternatives="numpy:f2py:/usr/bin/f2py3" build_options="openblas" From f9f17554765c973a7bacf73c22dc124b0ac0c45a 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 4/5] New package: python3-conway-polynomials-0.8 --- 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 0000000000000..388bc0017eded --- /dev/null +++ b/srcpkgs/python3-conway-polynomials/template @@ -0,0 +1,16 @@ +# Template file for 'python3-conway-polynomials' +pkgname=python3-conway-polynomials +version=0.8 +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=67ddcd7c0fa7a569fddd9ba70621423e638fd03646c1d4a375c8301f6b1100cb From 8ba09da971cd4cdf06004f146e98a186e7ce543c 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.beta4. --- srcpkgs/sagemath/files/sage_conf.py | 3 +- .../sagemath/patches/35848-flintlib_3.0.patch | 1867 ----------------- .../patches/36769-fix_jmol_detect.patch | 92 - srcpkgs/sagemath/patches/get_patches | 4 +- srcpkgs/sagemath/template | 17 +- srcpkgs/sagemath/update | 6 +- 6 files changed, 16 insertions(+), 1973 deletions(-) delete mode 100644 srcpkgs/sagemath/patches/35848-flintlib_3.0.patch delete mode 100644 srcpkgs/sagemath/patches/36769-fix_jmol_detect.patch diff --git a/srcpkgs/sagemath/files/sage_conf.py b/srcpkgs/sagemath/files/sage_conf.py index bc5388de8956d..d9ff901ac40e5 100644 --- a/srcpkgs/sagemath/files/sage_conf.py +++ b/srcpkgs/sagemath/files/sage_conf.py @@ -1,3 +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 2cad28134f6e6..0000000000000 --- 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/get_patches b/srcpkgs/sagemath/patches/get_patches index a552b402727d3..4bc46a675420b 100755 --- a/srcpkgs/sagemath/patches/get_patches +++ b/srcpkgs/sagemath/patches/get_patches @@ -20,6 +20,6 @@ get_pr() { # run from patches dir cd $(dirname "$0") +# positive review + # needs review -get_pr 35848 "flintlib 3.0" -get_pr 36769 "fix jmol detect" diff --git a/srcpkgs/sagemath/template b/srcpkgs/sagemath/template index 5d5bdccd70a25..1c405a4a82f69 100644 --- a/srcpkgs/sagemath/template +++ b/srcpkgs/sagemath/template @@ -1,6 +1,6 @@ # Template file for 'sagemath' pkgname=sagemath -version=10.2 +version=10.3.beta4 revision=1 build_wrksrc=pkgs/sagemath-standard build_style=python3-module @@ -15,7 +15,7 @@ makedepends="boost-devel brial-devel cliquer-devel ecl eclib-devel mpfr-devel ntl-devel openblas-devel pari-devel planarity-devel python3-cypari2 python3-cysignals python3-devel python3-gmpy2 python3-memory_allocator python3-numpy rankwidth-devel singular symmetrica-devel" -depends="eclib-devel fflas-ffpack flintlib-devel gcc-fortran gd-devel +depends="eclib-devel fflas-ffpack flintlib-devel gcc-fortran meson gd-devel gfan giac gsl-devel gzip libpng-devel linbox-devel m4ri-devel maxima-ecl mpfr-devel nauty ntl-devel palp pari-devel pari-elldata-small pari-galdata pari-galpol-small pari-seadata-small pkg-config python3-Cython python3-cypari2 @@ -24,25 +24,27 @@ depends="eclib-devel fflas-ffpack flintlib-devel gcc-fortran 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 meson" +checkdepends="$depends pythran python3-Sphinx" short_desc="Open source mathematics software" maintainer="Gonzalo Tornaría " 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 -nocross="due to ntl (eclib), fflas-ffpack, givaro, linbox, sympow, maxima" +checksum=64bfa7e6071f2282e1b3290917eaae139a6301d65dcafc2c37218d6ba64371f7 +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" } @@ -57,7 +59,6 @@ post_build() { } pre_install() { - export PYTHONPATH=../sage-setup export PYTHONDONTWRITEBYTECODE=yes export SAGE_NUM_THREADS="$XBPS_MAKEJOBS" } diff --git a/srcpkgs/sagemath/update b/srcpkgs/sagemath/update index 1a4e4049af025..f34bbdf5ec69b 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