cadabra2 icon indicating copy to clipboard operation
cadabra2 copied to clipboard

icon cache and desktop database shouldn't be updated from cmake scripts

Open yurivict opened this issue 10 months ago • 2 comments

These 3 lines break when istallation is done into the stage directory.

Pretty much all packaging systems install into the stage directory.

AFAIK cmake has no easy way of knowing whether installation is done into the stage directory. Perhaps the DESTDIR environment variable can be used as an indication.

I would suggest to either fix these lines so that they would work in both cases (of direct installation and stage installation), or remove them, since it is very unconventional to do this from cmake.

yurivict avatar Jan 08 '25 21:01 yurivict

I agree that this is ugly. If you know an authoritative reference for how to handle these things I am all ears. But it seems to me that either I do not include this, in which case make install will not properly install cadabra into the desktop menus etc., or I include it and then things break with strict packaging systems.

kpeeters avatar Jan 08 '25 22:01 kpeeters

You can try to make changes like this:

gtk-update-icon-cache --ignore-theme-index ${ICON_PREFIX_WITH_DESTDIR}/share/icons/hicolor

becomes

sh -c "if [ -z \"\$DESTDIR\" ]; then gtk-update-icon-cache --ignore-theme-index ${ICON_PREFIX_WITH_DESTDIR}/share/icons/hicolor; fi"

If such wrapped commands would work for a direct installation - this would likely fix the problem.

yurivict avatar Jan 08 '25 22:01 yurivict