From 04dfcfcf3cdc775cad72545ad40736c160384ff5 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Thu, 28 Dec 2023 18:25:50 -0800 Subject: [PATCH 1/2] build/bin/sage-get-system-packages (install-requires[-toml], pip): Do not require ENABLE_SYSTEM_SITE_PACKAGES=yes --- bootstrap | 4 ++-- build/bin/sage-get-system-packages | 26 ++++++++++++++++---------- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/bootstrap b/bootstrap index 5070b5df44a..7d54c8e7734 100755 --- a/bootstrap +++ b/bootstrap @@ -108,8 +108,8 @@ EOF if test -f "$DIR/requirements.txt" -o -f "$DIR/install-requires.txt"; then # A Python package SPKG_TREE_VAR=SAGE_VENV - echo "define(>>>SPKG_INSTALL_REQUIRES_${pkgname}<<<, >>>$(echo $(ENABLE_SYSTEM_SITE_PACKAGES=yes sage-get-system-packages install-requires ${pkgname}))<<<)dnl" >> m4/sage_spkg_versions.m4 - echo "define(>>>SPKG_INSTALL_REQUIRES_${pkgname}<<<, >>>$(echo $(ENABLE_SYSTEM_SITE_PACKAGES=yes sage-get-system-packages install-requires-toml ${pkgname}))<<<)dnl" >> m4/sage_spkg_versions_toml.m4 + echo "define(>>>SPKG_INSTALL_REQUIRES_${pkgname}<<<, >>>$(echo $(sage-get-system-packages install-requires ${pkgname}))<<<)dnl" >> m4/sage_spkg_versions.m4 + echo "define(>>>SPKG_INSTALL_REQUIRES_${pkgname}<<<, >>>$(echo $(sage-get-system-packages install-requires-toml ${pkgname}))<<<)dnl" >> m4/sage_spkg_versions_toml.m4 fi fi spkg_finalizes="$spkg_finalizes diff --git a/build/bin/sage-get-system-packages b/build/bin/sage-get-system-packages index 1b8aae79c16..a65acc1ef06 100755 --- a/build/bin/sage-get-system-packages +++ b/build/bin/sage-get-system-packages @@ -47,16 +47,22 @@ case "$SYSTEM" in esac for PKG_BASE in $SPKGS; do - # Skip this package if it uses the SAGE_PYTHON_PACKAGE_CHECK - # macro and if --enable-system-site-packages was NOT passed - # to ./configure (or if ./configure has not yet been run). - SPKG_CONFIGURE="${SAGE_ROOT}/build/pkgs/${PKG_BASE}/spkg-configure.m4" - if [ -z "${ENABLE_SYSTEM_SITE_PACKAGES}" ]; then - if grep -q SAGE_PYTHON_PACKAGE_CHECK "${SPKG_CONFIGURE}" 2>/dev/null; - then - continue; - fi - fi + case "$SYSTEM:$ENABLE_SYSTEM_SITE_PACKAGES" in + install-requires*|pip*) + ;; + *:) + # Skip this package if it uses the SAGE_PYTHON_PACKAGE_CHECK + # macro and if --enable-system-site-packages was NOT passed + # to ./configure (or if ./configure has not yet been run). + SPKG_CONFIGURE="${SAGE_ROOT}/build/pkgs/${PKG_BASE}/spkg-configure.m4" + if grep -q SAGE_PYTHON_PACKAGE_CHECK "${SPKG_CONFIGURE}" 2>/dev/null; + then + continue + fi + ;; + *) + ;; + esac for NAME in $SYSTEM_PACKAGES_FILE_NAMES; do SYSTEM_PACKAGES_FILE="$SAGE_ROOT"/build/pkgs/$PKG_BASE/$NAME From 00ab9a3a92096c0b7bcfa4485d9ffe385e99d178 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 30 Dec 2023 16:12:10 -0800 Subject: [PATCH 2/2] build/bin/sage-get-system-packages: Add/update comments --- build/bin/sage-get-system-packages | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/build/bin/sage-get-system-packages b/build/bin/sage-get-system-packages index a65acc1ef06..bac1925f291 100755 --- a/build/bin/sage-get-system-packages +++ b/build/bin/sage-get-system-packages @@ -49,11 +49,15 @@ for PKG_BASE in $SPKGS; do case "$SYSTEM:$ENABLE_SYSTEM_SITE_PACKAGES" in install-requires*|pip*) + # This is output for installation of packages into a Python environment. + # So it's OK to use any Python packages. ;; *:) - # Skip this package if it uses the SAGE_PYTHON_PACKAGE_CHECK - # macro and if --enable-system-site-packages was NOT passed - # to ./configure (or if ./configure has not yet been run). + # --enable-system-site-packages was NOT passed to configure + # (or script was run outside of the sage-build-env). + # + # Skip this package if it uses the SAGE_PYTHON_PACKAGE_CHECK macro. + # SPKG_CONFIGURE="${SAGE_ROOT}/build/pkgs/${PKG_BASE}/spkg-configure.m4" if grep -q SAGE_PYTHON_PACKAGE_CHECK "${SPKG_CONFIGURE}" 2>/dev/null; then @@ -61,6 +65,8 @@ for PKG_BASE in $SPKGS; do fi ;; *) + # --enable-system-site-packages was passed to configure. + # So any package (Python, non-Python) is fine. ;; esac