]> git.0d.be Git - empathy.git/blob - data/icons/Makefile.am
remove protocol icons from empathy tree
[empathy.git] / data / icons / Makefile.am
1 NULL =
2
3 public_icons_themes = \
4         hicolor \
5         $(NULL)
6
7 public_icons = \
8         hicolor_apps_16x16_empathy.png \
9         hicolor_apps_22x22_empathy.png \
10         hicolor_apps_24x24_empathy.png \
11         hicolor_apps_32x32_empathy.png \
12         hicolor_apps_48x48_empathy.png \
13         hicolor_apps_256x256_empathy.png \
14         $(NULL)
15
16 private_icons_themes = \
17         hicolor \
18         $(NULL)
19
20 private_icons = \
21         hicolor_actions_16x16_im-message-new.png \
22         hicolor_actions_22x22_im-message-new.png \
23         hicolor_actions_24x24_im-message-new.png \
24         hicolor_status_16x16_im-message.png \
25         hicolor_status_22x22_im-message.png \
26         hicolor_status_16x16_user-typing.png \
27         hicolor_status_16x16_user-available.png \
28         hicolor_status_16x16_user-away.png \
29         hicolor_status_16x16_user-busy.png \
30         hicolor_status_16x16_user-idle.png \
31         hicolor_status_16x16_user-offline.png \
32         hicolor_status_16x16_empathy-pending.png \
33         hicolor_status_22x22_user-available.png \
34         hicolor_status_22x22_user-away.png \
35         hicolor_status_22x22_user-busy.png \
36         hicolor_status_22x22_user-idle.png \
37         hicolor_status_22x22_user-offline.png \
38         hicolor_status_22x22_empathy-pending.png \
39         hicolor_status_24x24_user-available.png \
40         hicolor_status_24x24_user-away.png \
41         hicolor_status_24x24_user-busy.png \
42         hicolor_status_24x24_user-idle.png \
43         hicolor_status_24x24_user-offline.png \
44         hicolor_status_24x24_empathy-pending.png \
45         hicolor_status_32x32_user-available.png \
46         hicolor_status_32x32_user-away.png \
47         hicolor_status_32x32_user-busy.png \
48         hicolor_status_32x32_user-idle.png \
49         hicolor_status_32x32_user-offline.png \
50         hicolor_status_32x32_empathy-pending.png \
51         hicolor_status_48x48_user-available.png \
52         hicolor_status_48x48_user-away.png \
53         hicolor_status_48x48_user-busy.png \
54         hicolor_status_48x48_user-idle.png \
55         hicolor_status_48x48_user-offline.png \
56         hicolor_status_48x48_empathy-pending.png \
57         hicolor_status_scalable_user-available.svg \
58         hicolor_status_scalable_user-away.svg \
59         hicolor_status_scalable_user-busy.svg \
60         hicolor_status_scalable_user-idle.svg \
61         hicolor_status_scalable_user-offline.svg \
62         hicolor_status_scalable_empathy-pending.svg \
63         $(NULL)
64
65 EXTRA_DIST = \
66         $(public_icons)         \
67         $(private_icons)        \
68         empathy.svg             \
69         $(NULL)
70
71 include $(srcdir)/utils.mk
72
73 ###############################################################################
74
75 gtk_update_icon_cache = gtk-update-icon-cache -f -t
76
77 update-icon-cache:
78         @-if test -z "$(DESTDIR)"; then \
79                 echo "Updating Gtk icon cache."; \
80                 for theme in $(public_icons_themes); do \
81                         $(gtk_update_icon_cache) $(datadir)/icons/$$theme; \
82                 done; \
83                 for theme in $(private_icons_themes); do \
84                         $(gtk_update_icon_cache) $(pkgdatadir)/icons/$$theme; \
85                 done; \
86         else \
87                 echo "*** Icon cache not updated.  After (un)install, run this:"; \
88                 for theme in $(public_icons_themes); do \
89                         echo "***   $(gtk_update_icon_cache) $(datadir)/icons/$$theme"; \
90                 done; \
91                 for theme in $(private_icons_themes); do \
92                         echo "***   $(gtk_update_icon_cache) $(pkgdatadir)/icons/$$theme"; \
93                 done; \
94         fi
95
96 install-icons:
97         for icon in $(public_icons); do \
98                 THEME=`echo $$icon | cut -d_ -f1`; \
99                 CONTEXT=`echo $$icon | cut -d_ -f2`; \
100                 SIZE=`echo $$icon | cut -d_ -f3`; \
101                 ICONFILE=`echo $$icon | cut -d_ -f4`; \
102                 mkdir -p $(DESTDIR)$(datadir)/icons/$$THEME/$$SIZE/$$CONTEXT; \
103                 $(INSTALL_DATA) $(srcdir)/$$icon $(DESTDIR)$(datadir)/icons/$$THEME/$$SIZE/$$CONTEXT/$$ICONFILE; \
104         done; \
105         for icon in $(private_icons); do \
106                 THEME=`echo $$icon | cut -d_ -f1`; \
107                 CONTEXT=`echo $$icon | cut -d_ -f2`; \
108                 SIZE=`echo $$icon | cut -d_ -f3`; \
109                 ICONFILE=`echo $$icon | cut -d_ -f4`; \
110                 mkdir -p $(DESTDIR)$(pkgdatadir)/icons/$$THEME/$$SIZE/$$CONTEXT; \
111                 $(INSTALL_DATA) $(srcdir)/$$icon $(DESTDIR)$(pkgdatadir)/icons/$$THEME/$$SIZE/$$CONTEXT/$$ICONFILE; \
112         done
113
114 uninstall-icons:
115         -for icon in $(public_icons); do \
116                 THEME=`echo $$icon | cut -d_ -f1`; \
117                 CONTEXT=`echo $$icon | cut -d_ -f2`; \
118                 SIZE=`echo $$icon | cut -d_ -f3`; \
119                 ICONFILE=`echo $$icon | cut -d_ -f4`; \
120                 rm -f $(DESTDIR)$(datadir)/icons/$$THEME/$$SIZE/$$CONTEXT/$$ICONFILE; \
121         done; \
122         for icon in $(private_icons); do \
123                 THEME=`echo $$icon | cut -d_ -f1`; \
124                 CONTEXT=`echo $$icon | cut -d_ -f2`; \
125                 SIZE=`echo $$icon | cut -d_ -f3`; \
126                 ICONFILE=`echo $$icon | cut -d_ -f4`; \
127                 rm -f $(DESTDIR)$(pkgdatadir)/icons/$$THEME/$$SIZE/$$CONTEXT/$$ICONFILE; \
128         done
129
130 install-data-local:
131         $(MAKE) install-icons
132         $(MAKE) update-icon-cache
133
134 uninstall-local:
135         $(MAKE) uninstall-icons
136         $(MAKE) update-icon-cache
137
138 # Local copy of the "installed" icon. This is used to be able to run empathy
139 # from source (see bgo #616159)
140 local_icons_dir = local-copy
141
142 # Generate the lists of destination paths
143 public_icons_local_install_paths = $(foreach obj, $(public_icons), $(local_icons_dir)/$(subst _,/,$(call reorder,_,1 3 2 4,$(obj))))
144 private_icons_local_install_paths = $(foreach obj, $(private_icons), $(local_icons_dir)/$(subst _,/,$(call reorder,_,1 3 2 4,$(obj))))
145
146 # For each destination path we'll need to compute back the original icon
147 # and create a rule that will ensure that the destination directory exists
148 # and then copy the original file
149 define icon_local_install_rule_template
150 $(local_icons_dir)/$$(subst _,/,$$(call reorder,_,1 3 2 4,$1)): $1
151         $$(AM_V_GEN)mkdir -p $$(@D)
152         $$(AM_V_GEN)cp $$^ $$@
153 endef
154
155 # Instantiate the template above for each icon
156 $(foreach icon,$(public_icons),$(eval $(call icon_local_install_rule_template,$(icon))))
157 $(foreach icon,$(private_icons),$(eval $(call icon_local_install_rule_template,$(icon))))
158
159 install-icons-src: $(public_icons_local_install_paths) $(private_icons_local_install_paths)
160
161 all: install-icons-src
162
163 clean-local:
164         -rm -rf $(local_icons_dir)