[gnome-games] mahjongg: Install data files into standard location
- From: Robert Ancell <rancell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games] mahjongg: Install data files into standard location
- Date: Sat, 31 Dec 2011 07:52:11 +0000 (UTC)
commit f3e999f299d3bb773a4db49072d9df364ce65911
Author: Robert Ancell <robert ancell canonical com>
Date: Sat Dec 31 18:41:00 2011 +1100
mahjongg: Install data files into standard location
mahjongg/data/Makefile.am | 17 +++++++----------
mahjongg/src/Makefile.am | 7 +++----
mahjongg/src/config.vapi | 3 ++-
mahjongg/src/mahjongg.vala | 9 +++------
4 files changed, 15 insertions(+), 21 deletions(-)
---
diff --git a/mahjongg/data/Makefile.am b/mahjongg/data/Makefile.am
index 301e519..9f7eb0f 100644
--- a/mahjongg/data/Makefile.am
+++ b/mahjongg/data/Makefile.am
@@ -1,15 +1,13 @@
SUBDIRS = icons
-mapdir = $(pkgdatadir)/mahjongg/games
+mapdir = $(datadir)/mahjongg/maps
map_DATA = \
- mahjongg.map \
- $(NULL)
+ mahjongg.map
-pixmapdir = $(pkgdatadir)/mahjongg/pixmaps
-pixmap_DATA = \
+themedir = $(datadir)/mahjongg/themes
+theme_DATA = \
smooth.png \
- postmodern.svg \
- $(NULL)
+ postmodern.svg
gsettings_in_file = org.gnome.mahjongg.gschema.xml.in
gsettings_SCHEMAS = $(gsettings_in_file:.xml.in=.xml)
@@ -23,12 +21,11 @@ desktopdir = $(datadir)/applications
desktop_DATA = $(desktop_in_files:.desktop.in.in=.desktop)
EXTRA_DIST = \
- $(pixmap_DATA) \
+ $(theme_DATA) \
$(gsettings_in_file) \
$(man_MANS) \
$(map_DATA) \
- translatable_game_names.h \
- $(NULL)
+ translatable_game_names.h
CLEANFILES = $(desktop_DATA) $(gsettings_SCHEMAS)
DISTCLEANFILES = $(desktop_DATA) $(gsettings_SCHEMAS)
diff --git a/mahjongg/src/Makefile.am b/mahjongg/src/Makefile.am
index 1df2f0a..6965634 100644
--- a/mahjongg/src/Makefile.am
+++ b/mahjongg/src/Makefile.am
@@ -5,8 +5,7 @@ mahjongg_SOURCES = \
game.vala \
game-view.vala \
mahjongg.vala \
- map.vala \
- $(NULL)
+ map.vala
mahjongg_VALAFLAGS = \
--pkg posix \
@@ -18,6 +17,7 @@ mahjongg_CFLAGS = \
-I$(top_srcdir)/libgames-support \
-DVERSION=\"$(VERSION)\" \
-DGETTEXT_PACKAGE=\"$(GETTEXT_PACKAGE)\" \
+ -DDATA_DIRECTORY=\"$(datadir)/mahjongg\" \
$(GTK_CFLAGS)
if ENABLE_SETGID
@@ -27,8 +27,7 @@ endif
mahjongg_LDADD = \
$(top_builddir)/libgames-support/libgames-support.la \
$(GTK_LIBS) \
- $(INTLLIBS) \
- $(NULL)
+ $(INTLLIBS)
if HAVE_GNOME
mahjongg_CFLAGS += $(GNOME_CFLAGS)
diff --git a/mahjongg/src/config.vapi b/mahjongg/src/config.vapi
index 6477226..c0c89fc 100644
--- a/mahjongg/src/config.vapi
+++ b/mahjongg/src/config.vapi
@@ -1,2 +1,3 @@
public const string VERSION;
-public const string GETTEXT_PACKAGE;
\ No newline at end of file
+public const string GETTEXT_PACKAGE;
+public const string DATA_DIRECTORY;
diff --git a/mahjongg/src/mahjongg.vala b/mahjongg/src/mahjongg.vala
index d48b1ec..a0bfa8c 100644
--- a/mahjongg/src/mahjongg.vala
+++ b/mahjongg/src/mahjongg.vala
@@ -196,8 +196,7 @@ public class Mahjongg : Gtk.Application
private GnomeGamesSupport.Preimage? load_theme_texture (string filename, bool fail_on_error = false)
{
- var pixmap_directory = GnomeGamesSupport.runtime_get_directory (GnomeGamesSupport.RuntimeDirectory.GAME_PIXMAP_DIRECTORY);
- var path = Path.build_filename (pixmap_directory, filename);
+ var path = Path.build_filename (DATA_DIRECTORY, "themes", filename);
try
{
return new GnomeGamesSupport.Preimage.from_file (path);
@@ -439,11 +438,10 @@ public class Mahjongg : Gtk.Application
{
List<string> themes = null;
- var path = GnomeGamesSupport.runtime_get_directory (GnomeGamesSupport.RuntimeDirectory.GAME_PIXMAP_DIRECTORY);
Dir dir;
try
{
- dir = Dir.open (path);
+ dir = Dir.open (Path.build_filename (DATA_DIRECTORY, "themes"));
}
catch (FileError e)
{
@@ -743,8 +741,7 @@ public class Mahjongg : Gtk.Application
/* Add the builtin map */
maps.append (new Map.builtin ());
- var path = GnomeGamesSupport.runtime_get_directory (GnomeGamesSupport.RuntimeDirectory.GAME_GAMES_DIRECTORY);
- var filelist = new GnomeGamesSupport.FileList ("*.map", ".", path, null);
+ var filelist = new GnomeGamesSupport.FileList ("*.map", ".", Path.build_filename (DATA_DIRECTORY, "maps"), null);
for (var i = 0; i < filelist.length (); i++)
{
var filename = filelist.get_nth (i);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]