Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] [RFC] New package: sagelib-9.5
@ 2022-02-01  4:05 tornaria
  2022-02-01  9:21 ` dkwo
                   ` (17 more replies)
  0 siblings, 18 replies; 19+ messages in thread
From: tornaria @ 2022-02-01  4:05 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1278 bytes --]

There is a new pull request by tornaria against master on the void-packages repository

https://github.com/tornaria/void-packages sagelib
https://github.com/void-linux/void-packages/pull/35339

[RFC] New package: sagelib-9.5
This is a different approach for a sagemath package than #34030.

Here we build the sagelib as a python module and install it in the system site-packages. The scripts are all installed in `/usr/lib/sagemath/bin` to avoid polluting the PATH. A symlink `/usr/bin/sagelib` is provided.

NOTE: for the moment this is set up so it can coexists together with the `sagemath` package; that's why the package name is `sagelib` (instead of `sagemath`) and the binary is `sagelib` (instead of `sage`). The plan is to rename this package to `sagemath` and the binary to `sage` to replace the other since this one is much simpler and should work better.

With this version jupyter notebook should work out of the box without any adjustments. Please let me know if there's anything missing.

Any comments about packaging, package layout, etc, now is the moment. I would like to get this merged soon since everything seems to be in place.

Cc: @dkwo @leahneukirchen 

A patch file from https://github.com/void-linux/void-packages/pull/35339.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-sagelib-35339.patch --]
[-- Type: text/x-diff, Size: 43707 bytes --]

From f9002d5ec9cc7dbfa364d1f8cb3ab2f1f4608364 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Mon, 31 Jan 2022 12:50:38 -0300
Subject: [PATCH] New package: sagelib-9.5

---
 srcpkgs/sagelib/files/timings2.json           | 398 ++++++++++++++++++
 .../patches/01-dont_link_ratpoints.patch      |  10 +
 ...2-fix_get_shared_lib_path--see_29644.patch |  13 +
 .../patches/03-doctest_have_program.patch     |  20 +
 .../patches/04-doctest_sage_getfile.patch     |  22 +
 .../sagelib/patches/05-fix_sage_getfile.patch |  16 +
 ...6-skip_doctest_giac-1.7.0--see_31563.patch |  16 +
 .../sagelib/patches/07-ignore_warning.patch   |  15 +
 .../08-dont_run_pytest--see_31924.patch       |  27 ++
 ...2ddd4e2dc92469c1590ebf0c40f8f69bf579.patch | 126 ++++++
 .../patches/zzz-skip_doctest_no_threejs.patch |  13 +
 srcpkgs/sagelib/template                      | 131 ++++++
 12 files changed, 807 insertions(+)
 create mode 100644 srcpkgs/sagelib/files/timings2.json
 create mode 100644 srcpkgs/sagelib/patches/01-dont_link_ratpoints.patch
 create mode 100644 srcpkgs/sagelib/patches/02-fix_get_shared_lib_path--see_29644.patch
 create mode 100644 srcpkgs/sagelib/patches/03-doctest_have_program.patch
 create mode 100644 srcpkgs/sagelib/patches/04-doctest_sage_getfile.patch
 create mode 100644 srcpkgs/sagelib/patches/05-fix_sage_getfile.patch
 create mode 100644 srcpkgs/sagelib/patches/06-skip_doctest_giac-1.7.0--see_31563.patch
 create mode 100644 srcpkgs/sagelib/patches/07-ignore_warning.patch
 create mode 100644 srcpkgs/sagelib/patches/08-dont_run_pytest--see_31924.patch
 create mode 100644 srcpkgs/sagelib/patches/trac-33189-fix_doctests_for_arb_2.22-53532ddd4e2dc92469c1590ebf0c40f8f69bf579.patch
 create mode 100644 srcpkgs/sagelib/patches/zzz-skip_doctest_no_threejs.patch
 create mode 100644 srcpkgs/sagelib/template

