[gnome-nibbles] build: Simplify the GResource handling



commit cafeaf73de9d533439b1196240624db9c90eb245
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Thu Jun 2 16:54:20 2016 +0100

    build: Simplify the GResource handling
    
    Move the XML file into the data/ directory, and remove the full path to
    the various resources; this avoids builddir != srcdir issues.
    
    The C code generation can remain in the src/ directory, as long as the
    appropriate location for the resources is specified.

 configure.ac                       |    1 -
 data/gnome-nibbles.gresource.xml   |   15 +++++++++++++++
 src/Makefile.am                    |    9 +++++----
 src/gnome-nibbles.gresource.xml.in |   15 ---------------
 4 files changed, 20 insertions(+), 20 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index d47c48f..4267d65 100644
--- a/configure.ac
+++ b/configure.ac
@@ -76,6 +76,5 @@ data/pix/Makefile
 help/Makefile
 po/Makefile.in
 src/Makefile
-src/gnome-nibbles.gresource.xml
 ])
 AC_OUTPUT
diff --git a/data/gnome-nibbles.gresource.xml b/data/gnome-nibbles.gresource.xml
new file mode 100644
index 0000000..fc331ae
--- /dev/null
+++ b/data/gnome-nibbles.gresource.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<gresources>
+  <gresource prefix="/org/gnome/nibbles/ui">
+    <file>nibbles.ui</file>
+    <file>nibbles.css</file>
+    <file>scoreboard.ui</file>
+    <file>player-score-box.ui</file>
+    <file>controls-grid.ui</file>
+    <file>preferences-dialog.ui</file>
+  </gresource>
+  <gresource prefix="/org/gnome/nibbles/gtk">
+    <file alias="menus.ui">nibbles-menus.ui</file>
+  </gresource>
+</gresources>
+
diff --git a/src/Makefile.am b/src/Makefile.am
index 4eb7334..a98bb20 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -34,16 +34,17 @@ gnome_nibbles_VALAFLAGS = \
        --pkg libgames-support-1.0 \
        --pkg gee-0.8 \
        --target-glib=$(GLIB_REQUIRED) \
-       --gresources=$(builddir)/gnome-nibbles.gresource.xml
+       --gresources=$(top_srcdir)/data/gnome-nibbles.gresource.xml
 
 gnome_nibbles_LDADD = \
        $(GNOME_NIBBLES_LIBS)
 
-gnome-nibbles-resources.c: gnome-nibbles.gresource.xml $(shell $(GLIB_COMPILE_RESOURCES) 
--generate-dependencies gnome-nibbles.gresource.xml)
-       $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir) --sourcedir=$(builddir) 
--generate-source $<
+resources = $(shell $(GLIB_COMPILE_RESOURCES) --generate-dependencies --sourcedir=$(top_srcdir)/data 
$(top_srcdir)/data/gnome-nibbles.gresource.xml)
+
+gnome-nibbles-resources.c: $(top_srcdir)/data/gnome-nibbles.gresource.xml $(resources)
+       $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(top_srcdir)/data --generate-source $<
 
 CLEANFILES = \
-       gnome-nibbles.gresource.xml \
        gnome-nibbles-resources.c
 
 -include $(top_srcdir)/git.mk


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