[gucharmap] build: Validate desktop file on 'make check'



commit 6dbe4db14252d666123ba0eae83d9efd2ebe679c
Author: Christian Persch <chpe gnome org>
Date:   Mon Mar 25 21:11:50 2013 +0100

    build: Validate desktop file on 'make check'

 Makefile.am  |    7 +++++++
 configure.ac |    6 ++++++
 2 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 149c6ac..f9d312c 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -20,6 +20,13 @@ desktop_DATA          = $(desktop_in_files:.desktop.in.in=.desktop)
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = gucharmap-$(GUCHARMAP_API_PC_VERSION).pc
 
+desktop-file-validate: $(desktop_DATA)
+       for f in $^; do \
+               $(DESKTOP_FILE_VALIDATE) $$f; \
+       done
+
+check-local: desktop-file-validate
+
 EXTRA_DIST = \
        ChangeLog.pre-2-23 \
        ChangeLog.README \
diff --git a/configure.ac b/configure.ac
index ba32302..863f9fc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -171,6 +171,12 @@ fi
 #   AC_MSG_ERROR([hexdump not found])
 # fi
 
+AC_ARG_VAR([DESKTOP_FILE_VALIDATE],[the desktop-file-validate programme])
+AC_PATH_PROG([DESKTOP_FILE_VALIDATE],[desktop-file-validate],[])
+if test -z "$DESKTOP_FILE_VALIDATE"; then
+  AC_MSG_ERROR([desktop-file-validate not found])
+fi
+
 # ****
 # i18n
 # ****


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]