diff --git a/srcpkgs/sagelib/files/timings2.json b/srcpkgs/sagelib/files/timings2.json
new file mode 100644
index 000000000000..71a9aa84ce58
--- /dev/null
+++ b/srcpkgs/sagelib/files/timings2.json
@@ -0,0 +1,398 @@
+{
+  "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": 256},
+  "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.polynomial.polynomial_zmod_flint": {"walltime": 512},
+  "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": 256},
+  "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/sagelib/patches/01-dont_link_ratpoints.patch b/srcpkgs/sagelib/patches/01-dont_link_ratpoints.patch
new file mode 100644
index 000000000000..e5c3f5776aa2
--- /dev/null
+++ b/srcpkgs/sagelib/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/sagelib/patches/02-fix_get_shared_lib_path--see_29644.patch b/srcpkgs/sagelib/patches/02-fix_get_shared_lib_path--see_29644.patch
new file mode 100644
index 000000000000..d3672b094c1c
--- /dev/null
+++ b/srcpkgs/sagelib/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/sagelib/patches/03-doctest_have_program.patch b/srcpkgs/sagelib/patches/03-doctest_have_program.patch
new file mode 100644
index 000000000000..27ba3776470c
--- /dev/null
+++ b/srcpkgs/sagelib/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/sagelib/patches/04-doctest_sage_getfile.patch b/srcpkgs/sagelib/patches/04-doctest_sage_getfile.patch
new file mode 100644
index 000000000000..95bce107f854
--- /dev/null
+++ b/srcpkgs/sagelib/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/sagelib/patches/05-fix_sage_getfile.patch b/srcpkgs/sagelib/patches/05-fix_sage_getfile.patch
new file mode 100644
index 000000000000..56c58078f319
--- /dev/null
+++ b/srcpkgs/sagelib/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/sagelib/patches/06-skip_doctest_giac-1.7.0--see_31563.patch b/srcpkgs/sagelib/patches/06-skip_doctest_giac-1.7.0--see_31563.patch
new file mode 100644
index 000000000000..619e62f928dd
--- /dev/null
+++ b/srcpkgs/sagelib/patches/06-skip_doctest_giac-1.7.0--see_31563.patch
@@ -0,0 +1,16 @@
+ - these are broken in giac 1.7.0, skip
+
+--- a/src/sage/functions/min_max.py
++++ b/src/sage/functions/min_max.py
+@@ -233,9 +233,9 @@ class MaxSymbolic(MinMax_base):
+             sage: f = max_symbolic(sin(x), cos(x))
+             sage: r = integral(f, x, 0, 1)
+             ...
+-            sage: r
++            sage: r             # not tested -- broken with giac 1.7.0
+             sqrt(2) - cos(1)
+-            sage: r.n()
++            sage: r.n()         # not tested -- broken with giac 1.7.0
+             0.873911256504955
+         """
+         return max_symbolic(args)
diff --git a/srcpkgs/sagelib/patches/07-ignore_warning.patch b/srcpkgs/sagelib/patches/07-ignore_warning.patch
new file mode 100644
index 000000000000..69668678a40b
--- /dev/null
+++ b/srcpkgs/sagelib/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/sagelib/patches/08-dont_run_pytest--see_31924.patch b/srcpkgs/sagelib/patches/08-dont_run_pytest--see_31924.patch
new file mode 100644
index 000000000000..06bd2ccae6fb
--- /dev/null
+++ b/srcpkgs/sagelib/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/sagelib/patches/trac-33189-fix_doctests_for_arb_2.22-53532ddd4e2dc92469c1590ebf0c40f8f69bf579.patch b/srcpkgs/sagelib/patches/trac-33189-fix_doctests_for_arb_2.22-53532ddd4e2dc92469c1590ebf0c40f8f69bf579.patch
new file mode 100644
index 000000000000..b861af7ec982
--- /dev/null
+++ b/srcpkgs/sagelib/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 <arojas@archlinux.org>
+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 <arojas@archlinux.org>
+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/sagelib/patches/zzz-skip_doctest_no_threejs.patch b/srcpkgs/sagelib/patches/zzz-skip_doctest_no_threejs.patch
new file mode 100644
index 000000000000..5cb62f56e902
--- /dev/null
+++ b/srcpkgs/sagelib/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/sagelib/template b/srcpkgs/sagelib/template
new file mode 100644
index 000000000000..90bdbf56960f
--- /dev/null
+++ b/srcpkgs/sagelib/template
@@ -0,0 +1,131 @@
+# Template file for 'sagelib'
+pkgname=sagelib
+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 <tornaria@cmat.edu.uy>"
+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}
+
+	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
+}
+
+pre_build() {
+	export PYTHONPATH=../sage-setup
+	export PYTHONDONTWRITEBYTECODE=yes
+	export SAGE_NUM_THREADS="$XBPS_MAKEJOBS"
+}
+
+post_build() {
+	_scripts=$(cd build/scripts* && pwd)
+	cat >> $_scripts/sage-env-config <<-'EOF'
+	# sage-venv-config sets SAGE_VENV=/usr (sys.prefix)
+	# then sage-env prepends "$SAGE_VENV/bin" to PATH
+	# we don't want that to happen so we unset SAGE_VENV here
+	unset SAGE_VENV
+	PATH=$(dirname $SELF):$PATH
+	EOF
+}
+
+pre_install() {
+	export PYTHONPATH=../sage-setup
+	export PYTHONDONTWRITEBYTECODE=yes
+	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/sagelib-${version}
+	ln -s sagelib-${version} ${DESTDIR}/usr/bin/sagelib
+}
+
+do_check() {
+	_scripts=$(cd build/scripts* && pwd)
+	export PYTHONPATH=$(cd build/lib* && pwd)
+	export PYTHONDONTWRITEBYTECODE=yes
+
+	# 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}
+}

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [RFC] New package: sagelib-9.5
  2022-02-01  4:05 [PR PATCH] [RFC] New package: sagelib-9.5 tornaria
@ 2022-02-01  9:21 ` dkwo
  2022-02-01 10:10 ` dkwo
                   ` (16 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: dkwo @ 2022-02-01  9:21 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 321 bytes --]

New comment by dkwo on void-packages repository

https://github.com/void-linux/void-packages/pull/35339#issuecomment-1026629781

Comment:
Let me first say you've done a great job.
I'm building it right now, will report soon.
My only comment is about `depends`: is there a way not to bring in `-devel` and `gcc-` stuff?

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [RFC] New package: sagelib-9.5
  2022-02-01  4:05 [PR PATCH] [RFC] New package: sagelib-9.5 tornaria
  2022-02-01  9:21 ` dkwo
@ 2022-02-01 10:10 ` dkwo
  2022-02-01 10:12 ` dkwo
                   ` (15 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: dkwo @ 2022-02-01 10:10 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 635 bytes --]

New comment by dkwo on void-packages repository

https://github.com/void-linux/void-packages/pull/35339#issuecomment-1026673112

Comment:
For some reason, I struggle to pick up this kernel in jupyterlab.
I wonder if we need something similar to what Arch has
```
# fix symlinks to assets
  _pythonpath=`python -c "from sysconfig import get_path; print(get_path('platlib'))"`
  for _i in $(ls "$srcdir"/sage-$pkgver/src/sage/ext_data/notebook-ipython); do
    rm "$pkgdir"/usr/share/jupyter/kernels/sagemath/$_i
    ln -s $_pythonpath/sage/ext_data/notebook-ipython/$_i "$pkgdir"/usr/share/jupyter/kernels/sagemath/
  done
```

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [RFC] New package: sagelib-9.5
  2022-02-01  4:05 [PR PATCH] [RFC] New package: sagelib-9.5 tornaria
  2022-02-01  9:21 ` dkwo
  2022-02-01 10:10 ` dkwo
@ 2022-02-01 10:12 ` dkwo
  2022-02-01 10:13 ` dkwo
                   ` (14 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: dkwo @ 2022-02-01 10:12 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 883 bytes --]

New comment by dkwo on void-packages repository

https://github.com/void-linux/void-packages/pull/35339#issuecomment-1026673112

Comment:
For some reason, I struggle to pick up this kernel in jupyterlab.
I wonder if we need something similar to what Arch has
```
# fix symlinks to assets
  _pythonpath=`python -c "from sysconfig import get_path; print(get_path('platlib'))"`
  for _i in $(ls "$srcdir"/sage-$pkgver/src/sage/ext_data/notebook-ipython); do
    rm "$pkgdir"/usr/share/jupyter/kernels/sagemath/$_i
    ln -s $_pythonpath/sage/ext_data/notebook-ipython/$_i "$pkgdir"/usr/share/jupyter/kernels/sagemath/
  done
```
which also matches what we were doing previosuly, as well as suggested by sage [docs](https://doc.sagemath.org/html/en/installation/launching.html#setting-up-sagemath-as-a-jupyter-kernel-in-an-existing-jupyter-notebook-or-jupyterlab-installation)

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [RFC] New package: sagelib-9.5
  2022-02-01  4:05 [PR PATCH] [RFC] New package: sagelib-9.5 tornaria
                   ` (2 preceding siblings ...)
  2022-02-01 10:12 ` dkwo
@ 2022-02-01 10:13 ` dkwo
  2022-02-01 12:17 ` tornaria
                   ` (13 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: dkwo @ 2022-02-01 10:13 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 921 bytes --]

New comment by dkwo on void-packages repository

https://github.com/void-linux/void-packages/pull/35339#issuecomment-1026673112

Comment:
For some reason, I struggle to pick up this kernel in jupyterlab.
I wonder if we need something similar to what Arch has
```
# fix symlinks to assets
  _pythonpath=`python -c "from sysconfig import get_path; print(get_path('platlib'))"`
  for _i in $(ls "$srcdir"/sage-$pkgver/src/sage/ext_data/notebook-ipython); do
    rm "$pkgdir"/usr/share/jupyter/kernels/sagemath/$_i
    ln -s $_pythonpath/sage/ext_data/notebook-ipython/$_i "$pkgdir"/usr/share/jupyter/kernels/sagemath/
  done
```
which also matches what we were doing previosuly, as well as suggested by sage [docs](https://doc.sagemath.org/html/en/installation/launching.html#setting-up-sagemath-as-a-jupyter-kernel-in-an-existing-jupyter-notebook-or-jupyterlab-installation)
Otherwise, it builds and tests fine.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [RFC] New package: sagelib-9.5
  2022-02-01  4:05 [PR PATCH] [RFC] New package: sagelib-9.5 tornaria
                   ` (3 preceding siblings ...)
  2022-02-01 10:13 ` dkwo
@ 2022-02-01 12:17 ` tornaria
  2022-02-01 12:58 ` tornaria
                   ` (12 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: tornaria @ 2022-02-01 12:17 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1007 bytes --]

New comment by tornaria on void-packages repository

https://github.com/void-linux/void-packages/pull/35339#issuecomment-1026782273

Comment:
> Let me first say you've done a great job. I'm building it right now, will report soon. My only comment is about `depends`: is there a way not to bring in `-devel` and `gcc-` stuff?

I only added stuff that is needed to pass doctests. There is some functionality to cython-compile code (e.g. you may want to define a function in cython inside a notebook) and that needs at least headers and sometimes libraries, and a working gcc (which is required indirectly via gcc-fortran).

It might be possible to add "features" to sage that correspond to presence of gcc and headers, etc. but I'm not sure this is worth the trouble. Although some sage developers are trying to move it in a "modularization" direction such that it's possible to split it in parts and in that sense it could make sense to split out a "sagemath-cython" subpkg that gives this ability, etc.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [RFC] New package: sagelib-9.5
  2022-02-01  4:05 [PR PATCH] [RFC] New package: sagelib-9.5 tornaria
                   ` (4 preceding siblings ...)
  2022-02-01 12:17 ` tornaria
@ 2022-02-01 12:58 ` tornaria
  2022-02-01 13:32 ` dkwo
                   ` (11 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: tornaria @ 2022-02-01 12:58 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1616 bytes --]

New comment by tornaria on void-packages repository

https://github.com/void-linux/void-packages/pull/35339#issuecomment-1026815018

Comment:
> For some reason, I struggle to pick up this kernel in jupyterlab. I wonder if we need something similar to what Arch has
> 
> ```
> # fix symlinks to assets
>   _pythonpath=`python -c "from sysconfig import get_path; print(get_path('platlib'))"`
>   for _i in $(ls "$srcdir"/sage-$pkgver/src/sage/ext_data/notebook-ipython); do
>     rm "$pkgdir"/usr/share/jupyter/kernels/sagemath/$_i
>     ln -s $_pythonpath/sage/ext_data/notebook-ipython/$_i "$pkgdir"/usr/share/jupyter/kernels/sagemath/
>   done
> ```

The jupyter kernel spec is fixed right at the top of the `post_install()`.

> which also matches what we were doing previosuly, as well as suggested by sage [docs](https://doc.sagemath.org/html/en/installation/launching.html#setting-up-sagemath-as-a-jupyter-kernel-in-an-existing-jupyter-notebook-or-jupyterlab-installation) Otherwise, it builds and tests fine.

The goal is for the notebook to work out of the box. How are you running it?

I'm just doing
```
$ sagelib -notebook
```
and the browser is launched with a jupyter session in which I can create a new "SageMath 9.5" notebook. It is identical if run as `$ jupyter notebook`. It also works fine from jupyterlab (although jupyterlab does NOT work out of the box, see #35341)

Are you sure you don't have leftover cruft from "fixing" of jupyter for the other package? You shouldn't have anything at all in `/usr/share/jupyter` other than what is shipped in this `sagelib` package.


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [RFC] New package: sagelib-9.5
  2022-02-01  4:05 [PR PATCH] [RFC] New package: sagelib-9.5 tornaria
                   ` (5 preceding siblings ...)
  2022-02-01 12:58 ` tornaria
@ 2022-02-01 13:32 ` dkwo
  2022-02-01 13:32 ` dkwo
                   ` (10 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: dkwo @ 2022-02-01 13:32 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 848 bytes --]

New comment by dkwo on void-packages repository

https://github.com/void-linux/void-packages/pull/35339#issuecomment-1026847617

Comment:
I removed `/usr/local/share/jupyter` and well as the other sagemath.
Now it works with no modification:
```
[I 2022-02-01 14:26:46.535 LabApp] JupyterLab extension loaded from /usr/lib/python3.10/site-packages/jupyterlab
[I 2022-02-01 14:26:46.535 LabApp] JupyterLab application directory is /usr/share/jupyter/lab
```
although I may have some leftovers here
```
ls -la /usr/share/jupyter
total 24
drwxr-xr-x  6 root root 4096 Dec  2 17:18 .
drwxr-xr-x 80 root root 4096 Jan 20 14:08 ..
drwxr-xr-x  4 root root 4096 Feb  1 10:52 kernels
drwxr-xr-x  8 root root 4096 May 14  2021 lab
drwxr-xr-x  3 root root 4096 Dec  2 17:18 nbconvert
drwxr-xr-x  3 root root 4096 Dec  2 17:18 nbextensions
```

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [RFC] New package: sagelib-9.5
  2022-02-01  4:05 [PR PATCH] [RFC] New package: sagelib-9.5 tornaria
                   ` (6 preceding siblings ...)
  2022-02-01 13:32 ` dkwo
@ 2022-02-01 13:32 ` dkwo
  2022-02-01 13:32 ` tornaria
                   ` (9 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: dkwo @ 2022-02-01 13:32 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 940 bytes --]

New comment by dkwo on void-packages repository

https://github.com/void-linux/void-packages/pull/35339#issuecomment-1026847617

Comment:
I removed `/usr/local/share/jupyter` and well as the other sagemath.
Now it works with no modification:
```
[I 2022-02-01 14:26:46.535 LabApp] JupyterLab extension loaded from /usr/lib/python3.10/site-packages/jupyterlab
[I 2022-02-01 14:26:46.535 LabApp] JupyterLab application directory is /usr/share/jupyter/lab
```
although I may have some leftovers here
```
ls -la /usr/share/jupyter
total 24
drwxr-xr-x  6 root root 4096 Dec  2 17:18 .
drwxr-xr-x 80 root root 4096 Jan 20 14:08 ..
drwxr-xr-x  4 root root 4096 Feb  1 10:52 kernels
drwxr-xr-x  8 root root 4096 May 14  2021 lab
drwxr-xr-x  3 root root 4096 Dec  2 17:18 nbconvert
drwxr-xr-x  3 root root 4096 Dec  2 17:18 nbextensions
```
only things it complais about many
`[W 2022-02-01 14:26:55.623 LabApp] Build recommended`

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [RFC] New package: sagelib-9.5
  2022-02-01  4:05 [PR PATCH] [RFC] New package: sagelib-9.5 tornaria
                   ` (7 preceding siblings ...)
  2022-02-01 13:32 ` dkwo
@ 2022-02-01 13:32 ` tornaria
  2022-02-01 13:32 ` dkwo
                   ` (8 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: tornaria @ 2022-02-01 13:32 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2851 bytes --]

New comment by tornaria on void-packages repository

https://github.com/void-linux/void-packages/pull/35339#issuecomment-1026848250

Comment:
As for tests:
 1. there is one test failure in all architectures when running doctest on an installed package, namely:
```
sage -t --long --warn-long 60.0 --random-seed=36734515608409952297316154028352847160 /usr/lib/python3.10/site-packages/sage/misc/sageinspect.py
**********************************************************************
File "/usr/lib/python3.10/site-packages/sage/misc/sageinspect.py", line 186, in sage.misc.sageinspect.loadable_module_extension
Failed example:
    sage.structure.sage_object.__file__.endswith(loadable_module_extension())
Expected:
    True
Got:
    False
**********************************************************************
```
This is just because `loadable_module_extension()` returns `".cpython-310-x86_64-linux-gnu.so"` but we rename these files to just `.so` (in this case `.../sage/structure/sage_object.cpython-310-x86_64-linux-gnu.so` becomes `.../sage/structure/sage_object.so`). A simple workaround is to patch `loadable_module_extension()` to just return `".so"` but that's not upstream-friendly.

2. There is a fairly deterministic numerical noise in maxima on i686:
```
sage -t --long --warn-long 60.0 --random-seed=43442452431567652147900536515427073750 /usr/lib/python3.10/site-packages/sage/interfaces/maxima_abstract.py
**********************************************************************
File "/usr/lib/python3.10/site-packages/sage/interfaces/maxima_abstract.py", line 1527, in sage.interfaces.maxima_abstract.MaximaAbstractElement.?
Failed example:
    maxima('exp(-sqrt(x))').nintegral('x',0,1)
Expected:
    (0.5284822353142306, 4.1633141378838...e-11, 231, 0)
Got:
    (0.5284822353142306, 4.163291933423352e-11, 231, 0)
**********************************************************************
1 item had failures:
   1 of   5 in sage.interfaces.maxima_abstract.MaximaAbstractElement.?
    [236 tests, 1 failure, 4.57 s]
```
This seems to be just the error bound for the integral (the value seems to be exactly the same, more than 4e-11 close in any case), so not a real issue safe and should be easy to fix and upstream. I am guessing the reason we didn't see this before is that in the other package we are running `maxima -l ecl` but here we are running `maxima` which brings up sbcl version of maxima (note: we still need `maxima-ecl` because it's the only one that can be used as a library; here we are doctesting the pexpect interface to maxima which can run either).

I expect two small patches will make everything pass. If we figure out the issues @dkwo is having with the notebook (which works fine for me), I think we'd have something ready to merge.

@leahneukirchen: can you test in your webapp?

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [RFC] New package: sagelib-9.5
  2022-02-01  4:05 [PR PATCH] [RFC] New package: sagelib-9.5 tornaria
                   ` (8 preceding siblings ...)
  2022-02-01 13:32 ` tornaria
@ 2022-02-01 13:32 ` dkwo
  2022-02-01 13:39 ` dkwo
                   ` (7 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: dkwo @ 2022-02-01 13:32 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 942 bytes --]

New comment by dkwo on void-packages repository

https://github.com/void-linux/void-packages/pull/35339#issuecomment-1026847617

Comment:
I removed `/usr/local/share/jupyter` and well as the other sagemath.
Now it works with no modification:
```
[I 2022-02-01 14:26:46.535 LabApp] JupyterLab extension loaded from /usr/lib/python3.10/site-packages/jupyterlab
[I 2022-02-01 14:26:46.535 LabApp] JupyterLab application directory is /usr/share/jupyter/lab
```
although I may have some leftovers here
```
ls -la /usr/share/jupyter
total 24
drwxr-xr-x  6 root root 4096 Dec  2 17:18 .
drwxr-xr-x 80 root root 4096 Jan 20 14:08 ..
drwxr-xr-x  4 root root 4096 Feb  1 10:52 kernels
drwxr-xr-x  8 root root 4096 May 14  2021 lab
drwxr-xr-x  3 root root 4096 Dec  2 17:18 nbconvert
drwxr-xr-x  3 root root 4096 Dec  2 17:18 nbextensions
```
only thing is it complais about many
`[W 2022-02-01 14:26:55.623 LabApp] Build recommended`

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [RFC] New package: sagelib-9.5
  2022-02-01  4:05 [PR PATCH] [RFC] New package: sagelib-9.5 tornaria
                   ` (9 preceding siblings ...)
  2022-02-01 13:32 ` dkwo
@ 2022-02-01 13:39 ` dkwo
  2022-02-01 13:55 ` dkwo
                   ` (6 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: dkwo @ 2022-02-01 13:39 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 941 bytes --]

New comment by dkwo on void-packages repository

https://github.com/void-linux/void-packages/pull/35339#issuecomment-1026847617

Comment:
I removed `/usr/local/share/jupyter` as well as the other sagemath.
Now it works with no modification:
```
[I 2022-02-01 14:26:46.535 LabApp] JupyterLab extension loaded from /usr/lib/python3.10/site-packages/jupyterlab
[I 2022-02-01 14:26:46.535 LabApp] JupyterLab application directory is /usr/share/jupyter/lab
```
although I may have some leftovers here
```
ls -la /usr/share/jupyter
total 24
drwxr-xr-x  6 root root 4096 Dec  2 17:18 .
drwxr-xr-x 80 root root 4096 Jan 20 14:08 ..
drwxr-xr-x  4 root root 4096 Feb  1 10:52 kernels
drwxr-xr-x  8 root root 4096 May 14  2021 lab
drwxr-xr-x  3 root root 4096 Dec  2 17:18 nbconvert
drwxr-xr-x  3 root root 4096 Dec  2 17:18 nbextensions
```
only thing is it complais about many
`[W 2022-02-01 14:26:55.623 LabApp] Build recommended`

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [RFC] New package: sagelib-9.5
  2022-02-01  4:05 [PR PATCH] [RFC] New package: sagelib-9.5 tornaria
                   ` (10 preceding siblings ...)
  2022-02-01 13:39 ` dkwo
@ 2022-02-01 13:55 ` dkwo
  2022-02-01 15:14 ` leahneukirchen
                   ` (5 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: dkwo @ 2022-02-01 13:55 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 419 bytes --]

New comment by dkwo on void-packages repository

https://github.com/void-linux/void-packages/pull/35339#issuecomment-1026868659

Comment:
If I remove sagelib and jupyterlab, and by hand
```
rm -r /usr/share/jupyter/lab
rm -r /usr/share/jupyter/kernels/ (empty)
```
(probably again leftovers), then reinstall them, I'm on the same page as you, so this is an issue with jupyterlab, not sagelib.
Ready to merge imo.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [RFC] New package: sagelib-9.5
  2022-02-01  4:05 [PR PATCH] [RFC] New package: sagelib-9.5 tornaria
                   ` (11 preceding siblings ...)
  2022-02-01 13:55 ` dkwo
@ 2022-02-01 15:14 ` leahneukirchen
  2022-02-01 15:25 ` [PR PATCH] [Updated] " tornaria
                   ` (4 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: leahneukirchen @ 2022-02-01 15:14 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 255 bytes --]

New comment by leahneukirchen on void-packages repository

https://github.com/void-linux/void-packages/pull/35339#issuecomment-1026953201

Comment:
Works as a jupyter notebook without any adjustments.

I updated `docker.io/leahneukirchen/voidsage:9.5`.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PR PATCH] [Updated] [RFC] New package: sagelib-9.5
  2022-02-01  4:05 [PR PATCH] [RFC] New package: sagelib-9.5 tornaria
                   ` (12 preceding siblings ...)
  2022-02-01 15:14 ` leahneukirchen
@ 2022-02-01 15:25 ` tornaria
  2022-02-01 15:51 ` tornaria
                   ` (3 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: tornaria @ 2022-02-01 15:25 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1283 bytes --]

There is an updated pull request by tornaria against master on the void-packages repository

https://github.com/tornaria/void-packages sagelib
https://github.com/void-linux/void-packages/pull/35339

[RFC] New package: sagelib-9.5
This is a different approach for a sagemath package than #34030.

Here we build the sagelib as a python module and install it in the system site-packages. The scripts are all installed in `/usr/lib/sagemath/bin` to avoid polluting the PATH. A symlink `/usr/bin/sagelib` is provided.

NOTE: for the moment this is set up so it can coexists together with the `sagemath` package; that's why the package name is `sagelib` (instead of `sagemath`) and the binary is `sagelib` (instead of `sage`). The plan is to rename this package to `sagemath` and the binary to `sage` to replace the other since this one is much simpler and should work better.

With this version jupyter notebook should work out of the box without any adjustments. Please let me know if there's anything missing.

Any comments about packaging, package layout, etc, now is the moment. I would like to get this merged soon since everything seems to be in place.

Cc: @dkwo @leahneukirchen 

A patch file from https://github.com/void-linux/void-packages/pull/35339.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-sagelib-35339.patch --]
[-- Type: text/x-diff, Size: 45948 bytes --]

From f9002d5ec9cc7dbfa364d1f8cb3ab2f1f4608364 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Mon, 31 Jan 2022 12:50:38 -0300
Subject: [PATCH 1/2] New package: sagelib-9.5

---
 srcpkgs/sagelib/files/timings2.json           | 398 ++++++++++++++++++
 .../patches/01-dont_link_ratpoints.patch      |  10 +
 ...2-fix_get_shared_lib_path--see_29644.patch |  13 +
 .../patches/03-doctest_have_program.patch     |  20 +
 .../patches/04-doctest_sage_getfile.patch     |  22 +
 .../sagelib/patches/05-fix_sage_getfile.patch |  16 +
 ...6-skip_doctest_giac-1.7.0--see_31563.patch |  16 +
 .../sagelib/patches/07-ignore_warning.patch   |  15 +
 .../08-dont_run_pytest--see_31924.patch       |  27 ++
 ...2ddd4e2dc92469c1590ebf0c40f8f69bf579.patch | 126 ++++++
 .../patches/zzz-skip_doctest_no_threejs.patch |  13 +
 srcpkgs/sagelib/template                      | 131 ++++++
 12 files changed, 807 insertions(+)
 create mode 100644 srcpkgs/sagelib/files/timings2.json
 create mode 100644 srcpkgs/sagelib/patches/01-dont_link_ratpoints.patch
 create mode 100644 srcpkgs/sagelib/patches/02-fix_get_shared_lib_path--see_29644.patch
 create mode 100644 srcpkgs/sagelib/patches/03-doctest_have_program.patch
 create mode 100644 srcpkgs/sagelib/patches/04-doctest_sage_getfile.patch
 create mode 100644 srcpkgs/sagelib/patches/05-fix_sage_getfile.patch
 create mode 100644 srcpkgs/sagelib/patches/06-skip_doctest_giac-1.7.0--see_31563.patch
 create mode 100644 srcpkgs/sagelib/patches/07-ignore_warning.patch
 create mode 100644 srcpkgs/sagelib/patches/08-dont_run_pytest--see_31924.patch
 create mode 100644 srcpkgs/sagelib/patches/trac-33189-fix_doctests_for_arb_2.22-53532ddd4e2dc92469c1590ebf0c40f8f69bf579.patch
 create mode 100644 srcpkgs/sagelib/patches/zzz-skip_doctest_no_threejs.patch
 create mode 100644 srcpkgs/sagelib/template

diff --git a/srcpkgs/sagelib/files/timings2.json b/srcpkgs/sagelib/files/timings2.json
new file mode 100644
index 000000000000..71a9aa84ce58
--- /dev/null
+++ b/srcpkgs/sagelib/files/timings2.json
@@ -0,0 +1,398 @@
+{
+  "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": 256},
+  "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.polynomial.polynomial_zmod_flint": {"walltime": 512},
+  "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": 256},
+  "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/sagelib/patches/01-dont_link_ratpoints.patch b/srcpkgs/sagelib/patches/01-dont_link_ratpoints.patch
new file mode 100644
index 000000000000..e5c3f5776aa2
--- /dev/null
+++ b/srcpkgs/sagelib/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/sagelib/patches/02-fix_get_shared_lib_path--see_29644.patch b/srcpkgs/sagelib/patches/02-fix_get_shared_lib_path--see_29644.patch
new file mode 100644
index 000000000000..d3672b094c1c
--- /dev/null
+++ b/srcpkgs/sagelib/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/sagelib/patches/03-doctest_have_program.patch b/srcpkgs/sagelib/patches/03-doctest_have_program.patch
new file mode 100644
index 000000000000..27ba3776470c
--- /dev/null
+++ b/srcpkgs/sagelib/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/sagelib/patches/04-doctest_sage_getfile.patch b/srcpkgs/sagelib/patches/04-doctest_sage_getfile.patch
new file mode 100644
index 000000000000..95bce107f854
--- /dev/null
+++ b/srcpkgs/sagelib/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/sagelib/patches/05-fix_sage_getfile.patch b/srcpkgs/sagelib/patches/05-fix_sage_getfile.patch
new file mode 100644
index 000000000000..56c58078f319
--- /dev/null
+++ b/srcpkgs/sagelib/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/sagelib/patches/06-skip_doctest_giac-1.7.0--see_31563.patch b/srcpkgs/sagelib/patches/06-skip_doctest_giac-1.7.0--see_31563.patch
new file mode 100644
index 000000000000..619e62f928dd
--- /dev/null
+++ b/srcpkgs/sagelib/patches/06-skip_doctest_giac-1.7.0--see_31563.patch
@@ -0,0 +1,16 @@
+ - these are broken in giac 1.7.0, skip
+
+--- a/src/sage/functions/min_max.py
++++ b/src/sage/functions/min_max.py
+@@ -233,9 +233,9 @@ class MaxSymbolic(MinMax_base):
+             sage: f = max_symbolic(sin(x), cos(x))
+             sage: r = integral(f, x, 0, 1)
+             ...
+-            sage: r
++            sage: r             # not tested -- broken with giac 1.7.0
+             sqrt(2) - cos(1)
+-            sage: r.n()
++            sage: r.n()         # not tested -- broken with giac 1.7.0
+             0.873911256504955
+         """
+         return max_symbolic(args)
diff --git a/srcpkgs/sagelib/patches/07-ignore_warning.patch b/srcpkgs/sagelib/patches/07-ignore_warning.patch
new file mode 100644
index 000000000000..69668678a40b
--- /dev/null
+++ b/srcpkgs/sagelib/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/sagelib/patches/08-dont_run_pytest--see_31924.patch b/srcpkgs/sagelib/patches/08-dont_run_pytest--see_31924.patch
new file mode 100644
index 000000000000..06bd2ccae6fb
--- /dev/null
+++ b/srcpkgs/sagelib/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/sagelib/patches/trac-33189-fix_doctests_for_arb_2.22-53532ddd4e2dc92469c1590ebf0c40f8f69bf579.patch b/srcpkgs/sagelib/patches/trac-33189-fix_doctests_for_arb_2.22-53532ddd4e2dc92469c1590ebf0c40f8f69bf579.patch
new file mode 100644
index 000000000000..b861af7ec982
--- /dev/null
+++ b/srcpkgs/sagelib/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 <arojas@archlinux.org>
+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 <arojas@archlinux.org>
+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/sagelib/patches/zzz-skip_doctest_no_threejs.patch b/srcpkgs/sagelib/patches/zzz-skip_doctest_no_threejs.patch
new file mode 100644
index 000000000000..5cb62f56e902
--- /dev/null
+++ b/srcpkgs/sagelib/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/sagelib/template b/srcpkgs/sagelib/template
new file mode 100644
index 000000000000..90bdbf56960f
--- /dev/null
+++ b/srcpkgs/sagelib/template
@@ -0,0 +1,131 @@
+# Template file for 'sagelib'
+pkgname=sagelib
+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 <tornaria@cmat.edu.uy>"
+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}
+
+	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
+}
+
+pre_build() {
+	export PYTHONPATH=../sage-setup
+	export PYTHONDONTWRITEBYTECODE=yes
+	export SAGE_NUM_THREADS="$XBPS_MAKEJOBS"
+}
+
+post_build() {
+	_scripts=$(cd build/scripts* && pwd)
+	cat >> $_scripts/sage-env-config <<-'EOF'
+	# sage-venv-config sets SAGE_VENV=/usr (sys.prefix)
+	# then sage-env prepends "$SAGE_VENV/bin" to PATH
+	# we don't want that to happen so we unset SAGE_VENV here
+	unset SAGE_VENV
+	PATH=$(dirname $SELF):$PATH
+	EOF
+}
+
+pre_install() {
+	export PYTHONPATH=../sage-setup
+	export PYTHONDONTWRITEBYTECODE=yes
+	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/sagelib-${version}
+	ln -s sagelib-${version} ${DESTDIR}/usr/bin/sagelib
+}
+
+do_check() {
+	_scripts=$(cd build/scripts* && pwd)
+	export PYTHONPATH=$(cd build/lib* && pwd)
+	export PYTHONDONTWRITEBYTECODE=yes
+
+	# 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}
+}

