Portable interpreters using AppImage
- Posted by _tom (admin) May 11, 2021
- 953 views
An AppImage lets us create a portable interpreter.
- single file
- compressed
- only 0.02 seconds extra startup time
Worked for both OpenEuphoria and Phix
For example using Phix:
You need:
- phix install files
- the appimagetool https://appimage.github.io/appimagetool/
Create a directory (anywhere) like /CREATE
in this /CREATE directory:
- copy the appimagetool here
- make a /phix.AppDir directory
in this directory:
- create AppDir (a bash script)
- create phix.Desktop (a txt file)
- copy Phix256.png (an icon file)
- make a /phix.AppDir/usr directory
in this directory make another directory
- make a /phix.AppDir/usr/bin directory
duplicate a phix install
- copy /builtins (from a phix install)
- copy p (the interpreter)
- make a /phix.AppDir/usr/bin directory
- ensure p and AppRun are executable
- from /CREATE execute the apptool
./apptool.AppImage phix.AppDir - get
phix-x86_64.AppImage
You now have a portable app:
- ./phix-x86_64.AppImage (will launch the interpreter)
- rename to pp (any name is ok, no extension needed, pp suggests phix portable)
- run as ./pp
A portable app may be installed as a regular executable:
- copy the AppImage file to /home/bin
- check that .profile has this in the users path
- now pp will run from anywhere
The installation details:
The AppRun file looks like:
#!/bin/sh HERE="$(dirname "$(readlink -f "${0}")")" EXEC="${HERE}/usr/bin/p" exec "${EXEC}" "$@" # change p to eui for OE # "$@" allows arguments be passed to interpreter
The phix.desktop file looks like:
[Desktop Entry] Exec=p Icon=Phix256 Name[en_US]=phix Name=phix Path= StartupNotify=true TerminalOptions= Type=Application X-KDE-SubstituteUID=false Categories=Development
There was some protesting about the arguments of this file.
To create the OpenEuphoria version the apptool wanted an "ARCH" argument:
$ ARCH=x86_64 ./apptool.AppImage euphoria.AppDir
be well
_tom