feat: use lemonade without flatpak
hey, I found this Lemmy client and wanted to use it without Flatpak, so I compiled it with this command:
meson --prefix="/usr" _build
ninja -C _build -j8 -l8sudo ninja -C _build install
sudo ninja -C _build install
executing the application gave no window, and running in a terminal gave me this error:
Traceback (most recent call last):
File "/usr/share/lemonade/lemonade/main.py", line 188, in on_activate
self.win = LemonadeWindow(application=app)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/share/lemonade/lemonade/main.py", line 38, in __init__
os.mkdir(os.path.join(f"{os.environ['XDG_RUNTIME_DIR']}/app/{os.environ['FLATPAK_ID']}", "cache"))
~~~~~~~~~~^^^^^^^^^^^^^^
File "<frozen os>", line 679, in __getitem__
KeyError: 'FLATPAK_ID'
the workaround I used was to create the directory $XDG_RUNTIME_DIR/app/ml.mdwalters.Lemonade with user permissions, and run the application with FLATPAK_ID=ml.mdwalters.Lemonade, which fixed the issue.
presumably, this is a result of lemonade being primarily distributed as a Flatpak, which unfortunately breaks this app for those who don't have Flatpak (or compile the app directly), so I'm requesting a build flag (something like NO_FLATPAK?) that would automatically create the directory and use the application id instead of FLATPAK_ID.
I would send a pull request myself, but I'm not confident in writing a good meson script. (thanks for the app btw!)
seems like it has a hard requirement of flatpak, i'll do my best to figure out how to detect it not being a sandbox.
ok, thanks!
I'm try to package this app as an rpm. When I run lemonade, I get
Traceback (most recent call last):
File "/usr/share/lemonade/lemonade/main.py", line 221, in on_activate
self.win = LemonadeWindow(application=app)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/share/lemonade/lemonade/main.py", line 44, in __init__
os.mkdir(os.path.join(f"{os.environ['XDG_RUNTIME_DIR']}/app/ml.mdwalters.Lemonade", "cache"))
FileNotFoundError: [Errno 2] No such file or directory: '/run/user/1000/app/ml.mdwalters.Lemonade/cache'
I believe this is related