New comment by tornaria on void-packages repository https://github.com/void-linux/void-packages/pull/34030#issuecomment-1017637400 Comment: Note that `sage -notebook` is broken atm. If you need it, it should be possible to run it as ``` $ PYTHONPATH=/usr/lib/sage-9.5.rc3/venv/lib/python3.10/site-packages/ sage -notebook ``` which instructs python to search for packages in the venv. If you use the notebook and notice anything is missing, please report (I mostly only use the CLI). Some standard packages are just force-disabled (e.g. jmol, mathjax, threejs) and thist may or may not break the notebook or reduce its functionality. If setting PYTHONPATH doesn't work properly and you want to try the shebang hack, apply the following commit and rebuild: ```diff commit 4430467ee2e19479a09961e902e89881efad358a Author: Gonzalo TornarĂ­a Date: Thu Nov 11 09:39:20 2021 -0300 sagemath: don't rewrite python shebangs diff --git a/common/hooks/pre-pkg/03-rewrite-python-shebang.sh b/common/hooks/pre-pkg/03-rewrite-python-shebang.sh index 07162ad2c6..c0f2198e44 100644 --- a/common/hooks/pre-pkg/03-rewrite-python-shebang.sh +++ b/common/hooks/pre-pkg/03-rewrite-python-shebang.sh @@ -4,6 +4,10 @@ hook() { local pyver= shebang= off= + if [ -n "$_no_python_shebang" ]; then + return 0 + fi + if [ -d ${PKGDESTDIR}/usr/lib/python* ]; then pyver="$(find ${PKGDESTDIR}/usr/lib/python* -prune -type d | grep -o '[[:digit:]]\.[[:digit:]]\+$')" fi diff --git a/srcpkgs/sagemath/template b/srcpkgs/sagemath/template index de9fe51777..f01fff3eea 100644 --- a/srcpkgs/sagemath/template +++ b/srcpkgs/sagemath/template @@ -72,6 +72,9 @@ nostrip=yes # don't shlib_provide anything noshlibprovides=yes +# don't rewrite python shebang as sage uses its own python (for now) +_no_python_shebang=yes + # compile python code in sage venv pycompile_dirs="$_SAGE_ROOT/venv/" ``` I expect this will fix itself once we start installing sagemath in `/usr` as opposed to a private `venv` (the latter doesn't make sense anymore now that all python modules other than sagelib are from system).