From 61466f907a11305fd1ea3ee345b8dc6452569f7e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Tue, 1 Feb 2022 12:21:52 -0300
Subject: [PATCH 2/2] sagelib: fix two doctest failures

---
 .../sagelib/patches/09-doctest_numerical_fix.patch | 14 ++++++++++++++
 .../patches/zzz-loadable_module_extension.patch    | 14 ++++++++++++++
 2 files changed, 28 insertions(+)
 create mode 100644 srcpkgs/sagelib/patches/09-doctest_numerical_fix.patch
 create mode 100644 srcpkgs/sagelib/patches/zzz-loadable_module_extension.patch

diff --git a/srcpkgs/sagelib/patches/09-doctest_numerical_fix.patch b/srcpkgs/sagelib/patches/09-doctest_numerical_fix.patch
new file mode 100644
index 000000000000..8780c8a97efa
--- /dev/null
+++ b/srcpkgs/sagelib/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/sagelib/patches/zzz-loadable_module_extension.patch b/srcpkgs/sagelib/patches/zzz-loadable_module_extension.patch
new file mode 100644
index 000000000000..f3eb0aad2cca
--- /dev/null
+++ b/srcpkgs/sagelib/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):

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [RFC] New package: sagelib-9.5
  2022-02-01  4:05 [PR PATCH] [RFC] New package: sagelib-9.5 tornaria
                   ` (13 preceding siblings ...)
  2022-02-01 15:25 ` [PR PATCH] [Updated] " tornaria
