diff --git a/gjs-0.6.tar.bz2 b/gjs-0.6.tar.bz2 deleted file mode 100644 index 8b07801..0000000 --- a/gjs-0.6.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:5c5a54bbb819bfaea1e0e76f0508467e8d5690360ab550e1284951d905a56e5d -size 436575 diff --git a/gjs-0.7.tar.bz2 b/gjs-0.7.tar.bz2 new file mode 100644 index 0000000..87523dc --- /dev/null +++ b/gjs-0.7.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6eb9b3a26e98b524a455ae53f6af32599a8265bc8fc5122e4c806cbca1e91a44 +size 475023 diff --git a/gjs-bgo623775.patch b/gjs-bgo623775.patch new file mode 100644 index 0000000..19393a1 --- /dev/null +++ b/gjs-bgo623775.patch @@ -0,0 +1,291 @@ +From 324a06ee4bfc68ba13b4781d94f6f1d687c8b05c Mon Sep 17 00:00:00 2001 +From: Colin Walters +Date: Wed, 07 Jul 2010 18:49:38 +0000 +Subject: Adjust for g-i change to remove machine-independent type tags + +See bug 623774. + +https://bugzilla.gnome.org/show_bug.cgi?id=623775 +--- +Index: gjs-0.7/gi/arg.c +=================================================================== +--- gjs-0.7.orig/gi/arg.c ++++ gjs-0.7/gi/arg.c +@@ -101,43 +101,23 @@ _gjs_enum_value_is_valid(JSContext *con + return found; + } + +-/* Return the proper GI int type for the size and signedness. */ ++/* The typelib used to have machine-independent types like ++ * GI_TYPE_TAG_LONG that had to be converted; now we only ++ * handle GType specially here. ++ */ + static inline GITypeTag +-type_tag_from_size(int intsize, gboolean is_signed) +-{ +- /* Constant folding should be able to reduce this to a single constant, +- * given constant inputs. */ +- switch (intsize) { +- case 1: return (is_signed) ? GI_TYPE_TAG_INT8 : GI_TYPE_TAG_UINT8; +- case 2: return (is_signed) ? GI_TYPE_TAG_INT16 : GI_TYPE_TAG_UINT16; +- case 4: return (is_signed) ? GI_TYPE_TAG_INT32 : GI_TYPE_TAG_UINT32; +- case 8: return (is_signed) ? GI_TYPE_TAG_INT64 : GI_TYPE_TAG_UINT64; +- default: g_assert_not_reached (); +- } +-} +- +-/** Convert machine-specific integer type tags such as 'int' and 'long' +- * into machine-independent explicitly-sized type tags such as 'int32'. */ +-static GITypeTag +-normalize_int_types(GITypeTag type) { +- enum { UNSIGNED=FALSE, SIGNED=TRUE }; +- switch (type) { +-#define INT_TYPE(tag, ty, sign) \ +- case GI_TYPE_TAG_##tag: return type_tag_from_size(sizeof(ty), (sign)); +- INT_TYPE(SHORT, short, SIGNED); +- INT_TYPE(USHORT, unsigned short, UNSIGNED); +- INT_TYPE(INT, int, SIGNED); +- INT_TYPE(UINT, unsigned int, UNSIGNED); +- INT_TYPE(LONG, long, SIGNED); +- INT_TYPE(ULONG, unsigned long, UNSIGNED); +- INT_TYPE(SSIZE, ssize_t, SIGNED); +- INT_TYPE(SIZE, size_t, UNSIGNED); +- INT_TYPE(TIME_T, time_t, SIGNED); /* time_t is signed */ +- INT_TYPE(GTYPE, GType, UNSIGNED); +-#undef INT_TYPE +- default: +- return type; /* not a weird int type, return untouched */ ++replace_gtype(GITypeTag type) { ++ if (type == GI_TYPE_TAG_GTYPE) { ++ /* Constant folding should handle this hopefully */ ++ switch (sizeof(GType)) { ++ case 1: GI_TYPE_TAG_UINT8; ++ case 2: GI_TYPE_TAG_UINT16; ++ case 4: GI_TYPE_TAG_UINT32; ++ case 8: GI_TYPE_TAG_UINT64; ++ default: g_assert_not_reached (); ++ } + } ++ return type; + } + + /* Check if an argument of the given needs to be released if we created it +@@ -425,7 +405,7 @@ gjs_string_to_intarray(JSContext *cont + gsize length; + + element_type = g_type_info_get_tag(param_info); +- element_type = normalize_int_types(element_type); ++ element_type = replace_gtype(element_type); + + switch (element_type) { + case GI_TYPE_TAG_INT8: +@@ -521,7 +501,7 @@ gjs_array_to_array(JSContext *context, + GITypeTag element_type; + + element_type = g_type_info_get_tag(param_info); +- element_type = normalize_int_types(element_type); ++ element_type = replace_gtype(element_type); + + switch (element_type) { + case GI_TYPE_TAG_UTF8: +@@ -588,8 +568,7 @@ gjs_value_to_g_argument(JSContext * + gboolean nullable_type; + + type_tag = g_type_info_get_tag( (GITypeInfo*) type_info); +- if (type_tag != GI_TYPE_TAG_TIME_T) // we handle time_t as a non-int type +- type_tag = normalize_int_types(type_tag); ++ type_tag = replace_gtype(type_tag); + + gjs_debug_marshal(GJS_DEBUG_GFUNCTION, + "Converting jsval to GArgument %s", +@@ -680,14 +659,6 @@ gjs_value_to_g_argument(JSContext * + } + break; + +- case GI_TYPE_TAG_TIME_T: { +- double v; +- if (!JS_ValueToNumber(context, value, &v)) +- wrong = TRUE; +- arg->v_ulong = (unsigned long) (v/1000); +- } +- break; +- + case GI_TYPE_TAG_BOOLEAN: + if (!JS_ValueToBoolean(context, value, &arg->v_boolean)) + wrong = TRUE; +@@ -1063,18 +1034,6 @@ gjs_value_to_g_argument(JSContext * + } + break; + +- case GI_TYPE_TAG_SHORT: +- case GI_TYPE_TAG_USHORT: +- case GI_TYPE_TAG_INT: +- case GI_TYPE_TAG_UINT: +- case GI_TYPE_TAG_LONG: +- case GI_TYPE_TAG_ULONG: +- case GI_TYPE_TAG_SIZE: +- case GI_TYPE_TAG_SSIZE: +- case GI_TYPE_TAG_GTYPE: +- /* these types are converted by normalize_int_types */ +- g_assert_not_reached(); +- + default: + gjs_debug(GJS_DEBUG_ERROR, + "Unhandled type %s for JavaScript to GArgument conversion", +@@ -1134,8 +1093,7 @@ gjs_g_argument_init_default(JSContext + GITypeTag type_tag; + + type_tag = g_type_info_get_tag( (GITypeInfo*) type_info); +- if (type_tag != GI_TYPE_TAG_TIME_T) // we handle time_t as a non-int type +- type_tag = normalize_int_types(type_tag); ++ type_tag = replace_gtype(type_tag); + + switch (type_tag) { + case GI_TYPE_TAG_VOID: +@@ -1173,10 +1131,6 @@ gjs_g_argument_init_default(JSContext + case GI_TYPE_TAG_UINT64: + arg->v_uint64 = 0; + +- case GI_TYPE_TAG_TIME_T: +- arg->v_ulong = 0; +- break; +- + case GI_TYPE_TAG_BOOLEAN: + arg->v_boolean = FALSE; + break; +@@ -1233,18 +1187,6 @@ gjs_g_argument_init_default(JSContext + arg->v_pointer = NULL; + break; + +- case GI_TYPE_TAG_SHORT: +- case GI_TYPE_TAG_USHORT: +- case GI_TYPE_TAG_INT: +- case GI_TYPE_TAG_UINT: +- case GI_TYPE_TAG_LONG: +- case GI_TYPE_TAG_ULONG: +- case GI_TYPE_TAG_SIZE: +- case GI_TYPE_TAG_SSIZE: +- case GI_TYPE_TAG_GTYPE: +- /* these types are converted by normalize_int_types */ +- g_assert_not_reached(); +- + default: + gjs_debug(GJS_DEBUG_ERROR, + "Unhandled type %s for default GArgument initialization", +@@ -1429,8 +1371,7 @@ gjs_value_from_g_argument (JSContext *c + GITypeTag type_tag; + + type_tag = g_type_info_get_tag( (GITypeInfo*) type_info); +- if (type_tag != GI_TYPE_TAG_TIME_T) // we handle time_t as a non-int type +- type_tag = normalize_int_types(type_tag); ++ type_tag = replace_gtype(type_tag); + + gjs_debug_marshal(GJS_DEBUG_GFUNCTION, + "Converting GArgument %s to jsval", +@@ -1477,11 +1418,6 @@ gjs_value_from_g_argument (JSContext *c + case GI_TYPE_TAG_DOUBLE: + return JS_NewDoubleValue(context, arg->v_double, value_p); + +- case GI_TYPE_TAG_TIME_T: +- *value_p = gjs_date_from_time_t(context, +- (time_t) arg->v_long); +- return JS_TRUE; +- + case GI_TYPE_TAG_FILENAME: + if (arg->v_pointer) + return gjs_string_from_filename(context, arg->v_pointer, -1, value_p); +@@ -1701,18 +1637,6 @@ gjs_value_from_g_argument (JSContext *c + } + break; + +- case GI_TYPE_TAG_SHORT: +- case GI_TYPE_TAG_USHORT: +- case GI_TYPE_TAG_INT: +- case GI_TYPE_TAG_UINT: +- case GI_TYPE_TAG_LONG: +- case GI_TYPE_TAG_ULONG: +- case GI_TYPE_TAG_SIZE: +- case GI_TYPE_TAG_SSIZE: +- case GI_TYPE_TAG_GTYPE: +- /* these types are converted by normalize_int_types */ +- g_assert_not_reached(); +- + default: + gjs_debug(GJS_DEBUG_ERROR, + "Unhandled type %s converting GArgument to JavaScript", +@@ -1782,21 +1706,12 @@ gjs_g_arg_release_internal(JSContext *c + case GI_TYPE_TAG_UINT8: + case GI_TYPE_TAG_INT16: + case GI_TYPE_TAG_UINT16: +- case GI_TYPE_TAG_SHORT: +- case GI_TYPE_TAG_USHORT: +- case GI_TYPE_TAG_INT: + case GI_TYPE_TAG_INT32: +- case GI_TYPE_TAG_UINT: + case GI_TYPE_TAG_UINT32: + case GI_TYPE_TAG_INT64: + case GI_TYPE_TAG_UINT64: +- case GI_TYPE_TAG_LONG: +- case GI_TYPE_TAG_ULONG: + case GI_TYPE_TAG_FLOAT: + case GI_TYPE_TAG_DOUBLE: +- case GI_TYPE_TAG_SSIZE: +- case GI_TYPE_TAG_SIZE: +- case GI_TYPE_TAG_TIME_T: + break; + + case GI_TYPE_TAG_FILENAME: +@@ -1902,7 +1817,7 @@ gjs_g_arg_release_internal(JSContext *c + + param_info = g_type_info_get_param_type(type_info, 0); + element_type = g_type_info_get_tag(param_info); +- element_type = normalize_int_types(element_type); ++ element_type = replace_gtype(element_type); + + switch (element_type) { + case GI_TYPE_TAG_UTF8: +Index: gjs-0.7/gi/boxed.c +=================================================================== +--- gjs-0.7.orig/gi/boxed.c ++++ gjs-0.7/gi/boxed.c +@@ -1043,19 +1043,10 @@ struct_is_simple(GIStructInfo *info) + case GI_TYPE_TAG_UINT16: + case GI_TYPE_TAG_INT32: + case GI_TYPE_TAG_UINT32: +- case GI_TYPE_TAG_SHORT: +- case GI_TYPE_TAG_USHORT: +- case GI_TYPE_TAG_INT: +- case GI_TYPE_TAG_UINT: + case GI_TYPE_TAG_INT64: + case GI_TYPE_TAG_UINT64: +- case GI_TYPE_TAG_LONG: +- case GI_TYPE_TAG_ULONG: +- case GI_TYPE_TAG_SSIZE: +- case GI_TYPE_TAG_SIZE: + case GI_TYPE_TAG_FLOAT: + case GI_TYPE_TAG_DOUBLE: +- case GI_TYPE_TAG_TIME_T: + break; + case GI_TYPE_TAG_VOID: + case GI_TYPE_TAG_GTYPE: +Index: gjs-0.7/test/js/testEverythingBasic.js +=================================================================== +--- gjs-0.7.orig/test/js/testEverythingBasic.js ++++ gjs-0.7/test/js/testEverythingBasic.js +@@ -73,13 +73,9 @@ function testLifeUniverseAndEverything() + assertEquals(42, Everything.test_double(42)); + assertEquals(-42, Everything.test_double(-42)); + +- let now = new Date(); +- let bounced = Everything.test_timet(now); +- assertEquals(now.getFullYear(), bounced.getFullYear()); +- assertEquals(now.getMonth(), bounced.getMonth()); +- assertEquals(now.getDay(), bounced.getDay()); +- assertEquals(now.getHours(), bounced.getHours()); +- assertEquals(now.getSeconds(), bounced.getSeconds()); ++ let now = Math.floor(new Date().getTime() / 1000); ++ let bounced = Math.floor(Everything.test_timet(now)); ++ assertEquals(bounced, now); + } + + function testLimits() { diff --git a/gjs.changes b/gjs.changes index a49873b..353f08f 100644 --- a/gjs.changes +++ b/gjs.changes @@ -1,3 +1,32 @@ +------------------------------------------------------------------- +Thu Jul 15 17:25:15 UTC 2010 - dimstar@opensuse.org + +- Add gjs-bgo623775.patch, from upstream git to fix build with + gobject-introspection 0.9.2. + +------------------------------------------------------------------- +Fri May 28 22:36:18 CEST 2010 - dimstar@opensuse.org + +- Update to version 0.7: + + Add support for "foreign structs" - which are structures that + are referenced from gobject-introspection, but need glue + code to actually handle them. + + Hook cairo bindings to integrate with gobject-introspected + libraries using new foreign struct support + + Start working toward thread-safety by adding + JS_BeginRequest/JS_EndRequest calls throughout the codebase + + add Tweener.setTimeScale and Tweener.getTimeScale + + Wrap cairo_copy_path, cairo_copy_path_flat, and + cairo_append_path + + Handle destroy callbacks of type other than GDestroyNotify + + Handle flag arguments not registered with GObject + + Log errors that occur in callbacks + + Code cleanup + + Build fixes + + Bugs fixed: bgo#610357, bgo#614055, bgo#614344, bgo#615078, + bgo#615222, bgo#617343, bgo#617568, bgo#617702, bgo#617972, + bgo#618190, bgo#618195, bgo#618200, bgo#618201 + ------------------------------------------------------------------- Fri Mar 26 12:58:30 CET 2010 - vuntz@opensuse.org diff --git a/gjs.spec b/gjs.spec index 26cbe33..6ea0e4b 100644 --- a/gjs.spec +++ b/gjs.spec @@ -1,5 +1,5 @@ # -# spec file for package gjs (Version 0.6) +# spec file for package gjs (Version 0.7) # # Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany. # @@ -27,12 +27,13 @@ %endif Name: gjs -Version: 0.6 +Version: 0.7 Release: 1 License: MIT License (or similar) Summary: JavaScript bindings based on gobject-introspection and Mozilla Group: Development/Libraries/GNOME Source: %{name}-%{version}.tar.bz2 +Patch0: gjs-bgo623775.patch BuildRequires: cairo-devel BuildRequires: dbus-1-glib-devel BuildRequires: gcc-c++ @@ -74,6 +75,7 @@ Mozilla SpiderMonkey JavaScript engine. %prep %setup -q +%patch0 -p1 %build %configure \