SameBoy icon indicating copy to clipboard operation
SameBoy copied to clipboard

FreeDesktop issues

Open nadiaholmquist opened this issue 4 years ago • 2 comments

I noticed a couple of issues with the way the freedesktop stuff is installed:

  • Generally filetype icons for "generic" filetypes that might be handled by multiple apps aren't installed, when the files are associated by your application they will get the application's icon in most desktops and that's how it tends to be done
  • I don't think you're supposed to install the MIME type definition, other emulators such as Dolphin don't do this.
  • The .desktop file doesn't get installed by make install if PREFIX is set, it needs to be for distro packages where make install is run targeting a directory in the application's build directory.
  • Installation fails if ${DESTDIR}/${PREFIX} does not already exist.
  • Updating the icon/menu cache should not be done by your build system, this should be done by a distro package
  • Don't try to run things as root in the build system, and also the $SUDO_USER environment variable isn't set.

nadiaholmquist avatar Feb 28 '21 00:02 nadiaholmquist

Bullet 1 is because in all distros I checked (Not that many, I admit) don't have a single icon theme that includes icons for Game Boy ROMs. Leaving those files with a generic icon leaves the user with no visible indication that these files can be opened from the file browser. I'm aware this isn't the intended way, but for most users it's a UX upgrade, and FreeDesktop provides no other solution.

Bullet 2 is due to bullet 1, I can't assign an icon without installing a MIME definition.

Bullet 3 & 4 – will be fixed

Bullet 5 – A few distros aside, SameBoy does not have any packages; for the vast majority of Linux users, the make file is the only way to install SameBoy. This is especially true for mainstream distros with a policy against emulators, or ones that are very slow to upgrade packages. I need to have some way for users to properly install SameBoy if there is not package for their distribution, and make install is a standard way users expect.

Bullet 6 – It's actually the other way around. I noticed that some desktop environments behave differently if you run xdg-desktop-menu forceupdate as root, so if one runs sudo make install it would not work as expected. sudo sets the SUDO_USER environment variable to the name of the user that invoked it, and su de-escalate from root to the non-root user. It might be a good idea to wrap that call with an if though (Shouldn't run when SUDO_USER is not set)

I'd like to hear more opinions on this, especially if there are better ways to address the issues mentioned above.

LIJI32 avatar Feb 28 '21 13:02 LIJI32

* Generally filetype icons for "generic" filetypes that might be handled by multiple apps aren't installed, when the files are associated by your application they will get the application's icon in most desktops and that's how it tends to be done

a whole bunch of of themes do not ship with gameboy icons and even the more popular ones like Breeze / Breeze-Dark only ship gameboy icons (which are just copies of the default executable icon), not gameboy color and even those are often not used because gameboy roms are given the application-x-executable mime icon

* I don't think you're supposed to install the MIME type definition, other emulators such as Dolphin don't do this.

Citing the fact other emulators do not provide is not a good reason. Other well known applications like Audacity provide their own mime type and some distros pack their own mime types for programs like Blender.

The current shared-mime-info database provides great mimetypes for a lot of things but many of them

* Updating the icon/menu cache should not be done by your build system, this should be done by a distro package

I agree with this but its already the case I can only speak for rpm packaging, since I actively package sameboy for fedora as a copr for make install DESTDIR is set to the isolated root used for packaging, when DESTDIR is non empty the Makefile leaves all the updating to the whoever is building it

Jan200101 avatar Mar 02 '21 13:03 Jan200101