@ 2022-02-01 15:51 ` tornaria
  2022-02-01 21:40 ` leahneukirchen
                   ` (2 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: tornaria @ 2022-02-01 15:51 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 324 bytes --]

New comment by tornaria on void-packages repository

https://github.com/void-linux/void-packages/pull/35339#issuecomment-1026994027

Comment:
I pushed the fix for the two doctest failures.

If everything works ok I plan on redoing this PR later today as a package named `sagemath` with `/usr/bin/sage` as the main binary.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [RFC] New package: sagelib-9.5
  2022-02-01  4:05 [PR PATCH] [RFC] New package: sagelib-9.5 tornaria
                   ` (14 preceding siblings ...)
  2022-02-01 15:51 ` tornaria
@ 2022-02-01 21:40 ` leahneukirchen
  2022-02-02 21:06 ` [PR PATCH] [Closed]: " tornaria
  2022-02-02 21:06 ` tornaria
  17 siblings, 0 replies; 19+ messages in thread
From: leahneukirchen @ 2022-02-01 21:40 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 183 bytes --]

New comment by leahneukirchen on void-packages repository

https://github.com/void-linux/void-packages/pull/35339#issuecomment-1027313997

Comment:
And then we can merge it right? :)

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [RFC] New package: sagelib-9.5
  2022-02-01  4:05 [PR PATCH] [RFC] New package: sagelib-9.5 tornaria
                   ` (16 preceding siblings ...)
  2022-02-02 21:06 ` [PR PATCH] [Closed]: " tornaria
