[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
gtk-update-icon-cahce, update-mime-database
From: |
Yevgen Muntyan |
Subject: |
gtk-update-icon-cahce, update-mime-database |
Date: |
Fri, 01 Feb 2008 00:06:02 -0600 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.11) Gecko/20071119 Iceape/1.1.7 (Debian-1.1.7-1) |
Hey,
Sorry for a long post, hope you can read through it.
I am seeking an advice on the following. Gtk applications
which have icons should install them into
/usr/share/icons/hicolor/somesize/somewhere
and then call gtk-update-icon-cache (see below [*]
for a sample of makefile rules). This should be done
on install and uninstall. Similarly, if an application
has files for mime database, it should install those
files into /usr/share/mime/packages/ and then run
update-mime-database, also on install and uninstall.
Stuff like this is fairly hard (unless you find editing
Makefile.am and configure.ac easy), see for instance
this: http://bugzilla.gnome.org/show_bug.cgi?id=362604
My question is, is it possible to write some nifty
autoconf macros to make this task easy? I would
like to have some GTK_MISC_FILES macro in
configure.ac, which would make me able to put the
following into Makefile.am:
GTK_ICONS = myicon.png
and have all that gtk-update-icon-cache stuff handled
automatically. I can't actually imagine how I would
specify 48x48/apps directory here, though I do know
I want something nice and simple ;)
I can write an autoconf macro which will make me able
to do (in Makefile.am)
GTK_ICONS = myicon.png
GTK_ICONS_DIR = 48x48/apps
@GTK_ICONS_MAGIC_RULE@
That GTK_ICONS_MAGIC_RULE would actually
expand to a make rule (though I am not sure if
I can have two rules in it). But it'd be inconvenient
(at least my experience with intltool macros is
rather terrible), and it would be impossible to have
a rule for mime files in the same Makefile.am (since
they also need install-data-hook target).
So, is it possible to have such a functionality without
changing automake?
Thanks!
Yevgen
[*] Here is a piece of my Makefile.am which installs an icon:
hicolor = $(datadir)/icons/hicolor
iconthemedir = $(hicolor)/48x48/apps
icontheme_DATA = ../moo/mooutils/pixmaps/medit.png
update_icon_cache = gtk-update-icon-cache -f -t $(DESTDIR)$(hicolor)
install-data-hook:
if echo "Updating icon cache" && $(update_icon_cache); then \
echo "Done."; \
else \
echo "*** GTK icon cache not updated. After install, run this:";\
echo $(update_icon_cache); \
fi
uninstall-hook:
echo "Updating icon cache" && $(update_icon_cache) && echo "Done."
- gtk-update-icon-cahce, update-mime-database,
Yevgen Muntyan <=