AppRun (1047B)
1 #!/bin/sh 2 # AppImage entry point: 32-bit binary run through its own bundled loader + libs. 3 # data.blk / data.res live OUTSIDE the image, next to the AppImage file 4 # (override the folder with PC32_DIR). If there is none, the data.blk the AppImage was built 5 # with is copied there on first run. 6 APPDIR=${APPDIR:-$(dirname "$(readlink -f "$0")")} 7 if [ -n "$PC32_DIR" ]; then dir=$PC32_DIR 8 elif [ -n "$APPIMAGE" ]; then dir=$(dirname "$APPIMAGE") 9 else dir=${OWD:-$PWD}; fi 10 mkdir -p "$dir" && cd "$dir" || exit 1 11 if [ ! -f data.blk ]; then 12 echo "PC32: no data.blk in $dir - creating one from the copy bundled at build time" 13 cp "$APPDIR/usr/share/PC32/data.blk" data.blk 14 fi 15 if [ ! -f data/MC.bin ]; then # example data (optional) 16 mkdir -p data && cp "$APPDIR/usr/share/PC32/MC.bin" data/MC.bin 17 fi 18 export LIBGL_DRIVERS_PATH="$APPDIR/usr/lib32/dri" 19 export LIBGL_ALWAYS_SOFTWARE=1 # only the bundled 32-bit software driver exists 20 exec "$APPDIR/usr/lib32/ld-linux.so.2" --library-path "$APPDIR/usr/lib32" "$APPDIR/usr/bin/a.out" "$@"