[gnome-maps/wip/binary] Make gnome-maps a binary



commit af74d67843480fdd2a8d0f50efc0944c5d59de6f
Author: Mattias Bengtsson <mattias jc bengtsson gmail com>
Date:   Tue Jan 21 06:50:12 2014 +0100

    Make gnome-maps a binary

 configure.ac                 |    8 +++++-
 src/Makefile-js.am           |   33 ++++++++------------------
 src/Makefile.am              |   53 +++++++++++++++++++++++++++---------------
 src/application.js           |    2 +-
 src/gnome-maps.gresource.xml |   15 ------------
 src/gnome-maps.in            |   18 --------------
 6 files changed, 52 insertions(+), 77 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 6d475b6..5e21f67 100644
--- a/configure.ac
+++ b/configure.ac
@@ -5,7 +5,7 @@ AC_INIT([gnome-maps],
         [gnome-maps])
 
 AC_CONFIG_HEADERS([config/config.h])
-AC_CONFIG_SRCDIR([src/main.js])
+AC_CONFIG_SRCDIR([src/gnome-maps.c])
 AC_CONFIG_MACRO_DIR([m4])
 AC_CONFIG_AUX_DIR([config])
 
@@ -22,6 +22,12 @@ AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",[The name of the gettext d
 IT_PROG_INTLTOOL(0.40.0)
 PKG_PROG_PKG_CONFIG([0.22])
 
+SHARED_PCS="gtk+-3.0                  >= 3.11.4
+            gjs-internals-1.0         >= 1.39.0 
+            gobject-introspection-1.0 >= 0.10.1"
+
+PKG_CHECK_MODULES(GNOME_MAPS, $SHARED_PCS)
+
 # no stupid static libraries
 AM_DISABLE_STATIC
 # enable libtool
diff --git a/src/Makefile-js.am b/src/Makefile-js.am
index a7055f5..697f50f 100644
--- a/src/Makefile-js.am
+++ b/src/Makefile-js.am
@@ -1,21 +1,3 @@
-jsdir = $(pkgdatadir)/js/
-dist_js_DATA = \
-    application.js \
-    main.js \
-    mainWindow.js \
-    mapLocation.js \
-    mapView.js \
-    path.js \
-    sidebar.js \
-    settings.js \
-    utils.js \
-    userLocation.js \
-    geoclue.js \
-    zoomControl.js \
-    searchPopup.js \
-    contextMenu.js \
-    placeStore.js
-
 BUILT_SOURCES += \
     path.js \
     config.js
@@ -25,12 +7,17 @@ path.js: Makefile path.js.in
 config.js: Makefile config.js.in
        $(AM_V_GEN) $(do_subst) $(srcdir)/config.js.in > $@
 
-nodist_js_DATA = \
-    path.js \
-    config.js
+js_files = $(shell $(GLIB_COMPILE_RESOURCES) --sourcedir=$(srcdir) --generate-dependencies 
$(srcdir)/js.gresource.xml)
+gnome-maps-js.h: gnome-maps.js.gresource.xml $(js_files) path.js config.js
+       $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir) --sourcedir=$(builddir) 
--generate --c-name gnome-maps-js $<
+gnome-maps-js.c: gnome-maps.js.gresource.xml $(js_files) path.js config.js
+       $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir) --sourcedir=$(builddir) 
--generate --c-name gnome-maps-js $<
+
+js_built_sources = gnome-maps-js.c gnome-maps-js.h
+
+BUILT_SOURCES += $(js_built_sources)
 
-CLEANFILES += \
-    $(BUILT_SOURCES)
+CLEANFILES += $(js_built_sources)
 
 EXTRA_DIST += \
     path.js.in \
diff --git a/src/Makefile.am b/src/Makefile.am
index b5dbbc0..84f7b13 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -20,23 +20,38 @@ do_subst = sed -e 's|@abs_top_srcdir[ ]|$(abs_top_srcdir)|g' \
 include $(INTROSPECTION_MAKEFILE)
 include Makefile-js.am
 
-resource_files = $(shell $(GLIB_COMPILE_RESOURCES) --sourcedir=$(srcdir) --generate-dependencies 
$(srcdir)/gnome-maps.gresource.xml)
-gnome-maps.gresource: gnome-maps.gresource.xml $(resource_files)
+data_files = $(shell $(GLIB_COMPILE_RESOURCES) --sourcedir=$(srcdir) --generate-dependencies 
$(srcdir)/gnome-maps.data.gresource.xml)
+gnome-maps.data.gresource: gnome-maps.data.gresource.xml $(resource_files)
        $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir) $<
-EXTRA_DIST += gnome-maps.gresource.xml $(resource_files)
-
-resourcedir = $(pkgdatadir)
-resource_DATA = gnome-maps.gresource
-
-CLEANFILES += gnome-maps.gresource
-
-bin_SCRIPTS = gnome-maps
-
-gnome-maps: gnome-maps.in
-       $(AM_V_GEN) $(do_subst) $< > $@
-       chmod +x $@
-
-CLEANFILES += \
-    gnome-maps
-EXTRA_DIST += \
-    gnome-maps.in
+gnome-maps-data.h: gnome-maps.data.gresource.xml $(data_files)
+       $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir) --sourcedir=$(builddir) 
--generate --c-name gnome-maps-data $<
+gnome-maps-data.c: gnome-maps.data.gresource.xml $(js_files)
+       $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir) --sourcedir=$(builddir) 
--generate --c-name gnome-maps-data $<
+
+EXTRA_DIST += gnome-maps.data.gresource.xml $(resource_files)
+
+data_built_sources = gnome-maps-data.c gnome-maps-data.h
+
+BUILT_SOURCES += $(data_built_sources)
+
+bin_PROGRAMS = gnome-maps
+
+CLEANFILES +=                  \
+    gnome-maps                 \
+       $(data_built_sources)
+
+gnome_maps_SOURCES = gnome-maps.c              \
+       $(NULL)
+nodist_gnome_maps_SOURCES =                    \
+       $(top_builddir)/src/data.c                      \
+       $(top_builddir)/src/data.h                      \
+       $(top_builddir)/src/js.c                        \
+       $(top_builddir)/src/js.h                        \
+       $(NULL)
+
+gnome_maps_CPPFLAGS =                                          \
+       $(GNOME_MAPS_CFLAGS)                                    \
+       -DLOCALEDIR=\"$(localedir)\"                    \
+       -DGNOME_MAPS_PKGLIBDIR=\"$(pkglibdir)\"
+gnome_maps_LDADD =                                                     \
+       $(GNOME_MAPS_LIBS)
diff --git a/src/application.js b/src/application.js
index 3a67dc6..3e7b1e4 100644
--- a/src/application.js
+++ b/src/application.js
@@ -75,7 +75,7 @@ const Application = new Lang.Class({
 
         GtkClutter.init(null);
 
-        let resource = Gio.Resource.load(Path.RESOURCE_DIR + '/gnome-maps.gresource');
+        let resource = Gio.Resource.load(Path.RESOURCE_DIR + '/gnome-maps-data.gresource');
         resource._register();
 
         Utils.loadStyleSheet(Gio.file_new_for_uri('resource:///org/gnome/maps/application.css'));


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