diff --git a/.github/workflows/ci-distro.yml b/.github/workflows/ci-distro.yml index 2eea4400100..0a77cd142ef 100644 --- a/.github/workflows/ci-distro.yml +++ b/.github/workflows/ci-distro.yml @@ -53,7 +53,7 @@ jobs: targets: build targets_optional: ptestlong tox_system_factors: >- - ["ubuntu-jammy"] + ["ubuntu-noble"] tox_packages_factors: >- ["minimal"] docker_push_repository: ghcr.io/${{ github.repository }}/ @@ -89,6 +89,10 @@ jobs: with: python-version: "3.13" + - name: Install Python packages + run: | + pip install setuptools + - name: Install dependencies run: | eval $(build/bin/sage-print-system-package-command homebrew update) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 98caa3533b8..d24cc53306c 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -16,15 +16,15 @@ on: description: 'Stringified JSON object listing tox system factors' type: string # 'tox -e update_docker_platforms' updates below + # Only distros with Python 3.12+ are supported (Sage now requires system Python 3.12+) default: >- [ - "ubuntu-jammy", "ubuntu-noble", - "debian-bullseye", - "debian-bookworm", - "fedora-40", - "fedora-41", - "centos-stream-9", + "ubuntu-resolute", + "debian-trixie", + "fedora-42", + "fedora-43", + "centos-stream-10", "opensuse-tumbleweed", ] # 'tox -e update_docker_platforms' updates above @@ -280,4 +280,4 @@ jobs: else echo "No Docker images created." fi - if: always() && ${{ inputs.docker_push_repository }} + if: ${{ always() && inputs.docker_push_repository }} diff --git a/README.md b/README.md index 9bbf06a1933..e4e1c627e15 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,6 @@ Table of Contents * [Build System](#build-system) * [Relocation](#relocation) * [Redistribution](#redistribution) -* [Build System](#build-system) * [Changes to Included Software](#changes-to-included-software) Getting Started @@ -210,8 +209,9 @@ in the Installation Guide. 4. [Linux, WSL] Install the required minimal build prerequisites: - - Compilers: `gcc`, `gfortran`, `g++` (GCC versions from 8.4.0 to 13.x - and recent versions of Clang (LLVM) are supported). + - Compilers: `gcc`, `gfortran`, `g++`, or other suitable C, C++, and + Fortran compilers. Sage's classical build checks for a C compiler that + can compile C99 code and a C++ compiler with C++11 support. See [build/pkgs/gcc/SPKG.rst](build/pkgs/gcc/SPKG.rst) and [build/pkgs/gfortran/SPKG.rst](build/pkgs/gfortran/SPKG.rst) for a discussion of suitable compilers. @@ -221,11 +221,14 @@ in the Installation Guide. See [build/pkgs/_prereq/SPKG.rst](build/pkgs/_prereq/SPKG.rst) for more details. - - Python 3.4 or later, or Python 2.7, a full installation including - `urllib`; but ideally version 3.12.x or later, which - will avoid having to build Sage's own copy of Python 3. - See [build/pkgs/python3/SPKG.rst](build/pkgs/python3/SPKG.rst) - for more details. + - Python 3.12 or newer with a full standard library installation. + Sage no longer builds its own copy of Python; you must provide a + system Python or another external Python installation. + Sage's `./configure` currently requires Python `>= 3.12` and `< 3.15`, + with modules including `sqlite3`, `ctypes`, `math`, `hashlib`, + `socket`, `ssl`, `ensurepip`, and `zlib`. + See the [installation guide](https://doc.sagemath.org/html/en/installation/source-distro.html#using-an-external-python-installed-by-uv) + for details on using a system or `uv`-managed Python. We have collected lists of system packages that provide these build prerequisites. See, in the folder @@ -363,6 +366,20 @@ in the Installation Guide. For example, to build Sage with `gf2x` package supplied by Sage, use `./configure --with-system-gf2x=no`. + Sage no longer builds its own copy of Python, so `./configure` must + find a suitable external interpreter. If you want to use a Python + installed with `uv` instead of your system package manager's Python, + Sage's `./configure` check currently expects Python `>= 3.12` and + `< 3.15`. On Python 3.12 and newer, it also requires `setuptools`, + because the configure test creates a fresh virtual environment from + the selected interpreter and builds small extension modules there. + For a `uv`-managed Python, one working setup is: + + $ uv python install 3.13 + $ PYTHON3="$(uv python find --managed-python --resolve-links 3.13)" + $ uv pip install --python "$PYTHON3" --break-system-packages setuptools + $ ./configure --with-python="$PYTHON3" + At the end of a successful `./configure` run, you may see messages recommending to install extra system packages using your package manager. @@ -486,6 +503,7 @@ SAGE_ROOT Root directory (create by git clone) ├── configure Top-level configure script ├── COPYING.txt Copyright information ├── local (SAGE_LOCAL) Installation hierarchy for non-Python packages +│ and shared runtime files │ ├── bin Executables │ ├── include C/C++ headers │ ├── lib Shared libraries, architecture-dependent data @@ -541,9 +559,13 @@ and its associated user interfaces, and the larger software distribution of Sage's main dependencies (for those dependencies not supplied by the user's system). -Sage's Python library is built and installed using a `setup.py` script as is -standard for Python packages (Sage's `setup.py` is non-trivial, but not -unusual). +Sage no longer builds its own Python interpreter. Instead, `./configure` +selects a system or other external Python (`>= 3.12`, `< 3.15`) and uses it +to create `SAGE_VENV`. + +Sage's Python library is built and installed as a standard Python project via +`pip install .`, using the metadata in `pyproject.toml` and the +`meson-python` build backend. Most of the rest of the build system is concerned with building all of Sage's dependencies in the correct order in relation to each other. The dependencies @@ -567,18 +589,18 @@ The `configure` script itself, if it is not already built, can be generated by running the `bootstrap` script (the latter requires _GNU autotools_ being installed). The top-level `Makefile` also takes care of this automatically. -To summarize, running a command like `make python3` at the top-level of the +To summarize, running a command like `make sagelib` at the top-level of the source tree goes something like this: -1. `make python3` +1. `make sagelib` 2. run `./bootstrap` if `configure` needs updating 3. run `./configure` with any previously configured options if `build/make/Makefile` needs updating 4. change directory into `build/make` and run the `install` script--this is - little more than a front-end to running `make -f build/make/Makefile python3`, + little more than a front-end to running `make -f build/make/Makefile sagelib`, which sets some necessary environment variables and logs some information -5. `build/make/Makefile` contains the actual rule for building `python3`; this - includes building all of `python3`'s dependencies first (and their +5. `build/make/Makefile` contains the actual rule for building `sagelib`; this + includes building all of `sagelib`'s dependencies first (and their dependencies, recursively); the actual package installation is performed with the `sage-spkg` program @@ -629,4 +651,3 @@ part of the Sage git repository.

https://www.sagemath.org

