[recipes] Fix non-srcdir builds from git
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [recipes] Fix non-srcdir builds from git
- Date: Sat, 25 Feb 2017 19:41:52 +0000 (UTC)
commit 575493c0c6d28d468a32de75dbf74e336a9aa824
Author: Matthias Clasen <mclasen redhat com>
Date: Sat Feb 25 14:21:28 2017 -0500
Fix non-srcdir builds from git
jhbuild defaults to this now, so better make it work, for both
autotools and meson. To make it work with autotool we need to
split off the generated resources into a separate .gresource.xml
file.
Makefile.am | 2 +-
src/Makefile.am | 11 +++++++++--
src/meson.build | 8 +++++++-
src/recipes-generated.gresource.xml | 6 ++++++
src/recipes-images.gresource.xml | 1 -
5 files changed, 23 insertions(+), 5 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 83a5a0b..f101412 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -27,7 +27,7 @@ NEWS: data/appdata/org.gnome.Recipes.appdata.xml.in
fi
libgd.info:
- $(AM_V_GEN)(cd libgd; git log -1 --pretty=%h) > $@
+ $(AM_V_GEN)(cd $(top_srcdir)/libgd; git log -1 --pretty=%h) > $@
.PHONY: NEWS
diff --git a/src/Makefile.am b/src/Makefile.am
index bacc49b..71c99dc 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,7 +1,7 @@
bin_PROGRAMS = gnome-recipes
-commitid := $(shell $(GIT) describe)
-libgd_info = $(shell cat $(top_srcdir)/libgd.info)
+commitid := $(shell cd $(top_srcdir); $(GIT) describe)
+libgd_info = $(shell cat $(top_builddir)/libgd.info)
gnome_recipes_CFLAGS = \
$(WARN_CFLAGS) \
@@ -153,6 +153,7 @@ DISTCLEANFILES = \
MAINTAINERCLEANFILES = \
resources-ui.c \
resources-images.c \
+ resources-generated.c \
types.h \
types.c \
gr-shell-search-provider-dbus.h \
@@ -179,6 +180,12 @@ resources-images.c: recipes-images.gresource.xml $(resource_image_files)
$(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) $(srcdir)/recipes-images.gresource.xml \
--target=$@ --sourcedir=$(srcdir) --generate-source
+resource_generated_files = $(shell $(GLIB_COMPILE_RESOURCES) --sourcedir=$(builddir) --generate-dependencies
$(srcdir)/recipes-generated.gresource.xml)
+
+resources-generated.c: recipes-generated.gresource.xml $(resource_generated_files)
+ $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) $(srcdir)/recipes-generated.gresource.xml \
+ --target=$@ --sourcedir=$(builddir) --generate-source
+
types.h: types.h.template gr-diet.h
$(AM_V_GEN) ($(GLIB_MKENUMS) --template $^ ) > xgen-eh && \
cp xgen-eh $@ && \
diff --git a/src/meson.build b/src/meson.build
index 317f30a..af3108a 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -34,6 +34,11 @@ resources_ui = gnome.compile_resources('resources_ui',
resources_images = gnome.compile_resources('resources_images',
'recipes-images.gresource.xml',
c_name: '_recipes_images',
+ source_dir: 'src')
+
+resources_generated = gnome.compile_resources('resources_generated',
+ 'recipes-generated.gresource.xml',
+ c_name: '_recipes_generated',
source_dir: 'src',
dependencies: cuisine_css)
@@ -106,7 +111,8 @@ src += ['main.c',
enums,
search_provider,
resources_ui,
- resources_images]
+ resources_images,
+ resources_generated]
executable('gnome-recipes',
src,
diff --git a/src/recipes-generated.gresource.xml b/src/recipes-generated.gresource.xml
new file mode 100644
index 0000000..ab920d4
--- /dev/null
+++ b/src/recipes-generated.gresource.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<gresources>
+ <gresource prefix="/org/gnome/Recipes">
+ <file>cuisine.css</file>
+ </gresource>
+</gresources>
diff --git a/src/recipes-images.gresource.xml b/src/recipes-images.gresource.xml
index 8f8f3af..fa754f1 100644
--- a/src/recipes-images.gresource.xml
+++ b/src/recipes-images.gresource.xml
@@ -3,7 +3,6 @@
<gresource prefix="/org/gnome/Recipes">
<file>org.gnome.Recipes-symbolic.symbolic.png</file>
<file>recipes.css</file>
- <file>cuisine.css</file>
<file>icons/16x16/apps/garlic-content-symbolic.symbolic.png</file>
<file>icons/24x24/apps/garlic-content-symbolic.symbolic.png</file>
<file>icons/32x32/apps/garlic-content-symbolic.symbolic.png</file>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]