diff --git a/bootstrap b/bootstrap index c4c50ad9e37..22a1b295930 100755 --- a/bootstrap +++ b/bootstrap @@ -73,7 +73,7 @@ AS_VAR_SET_IF([SAGE_ENABLE_$pkgname], [], [AS_VAR_SET([SAGE_ENABLE_$pkgname], [y *:none) # Issue #31163: Just an optional dummy package spkg_configures="$spkg_configures - AC_SUBST(SAGE_ENABLE_$pkgname, [if_installed])" +AC_SUBST(SAGE_ENABLE_$pkgname, [if_installed])" ;; *:*) spkg_configures="$spkg_configures @@ -98,24 +98,26 @@ $config" $config" fi done >> m4/sage_spkg_configures.m4 - cat >> m4/sage_spkg_configures.m4 <>>SPKG_INSTALL_REQUIRES_${pkgname}<<<, >>>$(echo $(sage-get-system-packages install-requires ${pkgname}))<<<)dnl" >> m4/sage_spkg_versions.m4 + INSTALL_REQUIRES_TOML= echo "define(>>>SPKG_INSTALL_REQUIRES_${pkgname}<<<, >>>$(echo $(sage-get-system-packages install-requires-toml ${pkgname}))<<<)dnl" >> m4/sage_spkg_versions_toml.m4 + echo "m4_define([SPKG_INSTALL_REQUIRES_${pkgname}], [[$(echo $(sage-get-system-packages install-requires-toml ${pkgname} | sed 's/"/\\"/g'))]])dnl" >> m4/sage_spkg_configures.m4 fi spkg_finalizes="$spkg_finalizes SAGE_SPKG_FINALIZE([$pkgname], [$pkgtype], [$SPKG_SOURCE], [$SPKG_TREE_VAR])" done - echo "$spkg_finalizes" >> m4/sage_spkg_configures.m4 for a in m4/sage_spkg_versions.m4 m4/sage_spkg_versions_toml.m4; do echo 'changequote(>>>`<<<, >>>'"'"'<<<)dnl' >> $a done + cat >> m4/sage_spkg_configures.m4 <&AS_MESSAGE_LOG_FD], [ AC_MSG_RESULT(yes) - dnl strip all comments from version_requirements.txt; this should leave - dnl only a single line containing the version specification for this - dnl package. Afterwards, convert all double-quotes to single quotes. - dnl Both work, but only single quotes are documented. However, at the - dnl time of writing, double quotes are more compatible with our toml - dnl generation in ./bootstrap. Converting them from double- to single- - dnl quotes on-the-fly here lets us support both (in this macro, at - dnl least). - SAGE_PKG_VERSPEC=$(sed \ - -e '/^#/d' \ - -e "s/\"/'/g" \ - "./build/pkgs/$1/version_requirements.txt" - ) - AC_MSG_CHECKING([for python package $1 ("${SAGE_PKG_VERSPEC}")]) + dnl SAGE_PKG_VERSPEC is in the format of a toml list, but + dnl without surrounding brackets, of single-quoted strings, + dnl with any double-quotes escaped by backslash. + AS_VAR_SET([SAGE_PKG_VERSPEC], ["SPKG_INSTALL_REQUIRES_]$1["]) + AC_MSG_CHECKING([for python package $1 (${SAGE_PKG_VERSPEC%,})]) WITH_SAGE_PYTHONUSERBASE([dnl - dnl double-quote SAGE_PKG_VERSPEC because platform-specific - dnl dependencies like python_version<'3.11' will have single - dnl quotes in them. (We normalized the quotes earlier with sed.) AS_IF( - [config.venv/bin/python3 -c dnl - "import pkg_resources; dnl - pkg_resources.require(\"${SAGE_PKG_VERSPEC}\".splitlines())" dnl + [config.venv/bin/python3 -c dnl + "import pkg_resources; dnl + pkg_resources.require((${SAGE_PKG_VERSPEC}))" dnl 2>&AS_MESSAGE_LOG_FD], [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no); sage_spkg_install_$1=yes]