]> git.draconx.ca Git - rrace.git/commitdiff
Generate and install "locolor" icons.
authorNick Bowler <nbowler@draconx.ca>
Wed, 30 Nov 2022 04:20:48 +0000 (23:20 -0500)
committerNick Bowler <nbowler@draconx.ca>
Sat, 3 Dec 2022 19:32:19 +0000 (14:32 -0500)
Since we now have the capability to generate nice enough 16-colour
icons, let's install them into the "locolor" theme.

It also turns out that icon installation was broken by the recent
rework, so as a bonus the "hicolor" icons are installed again too.
In an attempt to avoid this happening in the future, add a new
installcheck procedure which does a very basic sanity check.

Makefile.am
data/.gitignore

index d99c5d754c354a9541cbc3ec06affecf127c0566..b475a79e8215a8b1f213fa9a8249cee19941d8e6 100644 (file)
@@ -105,18 +105,28 @@ $(t_ewmhicon_OBJECTS): $(gnulib_headers)
 t_rng_test_LDADD = libgnu.a
 $(t_rng_test_OBJECTS): $(gnulib_headers)
 
-XPMICONS = data/rr16x16.xpm data/rr24x24.xpm data/rr32x32.xpm data/rr48x48.xpm
+XPMICONS_LOCOLOR = data/lo16x16.xpm data/lo32x32.xpm data/lo48x48.xpm
+XPMICONS_HICOLOR = data/hi16x16.xpm data/hi24x24.xpm \
+                   data/hi32x32.xpm data/hi48x48.xpm
+
+XPMICONS = $(XPMICONS_LOCOLOR) $(XPMICONS_HICOLOR)
 PNGICONS = $(XPMICONS:.xpm=.png)
 
 DISTCLEANFILES += $(XPMICONS)
 MAINTAINERCLEANFILES += $(PNGICONS)
 
-$(XPMICONS): t/ewmhicon$(EXEEXT)
+$(XPMICONS_HICOLOR): t/ewmhicon$(EXEEXT)
        $(AM_V_GEN) $(MKDIR_P) $(@D)
        $(AM_V_at) s=`expr $(@F) : '[^0-9]*\([^.]*\)'`; \
          t/ewmhicon$(EXEEXT) -c yrwyogbbg "$$s" >$(@:.xpm=.tmp)
        $(AM_V_at) mv -f $(@:.xpm=.tmp) $@
 
+$(XPMICONS_LOCOLOR): t/ewmhicon$(EXEEXT)
+       $(AM_V_GEN) $(MKDIR_P) $(@D)
+       $(AM_V_at) s=`expr $(@F) : '[^0-9]*\([^.]*\)'`; \
+         t/ewmhicon$(EXEEXT) --w32vga -c yrwyogbbg "$$s" >$(@:.xpm=.tmp)
+       $(AM_V_at) mv -f $(@:.xpm=.tmp) $@
+
 GENERIC_V   = $(GENERIC_V_@AM_V@)
 GENERIC_V_  = $(GENERIC_V_@AM_DEFAULT_V@)
 GENERIC_V_0 = @printf '%2.0s%$(DX_ALIGN_V)s %s\n'
@@ -151,27 +161,39 @@ dist-icons: build-icons
          fi; done
 .PHONY: dist-icons
 
-iconsdir = $(datarootdir)/icons/hicolor
+hicolordir = $(datarootdir)/icons/hicolor
+locolordir = $(datarootdir)/icons/locolor
 
 install-data-local: install-icons
 install-icons: build-icons
-       for f in $(GENICONS); do \
+       for f in $(PNGICONS); do \
          s=`expr "$$f" : '[^0-9]*\([^.]*\)'`; \
-         od="$(DESTDIR)$(iconsdir)/$$s/apps"; \
-         $(MKDIR_P) "$$od"; if test -f "$$f"; \
-           then $(INSTALL_DATA) "$$f" "$$od/$(PACKAGE_TARNAME).png"; \
-           else $(INSTALL_DATA) "$(srcdir)/$$f" "$$od/$(PACKAGE_TARNAME).png";\
-         fi; done
+         od="$(hicolordir)"; case $$f in */lo*) od="$(locolordir)" ;; esac; \
+         od="$(DESTDIR)$$od/$$s/apps"; test -f "$$f" || f="$(srcdir)/$$f"; \
+         $(MKDIR_P) "$$od"; \
+         $(INSTALL_DATA) "$$f" "$$od/$(PACKAGE_TARNAME).png"; \
+       done
 .PHONY: install-icons
 
 uninstall-local: uninstall-icons
 uninstall-icons:
-       for f in $(GENICONS); do \
+       for f in $(PNGICONS); do \
          s=`expr "$$f" : '[^0-9]*\([^.]*\)'`; \
-         od="$(DESTDIR)$(iconsdir)/$$s/apps"; \
+         od="$(hicolordir)"; case $$f in */lo*) od="$(locolordir)" ;; esac; \
+         od="$(DESTDIR)$$od/$$s/apps"; \
          rm -f "$$od/$(PACKAGE_TARNAME).png"; \
-         done
+       done
 .PHONY: uninstall-icons
 
+installcheck = installcheck
+$(installcheck): check-installed-icons
+check-installed-icons:
+       $(GENERIC_V) : 'CHECK   ' "$(DESTDIR)$(hicolordir)"; \
+         cd "$(DESTDIR)$(hicolordir)" && \
+         test `find -name $(PACKAGE_TARNAME).png | wc -l` -gt 0
+       $(GENERIC_V) : 'CHECK   ' "$(DESTDIR)$(locolordir)"; \
+         cd "$(DESTDIR)$(locolordir)" && \
+         test `find -name $(PACKAGE_TARNAME).png | wc -l` -gt 0
+
 include $(top_srcdir)/lib/gnulib.mk
 include $(top_srcdir)/common/snippet/autotest.mk
index 5440e716ac6fdf14ec96e16485c3d5809ba6c98f..c31310405bce94b6416fe210448a16c83e797173 100644 (file)
@@ -1 +1 @@
-/rr??x??.[xp][pn][mg]
+/[lh][oi]??x??.[xp][pn][mg]