Blame SOURCES/grilo-0.2.12-vala-revert.patch

41b49a
From c9127ac6218c997ff2ddf250dbf5a6d5af9fd12d Mon Sep 17 00:00:00 2001
41b49a
From: Bastien Nocera <hadess@hadess.net>
41b49a
Date: Mon, 4 May 2015 15:45:47 +0200
41b49a
Subject: [PATCH 1/7] Revert "vala: Add some missing definitions"
41b49a
41b49a
This reverts commit 78d4690dabd4fe1822ab8d610a76faa385d2e3e3.
41b49a
---
41b49a
 bindings/vala/grilo-0.2-custom.vala | 6 ------
41b49a
 1 file changed, 6 deletions(-)
41b49a
41b49a
diff --git a/bindings/vala/grilo-0.2-custom.vala b/bindings/vala/grilo-0.2-custom.vala
41b49a
index d045526..4e075e9 100644
41b49a
--- a/bindings/vala/grilo-0.2-custom.vala
41b49a
+++ b/bindings/vala/grilo-0.2-custom.vala
41b49a
@@ -112,12 +112,6 @@ namespace Grl {
41b49a
 		[CCode (cname ="GRL_METADATA_KEY_AUDIO_TRACK")]
41b49a
 		public static Grl.KeyID AUDIO_TRACK;
41b49a
 
41b49a
-		[CCode (cname ="GRL_METADATA_KEY_CHILDCOUNT_UNKNOWN")]
41b49a
-		public static uint CHILDCOUNT_UNKNOWN;
41b49a
-
41b49a
-		[CCode (cname ="GRL_SOURCE_REMAINING_UNKNOWN")]
41b49a
-		public static uint REMAINING_UNKNOWN;
41b49a
-
41b49a
 		public static GLib.List list_new (Grl.KeyID p, ...);
41b49a
 	}
41b49a
 }
41b49a
-- 
41b49a
2.4.0
41b49a
41b49a
41b49a
From 62845c257f736472c7bba9043e6ad04c435f4f32 Mon Sep 17 00:00:00 2001
41b49a
From: Bastien Nocera <hadess@hadess.net>
41b49a
Date: Mon, 4 May 2015 15:46:56 +0200
41b49a
Subject: [PATCH 2/7] Revert "build: fix distcheck for Vala"
41b49a
41b49a
This reverts commit 76eafa8194c4563190cbfe6cd058c02576e8c7f4.
41b49a
---
41b49a
 bindings/vala/Makefile.am | 5 +----
41b49a
 1 file changed, 1 insertion(+), 4 deletions(-)
41b49a
41b49a
diff --git a/bindings/vala/Makefile.am b/bindings/vala/Makefile.am
41b49a
index acb859c..bb494be 100644
41b49a
--- a/bindings/vala/Makefile.am
41b49a
+++ b/bindings/vala/Makefile.am
41b49a
@@ -1,5 +1,4 @@
41b49a
 EXTRA_DIST =
41b49a
-CLEANFILES =
41b49a
 
41b49a
 if ENABLE_VAPIGEN
41b49a
 -include $(VAPIGEN_MAKEFILE)
41b49a
@@ -12,7 +11,7 @@ grilo_@GRL_MAJORMINOR_NORM@_vapi_DEPS = gio-2.0
41b49a
 grilo_@GRL_MAJORMINOR_NORM@_vapi_METADATADIRS = $(srcdir)
41b49a
 grilo_@GRL_MAJORMINOR_NORM@_vapi_FILES = $(srcdir)/grilo-@GRL_MAJORMINOR@-custom.vala $(top_builddir)/src/Grl-@GRL_MAJORMINOR@.gir
41b49a
 
41b49a
-EXTRA_DIST += Grl-@GRL_MAJORMINOR@.metadata grilo-@GRL_MAJORMINOR@.deps grilo-@GRL_MAJORMINOR@-custom.vala
41b49a
+EXTRA_DIST += grilo-@GRL_MAJORMINOR@.metadata grilo-@GRL_MAJORMINOR@.deps grilo-@GRL_MAJORMINOR@-custom.vala
41b49a
 
41b49a
 grilo-net-@GRL_MAJORMINOR@.vapi:  $(top_builddir)/libs/net/GrlNet-@GRL_MAJORMINOR@.gir grilo-net-@GRL_MAJORMINOR@-custom.vala grilo-net-@GRL_MAJORMINOR@.deps GrlNet-@GRL_MAJORMINOR@.metadata
41b49a
 
41b49a
@@ -25,8 +24,6 @@ EXTRA_DIST += GrlNet-@GRL_MAJORMINOR@.metadata grilo-net-@GRL_MAJORMINOR@.deps g
41b49a
 vapidir = $(datadir)/vala/vapi
41b49a
 vapi_DATA = $(VAPIGEN_VAPIS) $(VAPIGEN_VAPIS:.vapi=.deps)
41b49a
 
41b49a
-CLEANFILES += $(vapi_DATA)
41b49a
-
41b49a
 endif
41b49a
 
41b49a
 -include $(top_srcdir)/git.mk
41b49a
-- 
41b49a
2.4.0
41b49a
41b49a
41b49a
From d58512af408ad8e1de508b4c22a57a00f0d36bd7 Mon Sep 17 00:00:00 2001
41b49a
From: Bastien Nocera <hadess@hadess.net>
41b49a
Date: Mon, 4 May 2015 15:48:30 +0200
41b49a
Subject: [PATCH 3/7] Revert "build: Add vapigen.m4 file"
41b49a
41b49a
This reverts commit 7a7ccfc43d558e5b6f425498fd8be9d2664eabd0.
41b49a
---
41b49a
 m4/vapigen.m4 | 101 ----------------------------------------------------------
41b49a
 1 file changed, 101 deletions(-)
