Skip to content

Commit

Permalink
m4/sage_spkg_collect.m4: Use 'sage-package properties' to get versions
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Koeppe committed Dec 16, 2023
1 parent 8df0d9f commit 74b1b83
Showing 1 changed file with 7 additions and 21 deletions.
28 changes: 7 additions & 21 deletions m4/sage_spkg_collect.m4
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,12 @@ m4_include([m4/sage_spkg_configures.m4])
dnl ==========================================================================
AC_DEFUN([SAGE_SPKG_COLLECT_INIT], [
dnl Intialize the collection variables.
m4_pushdef([SPKG_NAMES], [$1])dnl
dnl Obtain dependencies at configure time.
eval $($SAGE_BOOTSTRAP_PYTHON build/bin/sage-package dependencies --format=shell ]SPKG_NAMES[)
SPKGS="$1"
dnl Obtain dependencies and versions at configure time.
AS_IF([eval $($SAGE_BOOTSTRAP_PYTHON build/bin/sage-package dependencies --format=shell $SPKGS) && eval $($SAGE_BOOTSTRAP_PYTHON build/bin/sage-package properties $SPKGS)], [], [
AC_MSG_ERROR([Package directory missing. Re-run bootstrap.])dnl
])
# To deal with ABI incompatibilities when gcc is upgraded, every package
# (except gcc) should depend on gcc if gcc is already installed.
# See https://github.com/sagemath/sage/issues/24703
Expand All @@ -92,17 +95,6 @@ AC_SUBST([SAGE_GCC_DEP])
AS_BOX([Build status for each package: ]) >& AS_MESSAGE_FD
AS_BOX([Build status for each package: ]) >& AS_MESSAGE_LOG_FD
# Usage: newest_version $pkg
# Print version number of latest package $pkg
newest_version() {
SPKG=$[1]
if test -f "$SAGE_ROOT/build/pkgs/$SPKG/package-version.txt" ; then
cat "$SAGE_ROOT/build/pkgs/$SPKG/package-version.txt"
else
echo none
fi
}
# Packages that are actually built/installed as opposed to packages that are
# not required on this platform or that can be taken from the underlying system
# installation. Note that this contains packages that are not actually going to
Expand Down Expand Up @@ -145,7 +137,6 @@ AC_SUBST([SAGE_DUMMY_PACKAGES])
AC_SUBST([SAGE_OPTIONAL_INSTALLED_PACKAGES])
AC_SUBST([SAGE_OPTIONAL_UNINSTALLED_PACKAGES])
AC_SUBST([SAGE_SDIST_PACKAGES])
m4_popdef([SPKG_NAMES])
])


Expand All @@ -161,12 +152,7 @@ AC_DEFUN([SAGE_SPKG_FINALIZE], [dnl
dnl depending on the package type and other criteria (such as whether or not it
dnl needs to be installed)
dnl
DIR="$SAGE_ROOT"/build/pkgs/SPKG_NAME
AS_IF([test ! -d "$DIR"], [dnl
AC_MSG_ERROR([Directory $DIR is missing. Re-run bootstrap.])dnl
])
dnl
SPKG_VERSION=$(newest_version SPKG_NAME)
SPKG_VERSION=$[version_]SPKG_NAME
dnl
dnl Determine package source
dnl
Expand Down

0 comments on commit 74b1b83

Please sign in to comment.