Johannes Lips (who packages gretl for Fedora) has pointed out
to me that with the gretl 1.9.10 package the XDG files
(desktop file, icons, mime types) don't get installed when you
do a top-level "make install". This bug affects those who are
building gretl from source for their use, and also packagers.
In a sense this is easy to fix (just add gretl's xdg
subdirectory to the list of SUBDIRS that get activated by
"make install") but actually it raises some further issues and
I'd like to hear people's views.
Between the 1.9.9 and 1.9.10 releases I added up-to-date XDG
support, but the way I implemented "make install" in the xdg
subdir relies on the XDG tools (xdg-desktop-menu, xdg-mime,
xdg-icon-resource). These are nice in that they handle both
the case where they're invoked by root (in which case the
icons and so on are installed to system locations) and the
case where they're invoked by an unprivileged user (in which
case the files go under ~/.local). Moreover, the installed
locations of these files are guaranteed to be right -- so
they're found by the desktop software -- unless the system
itself is messed up.
But... using these tools is not what a packager wants, since
they won't respect DESTDIR. For packaging purposes we need to
figure the correct locations in advance based on the
installation prefix. For example, instead of doing
# nice for regular people
xdg-desktop-menu install gretl.desktop --novendor
we need to do something like
# packager-friendly
$(INSTALL_DATA) gretl.desktop \
$(DESTDIR)$(prefix)/share/applications
So, should we set up a choice between these methods in the
configure script? If so, any suggestions on which should be
the default (if there's a default) and how the option might be
phrased?
One possibility would be an "enable" switch:
--enable-xdg-utils Use xdg-utils for installing XDG files
which could either default to "no" or perhaps to "auto", based
on whether or not xdg-desktop-menu is found. In the latter
case a packager whose machine has xdg-utils installed would
have to do --disable-xdg-utils.
Allin Cottrell