LÖVE 11.1 AppImage and relative paths
Posted: Mon Apr 16, 2018 2:14 pm
I don't want to upgrade my system to 11.1 yet, so I tried the AppImage distribution. I quickly learned that this doesn't work:
It only works when specifying the absolute path to the love file/game directory. This seems to be a common problem with AppImageKit. See also here.
This doesn't play well with my current build system. I can probably fix this with a shell script, but it would be nice if it worked out of the box and showed the same behavior as when using a vanilla installation. I don't know jack about AppImages, but the above links seem to suggest it can be fixed when building the image.
If there is another quick solution other than writing a script to expand the path, I'd love to know.
Edit: here's the solution I came up with (requires bash):
I saved this as /usr/bin/love11, with the AppImage in the executable path. Makes both absolute and relative paths work.
Code: Select all
$ love-11.1-linux-x86_64.AppImage game.love
Code: Select all
Error: [string "boot.lua"]:481: Cannot load game at path '/tmp/.mount_AjgSUk/usr/game.love'
Make sure a folder exists at the specified path.
This doesn't play well with my current build system. I can probably fix this with a shell script, but it would be nice if it worked out of the box and showed the same behavior as when using a vanilla installation. I don't know jack about AppImages, but the above links seem to suggest it can be fixed when building the image.
If there is another quick solution other than writing a script to expand the path, I'd love to know.
Edit: here's the solution I came up with (requires bash):
Code: Select all
#!/bin/bash
GAME="$(readlink -f ${@: -1})"
set -- "${@:1:$(($#-1))}"
love-11.1-linux-x86_64.AppImage $@ $GAME