The ninja build system supports overriding "ninja" with $NINJA, just
like how $MAKE overrides "make". In Gentoo we go one step further and
allow dev-util/samurai to replace dev-util/ninja when NINJA=samu.
Here we tweak sage-configure to override sage's ninja check when NINJA
is set in the environment.
# This is trinary, ha ha!
export SAGE_DEBUG=no
# This is trinary, ha ha!
export SAGE_DEBUG=no
+# Print the path to either ninja (default) or samurai (if set via
+# $NINJA).
+_sage_find_ninja(){
+ [ -z "${NINJA}" ] && NINJA=ninja
+ command -v "${NINJA}"
+}
+
# Run ./configure within the SageMath git repository. This tweaks all
# of the flags that I don't want to tweak manually:
#
# Run ./configure within the SageMath git repository. This tweaks all
# of the flags that I don't want to tweak manually:
#
# * --with-system-foo=force: ensure that the system packages I have
# installed are actually used.
#
# * --with-system-foo=force: ensure that the system packages I have
# installed are actually used.
#
+# We also override the autoconf variable used to detect ninja, because
+# it does a version check that isn't compatible with samurai.
+ ac_cv_path_NINJA=$(_sage_find_ninja) \
./configure \
--enable-download-from-upstream-url \
--enable-system-site-packages \
./configure \
--enable-download-from-upstream-url \
--enable-system-site-packages \