packages: gjs/gjs.spec, gjs/gjs-xulrunner-5.0.patch (NEW) - fixed build wit...

megabajt megabajt at pld-linux.org
Thu Jun 23 17:55:40 CEST 2011


Author: megabajt                     Date: Thu Jun 23 15:55:40 2011 GMT
Module: packages                      Tag: HEAD
---- Log message:
- fixed build with xulrunner 5.0
- release 4

---- Files affected:
packages/gjs:
   gjs.spec (1.23 -> 1.24) , gjs-xulrunner-5.0.patch (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: packages/gjs/gjs.spec
diff -u packages/gjs/gjs.spec:1.23 packages/gjs/gjs.spec:1.24
--- packages/gjs/gjs.spec:1.23	Thu Jun 23 13:47:11 2011
+++ packages/gjs/gjs.spec	Thu Jun 23 17:55:35 2011
@@ -3,12 +3,13 @@
 Summary(pl.UTF-8):	Wiązania JavaScript dla GNOME
 Name:		gjs
 Version:	0.7.14
-Release:	3
+Release:	4
 License:	MIT and (MPL v1.1 / GPL v2+ / LGPL v2+)
 Group:		Libraries
 Source0:	http://ftp.gnome.org/pub/GNOME/sources/gjs/0.7/%{name}-%{version}.tar.bz2
 # Source0-md5:	0e1487e066df8937317da34545f7b548
 Patch0:		%{name}-rpath.patch
+Patch1:		%{name}-xulrunner-5.0.patch
 URL:		http://live.gnome.org/Gjs
 BuildRequires:	autoconf >= 2.61
 BuildRequires:	automake
@@ -54,6 +55,7 @@
 %prep
 %setup -q
 %patch0 -p1
+%patch1 -p1
 
 %build
 %{__libtoolize}
@@ -123,6 +125,10 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.24  2011/06/23 15:55:35  megabajt
+- fixed build with xulrunner 5.0
+- release 4
+
 Revision 1.23  2011/06/23 11:47:11  arekm
 - release 3
 

================================================================
Index: packages/gjs/gjs-xulrunner-5.0.patch
diff -u /dev/null packages/gjs/gjs-xulrunner-5.0.patch:1.1
--- /dev/null	Thu Jun 23 17:55:40 2011
+++ packages/gjs/gjs-xulrunner-5.0.patch	Thu Jun 23 17:55:35 2011
@@ -0,0 +1,154 @@
+From 0f886dc29b268ad0683e1372a80044a40a981192 Mon Sep 17 00:00:00 2001
+From: Marc-Antoine Perennou <Marc-Antoine at Perennou.com>
+Date: Fri, 01 Apr 2011 18:55:43 +0000
+Subject: Conditionally adapt to JS_CLASS_TRACE removal
+
+Upstream removed it in http://hg.mozilla.org/mozilla-central/rev/a7784d11c59b
+
+https://bugzilla.gnome.org/show_bug.cgi?id=646471
+---
+diff --git a/configure.ac b/configure.ac
+index d185ba1..1c773c0 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -155,11 +155,14 @@ else
+   AC_MSG_ERROR([$JS_PACKAGE >= 1.9.2 is required])
+ fi
+ 
++dnl xulrunner 2 checks
+ AC_CHECK_LIB([mozjs], [JS_GetStringBytes], AC_DEFINE([HAVE_JS_GETSTRINGBYTES], [1], [Define if we still have JS_GetStringBytes]),, [$JS_LIBS])
+ AC_CHECK_LIB([mozjs], [JS_GetFunctionName], AC_DEFINE([HAVE_JS_GETFUNCTIONNAME], [1], [Define if we still have JS_GetFunctionName]),, [$JS_LIBS])
+ AC_CHECK_LIB([mozjs], [JS_GetStringChars], AC_DEFINE([HAVE_JS_GETSTRINGCHARS], [1], [Define if we still have JS_GetStringChars]),, [$JS_LIBS])
+ AC_CHECK_LIB([mozjs], [JS_StrictPropertyStub], AC_DEFINE([HAVE_JS_STRICTPROPERTYSTUB], [1], [Define if we have JS_StrictPropertyStub]),, [$JS_LIBS])
+ AC_CHECK_LIB([mozjs], [JS_GetGlobalForScopeChain], AC_DEFINE([HAVE_JS_GETGLOBALFORSCOPECHAIN], [1], [Define if we have JS_GetGlobalForScopeChain]),, [$JS_LIBS])
++dnl xulrunner 2.2 checks
++AC_CHECK_LIB([mozjs], [JS_CLASS_TRACE], AC_DEFINE([HAVE_JS_CLASS_TRACE], [1], [Define if we still have JS_CLASS_TRACE]),, [$JS_LIBS])
+ 
+ AC_MSG_CHECKING([for mozilla-js >= 2 ])
+ if `$PKG_CONFIG --exists $JS_PACKAGE '>=' 2`; then
+diff --git a/gi/keep-alive.c b/gi/keep-alive.c
+index c7149ac..e268eaf 100644
+--- a/gi/keep-alive.c
++++ b/gi/keep-alive.c
+@@ -184,8 +184,10 @@ keep_alive_trace(JSTracer *tracer,
+  */
+ static struct JSClass gjs_keep_alive_class = {
+     "__private_GjsKeepAlive", /* means "new __private_GjsKeepAlive()" works */
+-    JSCLASS_HAS_PRIVATE |
+-    JSCLASS_MARK_IS_TRACE, /* TraceOp not MarkOp */
++#ifdef HAVE_JS_CLASS_TRACE
++    JSCLASS_MARK_IS_TRACE | /* TraceOp not MarkOp */
++#endif
++    JSCLASS_HAS_PRIVATE,
+     JS_PropertyStub,
+     JS_PropertyStub,
+     JS_PropertyStub,
+@@ -200,7 +202,11 @@ static struct JSClass gjs_keep_alive_class = {
+     NULL,
+     NULL,
+     NULL,
++#ifdef HAVE_JS_CLASS_TRACE
+     JS_CLASS_TRACE(keep_alive_trace),
++#else
++    keep_alive_trace,
++#endif
+     NULL
+ };
+ 
+--
+cgit v0.9
+From 82a074e48610cafba0c4061b8267cccaada6be5e Mon Sep 17 00:00:00 2001
+From: Marc-Antoine Perennou <Marc-Antoine at Perennou.com>
+Date: Fri, 01 Apr 2011 19:04:57 +0000
+Subject: Conditionally adapt to JS_DestroyScript removal
+
+Upstream changed the behaviour of several things about JSScripts in
+http://hg.mozilla.org/mozilla-central/rev/c919a7271ac1
+
+We now have to use a JSObject instead of a JSScript in certain circumstances,
+and we no longer have to call JS_DestroyScript which no longer exists
+
+https://bugzilla.gnome.org/show_bug.cgi?id=646471
+---
+diff --git a/configure.ac b/configure.ac
+index 1c773c0..2e23e8e 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -163,6 +163,7 @@ AC_CHECK_LIB([mozjs], [JS_StrictPropertyStub], AC_DEFINE([HAVE_JS_STRICTPROPERTY
+ AC_CHECK_LIB([mozjs], [JS_GetGlobalForScopeChain], AC_DEFINE([HAVE_JS_GETGLOBALFORSCOPECHAIN], [1], [Define if we have JS_GetGlobalForScopeChain]),, [$JS_LIBS])
+ dnl xulrunner 2.2 checks
+ AC_CHECK_LIB([mozjs], [JS_CLASS_TRACE], AC_DEFINE([HAVE_JS_CLASS_TRACE], [1], [Define if we still have JS_CLASS_TRACE]),, [$JS_LIBS])
++AC_CHECK_LIB([mozjs], [JS_DestroyScript], AC_DEFINE([HAVE_JS_DESTROYSCRIPT], [1], [Define if we still have JS_DestroyScript]),, [$JS_LIBS])
+ 
+ AC_MSG_CHECKING([for mozilla-js >= 2 ])
+ if `$PKG_CONFIG --exists $JS_PACKAGE '>=' 2`; then
+diff --git a/modules/console.c b/modules/console.c
+index ba4b5b6..35d03c1 100644
+--- a/modules/console.c
++++ b/modules/console.c
+@@ -161,7 +161,11 @@ gjs_console_interact(JSContext *context,
+ {
+     JSObject *object = JS_THIS_OBJECT(context, vp);
+     gboolean eof = FALSE;
++#ifdef HAVE_JS_DESTROYSCRIPT
+     JSScript *script = NULL;
++#else
++    JSObject *script = NULL;
++#endif
+     jsval result;
+     JSString *str;
+     GString *buffer = NULL;
+@@ -219,8 +223,10 @@ gjs_console_interact(JSContext *context,
+         }
+ 
+  next:
++#ifdef HAVE_JS_DESTROYSCRIPT
+         if (script)
+             JS_DestroyScript(context, script);
++#endif
+         g_string_free(buffer, TRUE);
+     } while (!eof);
+ 
+--
+cgit v0.9
+From 03efd168d1bfc3d3b07b26fda2c2464456df3054 Mon Sep 17 00:00:00 2001
+From: Marc-Antoine Perennou <Marc-Antoine at Perennou.com>
+Date: Thu, 28 Apr 2011 23:01:03 +0000
+Subject: conditonally adapt to JS_BufferIsCompilableUnit changes
+
+Upstream added an argument to JS_BufferIsCompilableUnit in commit
+http://hg.mozilla.org/mozilla-central/rev/a773890b676f
+We now have to tell if the bytes are utf8 or not.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=646471
+---
+diff --git a/configure.ac b/configure.ac
+index 2e23e8e..6fd8fb4 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -164,6 +164,7 @@ AC_CHECK_LIB([mozjs], [JS_GetGlobalForScopeChain], AC_DEFINE([HAVE_JS_GETGLOBALF
+ dnl xulrunner 2.2 checks
+ AC_CHECK_LIB([mozjs], [JS_CLASS_TRACE], AC_DEFINE([HAVE_JS_CLASS_TRACE], [1], [Define if we still have JS_CLASS_TRACE]),, [$JS_LIBS])
+ AC_CHECK_LIB([mozjs], [JS_DestroyScript], AC_DEFINE([HAVE_JS_DESTROYSCRIPT], [1], [Define if we still have JS_DestroyScript]),, [$JS_LIBS])
++AC_CHECK_LIB([mozjs], [JS_DecodeUTF8], AC_DEFINE([HAVE_JS_DECODEUTF8], [1], [Define if we have JS_DecodeUTF8]),, [$JS_LIBS])
+ 
+ AC_MSG_CHECKING([for mozilla-js >= 2 ])
+ if `$PKG_CONFIG --exists $JS_PACKAGE '>=' 2`; then
+diff --git a/modules/console.c b/modules/console.c
+index 35d03c1..d87b4a7 100644
+--- a/modules/console.c
++++ b/modules/console.c
+@@ -196,7 +196,11 @@ gjs_console_interact(JSContext *context,
+             g_string_append(buffer, temp_buf);
+             g_free(temp_buf);
+             lineno++;
++#ifdef HAVE_JS_DECODEUTF8
++        } while (!JS_BufferIsCompilableUnit(context, JS_TRUE, object, buffer->str, buffer->len));
++#else
+         } while (!JS_BufferIsCompilableUnit(context, object, buffer->str, buffer->len));
++#endif
+ 
+         script = JS_CompileScript(context, object, buffer->str, buffer->len, "typein",
+                                   startline);
+--
+cgit v0.9
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/gjs/gjs.spec?r1=1.23&r2=1.24&f=u



More information about the pld-cvs-commit mailing list