File 0004-Use-native-update-mime-database-for-install-when-cro.patch of Package mingw64-shared-mime-info

From 1bb1ea32766c85b900510ee7e81b1036f1df9281 Mon Sep 17 00:00:00 2001
From: Hib Eris <hib@hiberis.nl>
Date: Thu, 3 Nov 2011 14:20:47 +0100
Subject: [PATCH 4/4] Use native update-mime-database for install when cross compiling

---
 Makefile.am  |    8 +++++++-
 configure.in |    9 +++++++++
 2 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 02a74e5..06ac26d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -46,9 +46,15 @@ $(pkgconfig_DATA): config.status
 @INTLTOOL_XML_RULE@
 @INTLTOOL_DESKTOP_RULE@
 
+if CROSS_COMPILING
+  update_mime_database=$(UPDATE_MIME_DATABASE)
+else
+  update_mime_database="$(top_builddir)/update-mime-database$(EXEEXT)"
+endif
+
 install-data-hook: install-binPROGRAMS
 if ENABLE_UPDATE_MIMEDB
-	$(top_builddir)/update-mime-database$(EXEEXT) -V "$(DESTDIR)$(datadir)/mime"
+	$(update_mime_database) -V "$(DESTDIR)$(datadir)/mime"
 endif
 
 uninstall-hook:
diff --git a/configure.in b/configure.in
index d3ed777..aa4ad88 100644
--- a/configure.in
+++ b/configure.in
@@ -46,6 +46,15 @@ AC_ARG_ENABLE(update-mimedb,
    AC_HELP_STRING([--disable-update-mimedb],
                    [disable the update-mime-database after install [default=no]]),,
     enable_update_mimedb=yes)
+
+if test $cross_compiling = yes && test x$enable_update_mimedb = xyes; then
+  AC_PATH_PROG(UPDATE_MIME_DATABASE, update-mime-database, no)
+  if test x$UPDATE_MIME_DATABASE = xno; then
+    enable_update_mimedb=no
+    AC_MSG_WARN(Could not find the update-mime-database program in your PATH. Your mime database will not be updated upon install.)
+  fi
+fi
+
 AM_CONDITIONAL(ENABLE_UPDATE_MIMEDB, test x$enable_update_mimedb = xyes)
 
 AC_PATH_PROG([XMLLINT],[xmllint])
-- 
1.7.4.1

openSUSE Build Service is sponsored by