There was a post on RETROB regarding a desire for a ScriptBasic AppImage that caught my eye.
I decided to accept the "challenge" of making this work.
One of the issues that SB has is that the required paths for the modules and includes need to be absolute, which would normally make creating a usable AppImage impossible.
I ended up cheating a little, creating an AppRun file using Bash. With this, I was able to make use of the mktemp command, to first create a text version of the config on the fly, and then also create the binary version of the config on the fly as well.
One of the things I did NOT want to do was modify the source in any way to enable either relative paths or the use of environment variables.
Using one of the binary distributions that John created (SBCentOS) I was able to coerce the AppImage to work.
./sb64-x86_64.AppImage -D
dll ".so"
module "/tmp/.mount_sb64-xb8OgNk/module/"
include "/tmp/.mount_sb64-xb8OgNk/include/"
maxstep 0
maxlocalstep 0
maxlevel 29666
maxmem 0
Note that above, the full path to the "module" and "include" sections changes each time the AppImage is executed.
Note also that I have not configured this for sbhttpd, only for scriba.
Note that the environment variables contained in the AppRun file are temporary, meaning that they exist only as long as the AppImage is executing and don't modify the persistent environment variables.
The AppRun file:
#!/bin/bash
WORKDIR=$(dirname "$(readlink -f "$0")")
export PATH=$PATH:"${WORKDIR}"/bin
TEXT_CONF=$(mktemp)
BINARY_CONF=$(mktemp)
CONFIG="dll \".so\"
module \"${WORKDIR}/module/\"
include \"${WORKDIR}/include/\"
maxstep 0
maxlocalstep 0
maxlevel 29666
maxmem 0
"
echo "$CONFIG" > "${TEXT_CONF}"
scriba -f ${BINARY_CONF} -k ${TEXT_CONF} 2>/dev/null
export SCRIBACONF="${BINARY_CONF}"
scriba $@
[[ -e "${TEXT_CONF}" ]] && rm "${TEXT_CONF}"
[[ -e "${BINARY_CONF}" ]] && rm "${BINARY_CONF}"
The sb.desktop file:
[Desktop Entry]
Type=Application
Name=sb64
Exec=scriba
Comment=ScriptBasic Programming Language
Icon=debian-logo
Categories=Development;
Terminal=true
TestRun:
riveraa@nas:~/src$ ./sb64-x86_64.AppImage testhash.bas
q1 1
q2 2
q3 3
q4 4
q5 5
q6 6
q7 7
q8 8
q9 9
q10 10
AppImage attached. Created with appimagetool.AppImage, forget the other weird ways to create AppImages.
This is a POC (Proof of Concept), I am not going to maintain this...
AIR.