[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Freeze exception or t-p-u upload for libcairo-ruby



On Tue, Aug 19, 2008 at 11:50:13PM +0100, Adeodato Simó wrote:
> * Michael Schutte [Tue, 19 Aug 2008 22:07:47 +0200]:
> 
> > This excludes huge changes to the documentation, but the modifications
> > are still large.  I guess you don’t like letting a new upstream version
> > migrate at this point, so a backported fix will need to go through
> > testing-proposed-updates.  Please establish your authority and decide on
> > this matter :-)
> 
> Yes, send a diff of your proposed t-p-u upload so that we can take a
> look.

Attached (between 1.5.1-1 and 1.5.1-1+lenny1).

-- 
Michael Schutte <michi@uiae.at>
diff -u libcairo-ruby-1.5.1/debian/control libcairo-ruby-1.5.1/debian/control
--- libcairo-ruby-1.5.1/debian/control
+++ libcairo-ruby-1.5.1/debian/control
@@ -2,9 +2,9 @@
 Section: libs
 Priority: optional
 Maintainer: Paul van Tilburg <paulvt@debian.org>
-Uploaders: Debian Ruby Extras Maintainers <pkg-ruby-extras-maintainers@lists.alioth.debian.org>
-Build-Depends: debhelper (>> 5), ruby, ruby1.8, ruby1.8-dev, ruby1.9, ruby1.9-dev, cdbs, ruby-pkg-tools (>= 0.8), libcairo2-dev (>= 1.2.0)
-Standards-Version: 3.7.3
+Uploaders: Debian Ruby Extras Maintainers <pkg-ruby-extras-maintainers@lists.alioth.debian.org>, Antonio Terceiro <terceiro@softwarelivre.org>, Michael Schutte <m.schutte.jr@gmail.com>
+Build-Depends: debhelper (>> 5), ruby, ruby1.8, ruby1.8-dev, ruby1.9, ruby1.9-dev, cdbs, ruby-pkg-tools (>= 0.14), libcairo2-dev (>= 1.2.0)
+Standards-Version: 3.8.0
 Homepage: http://cairographics.org/rcairo
 Vcs-Browser: http://svn.debian.org/wsvn/pkg-ruby-extras/packages/libcairo-ruby/trunk/
 Vcs-Svn: svn://svn.debian.org/pkg-ruby-extras/packages/libcairo-ruby/trunk/
