From 69ac706959ec017629535a8fdac28e2ba2d37fc3 Mon Sep 17 00:00:00 2001 From: yabause Date: Sun, 12 Jul 2009 06:22:41 +0000 Subject: [PATCH] Added support for application/x-nintendo-ds-rom mime type in gtk desktop file. Also added some (un)install hooks so that mime type database is updated when (un)installing the gtk port. Those two changes let users double-click on a rom to open it with the gtk port. --- desmume/configure.ac | 2 ++ desmume/src/gtk/Makefile.am | 14 ++++++++++++++ desmume/src/gtk/desmume.desktop | 1 + 3 files changed, 17 insertions(+) diff --git a/desmume/configure.ac b/desmume/configure.ac index c4425c54a..386967996 100644 --- a/desmume/configure.ac +++ b/desmume/configure.ac @@ -151,6 +151,8 @@ AC_PROVIDE_IFELSE([PKG_PROG_PKG_CONFIG], [ PKG_CHECK_MODULES(LIBAGG, libagg >= 2.5.0, HAVE_LIBAGG=yes, HAVE_LIBAGG=no) AC_SUBST(LIBAGG_CFLAGS) AC_SUBST(LIBAGG_LIBS) + + AC_PATH_PROG(UPDATEDESKTOP, [update-desktop-database]) fi ],[ echo "WARNING: pkg-config is not available therefore gtk, gtk-glade UIs and lua scripting are not available either." diff --git a/desmume/src/gtk/Makefile.am b/desmume/src/gtk/Makefile.am index 432903bbe..28034aa19 100644 --- a/desmume/src/gtk/Makefile.am +++ b/desmume/src/gtk/Makefile.am @@ -24,3 +24,17 @@ desmume_LDADD = ../libdesmume.a \ if HAVE_GDB_STUB desmume_LDADD += ../gdbstub/libgdbstub.a endif + +UPDATE_DESKTOP = \ + appsdir=$(DESTDIR)$(datadir)/applications ; \ + if [ -f $$appsdir/mimeinfo.cache ] ; then \ + if test ! "x$(UPDATEDESKTOP)" = "x" ; then \ + $(UPDATEDESKTOP) $$appsdir ; \ + fi \ + fi + +install-data-hook: + $(UPDATE_DESKTOP) + +uninstall-hook: + $(UPDATE_DESKTOP) diff --git a/desmume/src/gtk/desmume.desktop b/desmume/src/gtk/desmume.desktop index 1868030b1..cae4c8eba 100644 --- a/desmume/src/gtk/desmume.desktop +++ b/desmume/src/gtk/desmume.desktop @@ -7,3 +7,4 @@ TryExec=desmume Exec=desmume Icon=DeSmuME Categories=GNOME;GTK;Game;Emulator; +MimeType=application/x-nintendo-ds-rom;