41b49a
 delete mode 100644 m4/vapigen.m4
41b49a
41b49a
diff --git a/m4/vapigen.m4 b/m4/vapigen.m4
41b49a
deleted file mode 100644
41b49a
index 2c435e7..0000000
41b49a
--- a/m4/vapigen.m4
41b49a
+++ /dev/null
41b49a
@@ -1,101 +0,0 @@
41b49a
-dnl vapigen.m4
41b49a
-dnl
41b49a
-dnl Copyright 2012 Evan Nemerson
41b49a
-dnl
41b49a
-dnl This library is free software; you can redistribute it and/or
41b49a
-dnl modify it under the terms of the GNU Lesser General Public
41b49a
-dnl License as published by the Free Software Foundation; either
41b49a
-dnl version 2.1 of the License, or (at your option) any later version.
41b49a
-dnl
41b49a
-dnl This library is distributed in the hope that it will be useful,
41b49a
-dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
41b49a
-dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
41b49a
-dnl Lesser General Public License for more details.
41b49a
-dnl
41b49a
-dnl You should have received a copy of the GNU Lesser General Public
41b49a
-dnl License along with this library; if not, write to the Free Software
41b49a
-dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
41b49a
-
41b49a
-# VAPIGEN_CHECK([VERSION], [API_VERSION], [FOUND_INTROSPECTION], [DEFAULT])
41b49a
-# --------------------------------------
41b49a
-# Check vapigen existence and version
41b49a
-#
41b49a
-# See http://live.gnome.org/Vala/UpstreamGuide for detailed documentation
41b49a
-AC_DEFUN([VAPIGEN_CHECK],
41b49a
-[
41b49a
-  AS_IF([test "x$3" != "xyes"], [
41b49a
-      m4_provide_if([GOBJECT_INTROSPECTION_CHECK], [], [
41b49a
-          m4_provide_if([GOBJECT_INTROSPECTION_REQUIRE], [], [
41b49a
-              AC_MSG_ERROR([[You must call GOBJECT_INTROSPECTION_CHECK or GOBJECT_INTROSPECTION_REQUIRE before using VAPIGEN_CHECK unless using the FOUND_INTROSPECTION argument is "yes"]])
41b49a
-            ])
41b49a
-        ])
41b49a
-    ])
41b49a
-
41b49a
-  AC_ARG_ENABLE([vala],
41b49a
-    [AS_HELP_STRING([--enable-vala[=@<:@no/auto/yes@:>@]],[build Vala bindings @<:@default=]ifelse($4,,auto,$4)[@:>@])],,[
41b49a
-      AS_IF([test "x$4" = "x"], [
41b49a
-          enable_vala=auto
41b49a
-        ], [
41b49a
-          enable_vala=$4
41b49a
-        ])
41b49a
-    ])
41b49a
-
41b49a
-  AS_CASE([$enable_vala], [no], [enable_vala=no],
41b49a
-      [yes], [
41b49a
-        AS_IF([test "x$3" != "xyes" -a "x$found_introspection" != "xyes"], [
41b49a
-            AC_MSG_ERROR([Vala bindings require GObject Introspection])
41b49a
-          ])
41b49a
-      ], [auto], [
41b49a
-        AS_IF([test "x$3" != "xyes" -a "x$found_introspection" != "xyes"], [
41b49a
-            enable_vala=no
41b49a
-          ])
41b49a
-      ], [
41b49a
-        AC_MSG_ERROR([Invalid argument passed to --enable-vala, should be one of @<:@no/auto/yes@:>@])
41b49a
-      ])
41b49a
-
41b49a
-  AS_IF([test "x$2" = "x"], [
41b49a
-      vapigen_pkg_name=vapigen
41b49a
-    ], [
41b49a
-      vapigen_pkg_name=vapigen-$2
41b49a
-    ])
41b49a
-  AS_IF([test "x$1" = "x"], [
41b49a
-      vapigen_pkg="$vapigen_pkg_name"
41b49a
-    ], [
41b49a
-      vapigen_pkg="$vapigen_pkg_name >= $1"
41b49a
-    ])
41b49a
-
41b49a
-  PKG_PROG_PKG_CONFIG
41b49a
-
41b49a
-  PKG_CHECK_EXISTS([$vapigen_pkg], [
41b49a
-      AS_IF([test "$enable_vala" = "auto"], [
41b49a
-          enable_vala=yes
41b49a
-        ])
41b49a
-    ], [
41b49a
-      AS_CASE([$enable_vala], [yes], [
41b49a
-          AC_MSG_ERROR([$vapigen_pkg not found])
41b49a
-        ], [auto], [
41b49a
-          enable_vala=no
41b49a
-        ])
41b49a
-    ])
41b49a
-
41b49a
-  AC_MSG_CHECKING([for vapigen])
41b49a
-
41b49a
-  AS_CASE([$enable_vala],
41b49a
-    [yes], [
41b49a
-      VAPIGEN=`$PKG_CONFIG --variable=vapigen $vapigen_pkg_name`
41b49a
-      VAPIGEN_MAKEFILE=`$PKG_CONFIG --variable=datadir $vapigen_pkg_name`/vala/Makefile.vapigen
41b49a
-      AS_IF([test "x$2" = "x"], [
41b49a
-          VAPIGEN_VAPIDIR=`$PKG_CONFIG --variable=vapidir $vapigen_pkg_name`
41b49a
-        ], [
41b49a
-          VAPIGEN_VAPIDIR=`$PKG_CONFIG --variable=vapidir_versioned $vapigen_pkg_name`
41b49a
-        ])
41b49a
-    ])
41b49a
-
41b49a
-  AC_MSG_RESULT([$enable_vala])
41b49a
-
41b49a
-  AC_SUBST([VAPIGEN])
41b49a
-  AC_SUBST([VAPIGEN_VAPIDIR])
41b49a
-  AC_SUBST([VAPIGEN_MAKEFILE])
41b49a
-
41b49a
-  AM_CONDITIONAL(ENABLE_VAPIGEN, test "x$enable_vala" = "xyes")
41b49a
-])
41b49a
-- 
41b49a
2.4.0
41b49a
41b49a
41b49a
From 010af674f7e32d22aed070e78fe84c5f7f4c5510 Mon Sep 17 00:00:00 2001
41b49a
From: Bastien Nocera <hadess@hadess.net>
41b49a
Date: Mon, 4 May 2015 15:49:21 +0200
41b49a
Subject: [PATCH 4/7] Revert "build-sys: fix out-of-tree build of vapi"
41b49a
41b49a
This reverts commit 8a583607a59395958169dbd2230ab39b90d59e81.
41b49a
---
41b49a
 bindings/vala/Makefile.am | 4 ++--