diff -u libcairo-ruby-1.5.1/debian/changelog libcairo-ruby-1.5.1/debian/changelog
--- libcairo-ruby-1.5.1/debian/changelog
+++ libcairo-ruby-1.5.1/debian/changelog
@@ -1,3 +1,17 @@
+libcairo-ruby (1.5.1-1+lenny1) testing-proposed-updates; urgency=low
+
+  [ Antonio Terceiro ]
+  * Backported change from CVS (r1.32-> r1.33, src/rb_cairo_surface.rb) to fix
+    object allocation during garbage collection phase. (Closes: #487204).
+
+  [ Michael Schutte ]
+  * Prepare upload to testing-proposed-updates.
+  * Bump Standards-Version to 3.8.0, no changes needed.
+  * Build-depend on r-p-t >= 0.14, to fix the ruby1.9 libs install problem.
+  * Add myself to Uploaders.
+
+ -- Michael Schutte <m.schutte.jr@gmail.com>  Wed, 20 Aug 2008 12:06:59 +0200
+
 libcairo-ruby (1.5.1-1) unstable; urgency=low
 
   [ Arnaud Cornet ]
only in patch2:
unchanged:
--- libcairo-ruby-1.5.1.orig/debian/patches/10-fixes-object-allocation-in-gc-phase.diff
+++ libcairo-ruby-1.5.1/debian/patches/10-fixes-object-allocation-in-gc-phase.diff
@@ -0,0 +1,166 @@
+diff -ru libcairo-ruby-1.5.1-from-archive/src/rb_cairo_surface.c libcairo-ruby-1.5.1/src/rb_cairo_surface.c
+--- libcairo-ruby-1.5.1-from-archive/src/rb_cairo_surface.c	2008-08-03 19:31:19.000000000 -0300
++++ libcairo-ruby-1.5.1/src/rb_cairo_surface.c	2008-08-03 19:40:44.000000000 -0300
+@@ -35,7 +35,9 @@
+ static ID cr_id_target;
+ static ID cr_id_read;
+ static ID cr_id_write;
++static ID cr_id_instances;
+ static cairo_user_data_key_t cr_closure_key;
++static cairo_user_data_key_t cr_object_holder_key;
+ 
+ #define _SELF  (RVAL2CRSURFACE(self))
+ 
+@@ -101,7 +103,7 @@
+ static void
+ cr_closure_destroy (cr_io_callback_closure_t *closure)
+ {
+-  free (closure);
++  xfree (closure);
+ }
+ 
+ static void
+@@ -224,12 +226,52 @@
+ }
+ 
+ static void
++add_gc_guard (VALUE self)
++{
++  rb_hash_aset (rb_ivar_get (rb_cCairo_Surface, cr_id_instances),
++                self, Qnil);
++}
++
++static void
++remove_gc_guard (VALUE self)
++{
++  rb_hash_delete (rb_ivar_get (rb_cCairo_Surface, cr_id_instances),
++                  self);
++}
++
++typedef struct cr_object_holder {
++  VALUE object;
++} cr_object_holder_t;
++
++static cr_object_holder_t *
++cr_object_holder_new (VALUE object)
++{
++  cr_object_holder_t *holder;
++
++  holder = ALLOC(cr_object_holder_t);
++  add_gc_guard (object);
++  holder->object = object;
++  return holder;
++}
++
++static void
++cr_object_holder_free (void *ptr)
++{
++  cr_object_holder_t *holder = ptr;
++
++  if (!NIL_P (holder->object))
++    remove_gc_guard (holder->object);
++
++  xfree (holder);
++}
++
++static void
+ cr_surface_free (void *ptr)
+ {
+-  if (ptr)
+-    {
+-      cairo_surface_destroy ((cairo_surface_t *) ptr);
+-    }
++  cairo_surface_t *surface = ptr;
++
++  if (surface)
++    cairo_surface_destroy (surface);
+ }
+ 
+ VALUE
+@@ -255,23 +297,30 @@
+ }
+ 
+ /* Surface manipulation */
+-static void
+-yield_and_finish (VALUE self)
++static VALUE
++cr_surface_finish (VALUE self)
+ {
+   cairo_surface_t *surface;
+-  cairo_status_t status;
+-
+-  rb_yield (self);
++  cr_io_callback_closure_t *closure;
+ 
+   surface = _SELF;
+-  if (cairo_surface_status (surface))
+-    return;
++  closure = cairo_surface_get_user_data (surface, &cr_closure_key);
++
+   cairo_surface_finish (surface);
+-  status = cairo_surface_status (surface);
+-  if (status == CAIRO_STATUS_SUCCESS || status == CAIRO_STATUS_SURFACE_FINISHED)
+-    return;
++  cairo_surface_set_user_data (surface, &cr_object_holder_key, NULL, NULL);
+ 
++  if (closure && !NIL_P (closure->error))
++    rb_exc_raise (closure->error);
+   cr_surface_check_status (surface);
++
++  return self;
++}
++
++static void
++yield_and_finish (VALUE self)
++{
++  rb_yield (self);
++  cr_surface_finish (self);
+ }
+ 
+ static VALUE
+@@ -288,21 +337,6 @@
+ }
+ 
+ static VALUE
+-cr_surface_finish (VALUE self)
+-{
+-  cr_io_callback_closure_t *closure;
+-  closure = cairo_surface_get_user_data (_SELF, &cr_closure_key);
+-  
+-  cairo_surface_finish (_SELF);
+-
+-  if (closure && !NIL_P (closure->error))
+-    rb_exc_raise (closure->error);
+-  
+-  cr_surface_check_status (_SELF);
+-  return self;
+-}
+-
+-static VALUE
+ cr_surface_get_content (VALUE self)
+ {
+   return INT2NUM (cairo_surface_get_content (_SELF));
+@@ -601,6 +635,9 @@
+           rb_ivar_set (self, cr_id_target, target);                     \
+           cairo_surface_set_user_data (surface, &cr_closure_key,        \
+                                        closure, cr_closure_free);       \
++          cairo_surface_set_user_data (surface, &cr_object_holder_key,  \
++                                       cr_object_holder_new(self),      \
++                                       cr_object_holder_free);          \
+         }                                                               \
+     }                                                                   \
+   else                                                                  \
+@@ -907,10 +944,13 @@
+   cr_id_target = rb_intern ("target");
+   cr_id_read = rb_intern ("read");
+   cr_id_write = rb_intern ("write");
++  cr_id_instances = rb_intern ("instances");
+   
+   rb_cCairo_Surface =
+     rb_define_class_under (rb_mCairo, "Surface", rb_cObject);
+   rb_define_alloc_func (rb_cCairo_Surface, cr_surface_allocate);
++
++  rb_ivar_set (rb_cCairo_Surface, cr_id_instances, rb_hash_new ());
+   
+   rb_define_method (rb_cCairo_Surface, "create_similar",
+                     cr_surface_create_similar, 3);

Attachment: signature.asc
Description: Digital signature


Reply to: