diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2024-05-20 06:45:58 +0300 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2024-05-20 06:45:58 +0300 |
commit | b6cec574785267adf5880ae16955b321e073e0ee (patch) | |
tree | db8b82c2da8e941574450e0de5ce0df2e07f001c | |
parent | a83b727a134d1262a1b91aa7fb0154330ca50f5f (diff) | |
download | applause2-b6cec574785267adf5880ae16955b321e073e0ee.tar.gz |
AppImages contain Jupyter notebook support now
* that's their default mode, but the ILua console and Lua prompt can also be accessed by
passing additional commandline parameters.
* README: we can install our ILua fork without explicitly cloning the repository
which simplifies matters a bit.
-rw-r--r-- | AppImage.yml | 27 | ||||
-rw-r--r-- | README.md | 32 |
2 files changed, 44 insertions, 15 deletions
diff --git a/AppImage.yml b/AppImage.yml index c6c6ab5..f5c0b87 100644 --- a/AppImage.yml +++ b/AppImage.yml @@ -15,27 +15,40 @@ ingredients: - feedgnuplot # FIXME: No matter what, we cannot get rid of gnuplot-qt, pulled in by feedgnuplot... #- gnuplot-x11 + # FIXME: Why is this required in the image? + - python3-venv dist: focal sources: - deb http://archive.ubuntu.com/ubuntu/ focal main universe script: - - wget -O applause.tar.gz -c "https://github.com/rhaberkorn/applause2/archive/refs/heads/master.tar.gz" - # Will leave an "applause2-master" directory. - - tar xzf applause.tar.gz # NOTE: The LuaJIT from Ubuntu is too outdated. - wget -O luajit.tar.gz -c "https://github.com/LuaJIT/LuaJIT/archive/refs/heads/v2.1.tar.gz" # Will leave a "LuaJIT-2.1" directory. - tar xzf luajit.tar.gz + - wget -O applause.tar.gz -c "https://github.com/rhaberkorn/applause2/archive/refs/heads/master.tar.gz" + # Will leave an "applause2-master" directory. + - tar xzf applause.tar.gz + # Install build-time dependencies + - sudo apt-get install -y build-essential lua5.1 libreadline-dev libjack-jackd2-dev virtualenv script: - # Install build-time dependencies - - sudo apt-get install -y build-essential lua5.1 libreadline-dev libjack-jackd2-dev - make -C ../LuaJIT-2.1 DESTDIR=`pwd` PREFIX=/usr install - make -C ../applause2-master LUA_CFLAGS="-I`pwd`/usr/include/luajit-2.1" LUA_LDFLAGS="-L`pwd`/usr/lib -lluajit-5.1" - cp -r ../applause2-master ./usr/share/applause # Will be required by the ILua fork - ln -s ../share/applause/ilua-wrapper.sh ./usr/bin/lua - - ln -s ../share/applause/ilua-wrapper.sh ./usr/bin/applause + # 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 + - #!/bin/sh + - cd ~/ + - if [ "\$1" = cli ]; then shift; exec lua "\$@"; fi + - if [ "\$1" = ilua ]; then shift; exec ilua "\$@"; fi + - exec jupyter notebook --MultiKernelManager.default_kernel_name=lua "\$@" + - EOF + - chmod a+x ./usr/bin/applause # Some thinning - remove unneeded files - find . -name "*.a" -delete - rm -rf ./usr/share/doc @@ -45,7 +58,7 @@ script: - Type=Application - Categories=Audio - Icon=applause - - Name=Applause (CLI) + - Name=Applause - Exec=applause %u - Terminal=true - EOF @@ -1,8 +1,28 @@ -# Applause 2 +# Applause ## Installation -You have to manually build and install LuaJIT v2.1: +The easiest way to install Applause on Linux is to install a +prebuilt AppImage. +It should run on any x86_64 Linux system that has the jackd2 daemon +installed and running. +The AppImage supports all three modes of running Applause: + +1. `./Applause.AppImage` by default launches a Jupyter notebook on HTTP port 8888. + Additional parameters are passed to jupyter. + Use the `APPLAUSE_OPTS` environment variable to pass commandline parameters to Applause itself. +2. `./Applause.AppImage ilua` launches a Jupyter/ILua console in the terminal. + Additional parameters are passed to ILua. + Use the `APPLAUSE_OPTS` environment variable to pass commandline parameters to Applause itself. +3. `./Applause.AppImage cli` launches a plain Applause shell (Lua prompt). + Additional parameters are directly passed to Applause, but the `APPLAUSE_OPTS` environment variable + can also provide parameters. + This also mode also allows executing scripts, but currently you will have to pass absolute paths. + +### Manual Installation + +You are recommended to manually build and install LuaJIT v2.1 +since distributions usually ship outdated versions: git clone -b v2.1 https://luajit.org/git/luajit.git cd luajit @@ -115,17 +135,14 @@ First, install ILua into a Python environment (see also this [ILua ticket](https://github.com/guysv/ilua/issues/28)): ```bash -git clone -b improvements --recurse-submodules https://github.com/rhaberkorn/ilua.git -cd ilua python3 -m venv env . env/bin/activate -pip install twisted==22.10.0 . +pip install twisted==22.10.0 git+https://github.com/rhaberkorn/ilua.git@improvements ``` You can now directly run an Applause Jupyter Console session: ```bash -cd ~/applause ilua --lua-interpreter=./applause ``` @@ -141,7 +158,7 @@ You can symlink this to `lua` in the Python environment to make Applause the def ILua interpreter in this Python environment: ```bash -ln -s ~/applause/ilua-wrapper.sh env/bin/lua +ln -s `pwd`/ilua-wrapper.sh env/bin/lua ``` If you would like to launch a Jupyter Notebook (Web UI!), first install the following Pip package: @@ -165,5 +182,4 @@ visiting http://localhost:8888/. Please note the following restrictions/bugs: * You cannot publicly host the Jupyter Notebook as the sound is generated on the host machine. - Similarily, it would be tricky to wrap everything in a Docker container. * The output of some functions like Stream:toplot() is garbled. |