# 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}"
+}
+
+# We have to export this because sage likes to re-bootstrap and
+# re-configure itself every time you change a comment in an m4 file,
+# and it won't re-configure with this variable set. So then after
+# five minutes you'll get an error from --with-system-ninja=force.
+export ac_cv_path_NINJA=$(_sage_find_ninja)
+
# 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.
#
+# We also override the autoconf variable used to detect ninja, because
+# it does a version check that isn't compatible with samurai.
sage-configure() {
./configure \
--enable-download-from-upstream-url \
--with-system-cliquer=force \
--with-system-cmake=force \
--with-system-contourpy=force \
+ --with-system-conway_polynomials=force \
--with-system-cppy=force \
--with-system-curl=force \
--with-system-cycler=force \
--with-system-idna=force \
--with-system-iml=force \
--with-system-importlib_metadata=force \
+ --with-system-ipython=force \
+ --with-system-ipywidgets=force \
--with-system-isl=force \
--with-system-jedi=force \
--with-system-jinja2=force \
--with-system-primecount=force \
--with-system-primecountpy=force \
--with-system-primesieve=force \
+ --with-system-prompt_toolkit=force \
+ --with-system-ptyprocess=force \
--with-system-pure_eval=force \
--with-system-pybind11=force \
--with-system-pygments=force \