41b49a
 1 file changed, 2 insertions(+), 2 deletions(-)
41b49a
41b49a
diff --git a/bindings/vala/Makefile.am b/bindings/vala/Makefile.am
41b49a
index bb494be..abcef6b 100644
41b49a
--- a/bindings/vala/Makefile.am
41b49a
+++ b/bindings/vala/Makefile.am
41b49a
@@ -9,7 +9,7 @@ grilo-@GRL_MAJORMINOR@.vapi: $(top_builddir)/src/Grl-@GRL_MAJORMINOR@.gir grilo-
41b49a
 
41b49a
 grilo_@GRL_MAJORMINOR_NORM@_vapi_DEPS = gio-2.0
41b49a
 grilo_@GRL_MAJORMINOR_NORM@_vapi_METADATADIRS = $(srcdir)
41b49a
-grilo_@GRL_MAJORMINOR_NORM@_vapi_FILES = $(srcdir)/grilo-@GRL_MAJORMINOR@-custom.vala $(top_builddir)/src/Grl-@GRL_MAJORMINOR@.gir
41b49a
+grilo_@GRL_MAJORMINOR_NORM@_vapi_FILES = grilo-@GRL_MAJORMINOR@-custom.vala $(top_builddir)/src/Grl-@GRL_MAJORMINOR@.gir
41b49a
 
41b49a
 EXTRA_DIST += grilo-@GRL_MAJORMINOR@.metadata grilo-@GRL_MAJORMINOR@.deps grilo-@GRL_MAJORMINOR@-custom.vala
41b49a
 
41b49a
@@ -17,7 +17,7 @@ grilo-net-@GRL_MAJORMINOR@.vapi:  $(top_builddir)/libs/net/GrlNet-@GRL_MAJORMINO
41b49a
 
41b49a
 grilo_net_@GRL_MAJORMINOR_NORM@_vapi_DEPS = gio-2.0
41b49a
 grilo_net_@GRL_MAJORMINOR_NORM@_vapi_METADATADIRS = $(srcdir)
41b49a
-grilo_net_@GRL_MAJORMINOR_NORM@_vapi_FILES = $(srcdir)/grilo-net-@GRL_MAJORMINOR@-custom.vala $(top_builddir)/libs/net/GrlNet-@GRL_MAJORMINOR@.gir
41b49a
+grilo_net_@GRL_MAJORMINOR_NORM@_vapi_FILES = grilo-net-@GRL_MAJORMINOR@-custom.vala $(top_builddir)/libs/net/GrlNet-@GRL_MAJORMINOR@.gir
41b49a
 
41b49a
 EXTRA_DIST += GrlNet-@GRL_MAJORMINOR@.metadata grilo-net-@GRL_MAJORMINOR@.deps grilo-net-@GRL_MAJORMINOR@-custom.vala
41b49a
 
41b49a
-- 
41b49a
2.4.0
41b49a
41b49a
41b49a
From f5375ed920981265477b6034b7fcdda43846c9f3 Mon Sep 17 00:00:00 2001
41b49a
From: Bastien Nocera <hadess@hadess.net>
41b49a
Date: Mon, 4 May 2015 15:50:58 +0200
41b49a
Subject: [PATCH 5/7] Revert "build-sys: fix gio-2.0 gir bindings errors"
41b49a
41b49a
This reverts commit c760d284acad86bb6f60af711af7d079052832f7.
41b49a
---
41b49a
 bindings/vala/Makefile.am | 4 ++--
41b49a
 1 file changed, 2 insertions(+), 2 deletions(-)
41b49a
41b49a
diff --git a/bindings/vala/Makefile.am b/bindings/vala/Makefile.am
41b49a
index abcef6b..77947ac 100644
41b49a
--- a/bindings/vala/Makefile.am
41b49a
+++ b/bindings/vala/Makefile.am
41b49a
@@ -7,7 +7,7 @@ VAPIGEN_VAPIS = grilo-@GRL_MAJORMINOR@.vapi grilo-net-@GRL_MAJORMINOR@.vapi
41b49a
 
41b49a
 grilo-@GRL_MAJORMINOR@.vapi: $(top_builddir)/src/Grl-@GRL_MAJORMINOR@.gir grilo-@GRL_MAJORMINOR@-custom.vala grilo-@GRL_MAJORMINOR@.deps Grl-@GRL_MAJORMINOR@.metadata
41b49a
 
41b49a
-grilo_@GRL_MAJORMINOR_NORM@_vapi_DEPS = gio-2.0
41b49a
+grilo_@GRL_MAJORMINOR_NORM@_vapi_DEPS =
41b49a
 grilo_@GRL_MAJORMINOR_NORM@_vapi_METADATADIRS = $(srcdir)
41b49a
 grilo_@GRL_MAJORMINOR_NORM@_vapi_FILES = grilo-@GRL_MAJORMINOR@-custom.vala $(top_builddir)/src/Grl-@GRL_MAJORMINOR@.gir
