diff --git a/srcpkgs/sagemath/files/timings2.json b/srcpkgs/sagemath/files/timings2.json
new file mode 100644
index 00000000000000..01b2fcc9e0bf1f
--- /dev/null
+++ b/srcpkgs/sagemath/files/timings2.json
@@ -0,0 +1,397 @@
+{
+ "doc.ca.intro.index": {"walltime": 8},
+ "doc.en.constructions.calculus": {"walltime": 64},
+ "doc.en.constructions.plotting": {"walltime": 32},
+ "doc.en.prep.Advanced-2DPlotting": {"walltime": 16},
+ "doc.en.prep.Calculus": {"walltime": 8},
+ "doc.en.prep.Symbolics-and-Basic-Plotting": {"walltime": 8},
+ "doc.en.thematic_tutorials.explicit_methods_in_number_theory.birds_other": {"walltime": 8},
+ "doc.en.thematic_tutorials.explicit_methods_in_number_theory.elliptic_curves": {"walltime": 8},
+ "doc.en.thematic_tutorials.geometry.polyhedra_tutorial": {"walltime": 16},
+ "doc.en.thematic_tutorials.sandpile": {"walltime": 16},
+ "doc.en.thematic_tutorials.vector_calculus.vector_calc_advanced": {"walltime": 32},
+ "doc.en.thematic_tutorials.vector_calculus.vector_calc_cartesian": {"walltime": 32},
+ "doc.en.thematic_tutorials.vector_calculus.vector_calc_change": {"walltime": 32},
+ "doc.en.thematic_tutorials.vector_calculus.vector_calc_curvilinear": {"walltime": 32},
+ "doc.en.thematic_tutorials.vector_calculus.vector_calc_plane": {"walltime": 16},
+ "doc.ja.tutorial.tour_plotting": {"walltime": 8},
+ "sage.algebras.cluster_algebra": {"walltime": 8},
+ "sage.algebras.commutative_dga": {"walltime": 16},
+ "sage.algebras.hecke_algebras.ariki_koike_algebra": {"walltime": 8},
+ "sage.algebras.iwahori_hecke_algebra": {"walltime": 8},
+ "sage.algebras.lie_algebras.classical_lie_algebra": {"walltime": 128},
+ "sage.algebras.lie_algebras.nilpotent_lie_algebra": {"walltime": 16},
+ "sage.algebras.quantum_clifford": {"walltime": 16},
+ "sage.algebras.quantum_groups.fock_space": {"walltime": 8},
+ "sage.algebras.quatalg.quaternion_algebra": {"walltime": 8},
+ "sage.algebras.steenrod.steenrod_algebra": {"walltime": 64},
+ "sage.algebras.steenrod.steenrod_algebra_bases": {"walltime": 8},
+ "sage.algebras.yangian": {"walltime": 8},
+ "sage.arith.misc": {"walltime": 32},
+ "sage.calculus.calculus": {"walltime": 16},
+ "sage.calculus.desolvers": {"walltime": 8},
+ "sage.calculus.functional": {"walltime": 8},
+ "sage.calculus.riemann": {"walltime": 64},
+ "sage.calculus.tests": {"walltime": 16},
+ "sage.calculus.transforms.dwt": {"walltime": 16},
+ "sage.calculus.transforms.fft": {"walltime": 8},
+ "sage.categories.coxeter_groups": {"walltime": 8},
+ "sage.categories.finite_monoids": {"walltime": 16},
+ "sage.categories.lie_conformal_algebras": {"walltime": 8},
+ "sage.categories.loop_crystals": {"walltime": 8},
+ "sage.categories.pushout": {"walltime": 8},
+ "sage.categories.super_hopf_algebras_with_basis": {"walltime": 32},
+ "sage.categories.super_lie_conformal_algebras": {"walltime": 8},
+ "sage.coding.ag_code": {"walltime": 64},
+ "sage.coding.ag_code_decoders": {"walltime": 128},
+ "sage.coding.binary_code": {"walltime": 8},
+ "sage.coding.linear_code": {"walltime": 16},
+ "sage.combinat.backtrack": {"walltime": 32},
+ "sage.combinat.chas.wqsym": {"walltime": 32},
+ "sage.combinat.cluster_algebra_quiver.cluster_seed": {"walltime": 64},
+ "sage.combinat.cluster_algebra_quiver.quiver": {"walltime": 128},
+ "sage.combinat.crystals.affine_factorization": {"walltime": 16},
+ "sage.combinat.crystals.alcove_path": {"walltime": 32},
+ "sage.combinat.crystals.highest_weight_crystals": {"walltime": 8},
+ "sage.combinat.crystals.kirillov_reshetikhin": {"walltime": 16},
+ "sage.combinat.crystals.letters": {"walltime": 8},
+ "sage.combinat.crystals.littelmann_path": {"walltime": 16},
+ "sage.combinat.crystals.mv_polytopes": {"walltime": 16},
+ "sage.combinat.crystals.pbw_crystal": {"walltime": 16},
+ "sage.combinat.crystals.star_crystal": {"walltime": 8},
+ "sage.combinat.designs.bibd": {"walltime": 8},
+ "sage.combinat.designs.database": {"walltime": 16},
+ "sage.combinat.designs.difference_family": {"walltime": 8},
+ "sage.combinat.designs.gen_quadrangles_with_spread": {"walltime": 128},
+ "sage.combinat.designs.orthogonal_arrays_build_recursive": {"walltime": 16},
+ "sage.combinat.designs.orthogonal_arrays_find_recursive": {"walltime": 8},
+ "sage.combinat.diagram_algebras": {"walltime": 64},
+ "sage.combinat.fqsym": {"walltime": 32},
+ "sage.combinat.free_prelie_algebra": {"walltime": 8},
+ "sage.combinat.fully_commutative_elements": {"walltime": 8},
+ "sage.combinat.grossman_larson_algebras": {"walltime": 8},
+ "sage.combinat.interval_posets": {"walltime": 8},
+ "sage.combinat.k_regular_sequence": {"walltime": 8},
+ "sage.combinat.k_tableau": {"walltime": 16},
+ "sage.combinat.matrices.hadamard_matrix": {"walltime": 8},
+ "sage.combinat.multiset_partition_into_sets_ordered": {"walltime": 8},
+ "sage.combinat.ncsf_qsym.ncsf": {"walltime": 16},
+ "sage.combinat.ncsf_qsym.qsym": {"walltime": 16},
+ "sage.combinat.partition": {"walltime": 16},
+ "sage.combinat.partition_kleshchev": {"walltime": 16},
+ "sage.combinat.partition_tuple": {"walltime": 8},
+ "sage.combinat.posets.moebius_algebra": {"walltime": 16},
+ "sage.combinat.posets.posets": {"walltime": 8},
+ "sage.combinat.rigged_configurations.kr_tableaux": {"walltime": 32},
+ "sage.combinat.rigged_configurations.rigged_configurations": {"walltime": 16},
+ "sage.combinat.rigged_configurations.tensor_product_kr_tableaux": {"walltime": 16},
+ "sage.combinat.root_system.associahedron": {"walltime": 8},
+ "sage.combinat.root_system.branching_rules": {"walltime": 8},
+ "sage.combinat.root_system.fusion_ring": {"walltime": 8},
+ "sage.combinat.root_system.integrable_representations": {"walltime": 16},
+ "sage.combinat.root_system.non_symmetric_macdonald_polynomials": {"walltime": 16},
+ "sage.combinat.root_system.pieri_factors": {"walltime": 8},
+ "sage.combinat.root_system.plot": {"walltime": 32},
+ "sage.combinat.root_system.root_lattice_realization_algebras": {"walltime": 16},
+ "sage.combinat.root_system.root_lattice_realizations": {"walltime": 16},
+ "sage.combinat.root_system.root_system": {"walltime": 8},
+ "sage.combinat.root_system.weyl_group": {"walltime": 8},
+ "sage.combinat.rsk": {"walltime": 32},
+ "sage.combinat.sf.classical": {"walltime": 16},
+ "sage.combinat.sf.jack": {"walltime": 16},
+ "sage.combinat.sf.k_dual": {"walltime": 16},
+ "sage.combinat.sf.llt": {"walltime": 16},
+ "sage.combinat.sf.macdonald": {"walltime": 64},
+ "sage.combinat.sf.new_kschur": {"walltime": 8},
+ "sage.combinat.sf.sfa": {"walltime": 32},
+ "sage.combinat.shifted_primed_tableau": {"walltime": 16},
+ "sage.combinat.skew_tableau": {"walltime": 8},
+ "sage.combinat.symmetric_group_algebra": {"walltime": 16},
+ "sage.combinat.tableau": {"walltime": 32},
+ "sage.combinat.tableau_tuple": {"walltime": 32},
+ "sage.combinat.tiling": {"walltime": 256},
+ "sage.combinat.tutorial": {"walltime": 16},
+ "sage.combinat.words.paths": {"walltime": 64},
+ "sage.crypto.block_cipher.des": {"walltime": 16},
+ "sage.crypto.mq.sr": {"walltime": 64},
+ "sage.crypto.sbox": {"walltime": 16},
+ "sage.crypto.sboxes": {"walltime": 8},
+ "sage.doctest.forker": {"walltime": 16},
+ "sage.doctest.sources": {"walltime": 64},
+ "sage.doctest.test": {"walltime": 128},
+ "sage.dynamics.arithmetic_dynamics.projective_ds": {"walltime": 64},
+ "sage.dynamics.arithmetic_dynamics.wehlerK3": {"walltime": 8},
+ "sage.dynamics.cellular_automata.glca": {"walltime": 8},
+ "sage.dynamics.cellular_automata.solitons": {"walltime": 8},
+ "sage.dynamics.complex_dynamics.mandel_julia": {"walltime": 16},
+ "sage.functions.bessel": {"walltime": 16},
+ "sage.functions.exp_integral": {"walltime": 8},
+ "sage.functions.hypergeometric": {"walltime": 8},
+ "sage.functions.other": {"walltime": 16},
+ "sage.functions.piecewise": {"walltime": 8},
+ "sage.games.quantumino": {"walltime": 8},
+ "sage.geometry.cone": {"walltime": 32},
+ "sage.geometry.fan": {"walltime": 8},
+ "sage.geometry.hyperbolic_space.hyperbolic_geodesic": {"walltime": 8},
+ "sage.geometry.hyperplane_arrangement.arrangement": {"walltime": 16},
+ "sage.geometry.hyperplane_arrangement.library": {"walltime": 8},
+ "sage.geometry.hyperplane_arrangement.plot": {"walltime": 8},
+ "sage.geometry.lattice_polytope": {"walltime": 16},
+ "sage.geometry.polyhedral_complex": {"walltime": 8},
+ "sage.geometry.polyhedron.base": {"walltime": 32},
+ "sage.geometry.polyhedron.library": {"walltime": 32},
+ "sage.geometry.polyhedron.plot": {"walltime": 8},
+ "sage.geometry.riemannian_manifolds.parametrized_surface3d": {"walltime": 16},
+ "sage.geometry.triangulation.base": {"walltime": 32},
+ "sage.geometry.triangulation.point_configuration": {"walltime": 16},
+ "sage.graphs.chrompoly": {"walltime": 8},
+ "sage.graphs.connectivity": {"walltime": 16},
+ "sage.graphs.generators.basic": {"walltime": 16},
+ "sage.graphs.generators.classical_geometries": {"walltime": 32},
+ "sage.graphs.generators.distance_regular": {"walltime": 256},
+ "sage.graphs.generators.families": {"walltime": 32},
+ "sage.graphs.generators.smallgraphs": {"walltime": 16},
+ "sage.graphs.generic_graph": {"walltime": 32},
+ "sage.graphs.genus": {"walltime": 16},
+ "sage.graphs.graph": {"walltime": 16},
+ "sage.graphs.graph_generators": {"walltime": 8},
+ "sage.graphs.graph_list": {"walltime": 8},
+ "sage.graphs.graph_plot": {"walltime": 8},
+ "sage.graphs.strongly_regular_db": {"walltime": 16},
+ "sage.groups.cubic_braid": {"walltime": 16},
+ "sage.groups.fqf_orthogonal": {"walltime": 16},
+ "sage.groups.libgap_mixin": {"walltime": 8},
+ "sage.groups.libgap_morphism": {"walltime": 8},
+ "sage.groups.lie_gps.nilpotent_lie_group": {"walltime": 16},
+ "sage.groups.matrix_gps.finitely_generated": {"walltime": 8},
+ "sage.groups.matrix_gps.heisenberg": {"walltime": 32},
+ "sage.groups.matrix_gps.linear": {"walltime": 8},
+ "sage.groups.perm_gps.cubegroup": {"walltime": 16},
+ "sage.groups.perm_gps.partn_ref.refinement_graphs": {"walltime": 8},
+ "sage.groups.perm_gps.permgroup": {"walltime": 8},
+ "sage.groups.perm_gps.permgroup_named": {"walltime": 8},
+ "sage.homology.hochschild_complex": {"walltime": 8},
+ "sage.homology.homology_vector_space_with_basis": {"walltime": 8},
+ "sage.interacts.test_jupyter": {"walltime": 16},
+ "sage.interfaces.ecm": {"walltime": 8},
+ "sage.interfaces.expect": {"walltime": 8},
+ "sage.interfaces.gap": {"walltime": 16},
+ "sage.interfaces.maxima": {"walltime": 8},
+ "sage.interfaces.maxima_abstract": {"walltime": 64},
+ "sage.interfaces.psage": {"walltime": 8},
+ "sage.interfaces.sage0": {"walltime": 8},
+ "sage.lfunctions.zero_sums": {"walltime": 8},
+ "sage.libs.eclib.interface": {"walltime": 16},
+ "sage.libs.eclib.mwrank": {"walltime": 16},
+ "sage.libs.gap.test_long": {"walltime": 32},
+ "sage.libs.giac": {"walltime": 32},
+ "sage.manifolds.catalog": {"walltime": 8},
+ "sage.manifolds.chart": {"walltime": 32},
+ "sage.manifolds.chart_func": {"walltime": 8},
+ "sage.manifolds.continuous_map": {"walltime": 8},
+ "sage.manifolds.differentiable.affine_connection": {"walltime": 128},
+ "sage.manifolds.differentiable.automorphismfield": {"walltime": 32},
+ "sage.manifolds.differentiable.automorphismfield_group": {"walltime": 8},
+ "sage.manifolds.differentiable.bundle_connection": {"walltime": 8},
+ "sage.manifolds.differentiable.characteristic_cohomology_class": {"walltime": 256},
+ "sage.manifolds.differentiable.curve": {"walltime": 16},
+ "sage.manifolds.differentiable.degenerate": {"walltime": 32},
+ "sage.manifolds.differentiable.degenerate_submanifold": {"walltime": 256},
+ "sage.manifolds.differentiable.diff_form": {"walltime": 64},
+ "sage.manifolds.differentiable.diff_map": {"walltime": 8},
+ "sage.manifolds.differentiable.examples.euclidean": {"walltime": 32},
+ "sage.manifolds.differentiable.examples.sphere": {"walltime": 32},
+ "sage.manifolds.differentiable.integrated_curve": {"walltime": 32},
+ "sage.manifolds.differentiable.levi_civita_connection": {"walltime": 32},
+ "sage.manifolds.differentiable.manifold": {"walltime": 16},
+ "sage.manifolds.differentiable.manifold_homset": {"walltime": 16},
+ "sage.manifolds.differentiable.metric": {"walltime": 64},
+ "sage.manifolds.differentiable.mixed_form": {"walltime": 16},
+ "sage.manifolds.differentiable.mixed_form_algebra": {"walltime": 8},
+ "sage.manifolds.differentiable.multivectorfield": {"walltime": 64},
+ "sage.manifolds.differentiable.pseudo_riemannian": {"walltime": 16},
+ "sage.manifolds.differentiable.pseudo_riemannian_submanifold": {"walltime": 128},
+ "sage.manifolds.differentiable.scalarfield": {"walltime": 16},
+ "sage.manifolds.differentiable.scalarfield_algebra": {"walltime": 8},
+ "sage.manifolds.differentiable.tangent_vector": {"walltime": 16},
+ "sage.manifolds.differentiable.tensorfield": {"walltime": 128},
+ "sage.manifolds.differentiable.tensorfield_paral": {"walltime": 16},
+ "sage.manifolds.differentiable.vector_bundle": {"walltime": 16},
+ "sage.manifolds.differentiable.vectorfield": {"walltime": 64},
+ "sage.manifolds.differentiable.vectorframe": {"walltime": 8},
+ "sage.manifolds.point": {"walltime": 16},
+ "sage.manifolds.scalarfield": {"walltime": 16},
+ "sage.manifolds.scalarfield_algebra": {"walltime": 8},
+ "sage.manifolds.section": {"walltime": 32},
+ "sage.manifolds.trivialization": {"walltime": 8},
+ "sage.manifolds.vector_bundle": {"walltime": 8},
+ "sage.matrix.benchmark": {"walltime": 8},
+ "sage.matrix.matrix2": {"walltime": 16},
+ "sage.matrix.matrix_integer_dense": {"walltime": 16},
+ "sage.matrix.matrix_integer_dense_hnf": {"walltime": 32},
+ "sage.matrix.matrix_mod2_dense": {"walltime": 8},
+ "sage.matrix.matrix_rational_dense": {"walltime": 8},
+ "sage.matrix.special": {"walltime": 8},
+ "sage.matroids.catalog": {"walltime": 64},
+ "sage.misc.cachefunc": {"walltime": 16},
+ "sage.misc.cython": {"walltime": 8},
+ "sage.misc.functional": {"walltime": 8},
+ "sage.misc.randstate": {"walltime": 16},
+ "sage.misc.sagedoc": {"walltime": 64},
+ "sage.misc.sageinspect": {"walltime": 32},
+ "sage.modular.abvar.abvar": {"walltime": 16},
+ "sage.modular.abvar.homspace": {"walltime": 8},
+ "sage.modular.abvar.lseries": {"walltime": 8},
+ "sage.modular.arithgroup.arithgroup_perm": {"walltime": 8},
+ "sage.modular.arithgroup.tests": {"walltime": 8},
+ "sage.modular.btquotients.pautomorphicform": {"walltime": 32},
+ "sage.modular.hypergeometric_motive": {"walltime": 16},
+ "sage.modular.local_comp.local_comp": {"walltime": 32},
+ "sage.modular.local_comp.type_space": {"walltime": 16},
+ "sage.modular.modform.ambient_R": {"walltime": 16},
+ "sage.modular.modform.constructor": {"walltime": 8},
+ "sage.modular.modform.cuspidal_submodule": {"walltime": 16},
+ "sage.modular.modform.element": {"walltime": 64},
+ "sage.modular.modform.ring": {"walltime": 64},
+ "sage.modular.modform.space": {"walltime": 8},
+ "sage.modular.modform_hecketriangle.abstract_space": {"walltime": 16},
+ "sage.modular.modform_hecketriangle.graded_ring_element": {"walltime": 16},
+ "sage.modular.modform_hecketriangle.hecke_triangle_group_element": {"walltime": 32},
+ "sage.modular.modform_hecketriangle.readme": {"walltime": 16},
+ "sage.modular.modform_hecketriangle.space": {"walltime": 8},
+ "sage.modular.modsym.ambient": {"walltime": 16},
+ "sage.modular.modsym.space": {"walltime": 8},
+ "sage.modular.pollack_stevens.modsym": {"walltime": 64},
+ "sage.modular.pollack_stevens.padic_lseries": {"walltime": 32},
+ "sage.modules.finite_submodule_iter": {"walltime": 16},
+ "sage.modules.free_module": {"walltime": 16},
+ "sage.modules.free_module_element": {"walltime": 8},
+ "sage.modules.free_module_integer": {"walltime": 32},
+ "sage.modules.free_quadratic_module_integer_symmetric": {"walltime": 8},
+ "sage.modules.torsion_quadratic_module": {"walltime": 16},
+ "sage.parallel.map_reduce": {"walltime": 8},
+ "sage.plot.animate": {"walltime": 128},
+ "sage.plot.arrow": {"walltime": 8},
+ "sage.plot.circle": {"walltime": 8},
+ "sage.plot.complex_plot": {"walltime": 8},
+ "sage.plot.contour_plot": {"walltime": 32},
+ "sage.plot.density_plot": {"walltime": 8},
+ "sage.plot.graphics": {"walltime": 32},
+ "sage.plot.line": {"walltime": 8},
+ "sage.plot.matrix_plot": {"walltime": 16},
+ "sage.plot.multigraphics": {"walltime": 16},
+ "sage.plot.plot": {"walltime": 64},
+ "sage.plot.plot3d.base": {"walltime": 8},
+ "sage.plot.plot3d.implicit_plot3d": {"walltime": 16},
+ "sage.plot.plot3d.implicit_surface": {"walltime": 8},
+ "sage.plot.plot3d.parametric_plot3d": {"walltime": 8},
+ "sage.plot.plot3d.parametric_surface": {"walltime": 8},
+ "sage.plot.plot3d.plot3d": {"walltime": 16},
+ "sage.plot.plot3d.tachyon": {"walltime": 8},
+ "sage.plot.plot3d.transform": {"walltime": 32},
+ "sage.plot.point": {"walltime": 8},
+ "sage.plot.polygon": {"walltime": 8},
+ "sage.plot.streamline_plot": {"walltime": 8},
+ "sage.quadratic_forms.genera.genus": {"walltime": 16},
+ "sage.quadratic_forms.quadratic_form__automorphisms": {"walltime": 8},
+ "sage.quadratic_forms.quadratic_form__local_representation_conditions": {"walltime": 64},
+ "sage.quadratic_forms.quadratic_form__neighbors": {"walltime": 8},
+ "sage.quadratic_forms.quadratic_form__siegel_product": {"walltime": 8},
+ "sage.repl.ipython_extension": {"walltime": 8},
+ "sage.rings.asymptotic.asymptotic_expansion_generators": {"walltime": 64},
+ "sage.rings.asymptotic.asymptotic_ring": {"walltime": 8},
+ "sage.rings.asymptotic.asymptotics_multivariate_generating_functions": {"walltime": 32},
+ "sage.rings.asymptotic.term_monoid": {"walltime": 8},
+ "sage.rings.continued_fraction": {"walltime": 8},
+ "sage.rings.finite_rings.finite_field_base": {"walltime": 8},
+ "sage.rings.function_field.function_field": {"walltime": 128},
+ "sage.rings.function_field.function_field_valuation": {"walltime": 64},
+ "sage.rings.function_field.ideal": {"walltime": 8},
+ "sage.rings.function_field.place": {"walltime": 8},
+ "sage.rings.integer": {"walltime": 128},
+ "sage.rings.invariants.invariant_theory": {"walltime": 8},
+ "sage.rings.number_field.bdd_height": {"walltime": 8},
+ "sage.rings.number_field.number_field": {"walltime": 64},
+ "sage.rings.number_field.number_field_element": {"walltime": 16},
+ "sage.rings.number_field.splitting_field": {"walltime": 8},
+ "sage.rings.number_field.totallyreal": {"walltime": 16},
+ "sage.rings.number_field.totallyreal_rel": {"walltime": 8},
+ "sage.rings.padics.padic_base_leaves": {"walltime": 64},
+ "sage.rings.padics.padic_extension_leaves": {"walltime": 64},
+ "sage.rings.padics.padic_generic_element": {"walltime": 16},
+ "sage.rings.padics.padic_lattice_element": {"walltime": 32},
+ "sage.rings.padics.relative_extension_leaves": {"walltime": 32},
+ "sage.rings.polynomial.multi_polynomial_ideal": {"walltime": 8},
+ "sage.rings.polynomial.multi_polynomial_sequence": {"walltime": 8},
+ "sage.rings.polynomial.ore_function_element": {"walltime": 8},
+ "sage.rings.polynomial.polynomial_element": {"walltime": 16},
+ "sage.rings.polynomial.polynomial_rational_flint": {"walltime": 8},
+ "sage.rings.qqbar": {"walltime": 16},
+ "sage.rings.tests": {"walltime": 16},
+ "sage.rings.valuation.augmented_valuation": {"walltime": 32},
+ "sage.rings.valuation.mapped_valuation": {"walltime": 64},
+ "sage.rings.valuation.valuation": {"walltime": 8},
+ "sage.sandpiles.sandpile": {"walltime": 16},
+ "sage.schemes.curves.affine_curve": {"walltime": 16},
+ "sage.schemes.curves.closed_point": {"walltime": 8},
+ "sage.schemes.curves.projective_curve": {"walltime": 32},
+ "sage.schemes.cyclic_covers.cycliccover_finite_field": {"walltime": 64},
+ "sage.schemes.elliptic_curves.BSD": {"walltime": 8},
+ "sage.schemes.elliptic_curves.Qcurves": {"walltime": 8},
+ "sage.schemes.elliptic_curves.constructor": {"walltime": 32},
+ "sage.schemes.elliptic_curves.ell_curve_isogeny": {"walltime": 16},
+ "sage.schemes.elliptic_curves.ell_egros": {"walltime": 32},
+ "sage.schemes.elliptic_curves.ell_finite_field": {"walltime": 8},
+ "sage.schemes.elliptic_curves.ell_generic": {"walltime": 8},
+ "sage.schemes.elliptic_curves.ell_modular_symbols": {"walltime": 16},
+ "sage.schemes.elliptic_curves.ell_number_field": {"walltime": 128},
+ "sage.schemes.elliptic_curves.ell_point": {"walltime": 8},
+ "sage.schemes.elliptic_curves.ell_rational_field": {"walltime": 128},
+ "sage.schemes.elliptic_curves.gal_reps_number_field": {"walltime": 32},
+ "sage.schemes.elliptic_curves.gp_simon": {"walltime": 16},
+ "sage.schemes.elliptic_curves.heegner": {"walltime": 32},
+ "sage.schemes.elliptic_curves.height": {"walltime": 64},
+ "sage.schemes.elliptic_curves.isogeny_class": {"walltime": 32},
+ "sage.schemes.elliptic_curves.isogeny_small_degree": {"walltime": 64},
+ "sage.schemes.elliptic_curves.kraus": {"walltime": 16},
+ "sage.schemes.elliptic_curves.mod_sym_num": {"walltime": 8},
+ "sage.schemes.elliptic_curves.padic_lseries": {"walltime": 8},
+ "sage.schemes.elliptic_curves.padics": {"walltime": 16},
+ "sage.schemes.elliptic_curves.saturation": {"walltime": 16},
+ "sage.schemes.elliptic_curves.sha_tate": {"walltime": 32},
+ "sage.schemes.hyperelliptic_curves.hyperelliptic_finite_field": {"walltime": 64},
+ "sage.schemes.hyperelliptic_curves.hyperelliptic_generic": {"walltime": 8},
+ "sage.schemes.hyperelliptic_curves.hyperelliptic_padic_field": {"walltime": 32},
+ "sage.schemes.hyperelliptic_curves.monsky_washnitzer": {"walltime": 8},
+ "sage.schemes.projective.projective_rational_point": {"walltime": 8},
+ "sage.schemes.riemann_surfaces.riemann_surface": {"walltime": 64},
+ "sage.schemes.toric.chow_group": {"walltime": 8},
+ "sage.schemes.toric.sheaf.klyachko": {"walltime": 8},
+ "sage.stats.distributions.discrete_gaussian_integer": {"walltime": 8},
+ "sage.stats.time_series": {"walltime": 8},
+ "sage.structure.coerce_dict": {"walltime": 32},
+ "sage.structure.element": {"walltime": 16},
+ "sage.structure.sage_object": {"walltime": 8},
+ "sage.symbolic.expression": {"walltime": 32},
+ "sage.symbolic.integration.integral": {"walltime": 32},
+ "sage.symbolic.random_tests": {"walltime": 32},
+ "sage.symbolic.relation": {"walltime": 8},
+ "sage.tests.book_schilling_zabrocki_kschur_primer": {"walltime": 32},
+ "sage.tests.book_stein_ent": {"walltime": 16},
+ "sage.tests.books.computational-mathematics-with-sagemath.combinat_doctest": {"walltime": 32},
+ "sage.tests.books.computational-mathematics-with-sagemath.float_doctest": {"walltime": 16},
+ "sage.tests.books.computational-mathematics-with-sagemath.graphique_doctest": {"walltime": 32},
+ "sage.tests.books.computational-mathematics-with-sagemath.graphtheory_doctest": {"walltime": 8},
+ "sage.tests.books.computational-mathematics-with-sagemath.integration_doctest": {"walltime": 32},
+ "sage.tests.books.computational-mathematics-with-sagemath.mpoly_doctest": {"walltime": 8},
+ "sage.tests.books.computational-mathematics-with-sagemath.nonlinear_doctest": {"walltime": 8},
+ "sage.tests.books.computational-mathematics-with-sagemath.recequadiff_doctest": {"walltime": 8},
+ "sage.tests.books.computational-mathematics-with-sagemath.sol.graphique_doctest": {"walltime": 16},
+ "sage.tests.books.computational-mathematics-with-sagemath.sol.numbertheory_doctest": {"walltime": 16},
+ "sage.tests.books.computational-mathematics-with-sagemath.sol.polynomes_doctest": {"walltime": 16},
+ "sage.tests.cmdline": {"walltime": 64},
+ "sage.tests.gosper-sum": {"walltime": 16},
+ "sage.tests.parigp": {"walltime": 8},
+ "sage.topology.simplicial_complex": {"walltime": 8},
+ "sage.topology.simplicial_complex_examples": {"walltime": 16}
+}
diff --git a/srcpkgs/sagemath/patches/01-dont_link_ratpoints.patch b/srcpkgs/sagemath/patches/01-dont_link_ratpoints.patch
new file mode 100644
index 00000000000000..e5c3f5776aa263
--- /dev/null
+++ b/srcpkgs/sagemath/patches/01-dont_link_ratpoints.patch
@@ -0,0 +1,10 @@
+ - do not link ratpoints where it's not used
+
+--- a/src/sage/schemes/elliptic_curves/descent_two_isogeny.pyx
++++ b/src/sage/schemes/elliptic_curves/descent_two_isogeny.pyx
+@@ -1,5 +1,3 @@
+-# distutils: libraries = ratpoints
+-
+ r"""
+ Descent on elliptic curves over `\QQ` with a 2-isogeny
+ """
diff --git a/srcpkgs/sagemath/patches/02-fix_get_shared_lib_path--see_29644.patch b/srcpkgs/sagemath/patches/02-fix_get_shared_lib_path--see_29644.patch
new file mode 100644
index 00000000000000..d3672b094c1c72
--- /dev/null
+++ b/srcpkgs/sagemath/patches/02-fix_get_shared_lib_path--see_29644.patch
@@ -0,0 +1,13 @@
+ - fix _get_shared_lib_path() so we don't need to configure GAP_SO
+
+--- a/src/sage/env.py
++++ b/src/sage/env.py
+@@ -293,7 +293,7 @@ def _get_shared_lib_path(*libnames: str) -> Optional[str]:
+ if sys.platform == 'darwin':
+ ext = 'dylib'
+ else:
+- ext = 'so'
++ ext = 'so*'
+
+ if SAGE_LOCAL:
+ search_directories.append(Path(SAGE_LOCAL) / 'lib')
diff --git a/srcpkgs/sagemath/patches/03-doctest_have_program.patch b/srcpkgs/sagemath/patches/03-doctest_have_program.patch
new file mode 100644
index 00000000000000..27ba3776470c9f
--- /dev/null
+++ b/srcpkgs/sagemath/patches/03-doctest_have_program.patch
@@ -0,0 +1,20 @@
+ - we don't know `SAGE_VENV/bin` contains `sage`, but `sys.argv[0]` should
+ be the full path to `sage-ipython` and the same directory should have `sage`
+
+--- a/src/sage/misc/sage_ostools.pyx
++++ b/src/sage/misc/sage_ostools.pyx
+@@ -32,12 +32,11 @@ def have_program(program, path=None):
+ True
+ sage: have_program('there_is_not_a_program_with_this_name')
+ False
+- sage: from sage.env import SAGE_VENV
+- sage: have_program('sage', os.path.join(SAGE_VENV, 'bin'))
++ sage: have_program('sage', os.path.dirname(sys.argv[0]))
+ True
+ sage: have_program('sage', '/there_is_not_a_path_with_this_name')
+ False
+- sage: have_program('there_is_not_a_program_with_this_name', os.path.join(SAGE_VENV, 'bin'))
++ sage: have_program('there_is_not_a_program_with_this_name', "/bin")
+ False
+ """
+ if path is None:
diff --git a/srcpkgs/sagemath/patches/04-doctest_sage_getfile.patch b/srcpkgs/sagemath/patches/04-doctest_sage_getfile.patch
new file mode 100644
index 00000000000000..95bce107f854b8
--- /dev/null
+++ b/srcpkgs/sagemath/patches/04-doctest_sage_getfile.patch
@@ -0,0 +1,22 @@
+ - add one doctest for coverage
+
+--- a/src/sage/misc/sageinspect.py
++++ b/src/sage/misc/sageinspect.py
+@@ -1341,10 +1342,12 @@ def sage_getfile(obj):
+ EXAMPLES::
+
+ sage: from sage.misc.sageinspect import sage_getfile
+- sage: sage_getfile(sage.rings.rational)[-23:]
+- 'sage/rings/rational.pyx'
+- sage: sage_getfile(Sq)[-42:]
+- 'sage/algebras/steenrod/steenrod_algebra.py'
++ sage: sage_getfile(sage.rings.rational)
++ '...sage/rings/rational.pyx'
++ sage: sage_getfile(Sq)
++ '...sage/algebras/steenrod/steenrod_algebra.py'
++ sage: sage_getfile(x)
++ '...sage/symbolic/expression.pyx'
+
+ The following tests against some bugs fixed in :trac:`9976`::
+
+
diff --git a/srcpkgs/sagemath/patches/05-fix_sage_getfile.patch b/srcpkgs/sagemath/patches/05-fix_sage_getfile.patch
new file mode 100644
index 00000000000000..56c58078f3198d
--- /dev/null
+++ b/srcpkgs/sagemath/patches/05-fix_sage_getfile.patch
@@ -0,0 +1,16 @@
+ - fix sage_getfile() by checking all possible EXTENSION_SUFFIXES
+
+--- a/src/sage/misc/sageinspect.py
++++ b/src/sage/misc/sageinspect.py
+@@ -1400,8 +1403,9 @@ def sage_getfile(obj):
+ sourcefile = inspect.getabsfile(obj)
+ except TypeError: # this happens for Python builtins
+ return ''
+- if sourcefile.endswith(loadable_module_extension()):
+- return sourcefile[:-len(loadable_module_extension())]+os.path.extsep+'pyx'
++ for suffix in import_machinery.EXTENSION_SUFFIXES:
++ if sourcefile.endswith(suffix):
++ return sourcefile[:-len(suffix)]+os.path.extsep+'pyx'
+ return sourcefile
+
+
diff --git a/srcpkgs/sagemath/patches/07-ignore_warning.patch b/srcpkgs/sagemath/patches/07-ignore_warning.patch
new file mode 100644
index 00000000000000..69668678a40b0c
--- /dev/null
+++ b/srcpkgs/sagemath/patches/07-ignore_warning.patch
@@ -0,0 +1,15 @@
+ - this ignores a warning caused by old notebook
+
+--- a/src/sage/all.py
++++ b/src/sage/all.py
+@@ -100,6 +100,9 @@ warnings.filterwarnings('ignore', category=DeprecationWarning,
+ message='The distutils(.sysconfig module| package) is deprecated',
+ module='Cython|distutils|numpy|sage.env|sage.features')
+
++warnings.filterwarnings('ignore', category=DeprecationWarning,
++ message=r"invalid escape sequence '\\s'")
++
+ ################ end setup warnings ###############################
+
+
+
diff --git a/srcpkgs/sagemath/patches/08-dont_run_pytest--see_31924.patch b/srcpkgs/sagemath/patches/08-dont_run_pytest--see_31924.patch
new file mode 100644
index 00000000000000..06bd2ccae6fb5f
--- /dev/null
+++ b/srcpkgs/sagemath/patches/08-dont_run_pytest--see_31924.patch
@@ -0,0 +1,27 @@
+ - using pytest is broken, see #31924
+
+--- a/src/bin/sage-runtests
++++ b/src/bin/sage-runtests
+@@ -154,21 +154,4 @@ if __name__ == "__main__":
+ DC = DocTestController(args, args.filenames)
+ err = DC.run()
+
+- try:
+- exit_code_pytest = 0
+- import pytest
+- pytest_options = ["--import-mode", "importlib"]
+- if args.verbose:
+- pytest_options.append("-v")
+- exit_code_pytest = pytest.main(pytest_options + args.filenames)
+- if exit_code_pytest == 5:
+- # Exit code 5 means there were no test files, pass in this case
+- exit_code_pytest = 0
+-
+- except ModuleNotFoundError:
+- print("Pytest is not installed, skip checking tests that rely on it.")
+-
+- if err == 0:
+- sys.exit(exit_code_pytest)
+- else:
+- sys.exit(err)
++ sys.exit(err)
diff --git a/srcpkgs/sagemath/patches/09-doctest_numerical_fix.patch b/srcpkgs/sagemath/patches/09-doctest_numerical_fix.patch
new file mode 100644
index 00000000000000..8780c8a97efaf0
--- /dev/null
+++ b/srcpkgs/sagemath/patches/09-doctest_numerical_fix.patch
@@ -0,0 +1,14 @@
+ - This fixes a doctest failure due to a small numerical issue when running
+ maxima-sbcl on 32 bit
+
+--- a/src/sage/interfaces/maxima_abstract.py
++++ b/src/sage/interfaces/maxima_abstract.py
+@@ -1525,7 +1525,7 @@ class MaximaAbstractElement(ExtraTabCompletion, InterfaceElement):
+ EXAMPLES::
+
+ sage: maxima('exp(-sqrt(x))').nintegral('x',0,1)
+- (0.5284822353142306, 4.1633141378838...e-11, 231, 0)
++ (0.5284822353142306, 4.163...e-11, 231, 0)
+
+ Note that GP also does numerical integration, and can do so to very
+ high precision very quickly::
diff --git a/srcpkgs/sagemath/patches/10-fix_very_slow_doctest-polynomial_zmod_flint.patch b/srcpkgs/sagemath/patches/10-fix_very_slow_doctest-polynomial_zmod_flint.patch
new file mode 100644
index 00000000000000..bae8387cf94a49
--- /dev/null
+++ b/srcpkgs/sagemath/patches/10-fix_very_slow_doctest-polynomial_zmod_flint.patch
@@ -0,0 +1,14 @@
+--- a/src/sage/rings/polynomial/polynomial_zmod_flint.pyx
++++ b/src/sage/rings/polynomial/polynomial_zmod_flint.pyx
+@@ -237,8 +237,9 @@ cdef class Polynomial_zmod_flint(Polynomial_template):
+
+ sage: a = ZZ['x'](range(100000))
+ sage: R = Integers(3)['x']
+- sage: R(a) # long time (7s on sage.math, 2013)
+- 2*x^99998 + ... + x
++ sage: p = R(a)
++ sage: p.truncate(10) # testing the whole poly is VERY SLOW
++ 2*x^8 + x^7 + 2*x^5 + x^4 + 2*x^2 + x
+ """
+ sig_on()
+ fmpz_poly_get_nmod_poly(&self.x, x)
diff --git a/srcpkgs/sagemath/patches/11-fix_very_slow_doctest-isogeny_small_degree.patch b/srcpkgs/sagemath/patches/11-fix_very_slow_doctest-isogeny_small_degree.patch
new file mode 100644
index 00000000000000..f3da5bbb555e91
--- /dev/null
+++ b/srcpkgs/sagemath/patches/11-fix_very_slow_doctest-isogeny_small_degree.patch
@@ -0,0 +1,106 @@
+diff --git a/src/sage/schemes/elliptic_curves/isogeny_small_degree.py b/src/sage/schemes/elliptic_curves/isogeny_small_degree.py
+index 43727346269..9d3ccd475cd 100644
+--- a/src/sage/schemes/elliptic_curves/isogeny_small_degree.py
++++ b/src/sage/schemes/elliptic_curves/isogeny_small_degree.py
+@@ -186,7 +186,7 @@ def Psi(l, use_stored=True):
+ sage: assert Psi(3, use_stored=True) == Psi(3, use_stored=False)
+ sage: assert Psi(5, use_stored=True) == Psi(5, use_stored=False)
+ sage: assert Psi(7, use_stored=True) == Psi(7, use_stored=False)
+- sage: assert Psi(13, use_stored=True) == Psi(13, use_stored=False) # not tested (very long time)
++ sage: assert Psi(13, use_stored=True) == Psi(13, use_stored=False) # long time (2s)
+ """
+ if l not in [2, 3, 5, 7, 13]:
+ raise ValueError("Genus zero primes are 2, 3, 5, 7 or 13.")
+@@ -1207,7 +1207,7 @@ def isogenies_13_0(E, minimal_models=True):
+ sage: K. = NumberField(f)
+ sage: E = EllipticCurve(j=K(0)); E.ainvs()
+ (0, 0, 0, 0, 1)
+- sage: [phi.codomain().ainvs() for phi in isogenies_13_0(E)]
++ sage: [phi.codomain().ainvs() for phi in isogenies_13_0(E)] # long time (4s)
+ [(0,
+ 0,
+ 20360599/165164973653422080*a^11 - 3643073/41291243413355520*a^10 - 101/8789110986240*a^9 + 5557619461/573489491852160*a^8 - 82824971/11947697746920*a^7 - 19487/21127670640*a^6 - 475752603733/29409717530880*a^5 + 87205112531/7352429382720*a^4 + 8349/521670880*a^3 + 5858744881/12764634345*a^2 - 1858703809/2836585410*a + 58759402/48906645,
+@@ -1325,7 +1325,7 @@ def isogenies_13_1728(E, minimal_models=True):
+ sage: f = x^12 + 1092*x^10 - 432432*x^8 + 6641024*x^6 - 282896640*x^4 - 149879808*x^2 - 349360128
+ sage: K. = NumberField(f)
+ sage: E = EllipticCurve(K, [1,0])
+- sage: [phi.codomain().ainvs() for phi in isogenies_13_1728(E)]
++ sage: [phi.codomain().ainvs() for phi in isogenies_13_1728(E)] # long time (3s)
+ [(0,
+ 0,
+ 0,
+@@ -1550,8 +1550,11 @@ def Psi2(l):
+ sage: from sage.schemes.elliptic_curves.isogeny_small_degree import Psi2
+ sage: Psi2(11)
+ x^5 - 55*x^4*u + 994*x^3*u^2 - 8774*x^2*u^3 + 41453*x*u^4 - 928945/11*u^5 + 33*x^4 + 276*x^3*u - 7794*x^2*u^2 + 4452*x*u^3 + 1319331/11*u^4 + 216*x^3*v - 4536*x^2*u*v + 31752*x*u^2*v - 842616/11*u^3*v + 162*x^3 + 38718*x^2*u - 610578*x*u^2 + 33434694/11*u^3 - 4536*x^2*v + 73872*x*u*v - 2745576/11*u^2*v - 16470*x^2 + 580068*x*u - 67821354/11*u^2 - 185976*x*v + 14143896/11*u*v + 7533*x - 20437029/11*u - 12389112/11*v + 19964151/11
+- sage: Psi2(71) # long time (1 second)
+- -2209380711722505179506258739515288584116147237393815266468076436521/71*u^210 + ... - 14790739586438315394567393301990769678157425619440464678252277649/71
++ sage: f = Psi2(71)
++ sage: f.coefficient([0, 210, 0])
++ -2209380711722505179506258739515288584116147237393815266468076436521/71
++ sage: f.coefficient([0, 0, 0])
++ -14790739586438315394567393301990769678157425619440464678252277649/71
+
+ TESTS::
+
+@@ -1665,17 +1668,17 @@ def isogenies_prime_degree_genus_plus_0(E, l=None, minimal_models=True):
+ sage: K = QuadraticField(5,'a')
+ sage: a = K.gen()
+ sage: E = EllipticCurve_from_j(184068066743177379840*a - 411588709724712960000)
+- sage: isogenies_prime_degree_genus_plus_0(E, 47) # long time (4.3s)
++ sage: isogenies_prime_degree_genus_plus_0(E, 47) # long time (2s)
+ [Isogeny of degree 47 from Elliptic Curve defined by y^2 = x^3 + (454562028554080355857852049849975895490560*a-1016431595837124114668689286176511361024000)*x + (-249456798429896080881440540950393713303830363999480904280965120*a+557802358738710443451273320227578156598454035482869042774016000) over Number Field in a with defining polynomial x^2 - 5 with a = 2.236067977499790? to Elliptic Curve defined by y^2 = x^3 + (39533118442361013730577638493616965245992960*a-88398740199669828340617478832005245173760000)*x + (214030321479466610282320528611562368963830105830555363061803253760*a-478586348074220699687616322532666163722004497458452316582576128000) over Number Field in a with defining polynomial x^2 - 5 with a = 2.236067977499790?]
+
+ sage: K = QuadraticField(-66827,'a')
+ sage: a = K.gen()
+ sage: E = EllipticCurve_from_j(-98669236224000*a + 4401720074240000)
+- sage: isogenies_prime_degree_genus_plus_0(E, 59) # long time (25s, 2012)
++ sage: isogenies_prime_degree_genus_plus_0(E, 59) # long time (5s)
+ [Isogeny of degree 59 from Elliptic Curve defined by y^2 = x^3 + (2605886146782144762297974784000*a+1893681048912773634944634716160000)*x + (-116918454256410782232296183198067568744071168000*a+17012043538294664027185882358514011304812871680000) over Number Field in a with defining polynomial x^2 + 66827 with a = 258.5091874576221?*I to Elliptic Curve defined by y^2 = x^3 + (-19387084027159786821400775098368000*a-4882059104868154225052787156713472000)*x + (-25659862010101415428713331477227179429538847260672000*a-2596038148441293485938798119003462972840818381946880000) over Number Field in a with defining polynomial x^2 + 66827 with a = 258.5091874576221?*I]
+
+ sage: E = EllipticCurve_from_j(GF(13)(5))
+- sage: isogenies_prime_degree_genus_plus_0(E, 71) # long time
++ sage: isogenies_prime_degree_genus_plus_0(E, 71)
+ [Isogeny of degree 71 from Elliptic Curve defined by y^2 = x^3 + x + 4 over Finite Field of size 13 to Elliptic Curve defined by y^2 = x^3 + 10*x + 7 over Finite Field of size 13, Isogeny of degree 71 from Elliptic Curve defined by y^2 = x^3 + x + 4 over Finite Field of size 13 to Elliptic Curve defined by y^2 = x^3 + 10*x + 7 over Finite Field of size 13]
+
+ sage: E = EllipticCurve(GF(13),[0,1,1,1,0])
+@@ -2117,11 +2120,11 @@ def isogenies_prime_degree_general(E, l, minimal_models=True):
+ sage: isogenies_prime_degree_general(E, 19)
+ [Isogeny of degree 19 from Elliptic Curve defined by y^2 + y = x^3 - 1862*x - 30956 over Rational Field to Elliptic Curve defined by y^2 + y = x^3 - 672182*x + 212325489 over Rational Field]
+ sage: E = EllipticCurve([0, -1, 0, -6288, 211072])
+- sage: isogenies_prime_degree_general(E, 37) # long time (10s)
++ sage: isogenies_prime_degree_general(E, 37) # long time (2s)
+ [Isogeny of degree 37 from Elliptic Curve defined by y^2 = x^3 - x^2 - 6288*x + 211072 over Rational Field to Elliptic Curve defined by y^2 = x^3 - x^2 - 163137088*x - 801950801728 over Rational Field]
+
+ sage: E = EllipticCurve([-3440, 77658])
+- sage: isogenies_prime_degree_general(E, 43) # long time (16s)
++ sage: isogenies_prime_degree_general(E, 43) # long time (2s)
+ [Isogeny of degree 43 from Elliptic Curve defined by y^2 = x^3 - 3440*x + 77658 over Rational Field to Elliptic Curve defined by y^2 = x^3 - 6360560*x - 6174354606 over Rational Field]
+
+ Isogenies of degree equal to the characteristic are computed (but
+@@ -2175,7 +2178,7 @@ def isogenies_prime_degree_general(E, l, minimal_models=True):
+
+ sage: K. = QuadraticField(-1)
+ sage: E = EllipticCurve(K,[0,0,0,1,0])
+- sage: [phi.codomain().ainvs() for phi in E.isogenies_prime_degree(37)] # long time
++ sage: [phi.codomain().ainvs() for phi in E.isogenies_prime_degree(37)] # long time (6s)
+ [(0, 0, 0, -840*i + 1081, 0), (0, 0, 0, 840*i + 1081, 0)]
+ """
+ if not l.is_prime():
+@@ -2329,14 +2332,14 @@ def isogenies_prime_degree(E, l, minimal_models=True):
+ sage: E = EllipticCurve(GF(101), [-3440, 77658])
+ sage: E.isogenies_prime_degree(71) # fast
+ []
+- sage: E.isogenies_prime_degree(73) # slower (2s)
++ sage: E.isogenies_prime_degree(73) # long time (2s)
+ []
+
+ Test that :trac:`32269` is fixed::
+
+ sage: K = QuadraticField(-11)
+ sage: E = EllipticCurve(K, [0,1,0,-117,-541])
+- sage: E.isogenies_prime_degree(37)
++ sage: E.isogenies_prime_degree(37) # long time (9s)
+ [Isogeny of degree 37 from Elliptic Curve defined by y^2 = x^3 + x^2 + (-117)*x + (-541) over Number Field in a with defining polynomial x^2 + 11 with a = 3.316624790355400?*I to Elliptic Curve defined by y^2 = x^3 + x^2 + (30800*a+123963)*x + (3931312*a-21805005) over Number Field in a with defining polynomial x^2 + 11 with a = 3.316624790355400?*I,
+ Isogeny of degree 37 from Elliptic Curve defined by y^2 = x^3 + x^2 + (-117)*x + (-541) over Number Field in a with defining polynomial x^2 + 11 with a = 3.316624790355400?*I to Elliptic Curve defined by y^2 = x^3 + x^2 + (-30800*a+123963)*x + (-3931312*a-21805005) over Number Field in a with defining polynomial x^2 + 11 with a = 3.316624790355400?*I]
+
diff --git a/srcpkgs/sagemath/patches/12-fix_very_slow_doctest-function_field.patch b/srcpkgs/sagemath/patches/12-fix_very_slow_doctest-function_field.patch
new file mode 100644
index 00000000000000..3b7b1ea843df97
--- /dev/null
+++ b/srcpkgs/sagemath/patches/12-fix_very_slow_doctest-function_field.patch
@@ -0,0 +1,97 @@
+--- a/src/sage/rings/function_field/function_field.py
++++ b/src/sage/rings/function_field/function_field.py
+@@ -111,22 +111,21 @@ Function fields over the algebraic field are supported::
+ sage: m = L.completion(pl, prec=5)
+ sage: m(x)
+ I + s + O(s^5)
+- sage: m(y)
++ sage: m(y) # long time (4s)
+ -2*s + (-4 - I)*s^2 + (-15 - 4*I)*s^3 + (-75 - 23*I)*s^4 + (-413 - 154*I)*s^5 + O(s^6)
+- sage: m(y)^2 + m(y) + m(x) + 1/m(x)
++ sage: m(y)^2 + m(y) + m(x) + 1/m(x) # long time (8s)
+ O(s^5)
+
+ TESTS::
+
+ sage: TestSuite(J).run()
+- sage: TestSuite(K).run(max_runs=1024) # long time (5s)
+- sage: TestSuite(L).run(max_runs=64) # long time (10s)
+- sage: TestSuite(M).run(max_runs=32) # long time (30s)
+- sage: TestSuite(N).run(max_runs=64, skip = '_test_derivation') # long time (8s)
+- sage: TestSuite(O).run(max_runs=128, skip = '_test_derivation') # long time (8s)
+-
++ sage: TestSuite(K).run(max_runs=256) # long time (10s)
++ sage: TestSuite(L).run(max_runs=8) # long time (25s)
++ sage: TestSuite(M).run(max_runs=8) # long time (35s)
++ sage: TestSuite(N).run(max_runs=8, skip = '_test_derivation') # long time (15s)
++ sage: TestSuite(O).run()
+ sage: TestSuite(R).run()
+- sage: TestSuite(S).run() # long time (3s)
++ sage: TestSuite(S).run() # long time (4s)
+
+ Global function fields
+ ----------------------
+@@ -287,7 +286,7 @@ class FunctionField(Field):
+ TESTS::
+
+ sage: K. = FunctionField(QQ)
+- sage: TestSuite(K).run()
++ sage: TestSuite(K).run() # long time (3s)
+ """
+ Field.__init__(self, base_field, names=names, category=category)
+
+@@ -729,7 +728,7 @@ class FunctionField(Field):
+ EXAMPLES::
+
+ sage: K. = FunctionField(QQ)
+- sage: TestSuite(K).run() # indirect doctest
++ sage: TestSuite(K).run() # indirect doctest, long time (3s)
+ """
+ tester = self._tester(**options)
+ S = tester.some_elements()
+@@ -1209,7 +1208,7 @@ class FunctionField_polymod(FunctionField):
+ sage: K. = FunctionField(QQ); R. = K[]
+ sage: L = K.extension(y^5 - x^3 - 3*x + x*y); L
+ Function field in y defined by y^5 + x*y - x^3 - 3*x
+- sage: TestSuite(L).run() # long time
++ sage: TestSuite(L).run(max_runs=512) # long time (15s)
+
+ We can set the variable name, which doesn't have to be y::
+
+@@ -2888,7 +2887,8 @@ class FunctionField_simple(FunctionField_polymod):
+ sage: F. = K.extension(Y^3 - x^2*(x^2 + x + 1)^2)
+ sage: O = K.maximal_order()
+ sage: pls = [O.ideal(x-QQbar(sqrt(c))).place() for c in [-2, -1, 0, 1, 2]]
+- sage: all(q.place_below() == p for p in pls for q in F.places_above(p))
++ sage: all(q.place_below() == p # long time (4s)
++ ....: for p in pls for q in F.places_above(p))
+ True
+ """
+ R = self.base_field()
+@@ -3091,7 +3091,7 @@ class FunctionField_global(FunctionField_simple):
+
+ sage: K. = FunctionField(GF(4)); _. = K[]
+ sage: L. = K.extension((1 - x)*Y^7 - x^3)
+- sage: L.gaps()
++ sage: L.gaps() # long time (6s)
+ [1, 2, 3]
+
+ or may define a trivial extension::
+@@ -3111,7 +3111,7 @@ class FunctionField_global(FunctionField_simple):
+
+ sage: K. = FunctionField(GF(5)); _. = K[]
+ sage: L. = K.extension(Y^3 - (x^3 - 1)/(x^3 - 2))
+- sage: TestSuite(L).run()
++ sage: TestSuite(L).run() # long time (7s)
+ """
+ FunctionField_polymod.__init__(self, polynomial, names)
+
+@@ -3807,7 +3807,7 @@ class RationalFunctionField(FunctionField):
+
+ sage: K. = FunctionField(CC); K
+ Rational function field in t over Complex Field with 53 bits of precision
+- sage: TestSuite(K).run()
++ sage: TestSuite(K).run() # long time (5s)
+
+ sage: FunctionField(QQ[I], 'alpha')
+ Rational function field in alpha over Number Field in I with defining polynomial x^2 + 1 with I = 1*I
diff --git a/srcpkgs/sagemath/patches/trac-33189-fix_doctests_for_arb_2.22-53532ddd4e2dc92469c1590ebf0c40f8f69bf579.patch b/srcpkgs/sagemath/patches/trac-33189-fix_doctests_for_arb_2.22-53532ddd4e2dc92469c1590ebf0c40f8f69bf579.patch
new file mode 100644
index 00000000000000..b861af7ec982a2
--- /dev/null
+++ b/srcpkgs/sagemath/patches/trac-33189-fix_doctests_for_arb_2.22-53532ddd4e2dc92469c1590ebf0c40f8f69bf579.patch
@@ -0,0 +1,126 @@
+From 24cc94b1988a90f3bd22a2368ec30c086283af13 Mon Sep 17 00:00:00 2001
+From: Antonio Rojas
+Date: Sun, 16 Jan 2022 11:55:04 +0100
+Subject: Add abs tol to some arb tests
+
+---
+ src/sage/functions/error.py | 2 +-
+ src/sage/rings/complex_arb.pyx | 6 +++---
+ src/sage/rings/real_arb.pyx | 10 +++++-----
+ 3 files changed, 9 insertions(+), 9 deletions(-)
+
+diff --git a/src/sage/functions/error.py b/src/sage/functions/error.py
+index f48d04f..06f0b24 100644
+--- a/src/sage/functions/error.py
++++ b/src/sage/functions/error.py
+@@ -267,7 +267,7 @@ class Function_erf(BuiltinFunction):
+
+ Check that real ball evaluation is fixed :trac:`28061`::
+
+- sage: RealBallField(128)(erf(5))
++ sage: RealBallField(128)(erf(5)) # abs tol 1e-38
+ [0.99999999999846254020557196514981165651 +/- 7.33e-39]
+ """
+ R = parent or s_parent(x)
+diff --git a/src/sage/rings/complex_arb.pyx b/src/sage/rings/complex_arb.pyx
+index f986970..93ff565 100644
+--- a/src/sage/rings/complex_arb.pyx
++++ b/src/sage/rings/complex_arb.pyx
+@@ -3974,8 +3974,8 @@ cdef class ComplexBall(RingElement):
+
+ EXAMPLES::
+
+- sage: CBF(20).erfc()
+- [5.39586561160790e-176 +/- ...e-191]
++ sage: CBF(20).erfc() # abs tol 1e-190
++ [5.39586561160790e-176 +/- 6.73e-191]
+ sage: CBF(100, 100).erfc()
+ [0.00065234366376858 +/- ...e-18] + [-0.00393572636292141 +/- ...e-18]*I
+ """
+@@ -4280,7 +4280,7 @@ cdef class ComplexBall(RingElement):
+
+ TESTS:
+
+- sage: CBF(Shi(I))
++ sage: CBF(Shi(I)) # abs tol 1e-15
+ [0.946083070367183 +/- 9.22e-16]*I
+ """
+ cdef ComplexBall result = self._new()
+diff --git a/src/sage/rings/real_arb.pyx b/src/sage/rings/real_arb.pyx
+index 4a81784..292bfea 100644
+--- a/src/sage/rings/real_arb.pyx
++++ b/src/sage/rings/real_arb.pyx
+@@ -3506,7 +3506,7 @@ cdef class RealBall(RingElement):
+
+ EXAMPLES::
+
+- sage: RBF(1/2).erf()
++ sage: RBF(1/2).erf() # abs tol 1e-16
+ [0.520499877813047 +/- 6.10e-16]
+ """
+ cdef RealBall res = self._new()
+@@ -3556,12 +3556,12 @@ cdef class RealBall(RingElement):
+
+ EXAMPLES::
+
+- sage: RBF(1).Si()
++ sage: RBF(1).Si() # abs tol 1e-15
+ [0.946083070367183 +/- 9.22e-16]
+
+ TESTS::
+
+- sage: RBF(Si(1))
++ sage: RBF(Si(1)) # abs tol 1e-15
+ [0.946083070367183 +/- 9.22e-16]
+ """
+ cdef RealBall res = self._new()
+@@ -3578,12 +3578,12 @@ cdef class RealBall(RingElement):
+
+ EXAMPLES::
+
+- sage: RBF(1).Ci() # abs tol 1e-16
++ sage: RBF(1).Ci() # abs tol 1e-15
+ [0.337403922900968 +/- 3.25e-16]
+
+ TESTS::
+
+- sage: RBF(Ci(1)) # abs tol 1e-16
++ sage: RBF(Ci(1)) # abs tol 1e-15
+ [0.337403922900968 +/- 3.25e-16]
+ """
+ cdef RealBall res = self._new()
+--
+cgit v1.0-1-gd88e
+
+
+From 53532ddd4e2dc92469c1590ebf0c40f8f69bf579 Mon Sep 17 00:00:00 2001
+From: Antonio Rojas
+Date: Sun, 16 Jan 2022 14:16:53 +0100
+Subject: Decrease abs tol
+
+---
+ src/sage/rings/real_arb.pyx | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/sage/rings/real_arb.pyx b/src/sage/rings/real_arb.pyx
+index 292bfea..eb30f7f 100644
+--- a/src/sage/rings/real_arb.pyx
++++ b/src/sage/rings/real_arb.pyx
+@@ -3578,12 +3578,12 @@ cdef class RealBall(RingElement):
+
+ EXAMPLES::
+
+- sage: RBF(1).Ci() # abs tol 1e-15
++ sage: RBF(1).Ci() # abs tol 5e-16
+ [0.337403922900968 +/- 3.25e-16]
+
+ TESTS::
+
+- sage: RBF(Ci(1)) # abs tol 1e-15
++ sage: RBF(Ci(1)) # abs tol 5e-16
+ [0.337403922900968 +/- 3.25e-16]
+ """
+ cdef RealBall res = self._new()
+--
+cgit v1.0-1-gd88e
+
diff --git a/srcpkgs/sagemath/patches/trac-33226-fix_doctests_giac-1.7.0-33ea2adf01e9e2ce9f1e33779f0b1ac0d9d1989c.patch b/srcpkgs/sagemath/patches/trac-33226-fix_doctests_giac-1.7.0-33ea2adf01e9e2ce9f1e33779f0b1ac0d9d1989c.patch
new file mode 100644
index 00000000000000..d4e8f8be60e3e8
--- /dev/null
+++ b/srcpkgs/sagemath/patches/trac-33226-fix_doctests_giac-1.7.0-33ea2adf01e9e2ce9f1e33779f0b1ac0d9d1989c.patch
@@ -0,0 +1,40 @@
+From 33ea2adf01e9e2ce9f1e33779f0b1ac0d9d1989c Mon Sep 17 00:00:00 2001
+From: Michael Orlitzky
+Date: Mon, 24 Jan 2022 09:03:29 -0500
+Subject: Trac #33226: update doctests for giac-1.7.0.45.
+
+We have two failing doctests with giac-1.7.0.45: one is a trivial
+tolerance issue, but the other is a symbolic integration result for
+which giac is no longer willing to return a symbolic answer. We add
+"abs tol" to the numeric test, and drop the symbolic one entirely.
+---
+ src/sage/functions/min_max.py | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/src/sage/functions/min_max.py b/src/sage/functions/min_max.py
+index fc18373..9b7d6d9 100644
+--- a/src/sage/functions/min_max.py
++++ b/src/sage/functions/min_max.py
+@@ -228,15 +228,15 @@ class MaxSymbolic(MinMax_base):
+ ...
+ TypeError: cannot evaluate symbolic expression numerically
+
+- ::
++ We can usually integrate these expressions, but can't
++ guarantee a symbolic answer in closed form::
+
+ sage: f = max_symbolic(sin(x), cos(x))
+ sage: r = integral(f, x, 0, 1)
+ ...
+- sage: r
+- sqrt(2) - cos(1)
+- sage: r.n()
++ sage: r.n() # abs tol 1e-8
+ 0.873911256504955
++
+ """
+ return max_symbolic(args)
+
+--
+cgit v1.0-1-gd88e
+
diff --git a/srcpkgs/sagemath/patches/zzz-loadable_module_extension.patch b/srcpkgs/sagemath/patches/zzz-loadable_module_extension.patch
new file mode 100644
index 00000000000000..f3eb0aad2cca26
--- /dev/null
+++ b/srcpkgs/sagemath/patches/zzz-loadable_module_extension.patch
@@ -0,0 +1,14 @@
+ - this is not a proper fix... should fix sage_getfile() instead
+
+--- a/src/sage/misc/sageinspect.py
++++ b/src/sage/misc/sageinspect.py
+@@ -187,7 +187,8 @@ def loadable_module_extension():
+ True
+ """
+ # Return the full platform-specific extension module suffix
+- return import_machinery.EXTENSION_SUFFIXES[0]
++ # PATCHED for void linux, we use the shortest extension (.so)
++ return import_machinery.EXTENSION_SUFFIXES[-1]
+
+
+ def isclassinstance(obj):
diff --git a/srcpkgs/sagemath/patches/zzz-skip_doctest_no_threejs.patch b/srcpkgs/sagemath/patches/zzz-skip_doctest_no_threejs.patch
new file mode 100644
index 00000000000000..5cb62f56e90214
--- /dev/null
+++ b/srcpkgs/sagemath/patches/zzz-skip_doctest_no_threejs.patch
@@ -0,0 +1,13 @@
+ - we don't have threejs in void
+
+--- a/src/sage/repl/ipython_kernel/install.py
++++ b/src/sage/repl/ipython_kernel/install.py
+@@ -124,7 +124,7 @@ class SageKernelSpec(object):
+ sage: spec = SageKernelSpec(prefix=tmp_dir())
+ sage: spec.use_local_threejs()
+ sage: threejs = os.path.join(spec.nbextensions_dir, 'threejs-sage')
+- sage: os.path.isdir(threejs)
++ sage: os.path.isdir(threejs) # optional - threejs
+ True
+ """
+ src = THREEJS_DIR
diff --git a/srcpkgs/sagemath/template b/srcpkgs/sagemath/template
new file mode 100644
index 00000000000000..710a9e80c0521c
--- /dev/null
+++ b/srcpkgs/sagemath/template
@@ -0,0 +1,129 @@
+# Template file for 'sagemath'
+pkgname=sagemath
+version=9.5
+revision=1
+wrksrc=sage-$version
+build_wrksrc=pkgs/sagemath-standard
+build_style=python3-module
+_bindir=/usr/lib/sagemath/bin
+make_install_args="--install-scripts=$_bindir"
+hostmakedepends="m4 pkg-config python3-Cython python3-Jinja2 python3-pkgconfig
+ python3-setuptools"
+makedepends="arb-devel 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
+ libpng-devel linbox-devel lrcalc-devel m4ri-devel m4rie-devel mpfi-devel
+ mpfr-devel ntl-devel openblas-devel pari-devel planarity-devel python3-cypari2
+ python3-cysignals python3-devel python3-gmpy2 python3-memory_allocator
+ python3-numpy rankwidth-devel singular symmetrica-devel zn_poly"
+depends="FlintQS eclib-devel fflas-ffpack flintlib-devel gcc-fortran gd-devel
+ gfan giac gsl-devel gzip libpng-devel linbox-devel m4ri-devel maxima-ecl
+ mpfr-devel nauty ntl-devel palp pari-devel pari-elldata-small pari-galdata
+ pari-galpol-small pari-seadata-small pkg-config python3-Cython python3-cypari2
+ python3-cysignals python3-devel python3-fpylll python3-ipython
+ python3-ipython_ipykernel python3-jupyter_ipywidgets python3-matplotlib
+ 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
+ sage-data-polytopes_db sympow tachyon"
+checkdepends="$depends"
+short_desc="Open source mathematics software"
+maintainer="Gonzalo TornarĂa "
+license="GPL-2.0-or-later"
+homepage="http://sagemath.org/"
+distfiles="https://github.com/sagemath/sage/archive/refs/tags/$version.tar.gz"
+checksum=8d70a3b26080802c5b2e33dda4c23795d494d8216a0c2ecfcd608ebab0e64ff6
+
+post_patch() {
+ # these are unused and nothing else uses ratpoints
+ rm sage/libs/ratpoints.{pyx,pxd}
+
+ # git tree needs bootstrapping
+ pushd $wrksrc/build/pkgs/sagelib
+ PATH=../../bin:$PATH BOOTSTRAP_QUIET=no ./bootstrap
+ popd
+}
+
+do_configure() {
+ # set variables in sage.env since we do not install sage_conf
+ cat >> sage/env.py <<-EOF
+ CONWAY_POLYNOMIALS_DATA_DIR = "/usr/share/sagemath/conway_polynomials"
+ GRAPHS_DATA_DIR = "/usr/share/sagemath/graphs"
+ ELLCURVE_DATA_DIR = "/usr/share/sagemath/ellcurves"
+ POLYTOPE_DATA_DIR = "/usr/share/sagemath/reflexive_polytopes"
+ COMBINATORIAL_DESIGN_DATA_DIR = "/usr/share/sagemath/combinatorial_designs"
+ CREMONA_MINI_DATA_DIR = "/usr/share/sagemath/cremona"
+ CREMONA_LARGE_DATA_DIR = "/usr/share/sagemath/cremona"
+ EOF
+
+ # don't install sage-venv-config: it is used to set SAGE_VENV=/usr and
+ # then sage-env prepends "$SAGE_VENV/bin" to PATH which is undesired
+ vsed -e '/sage-venv-config/d' -i $wrksrc/src/setup.cfg
+}
+
+pre_build() {
+ export PYTHONPATH=../sage-setup
+ export SAGE_NUM_THREADS="$XBPS_MAKEJOBS"
+}
+
+post_build() {
+ _scripts=$(cd build/scripts* && pwd)
+ cat >> $_scripts/sage-env-config <<-'EOF'
+ PATH=$(dirname $SELF):$PATH
+ EOF
+}
+
+pre_install() {
+ export PYTHONPATH=../sage-setup
+ export SAGE_NUM_THREADS="$XBPS_MAKEJOBS"
+}
+
+post_install() {
+ # fix jupyter kernel spec
+ vsed -i -e 's|"/usr/bin/sage", "--python"|"/usr/bin/python"|' \
+ ${DESTDIR}/usr/share/jupyter/kernels/sagemath/kernel.json
+ # 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
+ # we don't have threejs in void
+ rm ${DESTDIR}/usr/share/jupyter/nbextensions/threejs-sage
+
+ # symlink main binary
+ vmkdir usr/bin
+ ln -s $_bindir/sage ${DESTDIR}/usr/bin/sage-${version}
+ ln -s sage-${version} ${DESTDIR}/usr/bin/sage
+}
+
+do_check() {
+ _scripts=$(cd build/scripts* && pwd)
+ export PYTHONPATH=$(cd build/lib* && pwd)
+
+ # get out of $build_wrksrc, otherwise python picks the wrong sage module
+ cd $(mktemp -dp build)
+
+ if [ -f ${XBPS_DISTDIR}/sagemath-check ] ; then
+ _sed='s|#.*||;/^\s*$/d;s|[^ ]*/sage/|'$PYTHONPATH'/sage/|g' \
+ _test_files=$(sed -e "$_sed" ${XBPS_DISTDIR}/sagemath-check)
+ fi
+ if [ -z "$_test_files" ]; then
+ _test_files=--all
+ fi
+ cp ${FILESDIR}/timings2.json .
+ _test_args="--stats_path=timings2.json"
+ if [ "$XBPS_CHECK_PKGS" = full ]; then
+ _test_args+=" --long --warn-long 60.0"
+ else
+ _test_args+=" --warn-long 30.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}
+}