diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2024-05-21 21:08:30 +0300 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2024-05-21 21:08:30 +0300 |
commit | bd705feab6cdf50f11c3d7a265a3f157a750ec71 (patch) | |
tree | af03f0bd558df4fb039c574122f0dea4619c977a | |
parent | ebd28eeef0038fc26eff1c870470f9852bb262b6 (diff) | |
download | applause2-bd705feab6cdf50f11c3d7a265a3f157a750ec71.tar.gz |
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.
-rw-r--r-- | AppImage.yml | 14 |
1 files 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 <<EOF + # This custom launcher starts the notebook by default but allows launching the plain CLI as well. + # NOTE: The Pip-installed hash-bang lines hard code paths from the build system. + - cat >./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 |