From 4af35fc40135a52c6cf137cebfa1719c737146ae Mon Sep 17 00:00:00 2001 From: Nick Bowler Date: Tue, 29 Nov 2022 23:20:48 -0500 Subject: [PATCH] Generate and install "locolor" icons. 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 | 46 ++++++++++++++++++++++++++++++++++------------ data/.gitignore | 2 +- 2 files changed, 35 insertions(+), 13 deletions(-) diff --git a/Makefile.am b/Makefile.am index d99c5d7..b475a79 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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 diff --git a/data/.gitignore b/data/.gitignore index 5440e71..c313104 100644 --- a/data/.gitignore +++ b/data/.gitignore @@ -1 +1 @@ -/rr??x??.[xp][pn][mg] +/[lh][oi]??x??.[xp][pn][mg] -- 2.43.2