41b49a
 
41b49a
@@ -15,7 +15,7 @@ EXTRA_DIST += grilo-@GRL_MAJORMINOR@.metadata grilo-@GRL_MAJORMINOR@.deps grilo-
41b49a
 
41b49a
 grilo-net-@GRL_MAJORMINOR@.vapi:  $(top_builddir)/libs/net/GrlNet-@GRL_MAJORMINOR@.gir grilo-net-@GRL_MAJORMINOR@-custom.vala grilo-net-@GRL_MAJORMINOR@.deps GrlNet-@GRL_MAJORMINOR@.metadata
41b49a
 
41b49a
-grilo_net_@GRL_MAJORMINOR_NORM@_vapi_DEPS = gio-2.0
41b49a
+grilo_net_@GRL_MAJORMINOR_NORM@_vapi_DEPS =
41b49a
 grilo_net_@GRL_MAJORMINOR_NORM@_vapi_METADATADIRS = $(srcdir)
41b49a
 grilo_net_@GRL_MAJORMINOR_NORM@_vapi_FILES = grilo-net-@GRL_MAJORMINOR@-custom.vala $(top_builddir)/libs/net/GrlNet-@GRL_MAJORMINOR@.gir
41b49a
 
41b49a
-- 
41b49a
2.4.0
41b49a
41b49a
41b49a
From 7d34bd88a20b90a6eca14743eddae3ff9f689625 Mon Sep 17 00:00:00 2001
41b49a
From: Bastien Nocera <hadess@hadess.net>
41b49a
Date: Mon, 4 May 2015 16:18:21 +0200
41b49a
Subject: [PATCH 6/7] Revert "build: Require vala 0.27"
41b49a
41b49a
This reverts commit f48941d8e38cace3f709c78a2609c30d2693d998.
41b49a
---
41b49a
 configure.ac | 2 +-
41b49a
 1 file changed, 1 insertion(+), 1 deletion(-)
41b49a
41b49a
diff --git a/configure.ac b/configure.ac
41b49a
index a7e45a1..7c845e0 100644
41b49a
--- a/configure.ac
41b49a
+++ b/configure.ac
41b49a
@@ -258,7 +258,7 @@ GOBJECT_INTROSPECTION_CHECK([0.9])
41b49a
 # VALA BINDINGS
41b49a
 # ----------------------------------------------------------
41b49a
 
41b49a
-VAPIGEN_CHECK([0.27])
41b49a
+VAPIGEN_CHECK([0.26])
41b49a
 
41b49a
 # ----------------------------------------------------------
41b49a
 # GETTEXT/INTLTOOL
41b49a
-- 
41b49a
2.4.0
41b49a
41b49a
41b49a
From 98b94d97697bc63bdb16a64ed74da0d1f95bfc26 Mon Sep 17 00:00:00 2001
41b49a
From: Bastien Nocera <hadess@hadess.net>
41b49a
Date: Mon, 4 May 2015 16:18:29 +0200
41b49a
Subject: [PATCH 7/7] Revert "vala: modernize bindings generation"
41b49a
41b49a
This reverts commit 689bf702cb3d264cca9b1a689d6237f611ad3407.
41b49a
---
41b49a
 bindings/Makefile.am                             |  6 +-
41b49a
 bindings/vala/Grl-0.2.metadata                   | 15 -----
41b49a
 bindings/vala/GrlNet-0.2.metadata                |  3 -
41b49a
 bindings/vala/Makefile.am                        | 83 +++++++++++++++++++-----
41b49a
 bindings/vala/grilo-0.2-custom.vala              | 17 ++++-
41b49a
 bindings/vala/grilo-0.2.metadata                 | 58 +++++++++++++++++
41b49a
 bindings/vala/grilo-net-0.2.metadata             |  6 ++
41b49a
 bindings/vala/grilo-net-uninstalled.files.in     |  2 +
41b49a
 bindings/vala/grilo-net-uninstalled.namespace.in |  1 +
41b49a
 bindings/vala/grilo-uninstalled.defines          |  1 +
41b49a
 bindings/vala/grilo-uninstalled.files.in         | 13 ++++
41b49a
 bindings/vala/grilo-uninstalled.namespace.in     |  1 +
41b49a
 configure.ac                                     | 49 ++++++++++++--
41b49a
 13 files changed, 211 insertions(+), 44 deletions(-)
41b49a
 delete mode 100644 bindings/vala/Grl-0.2.metadata
41b49a
 delete mode 100644 bindings/vala/GrlNet-0.2.metadata
41b49a
 create mode 100644 bindings/vala/grilo-0.2.metadata
41b49a
 create mode 100644 bindings/vala/grilo-net-0.2.metadata
41b49a
 create mode 100644 bindings/vala/grilo-net-uninstalled.files.in
41b49a
 create mode 100644 bindings/vala/grilo-net-uninstalled.namespace.in
41b49a
 create mode 100644 bindings/vala/grilo-uninstalled.defines
41b49a
 create mode 100644 bindings/vala/grilo-uninstalled.files.in
41b49a
 create mode 100644 bindings/vala/grilo-uninstalled.namespace.in
41b49a
41b49a
diff --git a/bindings/Makefile.am b/bindings/Makefile.am
41b49a
index 86de8f0..50c92aa 100644
41b49a
--- a/bindings/Makefile.am
41b49a
+++ b/bindings/Makefile.am
41b49a
@@ -1,3 +1,7 @@
41b49a
-SUBDIRS = vala
41b49a
+SUBDIRS =
41b49a
+
41b49a
+if HAVE_VALA
41b49a
+SUBDIRS += vala
41b49a
+endif
41b49a
 
41b49a
 -include $(top_srcdir)/git.mk
