From 488caf8f526d766bf0d6d52bc6e66425cc9d28f6 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] sagemath: update to 10.3. --- srcpkgs/sagemath/files/sage_conf.py | 4 - .../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 - .../patches/37492-singular_4.3.2p16.patch | 229 ++ srcpkgs/sagemath/patches/get_patches | 10 +- srcpkgs/sagemath/template | 83 +- srcpkgs/sagemath/update | 6 +- 10 files changed, 262 insertions(+), 2252 deletions(-) delete mode 100644 srcpkgs/sagemath/files/sage_conf.py 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/37492-singular_4.3.2p16.patch diff --git a/srcpkgs/sagemath/files/sage_conf.py b/srcpkgs/sagemath/files/sage_conf.py deleted file mode 100644 index b5b23603118..00000000000 --- a/srcpkgs/sagemath/files/sage_conf.py +++ /dev/null @@ -1,4 +0,0 @@ -# configuration for sage on void linux -SAGE_SHARE = "/usr/share/sagemath" -GAP_SHARE_DIR = "/usr/share/gap" -JMOL_DIR = "/usr/share/jmol" 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 2cad28134f6..00000000000 --- 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 8eb2c20a34c..00000000000 --- 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 c3e6c055026..00000000000 --- 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 3973b55cdbd..00000000000 --- 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/37492-singular_4.3.2p16.patch b/srcpkgs/sagemath/patches/37492-singular_4.3.2p16.patch new file mode 100644 index 00000000000..6913f39b865 --- /dev/null +++ b/srcpkgs/sagemath/patches/37492-singular_4.3.2p16.patch @@ -0,0 +1,229 @@ +diff --git a/src/sage/interfaces/singular.py b/src/sage/interfaces/singular.py +index 9c9b8ffb8b9..12a9aa582a6 100644 +--- a/src/sage/interfaces/singular.py ++++ b/src/sage/interfaces/singular.py +@@ -1211,14 +1211,14 @@ def current_ring(self): + polynomial ring, over a field, global ordering + // coefficients: ZZ/127 + // number of vars : 3 +- // block 1 : ordering rp ++ // block 1 : ordering ip + // : names x y z + // block 2 : ordering C + sage: singular.current_ring() + polynomial ring, over a field, global ordering + // coefficients: ZZ/127 + // number of vars : 3 +- // block 1 : ordering rp ++ // block 1 : ordering ip + // : names x y z + // block 2 : ordering C + """ +@@ -2040,6 +2040,9 @@ def _sage_(self, R=None): + elif typ == 'intvec': + from sage.modules.free_module_element import vector + return vector([sage.rings.integer.Integer(str(e)) for e in self]) ++ elif typ == 'bigintvec': ++ from sage.modules.free_module_element import vector ++ return vector([sage.rings.rational.Rational(str(e)) for e in self]) + elif typ == 'intmat': + from sage.matrix.constructor import matrix + from sage.rings.integer_ring import ZZ +diff --git a/src/sage/libs/singular/decl.pxd b/src/sage/libs/singular/decl.pxd +index e36216d6395..855c95b00bd 100644 +--- a/src/sage/libs/singular/decl.pxd ++++ b/src/sage/libs/singular/decl.pxd +@@ -243,7 +243,7 @@ cdef extern from "singular/Singular/libsingular.h": + ringorder_s + ringorder_lp + ringorder_dp +- ringorder_rp ++ ringorder_ip + ringorder_Dp + ringorder_wp + ringorder_Wp +@@ -291,6 +291,10 @@ cdef extern from "singular/Singular/libsingular.h": + int row + int col + ++ cdef cppclass bigintmat: ++ int (*length)() ++ number* (*get)(int i) ++ + # omalloc bins + + ctypedef struct omBin "omBin_s" +@@ -921,6 +925,7 @@ cdef extern from "singular/Singular/libsingular.h": + cdef int MATRIX_CMD + cdef int LIST_CMD + cdef int INTVEC_CMD ++ cdef int BIGINTVEC_CMD + cdef int NONE + cdef int RESOLUTION_CMD + cdef int PACKAGE_CMD +diff --git a/src/sage/libs/singular/function.pyx b/src/sage/libs/singular/function.pyx +index ac4bde0c20b..8284cb921a3 100644 +--- a/src/sage/libs/singular/function.pyx ++++ b/src/sage/libs/singular/function.pyx +@@ -98,7 +98,7 @@ from sage.rings.polynomial.multi_polynomial_sequence import PolynomialSequence_g + from sage.libs.singular.decl cimport * + from sage.libs.singular.option import opt_ctx + from sage.libs.singular.polynomial cimport singular_vector_maximal_component +-from sage.libs.singular.singular cimport sa2si, si2sa, si2sa_intvec ++from sage.libs.singular.singular cimport sa2si, si2sa, si2sa_intvec, si2sa_bigintvec + from sage.libs.singular.singular import error_messages + + from sage.interfaces.singular import get_docstring +@@ -954,6 +954,8 @@ cdef class Converter(SageObject): + return si2sa(to_convert.data, self._singular_ring, self._sage_ring.base_ring()) + elif rtyp == INTVEC_CMD: + return si2sa_intvec( to_convert.data) ++ elif rtyp == BIGINTVEC_CMD: ++ return si2sa_bigintvec( to_convert.data) + elif rtyp == STRING_CMD: + # TODO: Need to determine what kind of data can be returned by a + # STRING_CMD--is it just ASCII strings or can it be an arbitrary +@@ -1231,7 +1233,7 @@ cdef class SingularFunction(SageObject): + Traceback (most recent call last): + ... + RuntimeError: error in Singular function call 'size': +- Wrong number of arguments (got 2 arguments, arity code is 302) ++ Wrong number of arguments (got 2 arguments, arity code is 303) + sage: size('foobar', ring=P) + 6 + +@@ -1634,17 +1636,17 @@ def singular_function(name): + Traceback (most recent call last): + ... + RuntimeError: error in Singular function call 'factorize': +- Wrong number of arguments (got 0 arguments, arity code is 305) ++ Wrong number of arguments (got 0 arguments, arity code is 306) + sage: factorize(f, 1, 2) + Traceback (most recent call last): + ... + RuntimeError: error in Singular function call 'factorize': +- Wrong number of arguments (got 3 arguments, arity code is 305) ++ Wrong number of arguments (got 3 arguments, arity code is 306) + sage: factorize(f, 1, 2, 3) + Traceback (most recent call last): + ... + RuntimeError: error in Singular function call 'factorize': +- Wrong number of arguments (got 4 arguments, arity code is 305) ++ Wrong number of arguments (got 4 arguments, arity code is 306) + + The Singular function ``list`` can be called with any number of + arguments:: +diff --git a/src/sage/libs/singular/ring.pyx b/src/sage/libs/singular/ring.pyx +index 494fd2c0caf..7b05d63e7c7 100644 +--- a/src/sage/libs/singular/ring.pyx ++++ b/src/sage/libs/singular/ring.pyx +@@ -24,7 +24,7 @@ from sage.libs.gmp.mpz cimport mpz_init_set_ui + from sage.libs.singular.decl cimport ring, currRing + from sage.libs.singular.decl cimport rChangeCurrRing, rComplete, rDelete, idInit + from sage.libs.singular.decl cimport omAlloc0, omStrDup, omAlloc +-from sage.libs.singular.decl cimport ringorder_dp, ringorder_Dp, ringorder_lp, ringorder_rp, ringorder_ds, ringorder_Ds, ringorder_ls, ringorder_M, ringorder_c, ringorder_C, ringorder_wp, ringorder_Wp, ringorder_ws, ringorder_Ws, ringorder_a, rRingOrder_t ++from sage.libs.singular.decl cimport ringorder_dp, ringorder_Dp, ringorder_lp, ringorder_ip, ringorder_ds, ringorder_Ds, ringorder_ls, ringorder_M, ringorder_c, ringorder_C, ringorder_wp, ringorder_Wp, ringorder_ws, ringorder_Ws, ringorder_a, rRingOrder_t + from sage.libs.singular.decl cimport prCopyR + from sage.libs.singular.decl cimport n_unknown, n_algExt, n_transExt, n_Z, n_Zn, n_Znm, n_Z2m + from sage.libs.singular.decl cimport n_coeffType +@@ -60,7 +60,7 @@ order_dict = { + "dp": ringorder_dp, + "Dp": ringorder_Dp, + "lp": ringorder_lp, +- "rp": ringorder_rp, ++ "ip": ringorder_ip, + "ds": ringorder_ds, + "Ds": ringorder_Ds, + "ls": ringorder_ls, +diff --git a/src/sage/libs/singular/singular.pxd b/src/sage/libs/singular/singular.pxd +index d943a1018a2..f398d27a1fa 100644 +--- a/src/sage/libs/singular/singular.pxd ++++ b/src/sage/libs/singular/singular.pxd +@@ -1,4 +1,4 @@ +-from sage.libs.singular.decl cimport ring, poly, number, intvec ++from sage.libs.singular.decl cimport ring, poly, number, intvec, bigintmat + from sage.libs.singular.function cimport Resolution + + from sage.rings.rational cimport Rational +@@ -29,6 +29,7 @@ cdef object si2sa_ZZmod(number *n, ring *_ring, object base) noexcept + cdef object si2sa_NF(number *n, ring *_ring, object base) noexcept + + cdef object si2sa_intvec(intvec *v) noexcept ++cdef object si2sa_bigintvec(bigintmat *v) noexcept + + # dispatches to all the above. + cdef object si2sa(number *n, ring *_ring, object base) noexcept +diff --git a/src/sage/libs/singular/singular.pyx b/src/sage/libs/singular/singular.pyx +index cf0124e0a35..0e5c7774e80 100644 +--- a/src/sage/libs/singular/singular.pyx ++++ b/src/sage/libs/singular/singular.pyx +@@ -1699,6 +1699,25 @@ cdef object si2sa_intvec(intvec *v) noexcept: + l.append(v.get(r)) + return tuple(l) + ++cdef object si2sa_bigintvec(bigintmat *v) noexcept: ++ r""" ++ create a sage tuple from a singular vector of big integers ++ ++ INPUT: ++ ++ - ``v`` -- a (pointer to) singular bigintmat ++ ++ OUTPUT: ++ ++ a sage tuple ++ """ ++ cdef int r ++ cdef list l = list() ++ for r in range(v.length()): ++ n = v.get(r) ++ l.append(si2sa_QQ(n, &n, currRing)) ++ return tuple(l) ++ + # ============== + # Initialisation + # ============== +diff --git a/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx b/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx +index 70386eb0b50..b18c53de177 100644 +--- a/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx ++++ b/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx +@@ -1285,7 +1285,7 @@ cdef class MPolynomialRing_libsingular(MPolynomialRing_base): + polynomial ring, over a field, global ordering + // coefficients: ZZ/2[a]/(a^8+a^4+a^3+a^2+1) + // number of vars : 10 +- // block 1 : ordering rp ++ // block 1 : ordering ip + // : names x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 + // block 2 : ordering C + +@@ -1294,7 +1294,7 @@ cdef class MPolynomialRing_libsingular(MPolynomialRing_base): + polynomial ring, over a field, global ordering + // coefficients: ZZ/127 + // number of vars : 2 +- // block 1 : ordering rp ++ // block 1 : ordering ip + // : names x0 x1 + // block 2 : ordering C + +@@ -1303,7 +1303,7 @@ cdef class MPolynomialRing_libsingular(MPolynomialRing_base): + polynomial ring, over a field, global ordering + // coefficients: QQ + // number of vars : 2 +- // block 1 : ordering rp ++ // block 1 : ordering ip + // : names x0 x1 + // block 2 : ordering C + +diff --git a/src/sage/rings/polynomial/term_order.py b/src/sage/rings/polynomial/term_order.py +index 48e49ac89fa..65e68681485 100644 +--- a/src/sage/rings/polynomial/term_order.py ++++ b/src/sage/rings/polynomial/term_order.py +@@ -388,7 +388,7 @@ + + singular_name_mapping = { + 'lex' : 'lp', +- 'invlex' : 'rp', ++ 'invlex' : 'ip', + 'degrevlex' : 'dp', + 'deglex' : 'Dp', + 'neglex' : 'ls', diff --git a/srcpkgs/sagemath/patches/get_patches b/srcpkgs/sagemath/patches/get_patches index b7836e27910..77afead3fc9 100755 --- a/srcpkgs/sagemath/patches/get_patches +++ b/srcpkgs/sagemath/patches/get_patches @@ -20,11 +20,5 @@ 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 37492 "singular 4.3.2p16" diff --git a/srcpkgs/sagemath/template b/srcpkgs/sagemath/template index 7bc92e7c107..22faf78921c 100644 --- a/srcpkgs/sagemath/template +++ b/srcpkgs/sagemath/template @@ -1,13 +1,12 @@ # Template file for 'sagemath' pkgname=sagemath -version=10.2 -revision=2 +version=10.3 +revision=1 build_wrksrc=pkgs/sagemath-standard -build_style=python3-module -_bindir=/usr/lib/sagemath/$version/bin -make_install_args="--install-scripts=$_bindir" +build_style=python3-pep517 +make_build_args="--skip-dependency-check" hostmakedepends="m4 pkg-config python3-Cython python3-Jinja2 - python3-pkgconfig python3-setuptools" + python3-pkgconfig python3-setuptools python3-wheel" makedepends="boost-devel brial-devel cliquer-devel ecl eclib-devel ecm-devel fflas-ffpack flintlib-devel gap-devel gd-devel giac-devel glpk-devel gsl-devel iml-devel lcalc-devel libbraiding-devel libhomfly-devel libmpc-devel @@ -24,7 +23,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,70 +32,42 @@ 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=59feb92c05e74d6db7a75f398c45c24b5157b1ecd3d8ac198806e2e6add77d96 nocross="due to ntl (eclib, singular), fflas-ffpack, givaro, linbox, sympow, maxima" +# parallel build +export SAGE_NUM_THREADS="$XBPS_MAKEJOBS" + post_patch() { # git tree needs bootstrapping $wrksrc/bootstrap sagelib -} -pre_build() { - export PYTHONPATH=../sage-setup - export PYTHONDONTWRITEBYTECODE=yes - export SAGE_NUM_THREADS="$XBPS_MAKEJOBS" -} - -post_build() { - _lib=$(cd build/lib* && pwd) - _scripts=$(cd build/scripts* && pwd) - - # configuration files - 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" + # we need sage_setup here + ln -s ../../src/sage_setup . } post_install() { - # fix jupyter kernel spec - vsed -i -e 's|"/usr/bin/sage"|"'${_bindir}'/sage"|' \ - ${DESTDIR}/usr/share/jupyter/kernels/sagemath/kernel.json + # move scripts to /usr/libexec + vmkdir usr/libexec + mv -T ${DESTDIR}/usr/bin ${DESTDIR}/usr/libexec/sagemath - # replace broken symlinks by good copies (sagemath logo images) - for file in $(ls sage/ext_data/notebook-ipython); do - rm ${DESTDIR}/usr/share/jupyter/kernels/sagemath/$file - cp -a sage/ext_data/notebook-ipython/$file \ - ${DESTDIR}/usr/share/jupyter/kernels/sagemath - done - - # 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 + # copy configuration + cp ${FILESDIR}/sage-env-config ${DESTDIR}/usr/libexec/sagemath # symlink main binary vmkdir usr/bin - ln -s $_bindir/sage ${DESTDIR}/usr/bin/sage-${version} - ln -s sage-${version} ${DESTDIR}/usr/bin/sage + ln -s /usr/libexec/sagemath/sage ${DESTDIR}/usr/bin } do_check() { - _lib=$(cd build/lib* && pwd) - _scripts=$(cd build/scripts* && pwd) + local testdir="${wrksrc}/.xbps-testdir/$(date +%s)" + python3 -m installer -d "${testdir}" dist/*.whl - export PYTHONPATH=$_lib - export PYTHONDONTWRITEBYTECODE=yes - - # get out of $build_wrksrc, otherwise python picks the wrong sage module - cd $(mktemp -dp build) + # this makes for nicer (shorter) relative paths in output + cd ${testdir}/${py3_sitelib} if [ -f ${XBPS_DISTDIR}/sagemath-check ] ; then - _sed='s|#.*||;/^\s*$/d;s|^\([^ ]*/\)\?sage/|'$_lib'/sage/|g' \ + _sed='s|#.*||;/^\s*$/d;s|^\s*\([^ ]*/\)\?sage/|sage/|g' \ _test_files=$(sed -e "$_sed" ${XBPS_DISTDIR}/sagemath-check) fi if [ -z "$_test_files" ]; then @@ -105,13 +76,15 @@ do_check() { cp ${FILESDIR}/timings2.json . _test_args="--stats_path=timings2.json" if [ "$XBPS_CHECK_PKGS" = full ]; then - _test_args+=" --long --warn-long 60.0" + _test_args+=" --long --warn-long 30.0" else - _test_args+=" --warn-long 30.0" + _test_args+=" --warn-long 10.0" fi if [ "$XBPS_BUILD_ENVIRONMENT" = "void-packages-ci" ]; then # for CI use a predictable random seed _test_args+=" --random-seed=0" fi - $_scripts/sage -tp ${XBPS_MAKEJOBS} ${_test_args} ${_test_files} + + PATH="${testdir}/usr/bin:${PATH}" PYTHONPATH="${testdir}/${py3_sitelib}" \ + sage -tp ${XBPS_MAKEJOBS} ${_test_args} ${_test_files} } diff --git a/srcpkgs/sagemath/update b/srcpkgs/sagemath/update index 1a4e4049af0..f34bbdf5ec6 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