Merge lp:~dobey/couchdb-glib/vapi-build into lp:couchdb-glib

Proposed by dobey
Status: Rejected
Rejected by: dobey
Proposed branch: lp:~dobey/couchdb-glib/vapi-build
Merge into: lp:couchdb-glib
Diff against target: 353 lines (+236/-6)
8 files modified
.gitignore (+13/-2)
configure.ac (+42/-0)
couchdb-glib/Makefile.am (+35/-2)
couchdb-glib/couchdb-glib-vala.deps (+3/-0)
couchdb-glib/test-couchdb-glib-vapi.vala (+51/-0)
desktopcouch-glib/Makefile.am (+37/-2)
desktopcouch-glib/desktopcouch-glib-vala.deps (+4/-0)
desktopcouch-glib/test-desktopcouch-glib-vapi.vala (+51/-0)
To merge this branch: bzr merge lp:~dobey/couchdb-glib/vapi-build
Reviewer Review Type Date Requested Status
dobey (community) Disapprove
Rodrigo Moya (community) Needs Information
Review via email: mp+49281@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Rodrigo Moya (rodrigo-moya) wrote :

Can't the test*vala* programs be in the tests/ directory? Apart from that, seems to look ok

review: Needs Information
Revision history for this message
Rodrigo Moya (rodrigo-moya) wrote :

This branch just needs the move of the test programs to tests/, so can you please do it Rodney?

Revision history for this message
dobey (dobey) wrote :

I talked with the vala devs some more, and I've decided we shouldn't go this route, and simply rely on the gir files all being correct. There are some issues there that need to be fixed as well, so I will propose a branch that includes those fixes instead.

review: Disapprove

Unmerged revisions

266. By dobey

