1. Portable interpreters using AppImage
- Posted by _tom (admin) May 11, 2021
- 926 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
To create the OpenEuphoria version the apptool wanted an "ARCH" argument:
be well
_tom
3. Re: Portable interpreters using AppImage
- Posted by _tom (admin) May 14, 2021
- 803 views
Wot no IUP?
It looks like an AppImage is its own, secure, bubble.
I don't think an external program can "look into" this bubble. It is possible to mount an appimage so someone can examine its contents--that is not a solution for using an appimage.
That means I can not "include" anything from inside the bubble into a program; for example "include builtins/regex.e" does not work. Because phix has lots of autoincludes, the initial impression of phix as an appimage is great.
To get iup to work you would have to make iup an autoinclude; dito for regex.e
Creating an all-inclusive autoinclude would be interesting--I am looking forward to it.
be well
_tom