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

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