From bd705feab6cdf50f11c3d7a265a3f157a750ec71 Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Tue, 21 May 2024 21:08:30 +0300 Subject: AppImage: fixed Jupyter and ILua modes on all but my own system * We cannot use the Pip-installed launchers since they have hardcoded paths. Instead we reference python3 explicitly in the /usr/bin/applause launcher. * For some strange reason, the site-packages directory where all of the relevant packages are put is not in sys.path. So also export it via $PYTHONPATH. --- AppImage.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/AppImage.yml b/AppImage.yml index 7f939ce..b2cfa59 100644 --- a/AppImage.yml +++ b/AppImage.yml @@ -40,15 +40,17 @@ script: # Install Jupyter notebooks... - virtualenv --python=python3 ./usr - ./usr/bin/pip3 install --no-input notebook twisted==22.10.0 git+https://github.com/rhaberkorn/ilua.git@improvements - # This custom launcher starts the notebook by default but allows launching the plain CLI as well: - - cat >./usr/bin/applause <./usr/bin/applause <<\EOF - #!/bin/sh - - HERE="$(dirname "$(readlink -f "${0}")")" + - HERE="$(dirname "$(readlink -f "$0")")" - APPDIR=$(readlink -f "$HERE/../../") + - export PYTHONPATH="$APPDIR/usr/lib/python3.8/site-packages" - cd ~/ - - if [ "\$1" = cli ]; then shift; exec lua "\$@"; fi - - if [ "\$1" = ilua ]; then shift; exec python3 "$APPDIR/usr/bin/ilua" "\$@"; fi - - exec python3 "$APPDIR/usr/bin/jupyter" notebook --MultiKernelManager.default_kernel_name=lua "\$@" + - if [ "$1" = cli ]; then shift; exec lua "$@"; fi + - if [ "$1" = ilua ]; then shift; exec python3 "$APPDIR/usr/bin/ilua" "$@"; fi + - exec python3 "$APPDIR/usr/bin/jupyter" notebook --MultiKernelManager.default_kernel_name=lua "$@" - EOF - chmod a+x ./usr/bin/applause # Some thinning - remove unneeded files -- cgit v1.2.3