41b49a
diff --git a/bindings/vala/Grl-0.2.metadata b/bindings/vala/Grl-0.2.metadata
41b49a
deleted file mode 100644
41b49a
index c59ffd8..0000000
41b49a
--- a/bindings/vala/Grl-0.2.metadata
41b49a
+++ /dev/null
41b49a
@@ -1,15 +0,0 @@
41b49a
-// vapigen has issues with the callbacks
41b49a
-PluginDescriptor skip=true
41b49a
-
41b49a
-Source.browse#method name="do_browse"
41b49a
-Source.query#method name="do_query"
41b49a
-Source.remove#method name="do_remove"
41b49a
-Source.resolve#method name="do_resolve"
41b49a
-Source.search#method name="do_search"
41b49a
-Source.store#method name="do_store"
41b49a
-Source.store_metadata#method name="do_store_metadata"
41b49a
-Source.supported_operations#method name="get_supported_operations"
41b49a
-*.callback delegate_target_cname="user_data"
41b49a
-
41b49a
-
41b49a
-SourceStoreSpec.user_data type="string"
41b49a
\ No newline at end of file
41b49a
diff --git a/bindings/vala/GrlNet-0.2.metadata b/bindings/vala/GrlNet-0.2.metadata
41b49a
deleted file mode 100644
41b49a
index 73465ad..0000000
41b49a
--- a/bindings/vala/GrlNet-0.2.metadata
41b49a
+++ /dev/null
41b49a
@@ -1,3 +0,0 @@
41b49a
-Wc.request_with_headers_hash_async finish_name="grl_net_wc_request_finish"
41b49a
-Wc.request_with_headers_async skip=false
41b49a
-Wc.request_with_headers_async finish_name="grl_net_wc_request_finish"
41b49a
diff --git a/bindings/vala/Makefile.am b/bindings/vala/Makefile.am
41b49a
index 77947ac..8c0fffe 100644
41b49a
--- a/bindings/vala/Makefile.am
41b49a
+++ b/bindings/vala/Makefile.am
41b49a
@@ -1,29 +1,78 @@
41b49a
-EXTRA_DIST =
41b49a
+# This Makefile is a tad convoluted. I've tried to make it so that the vapi
41b49a
+# can be built at the same time as the library in the hope that this will make
41b49a
+# it easier to keep it up-to-date.
41b49a
+#
41b49a
+# The vapi is generated in 2 steps:
41b49a
+#
41b49a
+#   vala-gen-introspect looks at headers and libs and generates a gidl for the
41b49a
+#   library. It takes a .files file containing paths to these. It also takes a
41b49a
+#   .namespace file containing the Vala namespace corresponding to this
41b49a
+#   library. Both these files are expected to be in the directory where you run
41b49a
+#   vala-gen-introspect.
41b49a
+#
41b49a
+#   vapigen takes the gidl, a .deps file containing the list of libs needed
41b49a
+#   to link this library, and a .metadata file containing annotations to the
41b49a
+#   gidl (e.g. foo() is the free function for object X).
41b49a
+#
41b49a
+# vala-gen-introspect runs with the -uninstalled .pc file. The .files is
41b49a
+# generated so that it has links to the headers and libraries from the source
41b49a
+# and build trees. The .namespace file is generated, though it doesn't need
41b49a
+# to be, so that it exists in the build tree where vala-gen-introspect is run
41b49a
+# (because this may not be the same as the source tree). Since we're working
41b49a
+# with the -uninstalled files, and vala-gen-introspect assumes filenames are
41b49a
+# named as <package>.<extension>, all the associated file names have an
41b49a
+# -uninstalled suffix.
41b49a
+#
41b49a
+# Running vapigen is simpler. It generates a the .vapi file using the gidl
41b49a
+# file from vala-gen-introspect. Since we want the final files to be in the
41b49a
+# form <libname>-<version>.*, we use the same convention for naming the files
41b49a
+# associated with this step (contrast with the -uninstalled suffix for the
41b49a
+# vala-gen-introspect step). The only file implicitly used by vapigen is the
41b49a
+# .deps file, so to make the build independent of a split source/build tree,
41b49a
+# I've put the deps on the vapigen command-line (it's redundant, but helps
41b49a
+# with distcheck).
41b49a
+#
41b49a
 
41b49a
-if ENABLE_VAPIGEN
41b49a
--include $(VAPIGEN_MAKEFILE)
41b49a
+targets = grilo-@GRL_MAJORMINOR@
41b49a
 
41b49a
-VAPIGEN_VAPIS = grilo-@GRL_MAJORMINOR@.vapi grilo-net-@GRL_MAJORMINOR@.vapi
41b49a
+if BUILD_GRILO_NET
41b49a
+targets += grilo-net-@GRL_MAJORMINOR@
41b49a
+endif
41b49a
+
41b49a
+targets_u = $(foreach target,$(targets),$(subst @GRL_MAJORMINOR@,uninstalled,$(target)))
41b49a
 
41b49a
-grilo-@GRL_MAJORMINOR@.vapi: $(top_builddir)/src/Grl-@GRL_MAJORMINOR@.gir grilo-@GRL_MAJORMINOR@-custom.vala grilo-@GRL_MAJORMINOR@.deps Grl-@GRL_MAJORMINOR@.metadata
41b49a
+# "source" files for vala-gen-introspect
41b49a
+filesfiles_src = $(foreach target,$(targets_u),$(target).files.in)
41b49a
+filesfiles = $(foreach target,$(targets_u),$(target).files)
41b49a
+nsfiles_src = $(foreach target,$(targets_u),$(target).namespace.in)
41b49a
+nsfiles = $(foreach target,$(targets_u),$(target).namespace)
41b49a
 
