The re-use of DESKTOP_PREFIX was to avoid inventing another variable . Another/new variable could be used as enabler for for this install mode - I just re-used DESKTOP_PREFIX as it wasn't used in this mode.
Well - yes - but like you wrote prefix can be set appropriately Remember it is a staging dir install (DESTDIR is set) The current solution would not be able to a stage install with everything under prefix /opt/local With my patch it is possible with the following command: make DESTDIR=/tmp/vice-stage-dir DESKTOP_PREFIX="" prefix=/opt/local install
Ok, I gave this a second thought :-) The attached patch enables the best of both worlds when installing into stage areas If DESTDIR is set - the current behavior of your commit is kept While DESTDIR is still set - but DESKTOP_PREFIX is forced to an empty value - a staged install behavior similar to previous behavior is achieved. example: make DESTDIR=/tmp/vice-stage-dir DESKTOP_PREFIX="" prefix=/ install
Ok, I gave this a second thought :-) The attached patch enables the best of both worlds when installing into stage areas If DESTDIR is set - the current behavior of your commit is kept While DESTDIR is still set - but DESKTOP_PREFIX is forced to an empty value - a staged install behavior similar to previous behavior is achieved. example: make DESTDIR=/tmp/vice-stage-dir DESKTOP_PREFIX="" prefix=/ install
What kind of packages are you producing there anyway? I'm playing with cross-compilation for Windows and FreeBSD (and MacOS) - just for fun :-) Oh i dont think anyone would try to install the desktop files or icons on macOS :) Is it even XDG compliant at all? Propably not - it seems that a better MacOS friendly approach it to have the icon(s) as a resource inside the app-bundle dir :-)
Did you read the lengthy comment in the makefile that explains what it does and why? yes I did :-) What I'm trying to say is that the current solution works - as it will handle the most common scenarios. But (for example) /opt/local/share is a perfectly legal prefix location for xdg files on Linux - just like FreeBSD mandates /usr/local/share for any xdg files that are not a part of the base-os. Also prefix-less installs into stage dir got a little worse by the current solution - a staged install...
As I see it the current committed solution is still not really good. To see for yourself you could try to do a staged install using the following parameters (and then inspect the results): make DESTDIR=/tmp/vice-stage DESKTOP_PREFIX=/opt/local prefix=/opt/local install
Note that PREFIX is not meant for staged installs. That is what DESTDIR is for (which is empty for direct installs). I do not agree with this - both PREFIX and DESTDIR are needed to construct certain staged directory layouts