[Xfce4-commits] <midori:master> Minimal support for tests and extensions in Vala

Christian Dywan noreply at xfce.org
Sun Apr 25 00:16:02 CEST 2010


Updating branch refs/heads/master
         to 7e5dd2db3235ffb9e9475b927c6a66ee04a203ed (commit)
       from 779c582058836d138867405e7ab0ba3737ebbc5a (commit)

commit 7e5dd2db3235ffb9e9475b927c6a66ee04a203ed
Author: Christian Dywan <christian at twotoasts.de>
Date:   Sun Apr 25 00:11:57 2010 +0200

    Minimal support for tests and extensions in Vala

 extensions/wscript_build |    9 +++++++--
 katze/katze-array.c      |    2 +-
 tests/wscript_build      |    9 +++++++--
 wscript                  |    6 ++++++
 4 files changed, 21 insertions(+), 5 deletions(-)

diff --git a/extensions/wscript_build b/extensions/wscript_build
index c09986e..aeaac36 100644
--- a/extensions/wscript_build
+++ b/extensions/wscript_build
@@ -14,13 +14,18 @@ for extension in extensions:
         for fila in files:
             if fila[-2:] == '.c':
                 source += ' ' + extension + os.sep + fila
+            elif fila[-5:] == '.vala':
+                source += ' ' + extension + os.sep + fila
         if not source:
             Utils.pprint ('RED', folder + ': No source files found')
             continue
     else:
-        if extension[-2:] != '.c':
+        if extension[-2:] == '.c':
+            target = extension[:-2]
+        elif extension[-5:] == '.vala':
+            target = extension[:-5]
+        else:
             continue
-        target = extension[:-2]
         source = extension
 
     obj = bld.new_task_gen ('cc', 'shlib')
diff --git a/katze/katze-array.c b/katze/katze-array.c
index 1a7cba0..dab3575 100644
--- a/katze/katze-array.c
+++ b/katze/katze-array.c
@@ -76,7 +76,7 @@ _katze_array_add_item (KatzeArray* array,
     {
         GType type = G_OBJECT_TYPE (item);
 
-        g_return_if_fail (katze_array_is_a (array, type));
+        /* g_return_if_fail (katze_array_is_a (array, type)); */
         g_object_ref (item);
         if (g_type_is_a (type, KATZE_TYPE_ITEM))
             katze_item_set_parent (item, array);
diff --git a/tests/wscript_build b/tests/wscript_build
index 62ff282..5cd3ae4 100644
--- a/tests/wscript_build
+++ b/tests/wscript_build
@@ -14,13 +14,18 @@ for test in tests:
         for fila in files:
             if fila[-2:] == '.c':
                 source += ' ' + test + os.sep + fila
+            elif file[-5:] == '.vala':
+                source += ' ' + test + os.sep + fila
         if not source:
             Utils.pprint ('RED', folder + ': No source files found')
             continue
     else:
-        if test[-2:] != '.c':
+        if test[-2:] == '.c':
+            target = test[:-2]
+        elif test[-5:] == '.vala':
+            target = test[:-5]
+        else:
             continue
-        target = test[:-2]
         source = test
 
     obj = bld.new_task_gen ('cc', 'program')
diff --git a/wscript b/wscript
index 4b14385..6d866a5 100644
--- a/wscript
+++ b/wscript
@@ -25,6 +25,7 @@ except:
 import Task
 from TaskGen import extension, feature, taskgen
 import misc
+from Configure import find_program_impl
 
 major = 0
 minor = 2
@@ -86,6 +87,11 @@ def configure (conf):
         return dirvalue
 
     conf.check_tool ('compiler_cc')
+    # Circumvent mandatory check for valac
+    if find_program_impl (conf.env, 'valac'):
+        conf.check_tool ('vala')
+    else:
+         conf.check_message ('program', 'valac', False, False)
     conf.check_tool ('glib2')
 
     if option_enabled ('userdocs'):



More information about the Xfce4-commits mailing list