Signed-off-by: Frederik 'playya' Sdun <[email protected]> --- ...ate-variables-in-GObject-creation-methods.patch | 60 ++++++++++++++++++++ ...Fix-return-type-of-closure-unref-function.patch | 25 ++++++++ ...Fix-error-propagation-in-creation-methods.patch | 29 ++++++++++ ...-glib-2.0-Fix-g_regex_get_pattern-binding.patch | 25 ++++++++ recipes/vala/vala-native_0.7.7.bb | 13 ++++ recipes/vala/vala_0.7.7.bb | 11 ++++ 6 files changed, 163 insertions(+), 0 deletions(-)
diff --git a/recipes/vala/files/0003-Fix-delegate-variables-in-GObject-creation-methods.patch b/recipes/vala/files/0003-Fix-delegate-variables-in-GObject-creation-methods.patch new file mode 100644 index 0000000..7f00072 --- /dev/null +++ b/recipes/vala/files/0003-Fix-delegate-variables-in-GObject-creation-methods.patch @@ -0,0 +1,60 @@ +From 9c0e7c1447bb932df92e6f0a0966e1da363f2c9d Mon Sep 17 00:00:00 2001 +From: =?utf-8?q?J=C3=BCrg=20Billeter?= <[email protected]> +Date: Mon, 28 Sep 2009 18:01:46 +0200 +Subject: [PATCH] Fix delegate variables in GObject creation methods + +Fixes bug 596621. +--- + codegen/valaccodemethodmodule.vala | 1 + + tests/Makefile.am | 1 + + tests/objects/bug596621.vala | 15 +++++++++++++++ + 3 files changed, 17 insertions(+), 0 deletions(-) + +diff --git a/codegen/valaccodemethodmodule.vala b/codegen/valaccodemethodmodule.vala +index aa2c1fe..93d49ab 100644 +--- a/codegen/valaccodemethodmodule.vala ++++ b/codegen/valaccodemethodmodule.vala +@@ -311,6 +311,7 @@ internal class Vala.CCodeMethodModule : CCodeStructModule { + if (!local.floating && requires_destroy (local.variable_type)) { + var ma = new MemberAccess.simple (local.name); + ma.symbol_reference = local; ++ ma.value_type = local.variable_type.copy (); + cblock.add_statement (new CCodeExpressionStatement (get_unref_expression (get_variable_cexpression (local.name), local.variable_type, ma))); + } + } +diff --git a/tests/Makefile.am b/tests/Makefile.am +index 8c83e86..f1058b8 100644 +--- a/tests/Makefile.am ++++ b/tests/Makefile.am +@@ -48,6 +48,7 @@ TESTS = \ + objects/test-029.vala \ + objects/test-034.vala \ + objects/bug593260.vala \ ++ objects/bug596621.vala \ + errors/errors.vala \ + errors/bug596228.vala \ + asynchronous/bug595735.vala \ +diff --git a/tests/objects/bug596621.vala b/tests/objects/bug596621.vala +new file mode 100644 +index 0000000..348ea40 +--- /dev/null ++++ b/tests/objects/bug596621.vala +@@ -0,0 +1,15 @@ ++class Foo : Object { ++ [CCode (has_construct_function = false)] ++ public Foo () { ++ } ++} ++ ++class Bar : Foo { ++ public Bar () { ++ Func baz; ++ } ++} ++ ++void main () { ++} ++ +-- +1.6.0.4 + diff --git a/recipes/vala/files/0005-Fix-return-type-of-closure-unref-function.patch b/recipes/vala/files/0005-Fix-return-type-of-closure-unref-function.patch new file mode 100644 index 0000000..5464831 --- /dev/null +++ b/recipes/vala/files/0005-Fix-return-type-of-closure-unref-function.patch @@ -0,0 +1,25 @@ +From 9ef542a99cc1d8263d5953b754c0b23bff4d0312 Mon Sep 17 00:00:00 2001 +From: =?utf-8?q?J=C3=BCrg=20Billeter?= <[email protected]> +Date: Tue, 29 Sep 2009 22:25:24 +0200 +Subject: [PATCH] Fix return type of closure unref function + +--- + codegen/valaccodebasemodule.vala | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/codegen/valaccodebasemodule.vala b/codegen/valaccodebasemodule.vala +index 38662ba..8a1ce31 100644 +--- a/codegen/valaccodebasemodule.vala ++++ b/codegen/valaccodebasemodule.vala +@@ -1839,7 +1839,7 @@ internal class Vala.CCodeBaseModule : CCodeModule { + ref_fun.block.add_statement (new CCodeReturnStatement (new CCodeIdentifier ("_data%d_".printf (block_id)))); + source_type_member_definition.append (ref_fun); + +- var unref_fun = new CCodeFunction ("block%d_data_unref".printf (block_id), struct_name + "*"); ++ var unref_fun = new CCodeFunction ("block%d_data_unref".printf (block_id), "void"); + unref_fun.add_parameter (new CCodeFormalParameter ("_data%d_".printf (block_id), struct_name + "*")); + unref_fun.modifiers = CCodeModifiers.STATIC; + source_declarations.add_type_member_declaration (unref_fun.copy ()); +-- +1.6.0.4 + diff --git a/recipes/vala/files/0014-GError-Fix-error-propagation-in-creation-methods.patch b/recipes/vala/files/0014-GError-Fix-error-propagation-in-creation-methods.patch new file mode 100644 index 0000000..1c697ef --- /dev/null +++ b/recipes/vala/files/0014-GError-Fix-error-propagation-in-creation-methods.patch @@ -0,0 +1,29 @@ +From fe541bc5cd9d84a567705b72777c2b2117c85aef Mon Sep 17 00:00:00 2001 +From: =?utf-8?q?J=C3=BCrg=20Billeter?= <[email protected]> +Date: Wed, 30 Sep 2009 19:28:37 +0200 +Subject: [PATCH] GError: Fix error propagation in creation methods + +--- + codegen/valagerrormodule.vala | 6 +++++- + 1 files changed, 5 insertions(+), 1 deletions(-) + +diff --git a/codegen/valagerrormodule.vala b/codegen/valagerrormodule.vala +index 9d624de..2f1d385 100644 +--- a/codegen/valagerrormodule.vala ++++ b/codegen/valagerrormodule.vala +@@ -116,7 +116,11 @@ internal class Vala.GErrorModule : CCodeDelegateModule { + append_local_free (current_symbol, free_frag, false); + cerror_block.add_statement (free_frag); + +- if (current_return_type is VoidType) { ++ if (current_method is CreationMethod) { ++ cerror_block.add_statement (new CCodeReturnStatement (new CCodeConstant ("NULL"))); ++ } else if (current_method != null && current_method.coroutine) { ++ cerror_block.add_statement (new CCodeReturnStatement (new CCodeConstant ("FALSE"))); ++ } else if (current_return_type is VoidType) { + cerror_block.add_statement (new CCodeReturnStatement ()); + } else { + cerror_block.add_statement (new CCodeReturnStatement (default_value_for_type (current_return_type, false))); +-- +1.6.0.4 + diff --git a/recipes/vala/files/0018-glib-2.0-Fix-g_regex_get_pattern-binding.patch b/recipes/vala/files/0018-glib-2.0-Fix-g_regex_get_pattern-binding.patch new file mode 100644 index 0000000..e791ec9 --- /dev/null +++ b/recipes/vala/files/0018-glib-2.0-Fix-g_regex_get_pattern-binding.patch @@ -0,0 +1,25 @@ +From 1c402a0db04c355a8414af4871b77bb62f72391f Mon Sep 17 00:00:00 2001 +From: Michael 'Mickey' Lauer <[email protected]> +Date: Thu, 1 Oct 2009 13:52:44 +0200 +Subject: [PATCH] glib-2.0: Fix g_regex_get_pattern binding + +--- + vapi/glib-2.0.vapi | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/vapi/glib-2.0.vapi b/vapi/glib-2.0.vapi +index 4837bc6..3682e7f 100644 +--- a/vapi/glib-2.0.vapi ++++ b/vapi/glib-2.0.vapi +@@ -2707,7 +2707,7 @@ namespace GLib { + [CCode (ref_function = "g_regex_ref", unref_function = "g_regex_unref")] + public class Regex { + public Regex (string pattern, RegexCompileFlags compile_options = 0, RegexMatchFlags match_options = 0) throws RegexError; +- public string get_pattern (); ++ public unowned string get_pattern (); + public int get_max_backref (); + public int get_capture_count (); + public int get_string_number (string name); +-- +1.6.0.4 + diff --git a/recipes/vala/vala-native_0.7.7.bb b/recipes/vala/vala-native_0.7.7.bb new file mode 100644 index 0000000..d1dee2a --- /dev/null +++ b/recipes/vala/vala-native_0.7.7.bb @@ -0,0 +1,13 @@ +require vala.inc +inherit native + +DEPENDS = "glib-2.0-native" + +SRC_URI_append = "\ + http://download.gnome.org/sources/vala/0.7/vala-${PV}.tar.gz \ + file://0003-Fix-delegate-variables-in-GObject-creation-methods.patch;patch=1 \ + file://0005-Fix-return-type-of-closure-unref-function.patch;patch=1 \ + file://0010-D-Bus-Fix-marshalling-of-GLib.Value-parameters.patch;patch=1 \ + file://0014-GError-Fix-error-propagation-in-creation-methods.patch;patch=1 \ + file://0018-glib-2.0-Fix-g_regex_get_pattern-binding.patch;patch=1 \ + " diff --git a/recipes/vala/vala_0.7.7.bb b/recipes/vala/vala_0.7.7.bb new file mode 100644 index 0000000..b98f9f5 --- /dev/null +++ b/recipes/vala/vala_0.7.7.bb @@ -0,0 +1,11 @@ +require vala.inc +PR = "r0" + +SRC_URI_append = "\ + http://download.gnome.org/sources/vala/0.7/vala-${PV}.tar.gz \ + file://0003-Fix-delegate-variables-in-GObject-creation-methods.patch;patch=1 \ + file://0005-Fix-return-type-of-closure-unref-function.patch;patch=1 \ + file://0010-D-Bus-Fix-marshalling-of-GLib.Value-parameters.patch;patch=1 \ + file://0014-GError-Fix-error-propagation-in-creation-methods.patch;patch=1 \ + file://0018-glib-2.0-Fix-g_regex_get_pattern-binding.patch;patch=1 \ + " -- 1.6.5.rc2.7.gf4df9.dirty _______________________________________________ Shr-devel mailing list [email protected] http://lists.shr-project.org/mailman/listinfo/shr-devel