41b49a
-grilo_@GRL_MAJORMINOR_NORM@_vapi_DEPS =
41b49a
-grilo_@GRL_MAJORMINOR_NORM@_vapi_METADATADIRS = $(srcdir)
41b49a
-grilo_@GRL_MAJORMINOR_NORM@_vapi_FILES = grilo-@GRL_MAJORMINOR@-custom.vala $(top_builddir)/src/Grl-@GRL_MAJORMINOR@.gir
41b49a
+# "source" files for vapigen
41b49a
+depsfiles = $(foreach target,$(targets),$(target).deps)
41b49a
+gifiles = $(foreach target,$(targets),$(target).gi)
41b49a
+metadatafiles = $(foreach target,$(targets),$(target).metadata)
41b49a
 
41b49a
-EXTRA_DIST += grilo-@GRL_MAJORMINOR@.metadata grilo-@GRL_MAJORMINOR@.deps grilo-@GRL_MAJORMINOR@-custom.vala
41b49a
+vapidir = $(datadir)/vala/vapi
41b49a
 
41b49a
-grilo-net-@GRL_MAJORMINOR@.vapi:  $(top_builddir)/libs/net/GrlNet-@GRL_MAJORMINOR@.gir grilo-net-@GRL_MAJORMINOR@-custom.vala grilo-net-@GRL_MAJORMINOR@.deps GrlNet-@GRL_MAJORMINOR@.metadata
41b49a
+if HAVE_VALA
41b49a
+vapifiles = $(foreach target,$(targets),$(target).vapi)
41b49a
+vapi_DATA = $(depsfiles) $(vapifiles)
41b49a
+endif
41b49a
 
41b49a
-grilo_net_@GRL_MAJORMINOR_NORM@_vapi_DEPS =
41b49a
-grilo_net_@GRL_MAJORMINOR_NORM@_vapi_METADATADIRS = $(srcdir)
41b49a
-grilo_net_@GRL_MAJORMINOR_NORM@_vapi_FILES = grilo-net-@GRL_MAJORMINOR@-custom.vala $(top_builddir)/libs/net/GrlNet-@GRL_MAJORMINOR@.gir
41b49a
+%-@GRL_MAJORMINOR@.gi: %-uninstalled.files %-uninstalled.namespace
41b49a
+	PKG_CONFIG_PATH=$(top_builddir)/:${PKG_CONFIG_PATH} \
41b49a
+		$(VALA_GEN_INTROSPECT) $*-uninstalled .
41b49a
+	@mv $*-uninstalled.gi $*-@GRL_MAJORMINOR@.gi
41b49a
 
41b49a
-EXTRA_DIST += GrlNet-@GRL_MAJORMINOR@.metadata grilo-net-@GRL_MAJORMINOR@.deps grilo-net-@GRL_MAJORMINOR@-custom.vala
41b49a
+%.vapi: %.gi %.metadata %-custom.vala
41b49a
+	$(VAPIGEN) --library $* \
41b49a
+		$(top_srcdir)/bindings/vala/$*.metadata $*.gi \
41b49a
+		$*-custom.vala
41b49a
 
41b49a
-vapidir = $(datadir)/vala/vapi
41b49a
-vapi_DATA = $(VAPIGEN_VAPIS) $(VAPIGEN_VAPIS:.vapi=.deps)
41b49a
+all: $(vapifiles)
41b49a
 
41b49a
-endif
41b49a
+EXTRA_DIST = $(depsfiles) $(filesfiles_src) $(nsfiles_src) $(metadatafiles) $(vapifiles)
41b49a
+CLEANFILES = $(gifiles)
41b49a
+DISTCLEANFILES = $(vapifiles) $(filesfiles) $(nsfiles)
41b49a
 
41b49a
 -include $(top_srcdir)/git.mk
