JaCzekanski / Avocado

🥑 PlayStation 1 emulator
GNU General Public License v2.0
536 stars 31 forks source link

Can the AppImage be downloaded somewhere? #74

Closed probonopd closed 4 years ago

probonopd commented 4 years ago

Can the AppImage be downloaded somewhere? Thanks for making one.

JaCzekanski commented 4 years ago

https://avocado-builds.czekanski.info/#e23d30b Linux section contains AppImage for the latest commit.

Unfortunately, Avocado cannot find data directory when running from AppImage so you'll end up with an error during emulator initialization. I might have to move the data directory to /usr/local/something and hardcode the path.

probonopd commented 4 years ago

Cool, thanks.

The way to go is: calculate the path to the data directory relative to the path to the main application.

Please see https://docs.appimage.org/packaging-guide/manual.html#no-hard-coded-paths and https://docs.appimage.org/reference/best-practices.html#binaries-must-not-use-compiled-in-absolute-paths for more information.

Shouldn't be too hard but in any case, let me know if you need help.

JaCzekanski commented 4 years ago

Thanks, I don't have any experience with deploying Linux applications. I'll try to fix it today.

JaCzekanski commented 4 years ago

AppImage is now fixed - the emulator should be able to locate data directory. There's another issue that results in nonworking persistence - configuration, save states and memory images are saved to the working directory which points to the inside of AppImage filesystem. This should be easy to fix by redirecting saved data to the user's local storage (SDL_GetPrefPath instead of SDL_GetBasePath).

probonopd commented 4 years ago

Thank you.

Yes, please save things to somewhere in $HOME rather than to the current working directory. (This is a good idea not only for the AppImage but in general for Unix applications, as those tend to get installed to read-only locations such as /usr or /opt.)

probonopd commented 4 years ago

Unfortunately this does not run on Ubuntu xenial:

/run/firejail/appimage/.appimage-9280/AppRun: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.27' not found (required by /run/firejail/appimage/.appimage-9280/AppRun)

Please see https://github.com/AppImage/AppImageKit/wiki/Creating-AppImages/cc2441518975caca23e9ce2dba6f08a22c678d1e#creating-appimages-that-are-compatible-with-many-systems.

JaCzekanski commented 4 years ago

@probonopd

I modified my clang10 Docker image to use ubuntu:16.04. Had to statically link libstdc++ or otherwise, AppImage would not start due to old GLIBC. Also, I'm building SDL2 from sources now, since Xenial has a very old package in repositories - I'm pretty sure it shouldn't cause any problems.

You can use https://avocado-builds.czekanski.info/latest/linux64?branch=develop to get the latest artifact for Linux.

Thanks for all the help with Linux deployment - I learned a lot. Not closing this issue because I still haven't touched the data saved in inside AppImage issue.

JaCzekanski commented 4 years ago

Data is now persisted in ~/.local/share/avocado. I'm closing this issue as AppImage should now be fully usable.