Add support for generating Vala bindings

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file '.gitignore'
--- .gitignore 2010-07-16 11:41:54 +0000
+++ .gitignore 2011-02-10 20:01:37 +0000
@@ -9,14 +9,15 @@
9config.status9config.status
10config.sub10config.sub
11configure11configure
12*.deps12.deps
13*.libs13.libs
14*.lo14*.lo
15*.la15*.la
16*.o16*.o
17*.bak17*.bak
18*~18*~
19*.pc19*.pc
20*_vala.stamp
20depcomp21depcomp
21install-sh22install-sh
22libtool23libtool
@@ -27,8 +28,16 @@
27couchdb-glib/Couchdb-1.0.typelib28couchdb-glib/Couchdb-1.0.typelib
28couchdb-glib/couchdb-marshal.c29couchdb-glib/couchdb-marshal.c
29couchdb-glib/couchdb-marshal.h30couchdb-glib/couchdb-marshal.h
31couchdb-glib/couchdb-glib-1.0.deps
32couchdb-glib/couchdb-glib-1.0.vapi
33couchdb-glib/test-couchdb-glib-vapi
34couchdb-glib/test-couchdb-glib-vapi.c
30desktopcouch-glib/Desktopcouch-1.0.gir35desktopcouch-glib/Desktopcouch-1.0.gir
31desktopcouch-glib/Desktopcouch-1.0.typelib36desktopcouch-glib/Desktopcouch-1.0.typelib
37desktopcouch-glib/desktopcouch-glib-1.0.deps
38desktopcouch-glib/desktopcouch-glib-1.0.vapi
39desktopcouch-glib/test-desktopcouch-glib-vapi
40desktopcouch-glib/test-desktopcouch-glib-vapi.c
32gtk-doc.make41gtk-doc.make
33m4/gtk-doc.m442m4/gtk-doc.m4
34m4/libtool.m443m4/libtool.m4
@@ -81,6 +90,8 @@
81bindings/mono/CouchdbDocumentInfo.cs90bindings/mono/CouchdbDocumentInfo.cs
82bindings/mono/CouchdbDocumentContact.cs91bindings/mono/CouchdbDocumentContact.cs
83bindings/mono/CouchdbDocumentTask.cs92bindings/mono/CouchdbDocumentTask.cs
93bindings/mono/CouchdbQuery.cs
94bindings/mono/CouchdbResponse.cs
84bindings/mono/CouchdbSession.cs95bindings/mono/CouchdbSession.cs
85bindings/mono/CouchdbStructField.cs96bindings/mono/CouchdbStructField.cs
86bindings/mono/DatabaseCreatedHandler.cs97bindings/mono/DatabaseCreatedHandler.cs
8798
=== modified file 'configure.ac'
--- configure.ac 2010-11-24 15:37:50 +0000
+++ configure.ac 2011-02-10 20:01:37 +0000
@@ -97,6 +97,48 @@
97# Check for introspection97# Check for introspection
98##################################################98##################################################
99GOBJECT_INTROSPECTION_CHECK([0.6.4])99GOBJECT_INTROSPECTION_CHECK([0.6.4])
100AC_MSG_CHECKING([if gobject-introspection requires new options])
101$PKG_CONFIG --atleast-version=0.9.4 gobject-introspection-1.0
102new_introspection=$?
103if test "x$new_introspection" = "x0"; then
104 AC_MSG_RESULT([yes])
105else
106 AC_MSG_RESULT([no])
107fi
108AM_CONDITIONAL([HAVE_NEW_INTROSPECTION], [test "x$new_introspection" = "x0"])
109
110# Fix up some junk from GIR
111if test "x$found_introspection" = "xyes"; then
112 INTROSPECTION_GIRDIR_NAME="`basename ${INTROSPECTION_GIRDIR}`"
113 INTROSPECTION_TYPELIBDIR_NAME="`basename ${INTROSPECTION_TYPELIBDIR}`"
114 AC_SUBST(INTROSPECTION_GIRDIR_NAME)
115 AC_SUBST(INTROSPECTION_TYPELIBDIR_NAME)
116fi
117
118##################################################
119# Check for Vala's vapigen
120##################################################
121VAPIGEN=""
122AC_MSG_CHECKING([whether to enable vapi generation])
123AC_ARG_ENABLE([vapigen],
124 AC_HELP_STRING([--disable-vapigen],
125 [Build the vapi for libsyncdaemon [default=enabled]]),
126 [enable_vapigen=$enableval],
127 [enable_vapigen=yes])
128if test "x$enable_vapigen" = "xyes"; then
129 if test "x$found_introspection" = "xyes"; then
130 AC_MSG_RESULT([yes])
131 AC_PATH_PROG([VAPIGEN], [vapigen], [])
132 AM_PROG_VALAC()
133 else
134 AC_MSG_RESULT([no])
135 AC_MSG_RESULT([gobject-introspection is required to generate a vapi])
136 fi
137else
138 AC_MSG_RESULT([no])
139fi
140AC_SUBST(VAPIGEN)
141AM_CONDITIONAL([HAVE_VAPIGEN], [test "x$VAPIGEN" != "x" -a "x$enable_vapigen" = "xyes"])
100142
101AC_OUTPUT([143AC_OUTPUT([
102Makefile144Makefile
103145
=== modified file 'couchdb-glib/Makefile.am'
--- couchdb-glib/Makefile.am 2010-11-24 15:25:47 +0000
+++ couchdb-glib/Makefile.am 2011-02-10 20:01:37 +0000
@@ -101,9 +101,15 @@
101101
102-include $(INTROSPECTION_MAKEFILE)102-include $(INTROSPECTION_MAKEFILE)
103INTROSPECTION_GIRS =103INTROSPECTION_GIRS =
104INTROSPECTION_SCANNER_ARGS = --add-include-path=$(srcdir)104INTROSPECTION_SCANNER_ARGS = \
105 --add-include-path=$(srcdir) \
106 --c-include="couchdb-glib.h"
105INTROSPECTION_COMPILER_ARGS = --includedir=$(srcdir)107INTROSPECTION_COMPILER_ARGS = --includedir=$(srcdir)
106108
109if HAVE_NEW_INTROSPECTION
110INTROSPECTION_SCANNER_ARGS += --identifier-prefix=Couchdb --warn-all
111endif
112
107if HAVE_INTROSPECTION113if HAVE_INTROSPECTION
108introspection_files = \114introspection_files = \
109 $(h_DATA) \115 $(h_DATA) \
@@ -113,6 +119,7 @@
113Couchdb_1_0_gir_CFLAGS = -I$(top_srcdir)/couchdb-glib -I$(top_builddir)/couchdb-glib119Couchdb_1_0_gir_CFLAGS = -I$(top_srcdir)/couchdb-glib -I$(top_builddir)/couchdb-glib
114Couchdb_1_0_gir_LIBS = libcouchdb-glib-1.0.la120Couchdb_1_0_gir_LIBS = libcouchdb-glib-1.0.la
115Couchdb_1_0_gir_FILES = $(addprefix $(srcdir)/, $(introspection_files))121Couchdb_1_0_gir_FILES = $(addprefix $(srcdir)/, $(introspection_files))
122Couchdb_1_0_gir_EXPORT_PACKAGES = couchdb-glib-1.0
116INTROSPECTION_GIRS += Couchdb-1.0.gir123INTROSPECTION_GIRS += Couchdb-1.0.gir
117124
118girdir = $(datadir)/gir-1.0125girdir = $(datadir)/gir-1.0
@@ -122,4 +129,30 @@
122typelibs_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)129typelibs_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
123130
124CLEANFILES += $(gir_DATA) $(typelibs_DATA)131CLEANFILES += $(gir_DATA) $(typelibs_DATA)
125endif132
133if HAVE_VAPIGEN
134vapidir = $(datadir)/vala/vapi
135vapi_DATA = couchdb-glib-1.0.vapi couchdb-glib-1.0.deps
136
137couchdb-glib-1.0.vapi: Couchdb-1.0.gir Makefile
138 $(VAPIGEN) --pkg gobject-2.0 --pkg json-glib-1.0 --library couchdb-glib-1.0 $<
139
140couchdb-glib-1.0.deps: couchdb-glib-vala.deps Makefile
141 cp $< $@
142
143noinst_PROGRAMS = test-couchdb-glib-vapi
144
145test_couchdb_glib_vapi_SOURCES = \
146 couchdb-glib-1.0.vapi \
147 test-couchdb-glib-vapi.vala
148
149test_couchdb_glib_vapi_VALAFLAGS = \
150 --pkg gobject-2.0 --pkg glib-2.0 --pkg json-glib-1.0
151
152test_couchdb_glib_vapi_LDADD = libcouchdb-glib-1.0.la $(COUCHDB_GLIB_LIBS)
153
154CLEANFILES += $(vapi_DATA) $(test_couchdb_glib_vapi_SOURCES:.vala=.c)
155
156endif # HAVE_VAPIGEN
157
158endif # HAVE_INTROSPECTION
126159
=== added file 'couchdb-glib/couchdb-glib-vala.deps'
--- couchdb-glib/couchdb-glib-vala.deps 1970-01-01 00:00:00 +0000
+++ couchdb-glib/couchdb-glib-vala.deps 2011-02-10 20:01:37 +0000
@@ -0,0 +1,3 @@
1gobject-2.0
2json-glib-1.0
3
04
=== added file 'couchdb-glib/test-couchdb-glib-vapi.vala'
--- couchdb-glib/test-couchdb-glib-vapi.vala 1970-01-01 00:00:00 +0000
+++ couchdb-glib/test-couchdb-glib-vapi.vala 2011-02-10 20:01:37 +0000
@@ -0,0 +1,51 @@
1/*
2 * Couchdb-GLib Vala API test binary
3 *
4 * Copyright 2011 Canonical Ltd.
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of version 2 of the GNU Lesser General Public
8 * License as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the
17 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 *
19 */
20using Couchdb;
21using GLib;
22
23public class TestVapi {
24 private MainLoop loop;
25 private int status;
26
27 public TestVapi () {
28 status = 0;
29 }
30
31 private bool test_instantiation () {
32 new Session ("http://test:test@127.0.0.1:5985");
33
34 loop.quit ();
35 return false;
36 }
37
38 public int main () {
39 loop = new MainLoop ();
40
41 Idle.add ((SourceFunc) test_instantiation);
42 loop.run ();
43
44 return status;
45 }
46}
47
48int main (string[] args) {
49 var test = new TestVapi ();
50 return test.main ();
51}
052
=== modified file 'desktopcouch-glib/Makefile.am'
--- desktopcouch-glib/Makefile.am 2010-11-24 15:26:48 +0000
+++ desktopcouch-glib/Makefile.am 2011-02-10 20:01:37 +0000
@@ -30,9 +30,16 @@
3030
31-include $(INTROSPECTION_MAKEFILE)31-include $(INTROSPECTION_MAKEFILE)
32INTROSPECTION_GIRS =32INTROSPECTION_GIRS =
33INTROSPECTION_SCANNER_ARGS = --add-include-path=$(srcdir) --add-include-path=$(top_srcdir)/couchdb-glib33INTROSPECTION_SCANNER_ARGS = \
34 --add-include-path=$(srcdir) \
35 --add-include-path=$(top_srcdir)/couchdb-glib \
36 --c-include="desktopcouch-glib.h"
34INTROSPECTION_COMPILER_ARGS = --includedir=$(srcdir) --includedir=$(top_builddir)/couchdb-glib37INTROSPECTION_COMPILER_ARGS = --includedir=$(srcdir) --includedir=$(top_builddir)/couchdb-glib
3538
39if HAVE_NEW_INTROSPECTION
40INTROSPECTION_SCANNER_ARGS += --identifier-prefix=Desktopcouch --warn-all
41endif
42
36if HAVE_INTROSPECTION43if HAVE_INTROSPECTION
37introspection_files = \44introspection_files = \
38 $(h_DATA) \45 $(h_DATA) \
@@ -42,6 +49,7 @@
42Desktopcouch_1_0_gir_CFLAGS = -I$(top_srcdir)/desktopcouch-glib -I$(top_builddir)/desktopcouch-glib -I$(top_srcdir)/couchdb-glib -I$(top_builddir)/couchdb-glib49Desktopcouch_1_0_gir_CFLAGS = -I$(top_srcdir)/desktopcouch-glib -I$(top_builddir)/desktopcouch-glib -I$(top_srcdir)/couchdb-glib -I$(top_builddir)/couchdb-glib
43Desktopcouch_1_0_gir_LIBS = libdesktopcouch-glib-1.0.la50Desktopcouch_1_0_gir_LIBS = libdesktopcouch-glib-1.0.la
44Desktopcouch_1_0_gir_FILES = $(addprefix $(srcdir)/, $(introspection_files))51Desktopcouch_1_0_gir_FILES = $(addprefix $(srcdir)/, $(introspection_files))
52Desktopcouch_1_0_gir_EXPORT_PACKAGES = desktopcouch-glib-1.0
45INTROSPECTION_GIRS += Desktopcouch-1.0.gir53INTROSPECTION_GIRS += Desktopcouch-1.0.gir
4654
47girdir = $(datadir)/gir-1.055girdir = $(datadir)/gir-1.0
@@ -51,4 +59,31 @@
51typelibs_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)59typelibs_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
5260
53CLEANFILES += $(gir_DATA) $(typelibs_DATA)61CLEANFILES += $(gir_DATA) $(typelibs_DATA)
54endif62
63if HAVE_VAPIGEN
64vapidir = $(datadir)/vala/vapi
65vapi_DATA = desktopcouch-glib-1.0.vapi desktopcouch-glib-1.0.deps
66
67desktopcouch-glib-1.0.vapi: Desktopcouch-1.0.gir Makefile
68 $(VAPIGEN) --vapidir=$(top_builddir)/couchdb-glib --pkg gobject-2.0 --pkg json-glib-1.0 --library desktopcouch-glib-1.0 $<
69
70desktopcouch-glib-1.0.deps: desktopcouch-glib-vala.deps Makefile
71 cp $< $@
72
73noinst_PROGRAMS = test-desktopcouch-glib-vapi
74
75test_desktopcouch_glib_vapi_SOURCES = \
76 desktopcouch-glib-1.0.vapi \
77 test-desktopcouch-glib-vapi.vala
78
79test_desktopcouch_glib_vapi_VALAFLAGS = \
80 --vapidir=$(top_builddir)/couchdb-glib \
81 --pkg gobject-2.0 --pkg glib-2.0 --pkg json-glib-1.0 --pkg couchdb-glib-1.0
82
83test_desktopcouch_glib_vapi_LDADD = libdesktopcouch-glib-1.0.la $(COUCHDB_GLIB_LIBS)
84
85CLEANFILES += $(vapi_DATA) $(test_desktopcouch_glib_vapi_SOURCES:.vala=.c)
86
87endif # HAVE_VAPIGEN
88
89endif # HAVE_INTROSPECTION
5590
=== added file 'desktopcouch-glib/desktopcouch-glib-vala.deps'
--- desktopcouch-glib/desktopcouch-glib-vala.deps 1970-01-01 00:00:00 +0000
+++ desktopcouch-glib/desktopcouch-glib-vala.deps 2011-02-10 20:01:37 +0000
@@ -0,0 +1,4 @@
1gobject-2.0
2couchdb-glib-1.0
3json-glib-1.0
4
05
=== added file 'desktopcouch-glib/test-desktopcouch-glib-vapi.vala'
--- desktopcouch-glib/test-desktopcouch-glib-vapi.vala 1970-01-01 00:00:00 +0000
+++ desktopcouch-glib/test-desktopcouch-glib-vapi.vala 2011-02-10 20:01:37 +0000
@@ -0,0 +1,51 @@
1/*
2 * Desktopcouch-GLib Vala API test binary
3 *
4 * Copyright 2011 Canonical Ltd.
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of version 2 of the GNU Lesser General Public
8 * License as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the
17 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 *
19 */
20using Desktopcouch;
21using GLib;
22
23public class TestVapi {
24 private MainLoop loop;
25 private int status;
26
27 public TestVapi () {
28 status = 0;
29 }
30
31 private bool test_instantiation () {
32 new Session ();
33
34 loop.quit ();
35 return false;
36 }
37
38 public int main () {
39 loop = new MainLoop ();
40
41 Idle.add ((SourceFunc) test_instantiation);
42 loop.run ();
43
44 return status;
45 }
46}
47
48int main (string[] args) {
49 var test = new TestVapi ();
50 return test.main ();
51}

Subscribers

People subscribed via source and target branches

to all changes: