hiran wrote: ↑Tue Jul 23, 2024 5:55 am
Re: the deb package. I note that stable and testing can be installed simultaneously (and are if the user doesn't think about it). However the desktop files seem a bit scrambled, and only 'stable' appears in the apps menu, at least on XFCE4. TLDR; Mostly looks like an issue caused by using /opt, though that's not all:
I jumped into the rabbit-hole
Hopefully save you some drilling.
Code: Select all
$ dpkg -l | grep -i starter
ii oolitestarter 0.1-32 amd64 OoliteStarter
ii oolitestarter-hoopsnake 0.1-33 amd64 OoliteStarter_hoopsnake
# Sanity check:
$ dpkg -L oolitestarter oolitestarter-hoopsnake | grep /bin/
/opt/oolitestarter/bin/OoliteStarter
/opt/oolitestarter-hoopsnake/bin/OoliteStarter_hoopsnake
# Good! Deeper sanity check.
$ dpkg -L oolitestarter oolitestarter-hoopsnake | grep desktop$ | grep OoliteStart
/opt/oolitestarter/lib/oolitestarter-OoliteStarter.desktop
/opt/oolitestarter-hoopsnake/lib/oolitestarter-OoliteStarter.desktop
/opt/oolitestarter-hoopsnake/lib/oolitestarter-hoopsnake-OoliteStarter_hoopsnake.desktop
# Right.. probably in THIS somewhere!
diff /opt/oolitestarter/lib/oolitestarter-OoliteStarter.desktop /opt/oolitestarter-hoopsnake/lib/oolitestarter-OoliteStarter.desktop
# Hmm.. Both the same. That's not right, but I'll check the other one anyway:-
$ diff /opt/oolitestarter/lib/oolitestarter-OoliteStarter.desktop /opt/oolitestarter-hoopsnake/lib/oolitestarter-hoopsnake-OoliteStarter_hoopsnake.desktop
2,5c2,5
< Name=OoliteStarter
< Comment=UI to manage Oolite, SaveGames and Expansions
< Exec=/opt/oolitestarter/bin/OoliteStarter
< Icon=/opt/oolitestarter/lib/OoliteStarter.png
---
> Name=OoliteStarter_hoopsnake
> Comment=OoliteStarter_hoopsnake
> Exec=/opt/oolitestarter-hoopsnake/bin/OoliteStarter_hoopsnake
> Icon=/opt/oolitestarter-hoopsnake/lib/OoliteStarter_hoopsnake.png
# Issue #1 That's what I've have expected from the previous test!
Not sure why
/opt/oolitestarter-hoopsnake/lib/oolitestarter-hoopsnake-OoliteStarter_hoopsnake.desktop isn't being seen, maybe it's just a name too long. Most packages put system desktop files in /usr/share/applications. It *could* be that only one item is picked if using */lib/wotnot.desktop rather than an applications 'pool' directory.
So, in an attempt to remove the 'same' deesktop entry, and make things potentially sane, I tried:-
Code: Select all
sudo mv -f /opt/oolitestarter-hoopsnake/lib/oolitestarter-hoopsnake-OoliteStarter_hoopsnake.desktop /opt/oolitestarter-hoopsnake/lib/oolitestarter-OoliteStarter.desktop
To no avail. So then I tried:-
Code: Select all
cp /opt/oolitestarter-hoopsnake/lib/oolitestarter-OoliteStarter.desktop ~/.local/share/applications/
And.. suddenly, only one starter is available in applications menu, hoopsnake! I'm not sure why the other one has been knocked out. I tried editing the Name and Comment field in the ~/.local copy, but to no avail.
Deleted my .local .desktop file, and the stable apps icon alone re-emerged
So: I've got a puddle of .desktops in ~/.local/share/applications which works, let's try it.
Code: Select all
cp /opt/oolitestarter-hoopsnake/lib/oolitestarter-OoliteStarter.desktop .local/share/applications/
cp /opt/oolitestarter-hoopsnake/lib/oolitestarter-OoliteStarter.desktop .local/share/applications/oolitestarter-hoopsnake.desktop
# note the simple rename of the hoopsnake one, which I'd also previously renamed from the 'very long name'.
I get both now!
Tried making /opt/*starterversion*/share/applications and moving the renamed desktop files in there as two differently named files.. No good. Maybe XFCE4 doesn't check opt trees thoroughly for .desktop files.
I suspect that for both to appear (when installed to system), the desktop files need different filenames, and to be installed ideally to /usr/share/applications. A quick grep through there and I see no other /opt/ apps are in there.
Admittedly, I have no other /opt/ apps on my system with two branches, but not much goes to /opt these days, I've nothing from .deb installs that does other than starter and there are 3353 packages installed on this laptop.
So I'd suggest your deb should install to /usr instead of /opt, uses share/applications for desktop files? e.g. Simply put, in your tree, put desktop files under share/applications, make sure to use differing filenames, then it should work equally well if unpacked to /usr, /usr/local, an also (for most systems) ~/.local.
In share/doc, you'll be wanting to put your files into a folder so they end up like/usr/share/doc/oolite-starter(-majorversion)/copyright and obviously NOT /usr/share/doc/copyright. Same logic for /usr, /usr/local, ~/.local, or any other potentially shared installation destination.
To buff and polish, I suggest adding a variation of these fields to the .desktop file, which will aid rapid searching, and have it appear in sane menu places.I doubt if programming or development are relevant, edit as you will, I just copied here what I'm doing for OoDC.
Code: Select all
Categories=Game;Simulation;Development
Keywords=Space;Game;Simulation;Debug;Programming
Right. /opt/oolitestarter-hoopsnake/bin/OoliteStarter_hoopsnake here we come!!