41b49a
diff --git a/bindings/vala/grilo-0.2-custom.vala b/bindings/vala/grilo-0.2-custom.vala
41b49a
index 4e075e9..1d13da3 100644
41b49a
--- a/bindings/vala/grilo-0.2-custom.vala
41b49a
+++ b/bindings/vala/grilo-0.2-custom.vala
41b49a
@@ -1,6 +1,19 @@
41b49a
 namespace Grl {
41b49a
+	[CCode (instance_pos = 3.1)]
41b49a
+	public delegate void SourceResolveCb (Grl.Source source, uint operation_id, Grl.Media? media, GLib.Error error);
41b49a
+	[CCode (instance_pos = 2.1)]
41b49a
+	public delegate void SourceRemoveCb (Grl.Source source, Grl.Media? media, GLib.Error error);
41b49a
+	[CCode (instance_pos = 4.1)]
41b49a
+	public delegate void SourceResultCb (Grl.Source source, uint operation_id, Grl.Media? media, uint remaining, GLib.Error? error);
41b49a
+	[CCode (instance_pos = 3.1)]
41b49a
+	public delegate void SourceStoreCb (Grl.Source source, Grl.MediaBox? parent, Grl.Media? media, GLib.Error? error);
41b49a
 
41b49a
-	public struct MetadataKey {
41b49a
+	[SimpleType]
41b49a
+	public struct KeyID {
41b49a
+	}
41b49a
+
41b49a
+	[Compact]
41b49a
+	public class MetadataKey {
41b49a
 		[CCode (cname ="GRL_METADATA_KEY_INVALID")]
41b49a
 		public static Grl.KeyID INVALID;
41b49a
 		[CCode (cname ="GRL_METADATA_KEY_ALBUM")]
41b49a
@@ -112,6 +125,6 @@ namespace Grl {
41b49a
 		[CCode (cname ="GRL_METADATA_KEY_AUDIO_TRACK")]
41b49a
 		public static Grl.KeyID AUDIO_TRACK;
41b49a
 
41b49a
-		public static GLib.List list_new (Grl.KeyID p, ...);
41b49a
+		public static unowned GLib.List list_new (Grl.KeyID p, ...);
41b49a
 	}
41b49a
 }
41b49a
diff --git a/bindings/vala/grilo-0.2.metadata b/bindings/vala/grilo-0.2.metadata
41b49a
new file mode 100644
41b49a
index 0000000..98ef88a
41b49a
--- /dev/null
41b49a
+++ b/bindings/vala/grilo-0.2.metadata
41b49a
@@ -0,0 +1,58 @@
41b49a
+# Grilo library
41b49a
+Grl cprefix="Grl" lower_case_cprefix="grl_" cheader_filename="grilo.h"
41b49a
+
41b49a
+# GrlConfig
41b49a
+grl_config_new.source nullable="1"
41b49a
+
41b49a
+# GrlRegistry
41b49a
+grl_registry_add_config.config transfer_ownership="1"
41b49a
+grl_registry_get_metadata_keys type_arguments="unowned KeyID" transfer_ownership="1"
41b49a
+grl_registry_get_sources type_arguments="unowned Plugin" transfer_ownership="1"
41b49a
+grl_registry_get_sources_by_operations type_arguments="unowned Plugin" transfer_ownership="1"
41b49a
+
41b49a
+# GrlPlugin
41b49a
+grl_plugin_get_info_keys type_arguments="unowned string" transfer_ownership="1"
41b49a
+
41b49a
+# GrlSource
41b49a
+grl_source_slow_keys type_arguments="unowned KeyID" transfer_ownership="0"
41b49a
+grl_source_supported_keys type_arguments="unowned KeyID" transfer_ownership="0"
41b49a
+grl_source_writable_keys type_arguments="unowned KeyID" transfer_ownership="0"
41b49a
+grl_source_browse.container nullable="1"
41b49a
+grl_source_browse.keys type_arguments="KeyID"
41b49a
+grl_source_browse_sync type_arguments="Media" transfer_ownership="1"
41b49a
+grl_source_browse_sync.keys type_arguments="KeyID"
41b49a
+grl_source_query.keys type_arguments="KeyID"
41b49a
+grl_source_query_sync type_arguments="Media" transfer_ownership="1"
41b49a
+grl_source_query_sync.keys type_arguments="KeyID"
41b49a
+grl_source_search.keys type_arguments="KeyID"
41b49a
+grl_source_search_sync type_arguments="Media" transfer_ownership="1"
41b49a
+grl_source_search_sync.keys type_arguments="KeyID"
41b49a
+grl_source_may_resolve.missing_keys type_arguments="unowned KeyID" is_out="1" transfer_ownership="1"
41b49a
+grl_source_resolve.keys type_arguments="KeyID"
41b49a
+grl_source_resolve_sync.keys type_arguments="KeyID"
41b49a
+grl_source_store_metadata.keys type_arguments="KeyID"
41b49a
+grl_source_set_metadata_sync.keys type_arguments="KeyID"
41b49a
+grl_source_key_depends type_arguments="unowned KeyID" transfer_ownership="0"
41b49a
+
41b49a
+# GrlOperationOptions
41b49a
+grl_operation_options_new.caps nullable="1"
41b49a
+
41b49a
+# GrlData
41b49a
+grl_data_get_keys type_arguments="unowned KeyID" transfer_ownership="1"
41b49a
+
41b49a
+# Error domain
41b49a
+GrlCoreError errordomain="1"
41b49a
+
41b49a
+# Callbacks
41b49a
+GrlSourceRemoveCb hidden="1"
41b49a
+GrlSourceResultCb hidden="1"
41b49a
+GrlSourceStoreCb hidden="1"
41b49a
+GrlSourceStoreMetadataCb hidden="1"
41b49a
+GrlSourceResolveCb hidden="1"
41b49a
+
41b49a
+# Util
41b49a
+grl_list_from_va ellipsis="1"
41b49a
+
41b49a
+# Grilo
41b49a
+grl_init.argc hidden="1"
41b49a
+grl_init.argv is_array="1" is_ref="1" array_length_pos="0.9"
41b49a
diff --git a/bindings/vala/grilo-net-0.2.metadata b/bindings/vala/grilo-net-0.2.metadata
41b49a
new file mode 100644
41b49a
index 0000000..3552012
41b49a
--- /dev/null
41b49a
+++ b/bindings/vala/grilo-net-0.2.metadata
41b49a
@@ -0,0 +1,6 @@
41b49a
+# Grilo Net library
41b49a
+GrlNet cprefix="GrlNet" lower_case_cprefix="grl_net_" cheader_filename="net/grl-net.h"
41b49a
+
41b49a
+# GrlNetWc
41b49a
+grl_net_wc_request_*.content transfer_ownership="0" is_out="1"
41b49a
+grl_net_wc_request_*.length nullable="1" is_out="1" default_value="null"
41b49a
diff --git a/bindings/vala/grilo-net-uninstalled.files.in b/bindings/vala/grilo-net-uninstalled.files.in
41b49a
new file mode 100644
41b49a
index 0000000..b857dbe
41b49a
--- /dev/null
41b49a
+++ b/bindings/vala/grilo-net-uninstalled.files.in
41b49a
@@ -0,0 +1,2 @@
41b49a
+@top_builddir@/libs/net/grl-net.h
41b49a
+@top_builddir@/libs/net/.libs/libgrlnet-0.2.so
41b49a
diff --git a/bindings/vala/grilo-net-uninstalled.namespace.in b/bindings/vala/grilo-net-uninstalled.namespace.in
41b49a
new file mode 100644
41b49a
index 0000000..6430318
41b49a
--- /dev/null
41b49a
+++ b/bindings/vala/grilo-net-uninstalled.namespace.in
41b49a
@@ -0,0 +1 @@
41b49a
+GrlNet
41b49a
diff --git a/bindings/vala/grilo-uninstalled.defines b/bindings/vala/grilo-uninstalled.defines
41b49a
new file mode 100644
41b49a
index 0000000..3bb8068
41b49a
--- /dev/null
41b49a
+++ b/bindings/vala/grilo-uninstalled.defines
41b49a
@@ -0,0 +1 @@
41b49a
+-DGRILO_COMPILATION
41b49a
diff --git a/bindings/vala/grilo-uninstalled.files.in b/bindings/vala/grilo-uninstalled.files.in
41b49a
new file mode 100644
41b49a
index 0000000..7c8a334
41b49a
--- /dev/null
41b49a
+++ b/bindings/vala/grilo-uninstalled.files.in
41b49a
@@ -0,0 +1,13 @@
41b49a
+@top_builddir@/src/grilo.h
41b49a
+@top_builddir@/src/grl-error.h
41b49a
+@top_builddir@/src/grl-log.h
41b49a
+@top_builddir@/src/grl-plugin.h
41b49a
+@top_builddir@/src/grl-source.h
41b49a
+
41b49a
+@top_builddir@/src/grl-caps.h
41b49a
+@top_builddir@/src/grl-operation-options.h
41b49a
+@top_builddir@/src/grl-multiple.h
41b49a
+@top_builddir@/src/grl-registry.h
41b49a
+@top_builddir@/src/grl-util.h
41b49a
+@top_builddir@/src/data/
41b49a
+@top_builddir@/src/.libs/libgrilo-0.2.so
41b49a
diff --git a/bindings/vala/grilo-uninstalled.namespace.in b/bindings/vala/grilo-uninstalled.namespace.in
41b49a
new file mode 100644
41b49a
index 0000000..a83f898
41b49a
--- /dev/null
41b49a
+++ b/bindings/vala/grilo-uninstalled.namespace.in
41b49a
@@ -0,0 +1 @@
41b49a
+Grl
41b49a
diff --git a/configure.ac b/configure.ac
41b49a
index 7c845e0..c3e2ae5 100644
41b49a
--- a/configure.ac
41b49a
+++ b/configure.ac
41b49a
@@ -243,22 +243,55 @@ AC_ARG_ENABLE([tests],
41b49a
 AM_CONDITIONAL(ENABLE_TESTS, test "enable_tests" = "xyes")
41b49a
 
41b49a
 # ----------------------------------------------------------
41b49a
-# GTK-DOC
41b49a
+# VALA BINDINGS
41b49a
 # ----------------------------------------------------------
41b49a
 
41b49a
-GTK_DOC_CHECK([1.10],[--flavour no-tmpl])
41b49a
+AC_PATH_PROG([VALAC], [valac])
41b49a
+AC_PATH_PROG([VALA_GEN_INTROSPECT], [vala-gen-introspect])
41b49a
+AC_PATH_PROG([VAPIGEN], [vapigen])
41b49a
+
41b49a
+AC_ARG_ENABLE([vala],
41b49a
+        AS_HELP_STRING([--enable-vala],
41b49a
+                [Enable Vala plugin support (default: auto)]),
41b49a
+        [
41b49a
+                case "$enableval" in
41b49a
+                     yes)
41b49a
+                        if test "x$VALAC" = "x"; then
41b49a
+                           AC_MSG_ERROR([valac not found, install it or use --disable-vala])
41b49a
+                        fi
41b49a
+                        if test "x$VALA_GEN_INTROSPECT" = "x"; then
41b49a
+                           AC_MSG_ERROR([vala-gen-introspect not found, install it or use --disable-vala])
41b49a
+                        fi
41b49a
+                        if test "x$VAPIGEN" = "x"; then
41b49a
+                           AC_MSG_ERROR([vapigen not found, install it or use --disable-vala])
41b49a
+                        fi
41b49a
+                        ;;
41b49a
+                     no)
41b49a
+                        enable_vala=no
41b49a
+                        ;;
41b49a
+                esac
41b49a
+        ],
41b49a
+        [
41b49a
+                if test "x$VALAC" != "x" -a "x$VALA_GEN_INTROSPECT" != "x" -a "x$VAPIGEN" != "x"; then
41b49a
+                   enable_vala=yes
41b49a
+                else
41b49a
+                   enable_vala=no
41b49a
+                fi
41b49a
+        ])
41b49a
+
41b49a
+AM_CONDITIONAL([HAVE_VALA], [test "x$enable_vala" = "xyes"])
41b49a
 
41b49a
 # ----------------------------------------------------------
41b49a
-# GOBJECT-INTROSPECTION
41b49a
+# GTK-DOC
41b49a
 # ----------------------------------------------------------
41b49a
 
41b49a
-GOBJECT_INTROSPECTION_CHECK([0.9])
41b49a
+GTK_DOC_CHECK([1.10],[--flavour no-tmpl])
41b49a
 
41b49a
 # ----------------------------------------------------------
41b49a
-# VALA BINDINGS
41b49a
+# GOBJECT-INTROSPECTION
41b49a
 # ----------------------------------------------------------
41b49a
 
41b49a
-VAPIGEN_CHECK([0.26])
41b49a
+GOBJECT_INTROSPECTION_CHECK([0.9])
41b49a
 
41b49a
 # ----------------------------------------------------------
41b49a
 # GETTEXT/INTLTOOL
41b49a
@@ -307,6 +340,10 @@ AC_CONFIG_FILES([
41b49a
   tools/grilo-launch/Makefile
41b49a
   bindings/Makefile
41b49a
   bindings/vala/Makefile
41b49a
+  bindings/vala/grilo-uninstalled.files
41b49a
+  bindings/vala/grilo-uninstalled.namespace
41b49a
+  bindings/vala/grilo-net-uninstalled.files
41b49a
+  bindings/vala/grilo-net-uninstalled.namespace
41b49a
   doc/Makefile
41b49a
   doc/grilo/Makefile
41b49a
   examples/Makefile
41b49a
-- 
41b49a
2.4.0
41b49a