- diff --git a/build/bin/sage-bootstrap-python b/build/bin/sage-bootstrap-python deleted file mode 100755 index d51ae4a751b..00000000000 --- a/build/bin/sage-bootstrap-python +++ /dev/null @@ -1,78 +0,0 @@ -#!/bin/sh - -# Run the system python. -# -# This is only for use by the build toolchain. -# -# (It has nothing to do with the python3 that configure --with-system-python3 -# is looking for in build/pkgs/python3/spkg-configure.m4.) - -if [ -z "$SAGE_ORIG_PATH" ]; then - # If not we're running from within sage-env just set the existing path - SAGE_ORIG_PATH="$PATH" -fi -IFS=':' -NEW_PATH="" -for path in $SAGE_ORIG_PATH -do - case "$path" in - */.pyenv/shims*);; - *) NEW_PATH="$NEW_PATH$path:";; - esac -done -unset IFS -SAGE_ORIG_PATH=${NEW_PATH%%':'} -# In particular, it is invoked by "bootstrap -d" for sage-download-file, -# i.e., before a configure run, and by "sage-spkg", also for sage-download-file. -# So it needs to find a python that has the urllib module. -# For example, on Debian buster, the python3-minimal package does NOT provide it. -# -# Also, Issue #20023 removed the vendored argparse library from sage_bootstrap, -# so we test that python is new enough (>= 2.7) to run it. -# -# See https://github.com/sagemath/sage/issues/29090 - -# Issue #29890: Our first choice is "python", not "python3". This is to avoid -# a defect of sage_bootstrap on macOS regarding SSL URLs. - -# Issue #30177: Also check for hashlib.sha1 to guard against broken python2 -# from old homebrew installations. Also check whether the current directory -# is accessible by this python; this is to guard on WSL against Pythons -# installed somewhere else in Windows. - -# Issue #29285: Do not accept pythons that manipulate PATH, such as -# the shims provided by pyenv. - -# Issue #30008: Make it work even if the environment tries to sabotage UTF-8 -# operation in Python 3.0.x-3.6.x by setting LC_ALL=C or similar. - -if [ "$LC_ALL" = "C" -o "$LANG" = "C" -o "$LC_CTYPE" = "C" ]; then - LC_ALL=$(locale -a | grep -E -i '^(c|en_us)[-.]utf-?8$' | head -n 1) - LANG=$LC_ALL - export LC_ALL - export LANG -fi - -PYTHONS="python python3 python3.12 python3.11 python3.10 python3.9 python3.8 python3.7 python2.7 python3.6 python2" -# Issue #32405: Prefer a Python that provides ssl with SNI, which allows developers -# to download from upstream URLs (configure --enable-download-from-upstream-url), -# in particular from PyPI, which requires SNI. -for PY in $PYTHONS; do - PYTHON="$(PATH="$SAGE_ORIG_PATH" command -v $PY)" - if [ -n "$PYTHON" ]; then - if CHECK_PATH="$PATH" "$PYTHON" -c "import argparse; import urllib; from hashlib import sha1; from ssl import HAS_SNI; assert HAS_SNI; from os import listdir, environ; listdir(\"$(pwd)\"); assert environ[\"PATH\"] == environ[\"CHECK_PATH\"];" 2>/dev/null; then - exec "$PYTHON" "$@" - fi - fi -done -# Second round, no ssl/SNI test. -for PY in $PYTHONS; do - PYTHON="$(PATH="$SAGE_ORIG_PATH" command -v $PY)" - if [ -n "$PYTHON" ]; then - if CHECK_PATH="$PATH" "$PYTHON" -c "import argparse; import urllib; from hashlib import sha1; from os import listdir, environ; listdir(\"$(pwd)\"); assert environ[\"PATH\"] == environ[\"CHECK_PATH\"];" 2>/dev/null; then - exec "$PYTHON" "$@" - fi - fi -done -echo >&2 "$0: error: none of $PYTHONS is a suitable Python" -exit 1 diff --git a/build/bin/sage-build-num-threads b/build/bin/sage-build-num-threads index 1ba165b1a21..f8b2bae7c82 100755 --- a/build/bin/sage-build-num-threads +++ b/build/bin/sage-build-num-threads @@ -1,4 +1,4 @@ -#!/usr/bin/env sage-bootstrap-python +#!/usr/bin/env python3 # # Determine the number of threads to be used by Sage. # diff --git a/build/bin/sage-download-file b/build/bin/sage-download-file index 3a369d29274..5d0e21ec9b9 100755 --- a/build/bin/sage-download-file +++ b/build/bin/sage-download-file @@ -1,4 +1,4 @@ -#!/usr/bin/env sage-bootstrap-python +#!/usr/bin/env python3 # USAGE: # diff --git a/build/bin/sage-flock b/build/bin/sage-flock index 9611cfde80b..18331e8f0b0 100755 --- a/build/bin/sage-flock +++ b/build/bin/sage-flock @@ -1,4 +1,4 @@ -#!/usr/bin/env sage-bootstrap-python +#!/usr/bin/env python3 # vim: set filetype=python: # USAGE: diff --git a/build/bin/sage-print-system-package-command b/build/bin/sage-print-system-package-command index 13bafa22dc0..47ca1d5a168 100755 --- a/build/bin/sage-print-system-package-command +++ b/build/bin/sage-print-system-package-command @@ -97,7 +97,7 @@ function print_shell_command() if [ -z "$WRAP" -o $# -lt 6 ]; then echo "${PROMPT}${quoted}" else - sage-bootstrap-python -c "import textwrap; print(' \\\\\n'.join(textwrap.wrap(r'''${quoted}''', $WRAP, initial_indent=r'''${PROMPT}''', subsequent_indent=r'''${CONTINUATION}''', break_long_words=False, break_on_hyphens=False)))" + python3 -c "import textwrap; print(' \\\\\n'.join(textwrap.wrap(r'''${quoted}''', $WRAP, initial_indent=r'''${PROMPT}''', subsequent_indent=r'''${CONTINUATION}''', break_long_words=False, break_on_hyphens=False)))" fi if [ -n "$OUTPUT_RST" ]; then echo diff --git a/build/bin/sage-spkg-installcheck b/build/bin/sage-spkg-installcheck index a8ef89ba2aa..7f1b697903e 100755 --- a/build/bin/sage-spkg-installcheck +++ b/build/bin/sage-spkg-installcheck @@ -1,4 +1,4 @@ -#!/usr/bin/env sage-bootstrap-python +#!/usr/bin/env python3 # usage: sage-spkg-installcheck [-h] PKG [SAGE_LOCAL] # diff --git a/build/bin/sage-spkg-uninstall b/build/bin/sage-spkg-uninstall index e99a914d6af..af13b527f7e 100755 --- a/build/bin/sage-spkg-uninstall +++ b/build/bin/sage-spkg-uninstall @@ -1,4 +1,4 @@ -#!/usr/bin/env sage-bootstrap-python +#!/usr/bin/env python3 # usage: sage-spkg-uninstall [-h] PKG [SAGE_LOCAL] # diff --git a/build/bin/sage-uncompress-spkg b/build/bin/sage-uncompress-spkg index 98f2c7645d1..c30c9dd4fcf 100755 --- a/build/bin/sage-uncompress-spkg +++ b/build/bin/sage-uncompress-spkg @@ -1,4 +1,4 @@ -#!/usr/bin/env sage-bootstrap-python +#!/usr/bin/env python3 # usage: sage-uncompress-spkg [-h] [-d DIR] PKG [FILE] # diff --git a/build/make/Makefile.in b/build/make/Makefile.in index 5611f3e5432..f77b2c363d6 100644 --- a/build/make/Makefile.in +++ b/build/make/Makefile.in @@ -33,7 +33,6 @@ SPKG_INST_RELDIR = var/lib/sage/installed # Aliases for mutually exclusive standard packages selected at configure time TOOLCHAIN = @SAGE_TOOLCHAIN@ -PYTHON = python3 MP_LIBRARY = gmp BLAS = openblas @@ -221,12 +220,7 @@ ifneq ($(PYTHON_FOR_VENV),) # 3 only). $(PYTHON) is set in Makefile to python3_venv. # Thus $(inst_python3_venv) will an (order-only) dependency of every Python package. # -# TODO: If we reconfigure to build our own Python after having used the system -# Python, files installed to create the virtualenv should be *removed*. That -# could either be done here by the makefile, or in an spkg-preinst for python3 -ifeq ($(PYTHON),python3) PYTHON = python3_venv -endif inst_python3_venv = $(SAGE_VENV)/$(SPKG_INST_RELDIR)/python3_venv-3.$(PYTHON_MINOR)-$(subst /,-,$(PYTHON_FOR_VENV))$(findstring --system-site-packages,$(SAGE_VENV_FLAGS)) $(SAGE_VENV)/$(SPKG_INST_RELDIR): @@ -313,9 +307,8 @@ all-toolchain: base-toolchain PYTHON_TOOLCHAIN = setuptools pip setuptools_scm wheel flit_core hatchling python_build meson_python # Issue #32056: Avoid installed setuptools leaking into the build of python3 by uninstalling it. -# It will have to be reinstalled anyway because of its dependency on $(PYTHON). -python3-SAGE_LOCAL-no-deps: setuptools-clean -python3-SAGE_VENV-no-deps: setuptools-clean +# python3-SAGE_LOCAL-no-deps: setuptools-clean +# python3-SAGE_VENV-no-deps: setuptools-clean # Everything needed to start up Sage using "./sage". Of course, not # every part of Sage will work. It does not include Maxima for example. diff --git a/build/pkgs/_bootstrap/SPKG.rst b/build/pkgs/_bootstrap/SPKG.rst index 9c8c233797b..220c77a68bc 100644 --- a/build/pkgs/_bootstrap/SPKG.rst +++ b/build/pkgs/_bootstrap/SPKG.rst @@ -7,3 +7,50 @@ Description This optional script package represents the requirements (system packages) that are needed in addition to those represented by the ``_prereq`` package in order to run the top-level ``bootstrap`` script. + +Namely, the following standard tools must be installed on your computer: + +- **liblzma/xz**: XZ Utils, the free general-purpose data compression software + with a high compression ratio. +- **python**: Python 3.12 or later from your system package manager or another + external installation. Sage no longer builds its own Python interpreter; it + uses this interpreter to create ``SAGE_VENV``. It needs to have the + development headers and the following standard modules available: + sqlite3, ctypes, math, hashlib, socket, ssl, ensurepip, zlib, setuptools + +XZ Utils (liblzma) is available with most supported distributions (package +names such as ``xz-devel`` on Fedora, ``liblzma-dev`` on Debian/Ubuntu). +It can also be built from source from https://github.com/tukaani-project/xz. +After downloading and untarring the release archive, and changing to the +directory with the sources:: + + $ ./configure --prefix=/usr/local && make && make install + +will install XZ Utils in ``/usr/local``. Instead of ``/usr/local`` one may choose +another location, say ``/opt/foo``. A modern xz/liblzma installs a +``liblzma.pc`` file, and Sage's ``./configure`` checks for it using a +pkg-config macro. To detect xz/liblzma at a non-standard location, add it +to ``PKG_CONFIG_PATH``:: + + $ export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/opt/foo/lib/pkgconfig + +Python 3.12 (or later) with development headers is available with most +supported distributions (package names such as ``python3-devel`` on Fedora, +``python3-dev`` on Debian/Ubuntu). +It can also be built from source from https://www.python.org/downloads/. +After downloading and untarring the release archive, and changing to the +directory with the sources:: + + $ ./configure --prefix=/usr/local --enable-optimizations --with-ensurepip=install && make && make install + +will install Python in ``/usr/local``; this takes a few minutes on a +moderately fast machine. Instead of ``/usr/local`` one may choose another +location, say ``/opt/foo``, which then should be passed to Sage's +``./configure`` with ``--with-python=/opt/foo/bin/python3``. +The ``--enable-optimizations`` flag is optional but recommended for +performance. Make sure that the prerequisites for the required standard +modules (``sqlite3``, ``ctypes``, ``zlib``, ``ssl``, etc.) are installed +before building Python; otherwise these modules will be missing. + +It is also possible to use a Python installed by `uv `_ +and pass it to ``./configure`` with ``--with-python=...``. diff --git a/build/pkgs/_bootstrap/distros/alpine.txt b/build/pkgs/_bootstrap/distros/alpine.txt index a4a429add74..825c7b9c491 100644 --- a/build/pkgs/_bootstrap/distros/alpine.txt +++ b/build/pkgs/_bootstrap/distros/alpine.txt @@ -3,3 +3,9 @@ gettext-dev autoconf automake libtool +# Python packages needed for configure and build +python3 +python3-dev +py3-setuptools +xz +xz-dev diff --git a/build/pkgs/_bootstrap/distros/arch.txt b/build/pkgs/_bootstrap/distros/arch.txt index bde788ee5d9..1c763596dbb 100644 --- a/build/pkgs/_bootstrap/distros/arch.txt +++ b/build/pkgs/_bootstrap/distros/arch.txt @@ -2,3 +2,7 @@ autoconf automake libtool +# Python packages needed for configure and build +python +python-setuptools +xz diff --git a/build/pkgs/_bootstrap/distros/conda.txt b/build/pkgs/_bootstrap/distros/conda.txt index bde788ee5d9..3c5e7cf83c3 100644 --- a/build/pkgs/_bootstrap/distros/conda.txt +++ b/build/pkgs/_bootstrap/distros/conda.txt @@ -2,3 +2,8 @@ autoconf automake libtool +# Python packages needed for configure and build +python +setuptools +xz +xz diff --git a/build/pkgs/_bootstrap/distros/debian.txt b/build/pkgs/_bootstrap/distros/debian.txt index bde788ee5d9..7a0055c00dd 100644 --- a/build/pkgs/_bootstrap/distros/debian.txt +++ b/build/pkgs/_bootstrap/distros/debian.txt @@ -2,3 +2,11 @@ autoconf automake libtool +# Python packages needed for configure and build +python3 +libpython3-dev +python3-setuptools +python3-venv +xz-utils +liblzma-dev +# pixz # provides pixz but not xz on debian buster diff --git a/build/pkgs/_bootstrap/distros/fedora.txt b/build/pkgs/_bootstrap/distros/fedora.txt index bde788ee5d9..a3511c5673d 100644 --- a/build/pkgs/_bootstrap/distros/fedora.txt +++ b/build/pkgs/_bootstrap/distros/fedora.txt @@ -2,3 +2,10 @@ autoconf automake libtool +# Python packages needed for configure and build +python3 +python3-devel +python3-setuptools +xz +xz-devel +xz diff --git a/build/pkgs/_bootstrap/distros/freebsd.txt b/build/pkgs/_bootstrap/distros/freebsd.txt index bde788ee5d9..e14505a8458 100644 --- a/build/pkgs/_bootstrap/distros/freebsd.txt +++ b/build/pkgs/_bootstrap/distros/freebsd.txt @@ -2,3 +2,7 @@ autoconf automake libtool +# Python packages needed for configure and build +lang/python +devel/py-setuptools +archivers/lzma diff --git a/build/pkgs/_bootstrap/distros/gentoo.txt b/build/pkgs/_bootstrap/distros/gentoo.txt index 0f6ce65e88a..05b8ffece8d 100644 --- a/build/pkgs/_bootstrap/distros/gentoo.txt +++ b/build/pkgs/_bootstrap/distros/gentoo.txt @@ -1,3 +1,7 @@ dev-build/autoconf dev-build/automake dev-build/libtool +# Python packages needed for configure and build +dev-lang/python +dev-python/setuptools +app-arch/xz-utils diff --git a/build/pkgs/_bootstrap/distros/homebrew.txt b/build/pkgs/_bootstrap/distros/homebrew.txt index bde788ee5d9..1f5372c2625 100644 --- a/build/pkgs/_bootstrap/distros/homebrew.txt +++ b/build/pkgs/_bootstrap/distros/homebrew.txt @@ -2,3 +2,7 @@ autoconf automake libtool +# Python packages needed for configure and build +python3 +python-setuptools +xz diff --git a/build/pkgs/_bootstrap/distros/macports.txt b/build/pkgs/_bootstrap/distros/macports.txt index 00bb27b6fe6..c2a42a2a994 100644 --- a/build/pkgs/_bootstrap/distros/macports.txt +++ b/build/pkgs/_bootstrap/distros/macports.txt @@ -3,3 +3,7 @@ gettext autoconf automake libtool +# Python packages needed for configure and build +python313 +py-setuptools +xz diff --git a/build/pkgs/_bootstrap/distros/nix.txt b/build/pkgs/_bootstrap/distros/nix.txt index bde788ee5d9..79db2ee2866 100644 --- a/build/pkgs/_bootstrap/distros/nix.txt +++ b/build/pkgs/_bootstrap/distros/nix.txt @@ -2,3 +2,7 @@ autoconf automake libtool +# Python packages needed for configure and build +python3 +python3Packages.setuptools +xz diff --git a/build/pkgs/_bootstrap/distros/opensuse.txt b/build/pkgs/_bootstrap/distros/opensuse.txt index bde788ee5d9..568ae5a94ed 100644 --- a/build/pkgs/_bootstrap/distros/opensuse.txt +++ b/build/pkgs/_bootstrap/distros/opensuse.txt @@ -2,3 +2,9 @@ autoconf automake libtool +# Python packages needed for configure and build +python3 +python3-devel +python3-setuptools +pkgconfig(liblzma) +xz diff --git a/build/pkgs/_bootstrap/distros/slackware.txt b/build/pkgs/_bootstrap/distros/slackware.txt index 4bd0e6e12b5..4e7ff5b7c27 100644 --- a/build/pkgs/_bootstrap/distros/slackware.txt +++ b/build/pkgs/_bootstrap/distros/slackware.txt @@ -2,3 +2,6 @@ autoconf automake libtool +# Python packages needed for configure and build +python3 +xz diff --git a/build/pkgs/_bootstrap/distros/void.txt b/build/pkgs/_bootstrap/distros/void.txt index d792463b0cc..b0730af5205 100644 --- a/build/pkgs/_bootstrap/distros/void.txt +++ b/build/pkgs/_bootstrap/distros/void.txt @@ -4,3 +4,9 @@ automake libtool xtools mk-configure +# Python packages needed for configure and build +python3 +python3-devel +python3-setuptools +liblzma-devel +xz diff --git a/build/pkgs/_prereq/SPKG.rst b/build/pkgs/_prereq/SPKG.rst index 7beb70aa3b2..985e741fcaf 100644 --- a/build/pkgs/_prereq/SPKG.rst +++ b/build/pkgs/_prereq/SPKG.rst @@ -20,9 +20,6 @@ computer: - **perl**: version 5.8.0 or later. - **ar** and **ranlib**: can be obtained as part of GNU binutils. - **tar**: GNU tar version 1.17 or later, or BSD tar (as provided on macOS). -- **python**: Python 3.4 or later, or Python 2.7. - (This range of versions is a minimal requirement for internal purposes of the SageMath - build system, which is referred to as ``sage-bootstrap-python``.) - **patch**. - **boost**: the library ``boost`` with its headers. - **bzip2**: the executable ``bzip2`` and the library ``libbz2`` with its headers. diff --git a/build/pkgs/_prereq/distros/debian.txt b/build/pkgs/_prereq/distros/debian.txt index 691c2ba0c2a..a4bf756cfbb 100644 --- a/build/pkgs/_prereq/distros/debian.txt +++ b/build/pkgs/_prereq/distros/debian.txt @@ -16,6 +16,11 @@ flex # python3-minimal is not enough on debian buster, ubuntu bionic - it does not have urllib # system python for bootstrapping the build python3 +# python3-dev is needed for Python.h header used in configure checks +python3-dev +# python3-setuptools and python3-venv are needed for configure checks (Python 3.12+ removed distutils) +python3-setuptools +python3-venv tar bc gcc diff --git a/build/pkgs/_prereq/distros/fedora.txt b/build/pkgs/_prereq/distros/fedora.txt index 3448c263b0c..abe3a3a5c1e 100644 --- a/build/pkgs/_prereq/distros/fedora.txt +++ b/build/pkgs/_prereq/distros/fedora.txt @@ -13,6 +13,10 @@ make m4 # a system python is needed for downloading the sage packages, https://github.com/sagemath/sage/issues/29090 python3 +# python3-devel is needed for Python.h header used in configure checks +python3-devel +# python3-setuptools is needed for configure checks (Python 3.12+ removed distutils) +python3-setuptools perl perl-ExtUtils-MakeMaker tar diff --git a/build/pkgs/_prereq/distros/opensuse.txt b/build/pkgs/_prereq/distros/opensuse.txt index 326916321f3..7c5e1dbdf56 100644 --- a/build/pkgs/_prereq/distros/opensuse.txt +++ b/build/pkgs/_prereq/distros/opensuse.txt @@ -13,6 +13,10 @@ m4 gawk perl python3 +# python3-devel is needed for Python.h header used in configure checks +python3-devel +# python3-setuptools is needed for configure checks (Python 3.12+ removed distutils) +python3-setuptools tar bc which diff --git a/build/pkgs/_prereq/distros/void.txt b/build/pkgs/_prereq/distros/void.txt index b157079820b..7151081a3cd 100644 --- a/build/pkgs/_prereq/distros/void.txt +++ b/build/pkgs/_prereq/distros/void.txt @@ -26,8 +26,6 @@ gzip # so require full python 3 and its prereqs python3-devel bzip2-devel -xz -liblzma-devel libffi-devel zlib-devel # to build python3 with the crypto module; there may be other packages that need it diff --git a/build/pkgs/appnope/spkg-install.in b/build/pkgs/appnope/spkg-install.in index 6a9ec337a12..01c5cd85806 100644 --- a/build/pkgs/appnope/spkg-install.in +++ b/build/pkgs/appnope/spkg-install.in @@ -1,7 +1,7 @@ cd src # Only install this package on OS X -if sage-bootstrap-python -c 'from sys import *; exit(0 if platform == "darwin" else 1)'; then +if python3 -c 'from sys import *; exit(0 if platform == "darwin" else 1)'; then sdh_pip_install . else echo "Not OS X, skipping installation of package 'appnope'" diff --git a/build/pkgs/ccache/dependencies b/build/pkgs/ccache/dependencies index e1c0b124beb..3b5b9e72ad0 100644 --- a/build/pkgs/ccache/dependencies +++ b/build/pkgs/ccache/dependencies @@ -1,4 +1,4 @@ -cmake xz +cmake ---------- All lines of this file are ignored except the first. diff --git a/build/pkgs/cmake/dependencies b/build/pkgs/cmake/dependencies index b5d585cd195..22bdd05323e 100644 --- a/build/pkgs/cmake/dependencies +++ b/build/pkgs/cmake/dependencies @@ -1,4 +1,4 @@ -curl liblzma +curl ---------- All lines of this file are ignored except the first. diff --git a/build/pkgs/database_stein_watkins_mini/spkg-install.in b/build/pkgs/database_stein_watkins_mini/spkg-install.in deleted file mode 120000 index d7005d17fc4..00000000000 --- a/build/pkgs/database_stein_watkins_mini/spkg-install.in +++ /dev/null @@ -1 +0,0 @@ -../database_stein_watkins/spkg-install.in \ No newline at end of file diff --git a/build/pkgs/database_stein_watkins_mini/spkg-install.in b/build/pkgs/database_stein_watkins_mini/spkg-install.in new file mode 100644 index 00000000000..da13b1e19cc --- /dev/null +++ b/build/pkgs/database_stein_watkins_mini/spkg-install.in @@ -0,0 +1,16 @@ +# spkg-install file for +# * database_stein_watkins +# * database_stein_watkins_mini + +if [ -z "$SAGE_SHARE" ]; then + echo >&2 "SAGE_SHARE undefined ... exiting" + echo >&2 "Maybe run 'sage --sh'?" + exit 1 +fi + +TARGET="${SAGE_SHARE}/stein_watkins" +if [ ! -d "${TARGET}" ]; then + mkdir "${TARGET}" +fi + +exec cp -R src/swdb/* "${TARGET}/" diff --git a/build/pkgs/gcc/SPKG.rst b/build/pkgs/gcc/SPKG.rst index 7e01df5bea8..722879b0c7a 100644 --- a/build/pkgs/gcc/SPKG.rst +++ b/build/pkgs/gcc/SPKG.rst @@ -6,9 +6,11 @@ Description This package represents the required C and C++ compilers. -- GCC (GNU Compiler Collection) versions 8.x (>= 8.4.0) to 13.x are supported. +- Sage's classical build checks for a C compiler that can compile C99 code. -- Clang (LLVM) is also supported. +- It also checks for a C++ compiler with C++11 support. + +- GCC (GNU Compiler Collection) and Clang (LLVM) are both supported. The required Fortran compiler is represented by the package ``gfortran``. diff --git a/build/pkgs/gcc/dependencies b/build/pkgs/gcc/dependencies index d22b16d38b8..092af423bbe 100644 --- a/build/pkgs/gcc/dependencies +++ b/build/pkgs/gcc/dependencies @@ -1,4 +1,4 @@ -| $(MP_LIBRARY) mpfr mpc xz +| $(MP_LIBRARY) mpfr mpc ------------------------------------------------------------------------ NOTE: all dependencies of GCC must be order-only dependencies diff --git a/build/pkgs/gengetopt/dependencies b/build/pkgs/gengetopt/dependencies deleted file mode 100644 index eb5b66f34f2..00000000000 --- a/build/pkgs/gengetopt/dependencies +++ /dev/null @@ -1,6 +0,0 @@ -| xz - -xz is needed for unpacking the tarball when sage-bootstrap-python is ancient - ----------- -All lines of this file are ignored except the first. diff --git a/build/pkgs/gmp/dependencies b/build/pkgs/gmp/dependencies deleted file mode 100644 index 9738ee88e94..00000000000 --- a/build/pkgs/gmp/dependencies +++ /dev/null @@ -1,3 +0,0 @@ -| xz - -# xz is only needed to unpack the tarball when sage-bootstrap-python is Python < 3.3 diff --git a/build/pkgs/info/dependencies b/build/pkgs/info/dependencies index 5405130e47b..ccce387cd2d 100644 --- a/build/pkgs/info/dependencies +++ b/build/pkgs/info/dependencies @@ -1,6 +1,5 @@ -ncurses | xz +ncurses -xz is needed for unpacking the tarball when sage-bootstrap-python is ancient Both perl and (g)awk are checked by the ./configure script, but perl is part of the _prereq package, and (g)awk is seemingly assumed throughout the build system despite not being listed explicitly anywhere. diff --git a/build/pkgs/libffi/checksums.ini b/build/pkgs/libffi/checksums.ini index 73ac72b3952..ee989cbdb49 100644 --- a/build/pkgs/libffi/checksums.ini +++ b/build/pkgs/libffi/checksums.ini @@ -1,4 +1,4 @@ tarball=libffi-VERSION.tar.gz -sha1=19251dfee520dff42acefe36bfe76d7168071e01 -sha256=b0dea9df23c863a7a50e825440f3ebffabd65df1497108e5d437747843895a4e +sha1=2bd35b135b0eeb5c631e02422c9dbe786ddb626a +sha256=f3a3082a23b37c293a4fcd1053147b371f2ff91fa7ea1b2a52e335676bac82dc upstream_url=https://github.com/libffi/libffi/releases/download/vVERSION/libffi-VERSION.tar.gz diff --git a/build/pkgs/libffi/package-version.txt b/build/pkgs/libffi/package-version.txt index 1cf8253024c..87ce492908a 100644 --- a/build/pkgs/libffi/package-version.txt +++ b/build/pkgs/libffi/package-version.txt @@ -1 +1 @@ -3.4.6 +3.5.2 diff --git a/build/pkgs/libgd/dependencies b/build/pkgs/libgd/dependencies index 66ad9984858..30c33ac62a1 100644 --- a/build/pkgs/libgd/dependencies +++ b/build/pkgs/libgd/dependencies @@ -1,5 +1 @@ -libpng | xz - -# xz needed to unpack tarball when sage-bootstrap-python is Python < 3.3 ----------- -All lines of this file are ignored except the first. +libpng diff --git a/build/pkgs/liblzma/SPKG.rst b/build/pkgs/liblzma/SPKG.rst deleted file mode 100644 index 373af0a91a2..00000000000 --- a/build/pkgs/liblzma/SPKG.rst +++ /dev/null @@ -1,21 +0,0 @@ -liblzma: General-purpose data compression software -================================================== - -Description ------------ - -This packages represents liblzma, a part of XZ Utils, the free general-purpose -data compression software with a high compression ratio. - -License -------- - -Some parts public domain, other parts GNU LGPLv2.1, GNU GPLv2, or GNU -GPLv3. - - -Upstream Contact ----------------- - -http://tukaani.org/xz/ - diff --git a/build/pkgs/liblzma/dependencies b/build/pkgs/liblzma/dependencies deleted file mode 100644 index 52b7ce903f8..00000000000 --- a/build/pkgs/liblzma/dependencies +++ /dev/null @@ -1,8 +0,0 @@ -$(SAGE_LOCAL)/$(SPKG_INST_RELDIR)/xz-$(vers_xz) - ----------- -All lines of this file are ignored except the first. - -Adding the above instead of "xz" makes sure that the dependency is not replaced -by ".dummy". In this way, liblzma delegates building to xz when -liblzma appears as a dependency. diff --git a/build/pkgs/liblzma/distros/alpine.txt b/build/pkgs/liblzma/distros/alpine.txt deleted file mode 100644 index da4a99a970e..00000000000 --- a/build/pkgs/liblzma/distros/alpine.txt +++ /dev/null @@ -1 +0,0 @@ -xz-dev diff --git a/build/pkgs/liblzma/distros/conda.txt b/build/pkgs/liblzma/distros/conda.txt deleted file mode 100644 index d66e95ca507..00000000000 --- a/build/pkgs/liblzma/distros/conda.txt +++ /dev/null @@ -1 +0,0 @@ -xz diff --git a/build/pkgs/liblzma/distros/debian.txt b/build/pkgs/liblzma/distros/debian.txt deleted file mode 100644 index 5cc8e2ad176..00000000000 --- a/build/pkgs/liblzma/distros/debian.txt +++ /dev/null @@ -1,3 +0,0 @@ -xz-utils -liblzma-dev -# pixz # provides pixz but not xz on debian buster diff --git a/build/pkgs/liblzma/distros/fedora.txt b/build/pkgs/liblzma/distros/fedora.txt deleted file mode 100644 index 87d41237fa8..00000000000 --- a/build/pkgs/liblzma/distros/fedora.txt +++ /dev/null @@ -1,2 +0,0 @@ -xz -xz-devel diff --git a/build/pkgs/liblzma/distros/homebrew.txt b/build/pkgs/liblzma/distros/homebrew.txt deleted file mode 100644 index d66e95ca507..00000000000 --- a/build/pkgs/liblzma/distros/homebrew.txt +++ /dev/null @@ -1 +0,0 @@ -xz diff --git a/build/pkgs/liblzma/distros/macports.txt b/build/pkgs/liblzma/distros/macports.txt deleted file mode 100644 index d66e95ca507..00000000000 --- a/build/pkgs/liblzma/distros/macports.txt +++ /dev/null @@ -1 +0,0 @@ -xz diff --git a/build/pkgs/liblzma/distros/opensuse.txt b/build/pkgs/liblzma/distros/opensuse.txt deleted file mode 100644 index 96db709ccb8..00000000000 --- a/build/pkgs/liblzma/distros/opensuse.txt +++ /dev/null @@ -1,2 +0,0 @@ -xz -pkgconfig(liblzma) diff --git a/build/pkgs/liblzma/distros/pyodide.txt b/build/pkgs/liblzma/distros/pyodide.txt deleted file mode 100644 index 35a0fe5a555..00000000000 --- a/build/pkgs/liblzma/distros/pyodide.txt +++ /dev/null @@ -1 +0,0 @@ -liblzma diff --git a/build/pkgs/liblzma/distros/repology.txt b/build/pkgs/liblzma/distros/repology.txt deleted file mode 100644 index d66e95ca507..00000000000 --- a/build/pkgs/liblzma/distros/repology.txt +++ /dev/null @@ -1 +0,0 @@ -xz diff --git a/build/pkgs/liblzma/distros/slackware.txt b/build/pkgs/liblzma/distros/slackware.txt deleted file mode 100644 index d66e95ca507..00000000000 --- a/build/pkgs/liblzma/distros/slackware.txt +++ /dev/null @@ -1 +0,0 @@ -xz diff --git a/build/pkgs/liblzma/distros/void.txt b/build/pkgs/liblzma/distros/void.txt deleted file mode 100644 index c5fa156f8a0..00000000000 --- a/build/pkgs/liblzma/distros/void.txt +++ /dev/null @@ -1,2 +0,0 @@ -xz -liblzma-devel diff --git a/build/pkgs/liblzma/package-version.txt b/build/pkgs/liblzma/package-version.txt deleted file mode 120000 index 814cca4c8bc..00000000000 --- a/build/pkgs/liblzma/package-version.txt +++ /dev/null @@ -1 +0,0 @@ -../xz/package-version.txt \ No newline at end of file diff --git a/build/pkgs/liblzma/spkg-configure.m4 b/build/pkgs/liblzma/spkg-configure.m4 deleted file mode 100644 index 52caa060f0a..00000000000 --- a/build/pkgs/liblzma/spkg-configure.m4 +++ /dev/null @@ -1,10 +0,0 @@ -SAGE_SPKG_CONFIGURE([liblzma], [ - SAGE_SPKG_DEPCHECK([xz], [ - dnl The library is actually installed by the xz spkg. - AC_CHECK_LIB([lzma], [lzma_raw_decoder], [lzma_cv_liblzma=yes], [lzma_cv_liblzma=no]) - AC_CHECK_HEADER([lzma.h], [lzma_cv_lzma_h=yes], [lzma_cv_lzma_h=no]) - if test "$lzma_cv_liblzma" != "yes" -o "$lzma_cv_lzma_h" != "yes"; then - sage_spkg_install_liblzma=yes - fi - ]) -]) diff --git a/build/pkgs/liblzma/spkg-install b/build/pkgs/liblzma/spkg-install deleted file mode 100755 index 3104094580f..00000000000 --- a/build/pkgs/liblzma/spkg-install +++ /dev/null @@ -1,3 +0,0 @@ -#! /usr/bin/env bash -# Actual installation is done by the xz spkg -# via a tricky dependency in liblzma/dependencies. diff --git a/build/pkgs/liblzma/type b/build/pkgs/liblzma/type deleted file mode 100644 index a6a7b9cd726..00000000000 --- a/build/pkgs/liblzma/type +++ /dev/null @@ -1 +0,0 @@ -standard diff --git a/build/pkgs/mpfr/checksums.ini b/build/pkgs/mpfr/checksums.ini index 4a1b68cfe48..ee96cd179ae 100644 --- a/build/pkgs/mpfr/checksums.ini +++ b/build/pkgs/mpfr/checksums.ini @@ -1,4 +1,4 @@ tarball=mpfr-VERSION.tar.bz2 -sha1=f9dbe49b092e4c8e0a039e6d46c059696cc2f51c -sha256=b9df93635b20e4089c29623b19420c4ac848a1b29df1cfd59f26cab0d2666aa0 +sha1=7e21e5bcfa67db572e5f2f38029fc731a19aecce +sha256=9ad62c7dc910303cd384ff8f1f4767a655124980bb6d8650fe62c815a231bb7b upstream_url=https://www.mpfr.org/mpfr-current/mpfr-VERSION.tar.bz2 diff --git a/build/pkgs/mpfr/package-version.txt b/build/pkgs/mpfr/package-version.txt index fae6e3d04b2..af8c8ec7c13 100644 --- a/build/pkgs/mpfr/package-version.txt +++ b/build/pkgs/mpfr/package-version.txt @@ -1 +1 @@ -4.2.1 +4.2.2 diff --git a/build/pkgs/ncurses/checksums.ini b/build/pkgs/ncurses/checksums.ini index 1e4d3ce8d6c..f2852aa9e89 100644 --- a/build/pkgs/ncurses/checksums.ini +++ b/build/pkgs/ncurses/checksums.ini @@ -1,4 +1,4 @@ tarball=ncurses-VERSION.tar.gz -sha1=38fb1462d13b04bb900adf07918725c4b7ed0682 -sha256=97fc51ac2b085d4cde31ef4d2c3122c21abc217e9090a43a30fc5ec21684e059 -upstream_url=https://ftp.gnu.org/pub/gnu/ncurses/ncurses-VERSION.tar.gz +sha1=99bf17b2b750958ce368fd69dbf8ca9113040472 +sha256=355b4cbbed880b0381a04c46617b7656e362585d52e9cf84a67e2009b749ff11 +upstream_url=https://mirrors.dotsrc.org/gnu/ncurses/ncurses-VERSION.tar.gz diff --git a/build/pkgs/ncurses/package-version.txt b/build/pkgs/ncurses/package-version.txt index 0faee7d968e..4074fe20274 100644 --- a/build/pkgs/ncurses/package-version.txt +++ b/build/pkgs/ncurses/package-version.txt @@ -1 +1 @@ -6.3 +6.6 diff --git a/build/pkgs/ncurses/spkg-install.in b/build/pkgs/ncurses/spkg-install.in index 1f47e2f5493..4940fe5dcf5 100644 --- a/build/pkgs/ncurses/spkg-install.in +++ b/build/pkgs/ncurses/spkg-install.in @@ -23,6 +23,8 @@ sdh_configure --with-termlib \ --without-ada \ --disable-rpath-hack \ --enable-overwrite \ + --without-cxx \ + --without-cxx-binding \ --with-pkg-config-libdir="$SAGE_LOCAL/lib/pkgconfig" \ --enable-pc-files \ "$DEBUG_CONFIGURE_FLAG" @@ -48,6 +50,8 @@ sdh_configure --with-termlib \ --without-ada \ --disable-rpath-hack \ --enable-overwrite \ + --without-cxx \ + --without-cxx-binding \ --with-pkg-config-libdir="$SAGE_LOCAL/lib/pkgconfig" \ --enable-pc-files \ "$DEBUG_CONFIGURE_FLAG" diff --git a/build/pkgs/ncurses/spkg-postinst b/build/pkgs/ncurses/spkg-postinst new file mode 100755 index 00000000000..2bc49f5c29f --- /dev/null +++ b/build/pkgs/ncurses/spkg-postinst @@ -0,0 +1,51 @@ +#!/usr/bin/env bash +# +# Create compatibility symbolic links for narrow ncurses libraries +# These link libncurses.so -> libncursesw.so if libncurses.so doesn't exist +# +# This is needed because some packages (like readline) need narrow version, +# but we only build wide version. Other packages (like Python's curses module) +# work better with wide version. + +cd "$SAGE_LOCAL/lib" || exit 1 + +echo "Creating compatibility symbolic links..." + +# Create symlinks for libraries (only if narrow version doesn't exist) +if [ ! -e libncurses.so ] && [ -e libncursesw.so ]; then + ln -sf libncursesw.so libncurses.so + echo "Created libncurses.so -> libncursesw.so" +fi + +if [ ! -e libtinfo.so ] && [ -e libtinfow.so ]; then + ln -sf libtinfow.so libtinfo.so + echo "Created libtinfo.so -> libtinfow.so" +fi + +# Create versioned symlinks +for ver in 6 6; do + if [ ! -e libncurses.so.$ver ] && [ -e libncursesw.so.$ver ]; then + ln -sf libncursesw.so.$ver libncurses.so.$ver + echo "Created libncurses.so.$ver -> libncursesw.so.$ver" + fi + + if [ ! -e libtinfo.so.$ver ] && [ -e libtinfow.so.$ver ]; then + ln -sf libtinfow.so.$ver libtinfo.so.$ver + echo "Created libtinfo.so.$ver -> libtinfow.so.$ver" + fi +done + +# Create symlinks for pkg-config files +cd "$SAGE_LOCAL/lib/pkgconfig" || exit 1 + +if [ ! -e ncurses.pc ] && [ -e ncursesw.pc ]; then + ln -sf ncursesw.pc ncurses.pc + echo "Created ncurses.pc -> ncursesw.pc" +fi + +if [ ! -e tinfo.pc ] && [ -e tinfow.pc ]; then + ln -sf tinfow.pc tinfo.pc + echo "Created tinfo.pc -> tinfow.pc" +fi + +echo "Symbolic links created successfully." \ No newline at end of file diff --git a/build/pkgs/openblas/spkg-install.in b/build/pkgs/openblas/spkg-install.in index dbfcb6c1a75..a3e33c10195 100644 --- a/build/pkgs/openblas/spkg-install.in +++ b/build/pkgs/openblas/spkg-install.in @@ -3,7 +3,7 @@ cd src # OpenBLAS does not build on 32bit Haswell. Upstream suggests to pass BINARY=32 to default to NEHALEM kernels # See https://github.com/xianyi/OpenBLAS/issues/657 # Right now this affect all 32bit CPUs. -if [ `sage-bootstrap-python -c "from __future__ import print_function; import platform; print(platform.architecture()[0])"` = "32bit" ]; then +if [ `python3 -c "from __future__ import print_function; import platform; print(platform.architecture()[0])"` = "32bit" ]; then echo >&2 "Building a 32bit version of OpenBLAS." OPENBLAS_CONFIGURE="$OPENBLAS_CONFIGURE BINARY=32" fi diff --git a/build/pkgs/openblas/write_pc_file.py b/build/pkgs/openblas/write_pc_file.py index dc5ebff6de3..0c2a16071f3 100755 --- a/build/pkgs/openblas/write_pc_file.py +++ b/build/pkgs/openblas/write_pc_file.py @@ -1,4 +1,4 @@ -#!/usr/bin/env sage-bootstrap-python +#!/usr/bin/env python3 TEMPLATE = """ diff --git a/build/pkgs/openssl/checksums.ini b/build/pkgs/openssl/checksums.ini index eac86dcdd87..16177def1f4 100644 --- a/build/pkgs/openssl/checksums.ini +++ b/build/pkgs/openssl/checksums.ini @@ -1,4 +1,4 @@ tarball=openssl-VERSION.tar.gz -sha1=b12311372a0277ca0eb218a68a7fd9f5ce66d162 -sha256=197149c18d9e9f292c43f0400acaba12e5f52cacfe050f3d199277ea738ec2e7 +sha1=72a5ebbdd30bc28a66f069e2d50c66a007c324d2 +sha256=b28c91532a8b65a1f983b4c28b7488174e4a01008e29ce8e69bd789f28bc2a89 upstream_url=https://www.openssl.org/source/openssl-VERSION.tar.gz diff --git a/build/pkgs/openssl/package-version.txt b/build/pkgs/openssl/package-version.txt index be94e6f53db..7d280e2cd47 100644 --- a/build/pkgs/openssl/package-version.txt +++ b/build/pkgs/openssl/package-version.txt @@ -1 +1 @@ -3.2.2 +3.5.5 diff --git a/build/pkgs/openssl/spkg-configure.m4 b/build/pkgs/openssl/spkg-configure.m4 index 9e3668873df..c954ee8dc53 100644 --- a/build/pkgs/openssl/spkg-configure.m4 +++ b/build/pkgs/openssl/spkg-configure.m4 @@ -49,11 +49,11 @@ SAGE_SPKG_CONFIGURE([openssl], [ sage_spkg_install_openssl=yes ]) ], [dnl REQUIRED-CHECK - AC_REQUIRE([SAGE_SPKG_CONFIGURE_PYTHON3]) AC_REQUIRE([SAGE_SPKG_CONFIGURE_CURL]) - dnl openssl is a dependency only of python3 and curl; so if we use system python3 and curl, + dnl openssl is a dependency only of curl; so if we use system curl, dnl we do not require it. (In particular, we do not need a specific version.) - AS_IF([test x$sage_spkg_install_python3 = xno -a x$sage_spkg_install_curl = xno], [ + dnl We always use system python3 now. + AS_IF([test x$sage_spkg_install_curl = xno], [ sage_require_openssl=no ]) ]) diff --git a/build/pkgs/p_group_cohomology/dependencies b/build/pkgs/p_group_cohomology/dependencies index 57ea7e0dd94..0013f3c1acb 100644 --- a/build/pkgs/p_group_cohomology/dependencies +++ b/build/pkgs/p_group_cohomology/dependencies @@ -1 +1 @@ - cython cysignals singular meataxe modular_resolution $(SAGE_SRC)/sage/matrix/matrix_gfpn_dense.pxd $(SAGE_SRC)/sage/structure/element.pxd $(SAGE_SRC)/sage/matrix/matrix_gfpn_dense.pxd $(SAGE_SRC)/sage/matrix/matrix0.pxd $(SAGE_SRC)/sage/libs/meataxe.pxd $(SAGE_SRC)/sage/rings/morphism.pxd | $(PYTHON_TOOLCHAIN) matplotlib gap xz $(SAGERUNTIME) ipywidgets $(PYTHON) + cython cysignals singular meataxe modular_resolution $(SAGE_SRC)/sage/matrix/matrix_gfpn_dense.pxd $(SAGE_SRC)/sage/structure/element.pxd $(SAGE_SRC)/sage/matrix/matrix_gfpn_dense.pxd $(SAGE_SRC)/sage/matrix/matrix0.pxd $(SAGE_SRC)/sage/libs/meataxe.pxd $(SAGE_SRC)/sage/rings/morphism.pxd | $(PYTHON_TOOLCHAIN) matplotlib gap $(SAGERUNTIME) ipywidgets $(PYTHON) diff --git a/build/pkgs/primecount/distros/debian.txt b/build/pkgs/primecount/distros/debian.txt index a783045f297..cc1213230cf 100644 --- a/build/pkgs/primecount/distros/debian.txt +++ b/build/pkgs/primecount/distros/debian.txt @@ -1 +1,2 @@ libprimecount-dev +primecount diff --git a/build/pkgs/python3/SPKG.rst b/build/pkgs/python3/SPKG.rst deleted file mode 100644 index c96b714bbab..00000000000 --- a/build/pkgs/python3/SPKG.rst +++ /dev/null @@ -1,29 +0,0 @@ -python3: The Python programming language -======================================== - -Description ------------ - -By default, Sage will try to use system's ``python3`` to set up a virtual -environment, a.k.a. `venv `_ -rather than building a Python 3 installation from scratch. - -Sage will accept versions 3.9.x to 3.12.x. - -You can also use ``--with-python=/path/to/python3_binary`` to tell Sage to use -``/path/to/python3_binary`` to set up the venv. Note that setting up the venv requires -a number of Python modules to be available within the Python in question. Currently, -as of Sage 10.3, these modules are as follows: ``sqlite3``, ``ctypes``, ``math``, -``hashlib``, ``socket``, ``ssl``, ``ensurepip``. -For Python >= 3.12, also ``setuptools`` is required; for older Python versions, -``distutils.core`` is required. These modules will be checked for by the ``configure`` -script. - -Use the ``configure`` option ``--without-system-python3`` if you want Python 3 -built from scratch. - - -Upstream Contact ----------------- - -https://www.python.org diff --git a/build/pkgs/python3/checksums.ini b/build/pkgs/python3/checksums.ini deleted file mode 100644 index 3bac47d26a6..00000000000 --- a/build/pkgs/python3/checksums.ini +++ /dev/null @@ -1,4 +0,0 @@ -tarball=Python-VERSION.tar.xz -sha1=d9b83c17a717e1cbd3ab6bd14cfe3e508e6d87b2 -sha256=fa8a2e12c5e620b09f53e65bcd87550d2e5a1e2e04bf8ba991dcc55113876397 -upstream_url=https://www.python.org/ftp/python/VERSION/Python-VERSION.tar.xz diff --git a/build/pkgs/python3/dependencies b/build/pkgs/python3/dependencies deleted file mode 100644 index 48589475f39..00000000000 --- a/build/pkgs/python3/dependencies +++ /dev/null @@ -1,4 +0,0 @@ -readline sqlite libpng liblzma libffi openssl | xz - ----------- -All lines of this file are ignored except the first. diff --git a/build/pkgs/python3/distros/alpine.txt b/build/pkgs/python3/distros/alpine.txt deleted file mode 100644 index c4fe4764a15..00000000000 --- a/build/pkgs/python3/distros/alpine.txt +++ /dev/null @@ -1,2 +0,0 @@ -python3-dev -py3-setuptools diff --git a/build/pkgs/python3/distros/debian.txt b/build/pkgs/python3/distros/debian.txt deleted file mode 100644 index 71f8637f37e..00000000000 --- a/build/pkgs/python3/distros/debian.txt +++ /dev/null @@ -1,4 +0,0 @@ -python3 -libpython3-dev -python3-setuptools -python3-venv diff --git a/build/pkgs/python3/distros/fedora.txt b/build/pkgs/python3/distros/fedora.txt deleted file mode 100644 index ab50f2d9b07..00000000000 --- a/build/pkgs/python3/distros/fedora.txt +++ /dev/null @@ -1,2 +0,0 @@ -python3-devel -python3-setuptools diff --git a/build/pkgs/python3/distros/freebsd.txt b/build/pkgs/python3/distros/freebsd.txt deleted file mode 100644 index d7bf687a0a3..00000000000 --- a/build/pkgs/python3/distros/freebsd.txt +++ /dev/null @@ -1,2 +0,0 @@ -lang/python -devel/py-setuptools diff --git a/build/pkgs/python3/distros/homebrew.txt b/build/pkgs/python3/distros/homebrew.txt deleted file mode 100644 index 3ae3509605d..00000000000 --- a/build/pkgs/python3/distros/homebrew.txt +++ /dev/null @@ -1,3 +0,0 @@ -# This installs /usr/local/bin/python3 -> python3.9 -python3 -python-setuptools diff --git a/build/pkgs/python3/distros/macports.txt b/build/pkgs/python3/distros/macports.txt deleted file mode 100644 index 60bf435e3ce..00000000000 --- a/build/pkgs/python3/distros/macports.txt +++ /dev/null @@ -1,2 +0,0 @@ -python310 -py-setuptools diff --git a/build/pkgs/python3/distros/opensuse.txt b/build/pkgs/python3/distros/opensuse.txt deleted file mode 100644 index de3b7dcc464..00000000000 --- a/build/pkgs/python3/distros/opensuse.txt +++ /dev/null @@ -1,2 +0,0 @@ -python3${PYTHON_MINOR}-devel -python3${PYTHON_MINOR}-setuptools diff --git a/build/pkgs/python3/distros/repology.txt b/build/pkgs/python3/distros/repology.txt deleted file mode 100644 index fdc793e786a..00000000000 --- a/build/pkgs/python3/distros/repology.txt +++ /dev/null @@ -1 +0,0 @@ -python diff --git a/build/pkgs/python3/distros/void.txt b/build/pkgs/python3/distros/void.txt deleted file mode 100644 index ab50f2d9b07..00000000000 --- a/build/pkgs/python3/distros/void.txt +++ /dev/null @@ -1,2 +0,0 @@ -python3-devel -python3-setuptools diff --git a/build/pkgs/python3/package-version.txt b/build/pkgs/python3/package-version.txt deleted file mode 100644 index d9506ceba51..00000000000 --- a/build/pkgs/python3/package-version.txt +++ /dev/null @@ -1 +0,0 @@ -3.12.5 diff --git a/build/pkgs/python3/spkg-build.in b/build/pkgs/python3/spkg-build.in deleted file mode 100644 index f2a8b4311db..00000000000 --- a/build/pkgs/python3/spkg-build.in +++ /dev/null @@ -1,128 +0,0 @@ -# It is best to unset these environment variables, as they might confuse -# the Python installer. -unset PYTHONHOME -unset PYTHONPATH -unset SETUPTOOLS_USE_DISTUTILS - -# Prevent use of the system hg and svn as it might make the installation fail -export HAS_HG=no -export SVNVERSION=no - -cd src - -if [ "$SAGE_DEBUG" = "yes" ]; then - echo "Building Python with pydebug" - PYTHON_CONFIGURE="$PYTHON_CONFIGURE --with-pydebug" -fi - -# pymalloc screws with valgrind, so let's disable it -if [ "$SAGE_VALGRIND" = "yes" ]; then - echo "Building Python without pymalloc" - PYTHON_CONFIGURE="$PYTHON_CONFIGURE --without-pymalloc" -fi - -# We will use EXTRA_CFLAGS for user-defined CFLAGS below. -OLD_CFLAGS="$CFLAGS" -unset CFLAGS - -if [ "$UNAME" = Darwin ]; then - PYTHON_CONFIGURE="--disable-toolbox-glue $PYTHON_CONFIGURE" - - mkdir "../include" - if [ -n "$OPENSSL_INCLUDE" ]; then - # If the user explicitely states where to get the openssl - # includes, use that. - cp -rp "$OPENSSL_INCLUDE" "../include" - export CFLAGS="-I../include" - else - # Otherwise try using homebrew version - brew_openssl="/usr/local/opt/openssl/include" - if [ -d "$brew_openssl" ]; then - export LDFLAGS="$LDFLAGS -L/usr/local/opt/openssl/lib" - export CPPFLAGS="$CPPFLAGS -I/usr/local/opt/openssl/include" - export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/opt/openssl/lib/pkgconfig" - fi - fi - - if [ $MACOSX_VERSION -ge 16 ]; then - echo "OS X 10.$[$MACOSX_VERSION-4] Building with clang." - CC=clang - fi -fi - -# Use EXTRA_CFLAGS for user-defined CFLAGS since Python puts its own -# default flags like -O3 after CFLAGS but before EXTRA_CFLAGS. -# We also disable warnings about unused variables/functions which are -# common in Cython-generated code. -export EXTRA_CFLAGS="`testcflags.sh -Wno-unused $OLD_CFLAGS`" - - # Note: --without-ensurepip ensures that setuptools+pip are *not* installed - # automatically when installing python3. They will be installed instead by - # the separate setuptools and pip packages; see - # https://github.com/sagemath/sage/issues/23398 - PYTHON_CONFIGURE="$PYTHON_CONFIGURE --without-ensurepip" - -sdh_configure --enable-shared $PYTHON_CONFIGURE - -# Make sure -L. is placed before -L$SAGE_LOCAL/lib so that python and extension -# modules are linked with the right libpython; we pass this in at make time -# only, since we don't want -L. to be saved as one of the default LDFLAGS -# used for building third-party extension modules. -# -# Issue #32442: As we now install python in SAGE_VENV, not SAGE_LOCAL, -# we need to provide paths into $SAGE_LOCAL, so that setup.py finds -# the libraries needed for the extension modules - in particular sqlite3. -# (The search code there does not know about CPATH and LIBRARY_PATH.) - -if [ "$UNAME" = "Darwin" ]; then - make_LDFLAGS="-L$SAGE_LOCAL/lib -L$SAGE_INST_LOCAL/lib $LDFLAGS" - # This enables python to find libpython - export DYLD_LIBRARY_PATH="." -fi -if [ "$UNAME" = "Linux" ]; then - make_LDFLAGS="-L. -Wl,-rpath,. -L$SAGE_LOCAL/lib $LDFLAGS" - make_CPPFLAGS="-I$SAGE_LOCAL/include $CPPFLAGS" - # Also, we need to add an rpath, like we do for SAGE_LOCAL in src/bin/sage-env. - # SAGE_INST_LOCAL is the installation hierarchy for the current package - # -- for python3, this is SAGE_VENV. - make_LDFLAGS="-Wl,-rpath,$SAGE_INST_LOCAL/lib $make_LDFLAGS" - make_LDFLAGS="-Wl,-rpath-link,$SAGE_INST_LOCAL/lib $make_LDFLAGS" - # This enables python to find libpython - export LD_LIBRARY_PATH="." -fi - -sdh_make LDFLAGS="$make_LDFLAGS" CPPFLAGS="$make_CPPFLAGS" - -# When building on a case-insensitive filesystem (on any OS, not just Windows) -# the Python executable is output to the build directory as 'python.exe' -if [ -f "python.exe" ]; then - PYTHON="./python.exe" -else - PYTHON="./python" -fi - -# Make sure extension modules were built correctly. -# All these modules are important and if any one -# fails to build, Sage will not work. - -echo "Testing importing of various modules..." -import_errors=false -# Issue #31160: We no longer check for readline here. -test_modules="ctypes math hashlib crypt socket zlib sqlite3 ssl" -if [ "$UNAME" = "Darwin" ]; then - test_modules="$test_modules _scproxy" -fi - -for module in $test_modules; do - if $PYTHON -c "import $module"; then - echo "$module module imported OK" - else - echo >&2 "$module module failed to import" - import_errors=true - fi -done - -if $import_errors; then - echo >&2 "Error: One or more modules failed to import." - exit 1 -fi diff --git a/build/pkgs/python3/spkg-check.in b/build/pkgs/python3/spkg-check.in deleted file mode 100644 index 11af4c50e28..00000000000 --- a/build/pkgs/python3/spkg-check.in +++ /dev/null @@ -1,2 +0,0 @@ -cd src -$MAKE test diff --git a/build/pkgs/python3/spkg-configure.m4 b/build/pkgs/python3/spkg-configure.m4 deleted file mode 100644 index f8ca72b60a5..00000000000 --- a/build/pkgs/python3/spkg-configure.m4 +++ /dev/null @@ -1,154 +0,0 @@ -SAGE_SPKG_CONFIGURE([python3], [ - m4_pushdef([MIN_VERSION], [3.12.0]) - m4_pushdef([MIN_NONDEPRECATED_VERSION], [3.12.0]) - m4_pushdef([LT_STABLE_VERSION], [3.15.0]) - m4_pushdef([LT_VERSION], [3.15.0]) - AC_ARG_WITH([python], - [AS_HELP_STRING([--with-python=PYTHON3], - [Python 3 executable to use for the Sage venv; default: python3])]) - AS_IF([test x"$with_python" = x2], [AC_MSG_ERROR([Sage cannot be built on Python 2. Exiting.])]) - AS_IF([test x"$with_python" = x3], [ - AC_MSG_NOTICE([The meaning of the option --with-python has changed in Sage 9.2. Ignoring.]) - with_python='' - ]) - AS_IF([test x"$with_python" = x"no"], - [AC_MSG_ERROR([building Sage --without-python is not supported])]) - ac_path_PYTHON3="$with_python" - - dnl If --with-python was explicitly specified and differs from the cached value, - dnl clear the cache to force re-checking. - dnl This fixes issue #41258 where changing --with-python would use stale cached values - AS_IF([test x"$ac_path_PYTHON3" != x && test x"$ac_path_PYTHON3" != x"$ac_cv_path_PYTHON3"], [ - AS_UNSET([ac_cv_path_PYTHON3]) - ]) - - dnl Issue #30559: Removed the DEPCHECK for sqlite. We never use libsqlite3 from SPKG for anything - dnl other than building the python3 SPKG; so our libsqlite3 cannot create shared library conflicts. - dnl - dnl However, if we add another package (providing a shared library linked into a Python module) - dnl that also uses libsqlite3, then we will have to put the DEPCHECK back in. - SAGE_SPKG_DEPCHECK([liblzma libffi], [ - dnl Check if we can do venv with a system python3 - dnl instead of building our own copy. - dnl Issue #31160: We no longer check for readline here. - check_modules="sqlite3, ctypes, math, hashlib, socket, ssl, ensurepip, zlib" - AC_CACHE_CHECK([for python3 >= ]MIN_VERSION[, < ]LT_VERSION[ with modules $check_modules and setuptools/distutils], [ac_cv_path_PYTHON3], [ - AS_IF([test x"$ac_path_PYTHON3" != x], [dnl checking explicitly specified $with_python - AC_MSG_RESULT([]) - AC_PATH_PROG([ac_path_PYTHON3], [$ac_path_PYTHON3]) - SAGE_CHECK_PYTHON_FOR_VENV([$ac_path_PYTHON3], - MIN_VERSION, LT_VERSION, - $check_modules, [ - AS_IF([[conftest_venv/bin/python3 -m sysconfig | grep '^\sw*\(C\|LD\)FLAGS *=.*[" ]-[IL] *[^.]' ]] [>& AS_MESSAGE_LOG_FD 2>&1 ], [ - AC_MSG_WARN([this is a misconfigured Python whose sysconfig compiler/linker flags contain -I or -L options, which may cause wrong versions of libraries to leak into the build of Python packages - see https://github.com/sagemath/sage/issues/31132]) - ]) - dnl It is good - ac_cv_path_PYTHON3="$ac_path_PYTHON3" - ac_path_PYTHON3_found=: - AC_MSG_RESULT([yes]) - dnl introduction for AC_MSG_RESULT printed by AC_CACHE_CHECK - AC_MSG_CHECKING([for python3 >= ]MIN_VERSION[, < ]LT_VERSION[ with modules $check_modules and setuptools/distutils]) - ]) - AS_IF([test -z "$ac_cv_path_PYTHON3"], [ - AC_MSG_ERROR([the python3 selected using --with-python=$with_python is not suitable]) - ]) - ], [dnl checking the default system python3 - AC_MSG_RESULT([]) - AC_PATH_PROGS_FEATURE_CHECK([PYTHON3], [python3], [ - SAGE_CHECK_PYTHON_FOR_VENV([$ac_path_PYTHON3], - MIN_VERSION, LT_VERSION, - $check_modules, [ - AS_IF([[conftest_venv/bin/python3 -m sysconfig | grep '^\sw*\(C\|LD\)FLAGS *=.*[" ]-[IL] *[^.]' ]] [>& AS_MESSAGE_LOG_FD 2>&1 ], [ - AC_MSG_RESULT([no, this is a misconfigured Python whose sysconfig compiler/linker flags contain -I or -L options, which may cause wrong versions of libraries to leak into the build of Python packages - see https://github.com/sagemath/sage/issues/31132; to use it anyway, use ./configure --with-python=$ac_path_PYTHON3]) - ], [ - dnl It is good - ac_cv_path_PYTHON3="$ac_path_PYTHON3" - ac_path_PYTHON3_found=: - AC_MSG_RESULT([yes]) - dnl introduction for AC_MSG_RESULT printed by AC_CACHE_CHECK - AC_MSG_CHECKING([for python3 >= ]MIN_VERSION[, < ]LT_VERSION[ with modules $check_modules]) - ]) - ]) - ]) - ]) - ]) - AS_IF([test -z "$ac_cv_path_PYTHON3"], [ - AC_MSG_NOTICE([to try to use a different system python, use ./configure --with-python=/path/to/python]) - sage_spkg_install_python3=yes - ]) - ]) -],, [ - dnl PRE -], [ - dnl POST - AS_IF([test x$sage_spkg_install_python3 = xno], [ - PYTHON_FOR_VENV="$ac_cv_path_PYTHON3" - AS_IF([test "$SAGE_ARCHFLAGS" = "unset"], [ - AC_MSG_CHECKING([whether $PYTHON_FOR_VENV is configured to build multiarch extensions]) - AS_IF([[CC="$CC" CXX="$CXX" conftest_venv/bin/python3 -m sysconfig | grep '^\sw*\(C\|LD\)FLAGS *=.*[" ]-arch.* -arch' ]] [>& AS_MESSAGE_LOG_FD 2>&1 ], [ - AC_MSG_RESULT([yes; disabling it by setting ARCHFLAGS]) - SAGE_ARCHFLAGS="" - ], [ - AC_MSG_RESULT([no]) - ]) - ]) - AS_IF([test "$SAGE_ARCHFLAGS" != "unset"], [ - ARCHFLAGS="$SAGE_ARCHFLAGS" - export ARCHFLAGS - ]) - AS_IF([test -n "$CFLAGS_MARCH"], [ - dnl Issue #31228 - AC_MSG_CHECKING([whether "$CFLAGS_MARCH" works with the C/C++ compilers configured for building extensions for $PYTHON_FOR_VENV]) - SAGE_PYTHON_CHECK_DISTUTILS([CC="$CC" CXX="$CXX" CFLAGS="$CFLAGS_MARCH" conftest_venv/bin/python3], [ - AC_MSG_RESULT([yes]) - ], [ - AC_MSG_RESULT([no, with these flags, $reason; disabling use of "$CFLAGS_MARCH"]) - CFLAGS_MARCH="" - ]) - ]) - - AS_IF([test -n "$OPENMP_CFLAGS$OPENMP_CXXFLAGS"], [ - AC_MSG_CHECKING([whether OpenMP works with the C/C++ compilers configured for building extensions for $PYTHON_FOR_VENV]) - SAGE_PYTHON_CHECK_DISTUTILS([CC="$CC" CXX="$CXX" CFLAGS="$CFLAGS $OPENMP_CFLAGS" CXXFLAGS="$CXXFLAGS $OPENMP_CXXFLAGS" conftest_venv/bin/python3], [ - AC_MSG_RESULT([yes]) - ], [ - AC_MSG_RESULT([no, $reason; disabling use OpenMP]) - OPENMP_CFLAGS="" - OPENMP_CXXFLAGS="" - ]) - ]) - - AX_COMPARE_VERSION([$python3_version], [lt], MIN_NONDEPRECATED_VERSION, [ - AC_MSG_NOTICE([deprecation notice: Support for system python < MIN_NONDEPRECATED_VERSION is deprecated -and will be removed in the next development cycle. Consider using a newer version of Python -that may be available on your system or can be installed using the system package manager. -To build Sage with a different system python, use ./configure --with-python=/path/to/python]) - ]) - AX_COMPARE_VERSION([$python3_version], [ge], LT_STABLE_VERSION, [ - AC_MSG_WARN([Support for system python >= LT_STABLE_VERSION is experimental. -To build Sage with a different system python, use ./configure --with-python=/path/to/python]) - ]) - ]) - AC_SUBST([PYTHON_FOR_VENV]) - - AS_IF([test -n "$PYTHON_FOR_VENV"], - [PYTHON_VERSION=$("$PYTHON_FOR_VENV" -c "import sysconfig; print(sysconfig.get_python_version())")], - [PYTHON_VERSION=$(echo $(cat build/pkgs/python3/package-version.txt))]) - AC_SUBST([PYTHON_MINOR], [$(echo $PYTHON_VERSION | cut -d. -f2)]) - export PYTHON_MINOR # for sage-get-system-packages - - AS_VAR_IF([SAGE_VENV], [auto], [SAGE_VENV=$SAGE_VENV_AUTO]) - AS_CASE([$SAGE_VENV], - [no], [SAGE_VENV='${SAGE_LOCAL}'],dnl Quoted so that it is resolved at build time by shell/Makefile - [yes], [SAGE_VENV='${SAGE_LOCAL}'/var/lib/sage/venv-python$PYTHON_VERSION] - ) - dnl These temporary directories are created by the check above - dnl and need to be cleaned up to prevent the "rm -f conftest*" - dnl (that a bunch of other checks do) from emitting warnings about - dnl conftest.dir and conftest_venv being directories. - rm -rf conftest.dir conftest_venv - - m4_popdef([MIN_VERSION]) - m4_popdef([MIN_NONDEPRECATED_VERSION]) - m4_popdef([LT_VERSION]) -]) diff --git a/build/pkgs/python3/spkg-install.in b/build/pkgs/python3/spkg-install.in deleted file mode 100644 index 2b2844ea02f..00000000000 --- a/build/pkgs/python3/spkg-install.in +++ /dev/null @@ -1,53 +0,0 @@ -########################################### -## Python -########################################### - -# It is best to unset these environment variables, as they might confuse -# the Python installer. -unset PYTHONHOME -unset PYTHONPATH - -# Prevent use of the system hg and svn as it might make the installation fail -export HAS_HG=no -export SVNVERSION=no - -cd src - -# Running 'make install' in parallel is a bad idea, so we use -# only 1 job. -# The "-i" option to ignore errors is crucial, especially in the -# case of upgrades. -sdh_make_install -i -j1 - -echo "Installing valgrind suppression file..." -SUPP_FILENAME="python3.supp" -sdh_install -T Misc/valgrind-python.supp "$SAGE_LOCAL/lib/valgrind/$SUPP_FILENAME" - -if [ "$UNAME" = "Linux" ]; then - export LD_LIBRARY_PATH="." -elif [ "$UNAME" = "Darwin" ]; then - export DYLD_LIBRARY_PATH="." -fi - -# When building on a case-insensitive filesystem (on any OS, not just Windows) -# the Python executable is output to the build directory as 'python.exe' -if [ -f "python.exe" ]; then - PYTHON="./python.exe" -else - PYTHON="./python" -fi - -PYTHON_VERSION=$($PYTHON -c 'import sys; print("%d.%d" % sys.version_info[:2])') -PYTHON_ABIFLAGS=$($PYTHON -c 'import sys; print(sys.abiflags)') -PYTHON_LDVERSION="$PYTHON_VERSION$PYTHON_ABIFLAGS" -PYTHON_CONFIG_DIR="$SAGE_LOCAL/lib/python${PYTHON_VERSION}/config-${PYTHON_LDVERSION}" - -# On OS X with XCode 4, the presence of -# $SAGE_LOCAL/lib/python3.x/config/libpython3.x.a causes problems with -# GiNaC -- see #11967. It is easiest to test the version of OS X; we -# delete this file if using OS X 10.6 or later (so `uname -r` returns -# x.y.z with x >= 10). -if [ "$UNAME" = "Darwin" ] && \ - [ `uname -r | cut '-d.' -f1` -gt 9 ]; then - rm -f "${SAGE_DESTDIR}${PYTHON_CONFIG_DIR}/libpython${PYTHON_LDVERSION}.a" -fi diff --git a/build/pkgs/python3/spkg-legacy-uninstall b/build/pkgs/python3/spkg-legacy-uninstall deleted file mode 100755 index bba823cd5a4..00000000000 --- a/build/pkgs/python3/spkg-legacy-uninstall +++ /dev/null @@ -1,4 +0,0 @@ -#! /usr/bin/env bash -echo "Cleaning out old python / python3 / python3 venv binaries" -rm -f "$SAGE_LOCAL"/pyvenv.cfg -rm -f "$SAGE_LOCAL"/bin/python "$SAGE_LOCAL"/bin/python3 "$SAGE_LOCAL"/bin/python3.* diff --git a/build/pkgs/python3/trees.txt b/build/pkgs/python3/trees.txt deleted file mode 100644 index f01330b2fe5..00000000000 --- a/build/pkgs/python3/trees.txt +++ /dev/null @@ -1 +0,0 @@ -SAGE_VENV diff --git a/build/pkgs/python3/type b/build/pkgs/python3/type deleted file mode 100644 index a6a7b9cd726..00000000000 --- a/build/pkgs/python3/type +++ /dev/null @@ -1 +0,0 @@ -standard diff --git a/build/pkgs/readline/checksums.ini b/build/pkgs/readline/checksums.ini index 5f3fbae748b..48a7b766592 100644 --- a/build/pkgs/readline/checksums.ini +++ b/build/pkgs/readline/checksums.ini @@ -1,4 +1,4 @@ tarball=readline-VERSION.tar.gz -sha1=8a05ad0d0ad67e18c383f1b2cf6a23bcbd46f87a -sha256=7589a2381a8419e68654a47623ce7dfcb756815c8fee726b98f90bf668af7bc6 -upstream_url=https://ftp.gnu.org/gnu/readline/readline-VERSION.tar.gz +sha1=2c05ae9350b695f69d70b47f17f092611de2081f +sha256=fe5383204467828cd495ee8d1d3c037a7eba1389c22bc6a041f627976f9061cc +upstream_url=https://ftpmirror.gnu.org/gnu/readline/readline-VERSION.tar.gz diff --git a/build/pkgs/readline/package-version.txt b/build/pkgs/readline/package-version.txt index 6b409d977b8..cf022018d84 100644 --- a/build/pkgs/readline/package-version.txt +++ b/build/pkgs/readline/package-version.txt @@ -1 +1 @@ -8.1.2 +8.3 diff --git a/build/pkgs/readline/patches/0001-macports.patch b/build/pkgs/readline/patches/0001-macports.patch deleted file mode 100644 index d9154a38443..00000000000 --- a/build/pkgs/readline/patches/0001-macports.patch +++ /dev/null @@ -1,18 +0,0 @@ ---- old/support/shobj-conf 2014-02-23 19:06:29.000000000 -0700 -+++ new/support/shobj-conf 2014-04-07 09:23:17.000000000 -0700 -@@ -189,13 +189,13 @@ - darwin[1-7].*) - SHOBJ_STATUS=unsupported - SHOBJ_LDFLAGS='-dynamic' -- SHLIB_XLDFLAGS='-arch_only `/usr/bin/arch` -install_name $(libdir)/`echo $@ | sed "s:\\..*::"`.$(SHLIB_MAJOR).$(SHLIB_LIBSUFF) -current_version $(SHLIB_MAJOR)$(SHLIB_MINOR) -compatibility_version $(SHLIB_MAJOR)$(SHLIB_MINOR) -v' -+ SHLIB_XLDFLAGS='-install_name $(libdir)/`echo $@ | sed "s:\\..*::"`.$(SHLIB_MAJOR).$(SHLIB_LIBSUFF) -current_version $(SHLIB_MAJOR)$(SHLIB_MINOR) -compatibility_version $(SHLIB_MAJOR)$(SHLIB_MINOR) -v' - ;; - # Darwin 8 == Mac OS X 10.4; Mac OS X 10.N == Darwin N+4 - *) - case "${host_os}" in - darwin[89]*|darwin1[012]*) -- SHOBJ_ARCHFLAGS='-arch_only `/usr/bin/arch`' -+ SHOBJ_ARCHFLAGS= - ;; - *) # Mac OS X 10.9 (Mavericks) and later - SHOBJ_ARCHFLAGS= diff --git a/build/pkgs/readline/patches/0002-ltinfo.patch b/build/pkgs/readline/patches/0002-ltinfo.patch index 11fc3265d66..cdc0230a6bd 100644 --- a/build/pkgs/readline/patches/0002-ltinfo.patch +++ b/build/pkgs/readline/patches/0002-ltinfo.patch @@ -13,7 +13,7 @@ SHLIB_DOT='.' SHLIB_LIBPREF='lib' -@@ -209,7 +209,7 @@ +@@ -171,7 +171,7 @@ ;; esac diff --git a/build/pkgs/readline/spkg-install.in b/build/pkgs/readline/spkg-install.in index a9322e4bed8..32f48e3486c 100644 --- a/build/pkgs/readline/spkg-install.in +++ b/build/pkgs/readline/spkg-install.in @@ -1,5 +1,14 @@ cd src/ + +# Force linking to ncurses even with --as-needed linker flag on Linux +# This ensures readline properly links to ncurses/tinfo for terminal handling +# The --no-as-needed flag is a GNU ld option, so only use it on Linux with GCC +if [ "$UNAME" = "Linux" ]; then + echo "Configuring readline to explicitly link ncurses on Linux..." + export LDFLAGS="-Wl,--no-as-needed $LDFLAGS" +fi + sdh_configure --with-curses --enable-shared --disable-static echo "Now building static and shared readline libraries..." sdh_make diff --git a/build/pkgs/sage_docbuild/spkg-install.in b/build/pkgs/sage_docbuild/spkg-install.in deleted file mode 120000 index 428e161a850..00000000000 --- a/build/pkgs/sage_docbuild/spkg-install.in +++ /dev/null @@ -1 +0,0 @@ -../sage_setup/spkg-install.in \ No newline at end of file diff --git a/build/pkgs/sage_docbuild/spkg-install.in b/build/pkgs/sage_docbuild/spkg-install.in new file mode 100644 index 00000000000..da7d7a2870f --- /dev/null +++ b/build/pkgs/sage_docbuild/spkg-install.in @@ -0,0 +1,9 @@ +cd src +if [ "$SAGE_EDITABLE" = yes ]; then + sdh_pip_editable_install . + if [ "$SAGE_WHEELS" = yes ]; then + sdh_build_and_store_wheel --no-isolation . + fi +else + sdh_pip_install . +fi diff --git a/build/pkgs/sagelib/dependencies b/build/pkgs/sagelib/dependencies index 43a322cddac..19101aa7c62 100644 --- a/build/pkgs/sagelib/dependencies +++ b/build/pkgs/sagelib/dependencies @@ -1,4 +1,4 @@ -FORCE $(SCRIPTS) $(BLAS) brial cliquer cypari cysignals cython ecl eclib ecm flint libgd gap givaro glpk gmpy2 gsl iml importlib_metadata importlib_resources jupyter_core lcalc lrcalc_python libbraiding libhomfly libpng linbox m4ri m4rie memory_allocator mpc mpfi mpfr $(MP_LIBRARY) ntl numpy pari pip pkgconfig planarity ppl pplpy primesieve primecount primecountpy $(PYTHON) requests rw singular symmetrica typing_extensions $(PCFILES) | $(PYTHON_TOOLCHAIN) $(PYTHON) pythran +FORCE $(SCRIPTS) $(BLAS) brial cliquer cypari cysignals cython ecl eclib ecm flint libgd gap givaro glpk gmpy2 gsl iml jupyter_core lcalc lrcalc_python libbraiding libhomfly libpng linbox m4ri m4rie maxima memory_allocator mpc mpfi mpfr $(MP_LIBRARY) ntl numpy pari pip pkgconfig planarity ppl pplpy primesieve primecount primecountpy $(PYTHON) requests rw singular symmetrica typing_extensions $(PCFILES) | $(PYTHON_TOOLCHAIN) $(PYTHON) pythran ---------- All lines of this file are ignored except the first. diff --git a/build/pkgs/sagemath_categories/spkg-install.in b/build/pkgs/sagemath_categories/spkg-install.in deleted file mode 120000 index d83cc631c9a..00000000000 --- a/build/pkgs/sagemath_categories/spkg-install.in +++ /dev/null @@ -1 +0,0 @@ -../sagemath_objects/spkg-install.in \ No newline at end of file diff --git a/build/pkgs/sagemath_categories/spkg-install.in b/build/pkgs/sagemath_categories/spkg-install.in new file mode 100644 index 00000000000..53c094fde04 --- /dev/null +++ b/build/pkgs/sagemath_categories/spkg-install.in @@ -0,0 +1,10 @@ +cd src + +export PIP_NO_INDEX=true +export PIP_FIND_LINKS="file://$SAGE_SPKG_WHEELS" + +# First build the sdist, then build the wheel from the sdist. +# https://pypa-build.readthedocs.io/en/latest/#python--m-build +# (Important because sagemath-objects uses MANIFEST.in for filtering.) +# Do not install the wheel. +sdh_build_and_store_wheel --sdist-then-wheel . diff --git a/build/pkgs/sagemath_environment/spkg-install.in b/build/pkgs/sagemath_environment/spkg-install.in deleted file mode 120000 index d83cc631c9a..00000000000 --- a/build/pkgs/sagemath_environment/spkg-install.in +++ /dev/null @@ -1 +0,0 @@ -../sagemath_objects/spkg-install.in \ No newline at end of file diff --git a/build/pkgs/sagemath_environment/spkg-install.in b/build/pkgs/sagemath_environment/spkg-install.in new file mode 100644 index 00000000000..53c094fde04 --- /dev/null +++ b/build/pkgs/sagemath_environment/spkg-install.in @@ -0,0 +1,10 @@ +cd src + +export PIP_NO_INDEX=true +export PIP_FIND_LINKS="file://$SAGE_SPKG_WHEELS" + +# First build the sdist, then build the wheel from the sdist. +# https://pypa-build.readthedocs.io/en/latest/#python--m-build +# (Important because sagemath-objects uses MANIFEST.in for filtering.) +# Do not install the wheel. +sdh_build_and_store_wheel --sdist-then-wheel . diff --git a/build/pkgs/sagemath_repl/spkg-install.in b/build/pkgs/sagemath_repl/spkg-install.in deleted file mode 120000 index d83cc631c9a..00000000000 --- a/build/pkgs/sagemath_repl/spkg-install.in +++ /dev/null @@ -1 +0,0 @@ -../sagemath_objects/spkg-install.in \ No newline at end of file diff --git a/build/pkgs/sagemath_repl/spkg-install.in b/build/pkgs/sagemath_repl/spkg-install.in new file mode 100644 index 00000000000..53c094fde04 --- /dev/null +++ b/build/pkgs/sagemath_repl/spkg-install.in @@ -0,0 +1,10 @@ +cd src + +export PIP_NO_INDEX=true +export PIP_FIND_LINKS="file://$SAGE_SPKG_WHEELS" + +# First build the sdist, then build the wheel from the sdist. +# https://pypa-build.readthedocs.io/en/latest/#python--m-build +# (Important because sagemath-objects uses MANIFEST.in for filtering.) +# Do not install the wheel. +sdh_build_and_store_wheel --sdist-then-wheel . diff --git a/build/pkgs/sqlite/SPKG.rst b/build/pkgs/sqlite/SPKG.rst deleted file mode 100644 index e036813330f..00000000000 --- a/build/pkgs/sqlite/SPKG.rst +++ /dev/null @@ -1,30 +0,0 @@ -sqlite: An SQL database engine -============================== - -Description ------------ - -SQLite is a software library that implements a self-contained, -serverless, zero-configuration, transactional SQL database engine. - -License -------- - -Public Domain - - -Upstream contact ----------------- - -- https://www.sqlite.org - -Dependencies ------------- - -- readline - - -Special Update/Build Instructions ---------------------------------- - -- Use the autoconf version of sqlite. diff --git a/build/pkgs/sqlite/checksums.ini b/build/pkgs/sqlite/checksums.ini deleted file mode 100644 index 144a50566d4..00000000000 --- a/build/pkgs/sqlite/checksums.ini +++ /dev/null @@ -1,4 +0,0 @@ -tarball=sqlite-autoconf-${VERSION_MAJOR}${VERSION_MINOR}0${VERSION_MICRO}00.tar.gz -sha1=a4bcf9e951bfb9745214241ba08476299fc2dc1e -sha256=bd90c3eb96bee996206b83be7065c9ce19aef38c3f4fb53073ada0d0b69bbce3 -upstream_url=https://www.sqlite.org/2021/sqlite-autoconf-${VERSION_MAJOR}${VERSION_MINOR}0${VERSION_MICRO}00.tar.gz diff --git a/build/pkgs/sqlite/dependencies b/build/pkgs/sqlite/dependencies deleted file mode 100644 index 7d283a67703..00000000000 --- a/build/pkgs/sqlite/dependencies +++ /dev/null @@ -1,4 +0,0 @@ -readline - ----------- -All lines of this file are ignored except the first. diff --git a/build/pkgs/sqlite/distros/alpine.txt b/build/pkgs/sqlite/distros/alpine.txt deleted file mode 100644 index 1598840794c..00000000000 --- a/build/pkgs/sqlite/distros/alpine.txt +++ /dev/null @@ -1 +0,0 @@ -sqlite-dev diff --git a/build/pkgs/sqlite/distros/arch.txt b/build/pkgs/sqlite/distros/arch.txt deleted file mode 100644 index 8b2f60c6f09..00000000000 --- a/build/pkgs/sqlite/distros/arch.txt +++ /dev/null @@ -1 +0,0 @@ -sqlite3 diff --git a/build/pkgs/sqlite/distros/conda.txt b/build/pkgs/sqlite/distros/conda.txt deleted file mode 100644 index 532c6c608dd..00000000000 --- a/build/pkgs/sqlite/distros/conda.txt +++ /dev/null @@ -1 +0,0 @@ -sqlite diff --git a/build/pkgs/sqlite/distros/debian.txt b/build/pkgs/sqlite/distros/debian.txt deleted file mode 100644 index 7fab23657d6..00000000000 --- a/build/pkgs/sqlite/distros/debian.txt +++ /dev/null @@ -1,2 +0,0 @@ -libsqlite3-dev -sqlite3 diff --git a/build/pkgs/sqlite/distros/fedora.txt b/build/pkgs/sqlite/distros/fedora.txt deleted file mode 100644 index 8983b4d0fdf..00000000000 --- a/build/pkgs/sqlite/distros/fedora.txt +++ /dev/null @@ -1,2 +0,0 @@ -sqlite-devel -sqlite diff --git a/build/pkgs/sqlite/distros/freebsd.txt b/build/pkgs/sqlite/distros/freebsd.txt deleted file mode 100644 index 4cbf4d685e0..00000000000 --- a/build/pkgs/sqlite/distros/freebsd.txt +++ /dev/null @@ -1 +0,0 @@ -databases/sqlite3 diff --git a/build/pkgs/sqlite/distros/gentoo.txt b/build/pkgs/sqlite/distros/gentoo.txt deleted file mode 100644 index 192f54b91b9..00000000000 --- a/build/pkgs/sqlite/distros/gentoo.txt +++ /dev/null @@ -1 +0,0 @@ -dev-db/sqlite diff --git a/build/pkgs/sqlite/distros/homebrew.txt b/build/pkgs/sqlite/distros/homebrew.txt deleted file mode 100644 index 532c6c608dd..00000000000 --- a/build/pkgs/sqlite/distros/homebrew.txt +++ /dev/null @@ -1 +0,0 @@ -sqlite diff --git a/build/pkgs/sqlite/distros/macports.txt b/build/pkgs/sqlite/distros/macports.txt deleted file mode 100644 index 8b2f60c6f09..00000000000 --- a/build/pkgs/sqlite/distros/macports.txt +++ /dev/null @@ -1 +0,0 @@ -sqlite3 diff --git a/build/pkgs/sqlite/distros/nix.txt b/build/pkgs/sqlite/distros/nix.txt deleted file mode 100644 index 532c6c608dd..00000000000 --- a/build/pkgs/sqlite/distros/nix.txt +++ /dev/null @@ -1 +0,0 @@ -sqlite diff --git a/build/pkgs/sqlite/distros/opensuse.txt b/build/pkgs/sqlite/distros/opensuse.txt deleted file mode 100644 index 80861d24415..00000000000 --- a/build/pkgs/sqlite/distros/opensuse.txt +++ /dev/null @@ -1 +0,0 @@ -pkgconfig(sqlite3) diff --git a/build/pkgs/sqlite/distros/repology.txt b/build/pkgs/sqlite/distros/repology.txt deleted file mode 100644 index 532c6c608dd..00000000000 --- a/build/pkgs/sqlite/distros/repology.txt +++ /dev/null @@ -1 +0,0 @@ -sqlite diff --git a/build/pkgs/sqlite/distros/slackware.txt b/build/pkgs/sqlite/distros/slackware.txt deleted file mode 100644 index 5a9494c03ec..00000000000 --- a/build/pkgs/sqlite/distros/slackware.txt +++ /dev/null @@ -1,2 +0,0 @@ -sqlite -icu4c diff --git a/build/pkgs/sqlite/distros/void.txt b/build/pkgs/sqlite/distros/void.txt deleted file mode 100644 index 6ec2f7b0ba4..00000000000 --- a/build/pkgs/sqlite/distros/void.txt +++ /dev/null @@ -1 +0,0 @@ -sqlite-devel diff --git a/build/pkgs/sqlite/package-version.txt b/build/pkgs/sqlite/package-version.txt deleted file mode 100644 index 0b477b458f2..00000000000 --- a/build/pkgs/sqlite/package-version.txt +++ /dev/null @@ -1 +0,0 @@ -3.36.0 diff --git a/build/pkgs/sqlite/spkg-configure.m4 b/build/pkgs/sqlite/spkg-configure.m4 deleted file mode 100644 index 5fe929ea03b..00000000000 --- a/build/pkgs/sqlite/spkg-configure.m4 +++ /dev/null @@ -1,40 +0,0 @@ -SAGE_SPKG_CONFIGURE([sqlite], [ - m4_pushdef([SAGE_SQLITE3_MIN_VERSION_MAJOR], [3]) - m4_pushdef([SAGE_SQLITE3_MIN_VERSION_MINOR], [8]) - m4_pushdef([SAGE_SQLITE3_MIN_VERSION_MICRO], [7]) - m4_pushdef([SAGE_SQLITE3_MIN_VERSION], [SAGE_SQLITE3_MIN_VERSION_MAJOR.SAGE_SQLITE3_MIN_VERSION_MINOR.SAGE_SQLITE3_MIN_VERSION_MICRO]) - AC_MSG_CHECKING([libsqlite3 >= sqlite3_min_version]) - dnl https://www.sqlite.org/c3ref/libversion.html - dnl https://www.sqlite.org/c3ref/c_source_id.html - SQLITE_SAVED_LIBS="$LIBS" - LIBS="$LIBS -lsqlite3" - AC_RUN_IFELSE([ - AC_LANG_PROGRAM([[ - #include - #include - #include - #include - ]], - [[ - assert( strcmp(sqlite3_libversion(),SQLITE_VERSION)==0 ); - if (SQLITE_VERSION_NUMBER < ]]SAGE_SQLITE3_MIN_VERSION_MAJOR[[*1000000 + ]]SAGE_SQLITE3_MIN_VERSION_MINOR[[*1000 + ]]SAGE_SQLITE3_MIN_VERSION_MICRO[[) - exit(1); - else - exit(0); - ]]) - ], - [AC_MSG_RESULT([yes])], - [AC_MSG_RESULT([no]) - LIBS="$SQLITE_SAVED_LIBS" - sage_spkg_install_sqlite=yes], - [AC_MSG_RESULT([cross compiling. assume yes])]) - m4_popdef([SAGE_SQLITE3_MIN_VERSION_MAJOR]) - m4_popdef([SAGE_SQLITE3_MIN_VERSION_MINOR]) - m4_popdef([SAGE_SQLITE3_MIN_VERSION_MICRO]) - m4_popdef([SAGE_SQLITE3_MIN_VERSION]) -], [dnl REQUIRED-CHECK - AC_REQUIRE([SAGE_SPKG_CONFIGURE_PYTHON3]) - AS_IF([test x$sage_spkg_install_python3 = xno], [ - sage_require_sqlite=no - ]) -]) diff --git a/build/pkgs/sqlite/spkg-install.in b/build/pkgs/sqlite/spkg-install.in deleted file mode 100644 index 4035b56733d..00000000000 --- a/build/pkgs/sqlite/spkg-install.in +++ /dev/null @@ -1,10 +0,0 @@ -cd src - -export CPPFLAGS="$CPPFLAGS -I$SAGE_LOCAL/include" - -# Issue #32646: configure script does not have --disable-maintainer-mode -touch configure */configure Makefile.in - -sdh_configure -sdh_make -sdh_make_install diff --git a/build/pkgs/sqlite/type b/build/pkgs/sqlite/type deleted file mode 100644 index a6a7b9cd726..00000000000 --- a/build/pkgs/sqlite/type +++ /dev/null @@ -1 +0,0 @@ -standard diff --git a/build/pkgs/symmetrica/dependencies b/build/pkgs/symmetrica/dependencies deleted file mode 100644 index eb5b66f34f2..00000000000 --- a/build/pkgs/symmetrica/dependencies +++ /dev/null @@ -1,6 +0,0 @@ -| xz - -xz is needed for unpacking the tarball when sage-bootstrap-python is ancient - ----------- -All lines of this file are ignored except the first. diff --git a/build/pkgs/xz/SPKG.rst b/build/pkgs/xz/SPKG.rst deleted file mode 100644 index a5f56b22e69..00000000000 --- a/build/pkgs/xz/SPKG.rst +++ /dev/null @@ -1,23 +0,0 @@ -xz: General-purpose data compression software -============================================= - -Description ------------ - -XZ Utils is free general-purpose data compression software with a high -compression ratio. - -License -------- - -Some parts public domain, other parts GNU LGPLv2.1, GNU GPLv2, or GNU -GPLv3. - - -Upstream Contact ----------------- - -http://tukaani.org/xz/ - -Dependencies ------------- diff --git a/build/pkgs/xz/checksums.ini b/build/pkgs/xz/checksums.ini deleted file mode 100644 index 6e4c2226c96..00000000000 --- a/build/pkgs/xz/checksums.ini +++ /dev/null @@ -1,4 +0,0 @@ -tarball=xz-VERSION.tar.gz -sha1=fa2ae4db119f639a01b02f99f1ba671ece2828eb -sha256=f6f4910fd033078738bd82bfba4f49219d03b17eb0794eb91efbae419f4aba10 -upstream_url=https://tukaani.org/xz/xz-VERSION.tar.gz diff --git a/build/pkgs/xz/dependencies b/build/pkgs/xz/dependencies deleted file mode 100644 index 4f00de20375..00000000000 --- a/build/pkgs/xz/dependencies +++ /dev/null @@ -1,4 +0,0 @@ -# no dependencies - ----------- -All lines of this file are ignored except the first. diff --git a/build/pkgs/xz/distros/alpine.txt b/build/pkgs/xz/distros/alpine.txt deleted file mode 100644 index d66e95ca507..00000000000 --- a/build/pkgs/xz/distros/alpine.txt +++ /dev/null @@ -1 +0,0 @@ -xz diff --git a/build/pkgs/xz/distros/conda.txt b/build/pkgs/xz/distros/conda.txt deleted file mode 100644 index d66e95ca507..00000000000 --- a/build/pkgs/xz/distros/conda.txt +++ /dev/null @@ -1 +0,0 @@ -xz diff --git a/build/pkgs/xz/distros/debian.txt b/build/pkgs/xz/distros/debian.txt deleted file mode 100644 index 4b3b46661f7..00000000000 --- a/build/pkgs/xz/distros/debian.txt +++ /dev/null @@ -1,2 +0,0 @@ -xz-utils -# pixz # provides pixz but not xz on debian buster diff --git a/build/pkgs/xz/distros/fedora.txt b/build/pkgs/xz/distros/fedora.txt deleted file mode 100644 index d66e95ca507..00000000000 --- a/build/pkgs/xz/distros/fedora.txt +++ /dev/null @@ -1 +0,0 @@ -xz diff --git a/build/pkgs/xz/distros/homebrew.txt b/build/pkgs/xz/distros/homebrew.txt deleted file mode 100644 index d66e95ca507..00000000000 --- a/build/pkgs/xz/distros/homebrew.txt +++ /dev/null @@ -1 +0,0 @@ -xz diff --git a/build/pkgs/xz/distros/macports.txt b/build/pkgs/xz/distros/macports.txt deleted file mode 100644 index d66e95ca507..00000000000 --- a/build/pkgs/xz/distros/macports.txt +++ /dev/null @@ -1 +0,0 @@ -xz diff --git a/build/pkgs/xz/distros/opensuse.txt b/build/pkgs/xz/distros/opensuse.txt deleted file mode 100644 index d66e95ca507..00000000000 --- a/build/pkgs/xz/distros/opensuse.txt +++ /dev/null @@ -1 +0,0 @@ -xz diff --git a/build/pkgs/xz/distros/repology.txt b/build/pkgs/xz/distros/repology.txt deleted file mode 100644 index d66e95ca507..00000000000 --- a/build/pkgs/xz/distros/repology.txt +++ /dev/null @@ -1 +0,0 @@ -xz diff --git a/build/pkgs/xz/distros/slackware.txt b/build/pkgs/xz/distros/slackware.txt deleted file mode 100644 index d66e95ca507..00000000000 --- a/build/pkgs/xz/distros/slackware.txt +++ /dev/null @@ -1 +0,0 @@ -xz diff --git a/build/pkgs/xz/distros/void.txt b/build/pkgs/xz/distros/void.txt deleted file mode 100644 index d66e95ca507..00000000000 --- a/build/pkgs/xz/distros/void.txt +++ /dev/null @@ -1 +0,0 @@ -xz diff --git a/build/pkgs/xz/package-version.txt b/build/pkgs/xz/package-version.txt deleted file mode 100644 index 462faf74854..00000000000 --- a/build/pkgs/xz/package-version.txt +++ /dev/null @@ -1 +0,0 @@ -5.2.5 diff --git a/build/pkgs/xz/spkg-check.in b/build/pkgs/xz/spkg-check.in deleted file mode 100644 index 917c8eb7209..00000000000 --- a/build/pkgs/xz/spkg-check.in +++ /dev/null @@ -1,3 +0,0 @@ -cd src - -$MAKE check diff --git a/build/pkgs/xz/spkg-configure.m4 b/build/pkgs/xz/spkg-configure.m4 deleted file mode 100644 index 88bf36bb925..00000000000 --- a/build/pkgs/xz/spkg-configure.m4 +++ /dev/null @@ -1,22 +0,0 @@ -SAGE_SPKG_CONFIGURE([xz], [ - AC_CACHE_CHECK([for xz >= 4.999.0], [ac_cv_path_XZ], [ - AC_PATH_PROGS_FEATURE_CHECK([XZ], [xz], [ - xz_version=`$ac_path_XZ --version 2>&1 | cut -d' ' -f4 | $SED -n 1p` - AS_IF([test -n "$xz_version"], [ - AX_COMPARE_VERSION([$xz_version], [ge], [4.999.0], [ - ac_cv_path_XZ="$ac_path_XZ" - ac_path_XZ_found=: - ]) - ]) - ]) - AS_IF([test -z "$ac_cv_path_XZ"], [sage_spkg_install_xz=yes]) - ]) -], [dnl REQUIRED-CHECK - dnl Issue #30948: All dependencies on "xz" are merely build-time dependencies - dnl on the xz binary (for unpacking the tarball in sage_bootstrap.uncompress.tar_file - dnl - when sage-bootstrap-python is so old that it cannot do that by itself). - dnl Packages that depend on actual xz or liblzma should depend on the liblzma spkg. - AS_IF(["$SAGE_BOOTSTRAP_PYTHON" -c "import lzma" 2>& AS_MESSAGE_LOG_FD], [ - sage_require_xz=no - ]) -]) diff --git a/build/pkgs/xz/spkg-install.in b/build/pkgs/xz/spkg-install.in deleted file mode 100644 index a863950189e..00000000000 --- a/build/pkgs/xz/spkg-install.in +++ /dev/null @@ -1,5 +0,0 @@ -cd src - -sdh_configure -sdh_make -sdh_make_install diff --git a/build/pkgs/xz/type b/build/pkgs/xz/type deleted file mode 100644 index a6a7b9cd726..00000000000 --- a/build/pkgs/xz/type +++ /dev/null @@ -1 +0,0 @@ -standard diff --git a/build/sage_bootstrap/creator.py b/build/sage_bootstrap/creator.py index e16002f12f9..f083e75f3cd 100644 --- a/build/sage_bootstrap/creator.py +++ b/build/sage_bootstrap/creator.py @@ -127,9 +127,9 @@ def set_python_data_and_scripts(self, pypi_package_name=None, source='normal', d else: dependencies = '' if source == 'wheel': - dependencies_order_only = 'pip $(PYTHON)' + dependencies_order_only = 'pip' else: - dependencies_order_only = '$(PYTHON_TOOLCHAIN) $(PYTHON)' + dependencies_order_only = '$(PYTHON_TOOLCHAIN)' f.write(dependencies + ' | ' + dependencies_order_only + '\n\n') f.write('----------\nAll lines of this file are ignored except the first.\n') if source == 'normal': diff --git a/build/sage_bootstrap/expand_class.py b/build/sage_bootstrap/expand_class.py index c5bab8a313e..565e23d77ea 100644 --- a/build/sage_bootstrap/expand_class.py +++ b/build/sage_bootstrap/expand_class.py @@ -77,7 +77,7 @@ def include_recursive_dependencies(names, package_name): pkg = Package(package_name) except FileNotFoundError: # Silently ignore unknown packages, - # substitutions such as $(BLAS) $(PYTHON), + # substitutions such as $(BLAS) # and optional dependencies of the form $(find-string ...). return names.add(package_name) diff --git a/build/sage_bootstrap/flock.py b/build/sage_bootstrap/flock.py index bc95a0ecf8f..872fb7d617f 100644 --- a/build/sage_bootstrap/flock.py +++ b/build/sage_bootstrap/flock.py @@ -1,4 +1,4 @@ -#!/usr/bin/env sage-bootstrap-python +#!/usr/bin/env python3 # vim: set filetype=python: """ This script runs the given command under a file lock (similar to the flock diff --git a/build/setup.py b/build/setup.py index b05dcc386ca..16f4ccda4a3 100755 --- a/build/setup.py +++ b/build/setup.py @@ -1,4 +1,4 @@ -#!/usr/bin/env sage-bootstrap-python +#!/usr/bin/env python3 from distutils.core import setup @@ -12,7 +12,7 @@ 'sage_bootstrap.download', 'sage_bootstrap.compat' ], - scripts=['bin/sage-package', 'bin/sage-download-file', 'bin/sage-bootstrap-python'], + scripts=['bin/sage-package', 'bin/sage-download-file'], version='1.0', url='https://www.sagemath.org', ) diff --git a/build/test/runnable.py b/build/test/runnable.py index 75edc551fd6..6424725f60d 100755 --- a/build/test/runnable.py +++ b/build/test/runnable.py @@ -1,4 +1,4 @@ -#!/usr/bin/env sage-bootstrap-python +#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Utility to test running with different values for ``SAGE_BOOTSTRAP`` diff --git a/configure.ac b/configure.ac index 960b59c41cc..44a0f4efaaf 100644 --- a/configure.ac +++ b/configure.ac @@ -80,8 +80,7 @@ if test "$SAGE_LOCAL" = NONE; then SAGE_LOCAL=local if test -x "$SAGE_LOCAL"/bin/python3; then # Incremental build with an existing installation of python3 spkg - # in SAGE_LOCAL or venv in SAGE_LOCAL. Keep old behavior. - SAGE_VENV_AUTO=no + AC_MSG_ERROR([A stale Python3 found in SAGE_LOCAL. Please remove local/ and try again.]) else SAGE_VENV_AUTO=yes fi @@ -319,6 +318,7 @@ if test -z "$MAKE"; then fi m4_pushdef([SAGE_PREREQ_URL],[See https://doc.sagemath.org/html/en/reference/spkg/_prereq.html]) +m4_pushdef([SAGE_BOOTSTRAP_URL],[See https://doc.sagemath.org/html/en/reference/spkg/_bootstrap.html]) # check for boost, hopefully supporting c++17 AX_BOOST_BASE([1.66.0], [], [ @@ -369,13 +369,93 @@ esac AC_CHECK_HEADER([zlib.h], [], [AC_MSG_ERROR([cannot find libz headers. $SAGE_PREREQ_URL])]) -# Check for system python -AC_MSG_CHECKING([for Python]) -if SAGE_BOOTSTRAP_PYTHON=$(build/bin/sage-bootstrap-python -c "import sys; print(sys.executable)"); then - AC_MSG_RESULT([$SAGE_BOOTSTRAP_PYTHON]) -else - AC_MSG_ERROR([You do not have a suitable version of Python installed]) -fi +# check for liblzma + +PKG_CHECK_MODULES([liblzma], [liblzma], [], [ + AC_MSG_ERROR([liblzma should be provided. SAGE_BOOTSTRAP_URL])]) + +######################################################################## +# Check for Python 3 for venv (required system package) +######################################################################## + +m4_pushdef([PYTHON_MIN_VERSION], [3.12.0]) +m4_pushdef([PYTHON_LT_VERSION], [3.15.0]) + +AC_ARG_WITH([python], + [AS_HELP_STRING([--with-python=PYTHON3], + [Python 3 executable to use for the Sage venv; default: python3])]) +AS_IF([test x"$with_python" = x2], [AC_MSG_ERROR([Sage cannot be built on Python 2. Exiting.])]) +AS_IF([test x"$with_python" = x3], [ + AC_MSG_NOTICE([The meaning of the option --with-python has changed in Sage 9.2. Ignoring.]) + with_python='' +]) +AS_IF([test x"$with_python" = x"no"], + [AC_MSG_ERROR([building Sage --without-python is not supported])]) + +ac_path_PYTHON3="$with_python" +check_modules="sqlite3, ctypes, math, hashlib, socket, ssl, ensurepip, zlib" + +AC_CACHE_CHECK([for python3 >= ]PYTHON_MIN_VERSION[, < ]PYTHON_LT_VERSION[ with modules $check_modules], [ac_cv_path_PYTHON3], [ + AS_IF([test x"$ac_path_PYTHON3" != x], [dnl checking explicitly specified $with_python + AC_MSG_RESULT([]) + AC_PATH_PROG([ac_path_PYTHON3], [$ac_path_PYTHON3]) + SAGE_CHECK_PYTHON_FOR_VENV([$ac_path_PYTHON3], + PYTHON_MIN_VERSION, PYTHON_LT_VERSION, + $check_modules, [ + dnl It is good + ac_cv_path_PYTHON3="$ac_path_PYTHON3" + ac_path_PYTHON3_found=: + AC_MSG_RESULT([yes]) + dnl introduction for AC_MSG_RESULT printed by AC_CACHE_CHECK + AC_MSG_CHECKING([for python3 >= ]PYTHON_MIN_VERSION[, < ]PYTHON_LT_VERSION[ with modules $check_modules]) + ]) + AS_IF([test -z "$ac_cv_path_PYTHON3"], [ + AC_MSG_ERROR([the python3 selected using --with-python=$with_python is not suitable]) + ]) + ], [dnl checking the default system python3 + AC_MSG_RESULT([]) + AC_PATH_PROGS_FEATURE_CHECK([PYTHON3], [python3], [ + SAGE_CHECK_PYTHON_FOR_VENV([$ac_path_PYTHON3], + PYTHON_MIN_VERSION, PYTHON_LT_VERSION, + $check_modules, [ + dnl It is good + ac_cv_path_PYTHON3="$ac_path_PYTHON3" + ac_path_PYTHON3_found=: + AC_MSG_RESULT([yes]) + dnl introduction for AC_MSG_RESULT printed by AC_CACHE_CHECK + AC_MSG_CHECKING([for python3 >= ]PYTHON_MIN_VERSION[, < ]PYTHON_LT_VERSION[ with modules $check_modules]) + ]) + ]) + ]) +]) + +AS_IF([test -z "$ac_cv_path_PYTHON3"], [ + AC_MSG_NOTICE([No suitable system Python found.]) + AC_MSG_NOTICE([Please install Python >= ]PYTHON_MIN_VERSION[ and < ]PYTHON_LT_VERSION[ with the following modules: $check_modules]) + AC_MSG_NOTICE([You can also specify a Python executable using --with-python=/path/to/python3]) + AC_MSG_ERROR([A suitable system Python is required to build Sage.]) +]) + +PYTHON_FOR_VENV="$ac_cv_path_PYTHON3" +AC_SUBST([PYTHON_FOR_VENV]) + +dnl Set PYTHON_VERSION based on the found system python +PYTHON_VERSION=$("$PYTHON_FOR_VENV" -c "import sysconfig; print(sysconfig.get_python_version())") +AC_SUBST([PYTHON_MINOR], [$(echo $PYTHON_VERSION | cut -d. -f2)]) +export PYTHON_MINOR + +dnl Handle SAGE_VENV configuration +AS_VAR_IF([SAGE_VENV], [auto], [SAGE_VENV=$SAGE_VENV_AUTO]) +AS_CASE([$SAGE_VENV], + [no], [SAGE_VENV='${SAGE_LOCAL}'],dnl Quoted so that it is resolved at build time by shell/Makefile + [yes], [SAGE_VENV='${SAGE_LOCAL}'/var/lib/sage/venv-python$PYTHON_VERSION] +) + +dnl Clean up temporary directories created by the check +rm -rf conftest.dir conftest_venv + +m4_popdef([PYTHON_MIN_VERSION]) +m4_popdef([PYTHON_LT_VERSION]) # Check that perl is available, with version 5.8.0 or later. # Some packages need perl, however it is not clear whether Sage really diff --git a/m4/sage_check_python_for_venv.m4 b/m4/sage_check_python_for_venv.m4 index 0af447c12c8..25e258c5992 100644 --- a/m4/sage_check_python_for_venv.m4 +++ b/m4/sage_check_python_for_venv.m4 @@ -85,12 +85,14 @@ AC_DEFUN([SAGE_PYTHON_CHECK_DISTUTILS], [ m4_pushdef([COMMANDS_IF_DISTUTILS_GOOD], [$2]) m4_pushdef([COMMANDS_IF_DISTUTILS_NOT_GOOD], [$3]) SAGE_PYTHON_DISTUTILS_C_CONFTEST + dnl Run the test in conftest.dir to avoid reading the main pyproject.toml dnl (echo "***ENV***:"; env; echo "***SYSCONFIG***"; conftest_venv/bin/python3 -m sysconfig) >& AS_MESSAGE_LOG_FD - echo PYTHON_EXE conftest.py --verbose build --build-base=conftest.dir >& AS_MESSAGE_LOG_FD - AS_IF([PYTHON_EXE conftest.py --verbose build --build-base=conftest.dir >& AS_MESSAGE_LOG_FD 2>&1 ], [ + conftest_python_exe_abs="$PWD/conftest_venv/bin/python3" + echo "(cd conftest.dir && $conftest_python_exe_abs conftest.py --verbose build --build-base=build)" >& AS_MESSAGE_LOG_FD + AS_IF([(cd conftest.dir && $conftest_python_exe_abs conftest.py --verbose build --build-base=build) >& AS_MESSAGE_LOG_FD 2>&1 ], [ SAGE_PYTHON_DISTUTILS_CXX_CONFTEST - echo PYTHON_EXE conftest.py --verbose build --build-base=conftest.dir >& AS_MESSAGE_LOG_FD 2>&1 - AS_IF([PYTHON_EXE conftest.py --verbose build --build-base=conftest.dir >& AS_MESSAGE_LOG_FD 2>&1 ], [ + echo "(cd conftest.dir && $conftest_python_exe_abs conftest.py --verbose build --build-base=build)" >& AS_MESSAGE_LOG_FD 2>&1 + AS_IF([(cd conftest.dir && $conftest_python_exe_abs conftest.py --verbose build --build-base=build) >& AS_MESSAGE_LOG_FD 2>&1 ], [ COMMANDS_IF_DISTUTILS_GOOD], [ reason="distutils cannot build a C++ 11 extension" COMMANDS_IF_DISTUTILS_NOT_GOOD @@ -104,9 +106,10 @@ AC_DEFUN([SAGE_PYTHON_CHECK_DISTUTILS], [ m4_popdef([COMMANDS_IF_DISTUTILS_NOT_GOOD]) ]) -dnl Write conftest.py and conftest.c +dnl Write conftest.py and conftest.c in conftest.dir directory AC_DEFUN([SAGE_PYTHON_DISTUTILS_C_CONFTEST], [ - rm -rf conftest.* + rm -rf conftest.dir + mkdir -p conftest.dir AC_LANG_PUSH([C]) AC_LANG_CONFTEST([ AC_LANG_SOURCE([[ @@ -134,7 +137,8 @@ PyInit_spam(void) ]]) ]) AC_LANG_POP([C]) - cat > conftest.py < conftest.dir/conftest.py < conftest.py < conftest.dir/conftest.py < diff --git a/src/doc/en/developer/packaging.rst b/src/doc/en/developer/packaging.rst index 6b694d2e41f..d7b712bc85a 100644 --- a/src/doc/en/developer/packaging.rst +++ b/src/doc/en/developer/packaging.rst @@ -325,28 +325,12 @@ Likewise for :envvar:`CXXFLAGS`, :envvar:`FCFLAGS`, and :envvar:`F77FLAGS`. code should go in a separate file (e.g. ``spkg-install.py``), and can then be executed from the real ``spkg-install.in`` like: - .. code-block:: text - - exec sage-bootstrap-python spkg-install.py - - or - .. code-block:: text exec python3 spkg-install.py - In more detail: ``sage-bootstrap-python`` runs a version of Python - pre-installed on the machine, which is a build prerequisite of Sage. - Note that ``sage-bootstrap-python`` accepts a wide range of Python - versions, Python >= 2.6 and >= 3.4, see :sage_root:`build/tox.ini` - for details. You should only use ``sage-bootstrap-python`` for - installation tasks that must be able to run before Sage has made - ``python3`` available. It must not be used for running ``pip`` or - ``setup.py`` for any package. - - ``python3`` runs the version of Python managed by Sage (either its - own installation of Python 3 from an SPKG or a venv over a system - python3. You should use this if you are installing a Python package + ``python3`` runs from the venv over a system python3. + You should use this if you are installing a Python package to make sure that the libraries are installed in the right place. Many packages currently do not separate the build and install steps and only diff --git a/src/doc/en/developer/portability_testing.rst b/src/doc/en/developer/portability_testing.rst index 51598f2015f..100d6c158b1 100644 --- a/src/doc/en/developer/portability_testing.rst +++ b/src/doc/en/developer/portability_testing.rst @@ -1006,7 +1006,7 @@ The ``local-homebrew-macos-standard-python3_xcode`` environment installs the same packages, but uses XCode's ``/usr/bin/python3``. The ``local-homebrew-macos-standard-python3_pythonorg`` expects an -installation of Python 3.10 in +installation of a supported Python 3.12+ release in ``/Library/Frameworks/Python.framework``; this is where the binary packages provided by python.org install themselves. @@ -1409,4 +1409,3 @@ dev container, to use Sage in a terminal, `open a new terminal in VS Code `_, type ``sage`` and hit :kbd:`Enter`. (Do not use ``./sage``; this will not work because the source tree is not configured.) - diff --git a/src/doc/en/faq/faq-usage.rst b/src/doc/en/faq/faq-usage.rst index 5976f73a6f5..31e734d7606 100644 --- a/src/doc/en/faq/faq-usage.rst +++ b/src/doc/en/faq/faq-usage.rst @@ -89,43 +89,42 @@ in case of crashes or hangs. More details may be found in `Installation Manual `_. -How to get Sage's Python to recognize my system's Tcl/Tk install? -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +How to get Sage to recognize my system's Tcl/Tk install? +"""""""""""""""""""""""""""""""""""""""""""""""""""""""" -It may be that you have Tcl/Tk installed and that your system's Python -recognizes it but Sage's Python does not. Normally speaking, there is little -need to build Sage's Python nowadays (anno 2023), but if you do, here it is. -Make sure you installed the Tcl/Tk development library. On Ubuntu, this is the -command +Sage uses the Python interpreter selected at build time. To use Tcl/Tk +libraries in Sage, make sure that this Python installation provides the +``tkinter`` module. On Ubuntu, this is usually done by installing .. code-block:: console - $ sudo apt-get install tk8.5-dev + $ sudo apt-get install python3-tk + +or a similarly named package such as ``python3-tkinter``. -or something along that line. Next, reinstall Sage's Python: +If you are using an external Python, first check that exact interpreter: .. code-block:: console - $ make python3-clean python3-uninstall && make python3 + $ "$PYTHON3" -c "import tkinter" -This will pick up the Tcl/Tk library automatically. After successfully -reinstalling Sage's Python, from within the Sage command line interface, -issue these commands: +After rebuilding or reinstalling Sage against that Python, you can also check +from the Sage command line interface that Tcl/Tk is available: -.. CODE-BLOCK:: python +.. code-block:: python - import _tkinter - import Tkinter + import tkinter -If they do not raise an :class:`ImportError` then it worked. +If this does not raise an :class:`ImportError`, then it worked. How do I import Sage into a Python script? """""""""""""""""""""""""""""""""""""""""" You can import Sage as a library in a Python script. One caveat is -that you need to run that Python script using the version of Python -that is bundled with Sage (Sage 9.2 ships with Python 3.7.x). +that you need to run that Python script inside Sage's Python +environment. In a source build, Sage creates this environment from the +external Python selected at build time. To import Sage, put the following in your Python script: .. CODE-BLOCK:: python @@ -133,9 +132,8 @@ To import Sage, put the following in your Python script: from sage.all import * When you want to run your script, you need to invoke Sage with the -option ``-python`` which would run your script using the version of -Python that comes with Sage. For example, if Sage is in your ``PATH`` -variable then you can do this: +option ``-python`` which runs your script inside that environment. For +example, if Sage is in your ``PATH`` variable then you can do this: .. code-block:: console diff --git a/src/doc/en/installation/source-distro.rst b/src/doc/en/installation/source-distro.rst index 2936d52c9dc..dcaf1937207 100644 --- a/src/doc/en/installation/source-distro.rst +++ b/src/doc/en/installation/source-distro.rst @@ -326,52 +326,66 @@ Then SageMath will be built either using the compilers provided by the operating system, or its own compilers. -Tcl/Tk (and system's Python) -^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Using an external Python installed by uv +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -If you want to use `Tcl/Tk `_ libraries in Sage, and you -are going to use your OS's Python3 as Sage's Python, you merely need to install -its **Tkinter** module. On Linux systems, it is usually provided by the -**python3-tk** or a similarly named (e.g. **python3-tkinter**) package, -which can be installed using:: +If you want Sage's classical ``./configure && make`` build to use an +external Python that is not provided by your system package manager, you can +install one with `uv `_. - $ sudo apt-get install python3-tk +Sage no longer builds its own Python interpreter, so you need to provide one +either from your system package manager or from a tool such as ``uv``. -or similar commands. +Sage's ``./configure`` currently accepts Python versions in the range +``>= 3.12`` and ``< 3.15``. It also checks that the interpreter provides the +modules ``sqlite3``, ``ctypes``, ``math``, ``hashlib``, ``socket``, ``ssl``, +``ensurepip``, and ``zlib``. -Tcl/Tk (and Sage's own Python) -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +On Python 3.12 and newer, Sage additionally checks for ``setuptools`` because +``distutils`` was removed from the Python standard library. The configure test +creates a fresh virtual environment from the selected interpreter and then +imports ``setuptools`` there before compiling small C and C++ extension +modules. Therefore it is not enough to install ``setuptools`` into an +unrelated project environment; it needs to be available from the Python +interpreter that you pass to ``./configure``. -If you want to use `Tcl/Tk `_ libraries in Sage, -and you are going to build Sage's Python from source, you need to install -these, and the corresponding headers. -On Linux systems, these are usually provided by the **tk** and **tk-dev** -(or **tk-devel**) packages which can be installed using:: +For a ``uv``-managed Python, ``uv`` marks the interpreter as externally +managed, so installing ``setuptools`` into it requires +``--break-system-packages``. Also, ``--with-python`` should point to the +actual Python executable path. One way to prepare such a Python is:: - $ sudo apt-get install tk tk-dev + $ uv python install 3.13 + $ PYTHON3="$(uv python find --managed-python --resolve-links 3.13)" + $ uv pip install --python "$PYTHON3" --break-system-packages setuptools + $ ./configure --with-python="$PYTHON3" -or similar commands. +You can replace ``3.13`` by another supported minor version such as ``3.12`` +or ``3.14``. After ``./configure`` succeeds, continue with the usual build +step:: + $ make -Sage's Python will then automatically recognize your system's install of Tcl/Tk. -If you installed Sage first, all is not lost. You just need to rebuild -Sage's Python and any part of Sage relying on it:: - $ sage -f python3 # rebuild Python3 - $ make # rebuild components of Sage depending on Python +Tcl/Tk +^^^^^^ -after installing the Tcl/Tk development libraries as above. +If you want to use `Tcl/Tk `_ libraries in Sage, make sure +that the Python installation used by Sage provides the **Tkinter** module. On +Linux systems, it is usually provided by the +**python3-tk** or a similarly named (e.g. **python3-tkinter**) package, +which can be installed using:: -If + $ sudo apt-get install python3-tk -.. skip +or similar commands. -.. code-block:: ipycon +If you are using an external Python, check that exact interpreter before +running ``./configure``:: - sage: import _tkinter - sage: import Tkinter + $ "$PYTHON3" -c "import tkinter" -does not raise an :class:`ImportError`, then it worked. +If this command raises an :class:`ImportError`, then the selected Python does +not provide Tcl/Tk support yet. .. _build-from-source-step-by-step: diff --git a/src/doc/it/faq/faq-usage.rst b/src/doc/it/faq/faq-usage.rst index 2ff786d4e0f..ec02019ce53 100644 --- a/src/doc/it/faq/faq-usage.rst +++ b/src/doc/it/faq/faq-usage.rst @@ -80,24 +80,23 @@ processori/core del tuo sistema. Come posso far riconoscere la mia attuale installazione di Tcl/Tk all'interprete Python di Sage? """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -Potresti avere la libreria Tcl/Tk installata e l'interprete Python del -tuo sistema la riconosce ma l'interprete Python di Sage no. Ad oggi (2023) -solitamente non c'è bisogno di compilare l'interprete Python di Sage, ma se ne -hai bisogno, segui queste istruzioni. Controlla di aver installato la libreria -di sviluppp Tcl/Tk. Su Ubuntu lancia, da riga di comando:: +Sage usa l'interprete Python selezionato in fase di compilazione. Per usare +le librerie Tcl/Tk in Sage, assicurati che questa installazione di Python +fornisca il modulo ``tkinter``. Su Ubuntu, questo di solito si ottiene +installando:: - sudo apt-get install tk8.5-dev + sudo apt-get install python3-tk -o qualcosa di simile. Poi reinstalla l'interprete Python di Sage con:: +o un pacchetto con un nome simile, ad esempio ``python3-tkinter``. - make python3-clean python3-uninstall && make python3 +Se stai usando un Python esterno, controlla prima proprio quell'interprete:: -Questo aggancerà automaticamente la libreria Tcl/Tk. -Dopo aver reinstallato correttamente l'interprete Python di Sage, -lancia i seguenti comandi dall'interfaccia a riga di comando di Sage:: + "$PYTHON3" -c "import tkinter" - import _tkinter - import Tkinter +Dopo aver ricompilato o reinstallato Sage con quell'interprete, puoi anche +controllare dalla riga di comando di Sage che Tcl/Tk sia disponibile:: + + import tkinter Se non ti viene segnalato alcun errore di :class:`ImportError` allora il problema è risolto. @@ -108,16 +107,17 @@ Come faccio ad importare Sage in uno script Python? Puoi importare Sage in uno script Python come faresti con una libreria. La cosa a cui fare attenzione è che devi lanciare quello script Python -usando l'interprete Python interno a Sage -(versione 3.7.x per Sage 9.2). +all'interno dell'ambiente Python di Sage. In una build da sorgente, +Sage crea questo ambiente a partire dall'interprete Python esterno +selezionato in fase di compilazione. Per importare Sage metti la seguente istruzione in cima al tuo script Python:: from sage.all import * Quando poi esegui il tuo script devi lanciare Sage con l'opzione -``-python`` che farà sì che venga eseguito dalla versione -dell'interprete interna a Sage. Ad esempio, se Sage è nella tua +``-python`` che farà sì che venga eseguito in questo ambiente +Python. Ad esempio, se Sage è nella tua variabile d'ambiente ``PATH``, puoi scrivere:: sage -python /path/to/my/script.py diff --git a/src/sage/tests/cmdline.py b/src/sage/tests/cmdline.py index 8edf9a27c5b..56fc16a205c 100644 --- a/src/sage/tests/cmdline.py +++ b/src/sage/tests/cmdline.py @@ -39,7 +39,6 @@ --ipynb2rst --sh --singular ---sqlite3 --standard --startuptime -t @@ -176,11 +175,11 @@ Test ``sage --info [packages]``:: sage: # optional - sage_spkg - sage: out, err, ret = check_executable(["sage", "--info", "sqlite"]) + sage: out, err, ret = check_executable(["sage", "--info", "pari"]) sage: print(out) - sqlite... - SQLite is a software library that implements a self-contained, - serverless, zero-configuration, transactional SQL database engine. + pari... + PARI/GP is a widely used computer algebra system designed for fast + computations in number theory... ... sage: err '' @@ -521,6 +520,7 @@ sage: ret 0 + sage: # optional - sqlite3 sage: (out, err, ret) = check_executable(["sage", "--sqlite3", "--version"]) sage: out.startswith("3.") True diff --git a/tox.ini b/tox.ini index b0d5a40b158..8421ee1ce11 100644 --- a/tox.ini +++ b/tox.ini @@ -239,6 +239,8 @@ setenv = ubuntu-mantic: BASE_TAG=mantic ubuntu-noble: BASE_TAG=noble ubuntu-noble: IGNORE_MISSING_SYSTEM_PACKAGES=yes + ubuntu-resolute: BASE_TAG=resolute + ubuntu-resolute: IGNORE_MISSING_SYSTEM_PACKAGES=yes # # https://hub.docker.com/_/debian # debian-buster does not have libfreetype-dev (it only has libfreetype6-dev) @@ -300,6 +302,8 @@ setenv = fedora-39: BASE_TAG=39 fedora-40: BASE_TAG=40 fedora-41: BASE_TAG=41 + fedora-42: BASE_TAG=42 + fedora-43: BASE_TAG=43 # # https://hub.docker.com/r/scientificlinux/sl # @@ -321,6 +325,7 @@ setenv = centos-stream: BASE_TAG=stream centos-stream-8: BASE_TAG=stream8 centos-stream-9: BASE_TAG=stream9 + centos-stream-10: BASE_TAG=stream10 # # https://hub.docker.com/_/almalinux #