Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
build/pkgs/sagelib: Implement --enable-editable
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Koeppe committed Feb 10, 2021
1 parent 3484774 commit 3dcfbe9
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
2 changes: 2 additions & 0 deletions build/bin/sage-build-env-config.in
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,5 @@ export SAGE_FREETYPE_PREFIX="@SAGE_FREETYPE_PREFIX@"
export SAGE_SUITESPARSE_PREFIX="@SAGE_SUITESPARSE_PREFIX@"

export SAGE_CONFIGURE_FFLAS_FFPACK="@SAGE_CONFIGURE_FFLAS_FFPACK@"

export SAGE_EDITABLE="@SAGE_EDITABLE@"
4 changes: 4 additions & 0 deletions build/pkgs/sagelib/spkg-configure.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
AC_ARG_ENABLE([editable],
[AS_HELP_STRING([--enable-build-as-root],
[use an editable install of the Sage library])],
[AC_SUBST([SAGE_EDITABLE], [yes])])
13 changes: 11 additions & 2 deletions build/pkgs/sagelib/spkg-install
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#!/usr/bin/env bash
cd src
if [ "$SAGE_EDITABLE" = yes ]; then
cd "$SAGE_SRC"
else
cd src
fi
## All sagelib-building is done by setup.py.
## This is so that sagelib can be installed by standard Python procedures,
## such as "./setup.py install" or "pip install ."
Expand Down Expand Up @@ -39,7 +43,12 @@ export SAGE_SHARE=/doesnotexist
# spec, which includes setting a symlink to the installed documentation.
# export SAGE_DOC=/doesnotexist

time "$PYTHON" -u setup.py --no-user-cfg build install || exit 1
if [ "$SAGE_EDITABLE" = yes ]; then
time python3 -m pip install --ignore-installed --verbose --no-deps --no-index --no-build-isolation --isolated --editable . || exit 1
else
time "$PYTHON" -u setup.py --no-user-cfg build install || exit 1
fi

if [ "$UNAME" = "CYGWIN" ]; then
sage-rebase.sh "$SAGE_LOCAL" 2>/dev/null;
fi

0 comments on commit 3dcfbe9

Please sign in to comment.