@ 2022-02-02 21:06 ` tornaria
  17 siblings, 0 replies; 19+ messages in thread
From: tornaria @ 2022-02-02 21:06 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 368 bytes --]

New comment by tornaria on void-packages repository

https://github.com/void-linux/void-packages/pull/35339#issuecomment-1028357848

Comment:
I moved back to the `sagemath` branch and PR (#34030) which should now be ready to merge. Remember to remove and cleanup this `sagelib` package before installing the new `sagemath` package since they will have file conflicts.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PR PATCH] [Closed]: [RFC] New package: sagelib-9.5
  2022-02-01  4:05 [PR PATCH] [RFC] New package: sagelib-9.5 tornaria
                   ` (15 preceding siblings ...)
  2022-02-01 21:40 ` leahneukirchen
@ 2022-02-02 21:06 ` tornaria
  2022-02-02 21:06 ` tornaria
  17 siblings, 0 replies; 19+ messages in thread
From: tornaria @ 2022-02-02 21:06 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1125 bytes --]

There's a closed pull request on the void-packages repository

[RFC] New package: sagelib-9.5
https://github.com/void-linux/void-packages/pull/35339

Description:
This is a different approach for a sagemath package than #34030.

Here we build the sagelib as a python module and install it in the system site-packages. The scripts are all installed in `/usr/lib/sagemath/bin` to avoid polluting the PATH. A symlink `/usr/bin/sagelib` is provided.

NOTE: for the moment this is set up so it can coexists together with the `sagemath` package; that's why the package name is `sagelib` (instead of `sagemath`) and the binary is `sagelib` (instead of `sage`). The plan is to rename this package to `sagemath` and the binary to `sage` to replace the other since this one is much simpler and should work better.

With this version jupyter notebook should work out of the box without any adjustments. Please let me know if there's anything missing.

Any comments about packaging, package layout, etc, now is the moment. I would like to get this merged soon since everything seems to be in place.

Cc: @dkwo @leahneukirchen 

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2022-02-02 21:06 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-01  4:05 [PR PATCH] [RFC] New package: sagelib-9.5 tornaria
2022-02-01  9:21 ` dkwo
2022-02-01 10:10 ` dkwo
2022-02-01 10:12 ` dkwo
2022-02-01 10:13 ` dkwo
2022-02-01 12:17 ` tornaria
2022-02-01 12:58 ` tornaria
2022-02-01 13:32 ` dkwo
2022-02-01 13:32 ` dkwo
2022-02-01 13:32 ` tornaria
2022-02-01 13:32 ` dkwo
2022-02-01 13:39 ` dkwo
2022-02-01 13:55 ` dkwo
2022-02-01 15:14 ` leahneukirchen
2022-02-01 15:25 ` [PR PATCH] [Updated] " tornaria
2022-02-01 15:51 ` tornaria
2022-02-01 21:40 ` leahneukirchen
2022-02-02 21:06 ` [PR PATCH] [Closed]: " tornaria
2022-02-02 21:06 ` tornaria

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).