[SCM] Debian packaging of libcairo-perl branch, master, updated. debian/1.090-1-11-g5c96bca

gregor herrmann gregoa at debian.org
Sun Apr 8 12:11:12 UTC 2012


The following commit has been merged in the master branch:
commit 12eb5a48caab39ebcc8f064969d43cc41610f36b
Author: gregor herrmann <gregoa at debian.org>
Date:   Sun Apr 8 14:05:14 2012 +0200

    Add two upstream patches to fix compiling and testing against older cairo
    versions and make t/CairoPath.t more robust.
    
    Closes: #666574

diff --git a/debian/patches/fix-compiling-and-testing-against-older-versions-of-cairo.patch b/debian/patches/fix-compiling-and-testing-against-older-versions-of-cairo.patch
new file mode 100644
index 0000000..9ca1374
--- /dev/null
+++ b/debian/patches/fix-compiling-and-testing-against-older-versions-of-cairo.patch
@@ -0,0 +1,161 @@
+Origin: upstream, http://git.gnome.org/browse/perl-Cairo/commit/?id=21dd8a0600cbfac46723c7745b377fce94c8bdc3
+Bug: https://rt.cpan.org/Ticket/Display.html?id=76199
+Bug-Debian: http://bugs.debian.org/666574
+Applied-Upstream: yes
+
+From 21dd8a0600cbfac46723c7745b377fce94c8bdc3 Mon Sep 17 00:00:00 2001
+From: Torsten Schönfeld <kaffeetisch at gmx.de>
+Date: Sat, 31 Mar 2012 10:34:11 +0000
+Subject: Fix compiling and testing against older versions of cairo
+
+---
+diff --git a/CairoFont.xs b/CairoFont.xs
+index 41a4331..c1af1d8 100644
+--- a/CairoFont.xs
++++ b/CairoFont.xs
+@@ -28,8 +28,12 @@ get_package (cairo_font_face_t *face)
+ 
+ 	    /* These aren't wrapped yet: */
+ 	    case CAIRO_FONT_TYPE_WIN32:
++#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 6, 0)
+ 	    case CAIRO_FONT_TYPE_QUARTZ:
++#endif
++#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 8, 0)
+ 	    case CAIRO_FONT_TYPE_USER:
++#endif
+ 		package = "Cairo::FontFace";
+ 		break;
+ 
+@@ -41,7 +45,7 @@ get_package (cairo_font_face_t *face)
+ 
+ 	return package;
+ #else
+-	const char *package = cairo_perl_package_table_lookup (pattern);
++	const char *package = cairo_perl_package_table_lookup (face);
+ 	return package ? package : "Cairo::FontFace";
+ #endif
+ }
+@@ -84,6 +88,10 @@ cairo_font_face_t_noinc *
+ cairo_toy_font_face_create (class, const char *family, cairo_font_slant_t slant, cairo_font_weight_t weight)
+     C_ARGS:
+ 	family, slant, weight
++    POSTCALL:
++#if CAIRO_VERSION < CAIRO_VERSION_ENCODE(1, 2, 0)
++	cairo_perl_package_table_insert (RETVAL, "Cairo::ToyFontFace");
++#endif
+ 
+ const char * cairo_toy_font_face_get_family (cairo_font_face_t *font_face);
+ 
+@@ -101,6 +109,10 @@ MODULE = Cairo::Font	PACKAGE = Cairo::ScaledFont	PREFIX = cairo_scaled_font_
+ cairo_scaled_font_t_noinc * cairo_scaled_font_create (class, cairo_font_face_t *font_face, const cairo_matrix_t *font_matrix, const cairo_matrix_t *ctm, const cairo_font_options_t *options)
+     C_ARGS:
+ 	font_face, font_matrix, ctm, options
++    POSTCALL:
++#if CAIRO_VERSION < CAIRO_VERSION_ENCODE(1, 2, 0)
++	cairo_perl_package_table_insert (RETVAL, "Cairo::ScaledFont");
++#endif
+ 
+ cairo_status_t cairo_scaled_font_status (cairo_scaled_font_t *scaled_font);
+ 
+diff --git a/CairoSurface.xs b/CairoSurface.xs
+index 59a4b06..d4d3c82 100644
+--- a/CairoSurface.xs
++++ b/CairoSurface.xs
+@@ -98,9 +98,13 @@ get_package (cairo_surface_t *surface)
+ 	    case CAIRO_SURFACE_TYPE_WIN32:
+ 	    case CAIRO_SURFACE_TYPE_BEOS:
+ 	    case CAIRO_SURFACE_TYPE_DIRECTFB:
++#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 4, 0)
+ 	    case CAIRO_SURFACE_TYPE_OS2:
++#endif
++#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 6, 0)
+ 	    case CAIRO_SURFACE_TYPE_WIN32_PRINTING:
+ 	    case CAIRO_SURFACE_TYPE_QUARTZ_IMAGE:
++#endif
+ #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 10, 0)
+ 	    case CAIRO_SURFACE_TYPE_SCRIPT:
+ 	    case CAIRO_SURFACE_TYPE_QT:
+diff --git a/Makefile.PL b/Makefile.PL
+index 2adf424..39afa77 100644
+--- a/Makefile.PL
++++ b/Makefile.PL
+@@ -321,9 +321,6 @@ if ($have_cairo_1_2) {
+ 		CAIRO_SURFACE_TYPE_BEOS
+ 		CAIRO_SURFACE_TYPE_DIRECTFB
+ 		CAIRO_SURFACE_TYPE_SVG
+-		CAIRO_SURFACE_TYPE_OS2
+-		CAIRO_SURFACE_TYPE_WIN32_PRINTING
+-		CAIRO_SURFACE_TYPE_QUARTZ_IMAGE
+ 	/];
+ 
+ 	$enums{cairo_svg_version_t} = [qw/
+@@ -354,6 +351,7 @@ if ($have_cairo_1_4) {
+ 	add_new_enum_values(
+ 		cairo_status_t => [qw/CAIRO_STATUS_INVALID_INDEX
+ 		                      CAIRO_STATUS_CLIP_NOT_REPRESENTABLE/],
++		cairo_surface_type_t => [qw/CAIRO_SURFACE_TYPE_OS2/],
+ 	);
+ 
+ 	push @exports, qw/newSVCairoRectangle
+@@ -365,7 +363,8 @@ if ($have_cairo_1_6) {
+ 		cairo_font_type_t => [qw/CAIRO_FONT_TYPE_QUARTZ/],
+ 		cairo_status_t => [qw/CAIRO_STATUS_TEMP_FILE_ERROR
+ 				      CAIRO_STATUS_INVALID_STRIDE/],
+-
++		cairo_surface_type_t => [qw/CAIRO_SURFACE_TYPE_WIN32_PRINTING
++					    CAIRO_SURFACE_TYPE_QUARTZ_IMAGE/],
+ 	);
+ 
+ 	$enums{cairo_ps_level_t} = [qw/
+diff --git a/t/CairoFont.t b/t/CairoFont.t
+index f9571dc..d8e974c 100644
+--- a/t/CairoFont.t
++++ b/t/CairoFont.t
+@@ -62,17 +62,17 @@ my $ctm = Cairo::Matrix->init_identity;
+ my $font = Cairo::ScaledFont->create ($face, $matrix, $ctm, $options);
+ isa_ok ($font, 'Cairo::ScaledFont');
+ 
+-$cr->set_scaled_font ($font);
+-is ($font->status, 'success');
+-is ($cr->status, 'success');
+-
+ isa_ok ($font->extents, 'HASH');
+ isa_ok ($font->glyph_extents ({ index => 1, x => 2, y => 3 }), 'HASH');
+ 
+ SKIP: {
+-	skip 'new stuff', 6
++	skip 'new stuff', 8
+ 		unless Cairo::VERSION >= Cairo::VERSION_ENCODE (1, 2, 0);
+ 
++	$cr->set_scaled_font ($font);
++	is ($font->status, 'success');
++	is ($cr->status, 'success');
++
+ 	ok (defined $font->get_type);
+ 
+ 	isa_ok ($font->text_extents('Bla'), 'HASH');
+diff --git a/t/CairoPath.t b/t/CairoPath.t
+index e515172..770e464 100644
+--- a/t/CairoPath.t
++++ b/t/CairoPath.t
+@@ -11,11 +11,17 @@ use strict;
+ use warnings;
+ use Cairo;
+ 
+-use Test::More tests => 6;
++use Test::More;
+ 
+ use constant IMG_WIDTH => 256;
+ use constant IMG_HEIGHT => 256;
+ 
++if (Cairo::VERSION >= Cairo::VERSION_ENCODE (1, 4, 0)) {
++  plan tests => 6;
++} else {
++  plan skip_all => 'path behavior not predictable on cairo < 1.4';
++}
++
+ my $surf = Cairo::ImageSurface->create ('rgb24', IMG_WIDTH, IMG_HEIGHT);
+ my $cr = Cairo::Context->create ($surf);
+ 
+--
+cgit v0.9.0.2
diff --git a/debian/patches/make_t_cairopath.t-more-robust.patch b/debian/patches/make_t_cairopath.t-more-robust.patch
new file mode 100644
index 0000000..47722c4
--- /dev/null
+++ b/debian/patches/make_t_cairopath.t-more-robust.patch
@@ -0,0 +1,107 @@
+Origin: upstream, http://git.gnome.org/browse/perl-Cairo/commit/?id=a1cd2e45b4ee49a724ae5d7e854ad9829eebf00d
+Bug: https://rt.cpan.org/Ticket/Display.html?id=76199
+Bug-Debian: http://bugs.debian.org/666574
+Applied-Upstream: yes
+
+From a1cd2e45b4ee49a724ae5d7e854ad9829eebf00d Mon Sep 17 00:00:00 2001
+From: Torsten Schönfeld <kaffeetisch at gmx.de>
+Date: Sat, 07 Apr 2012 18:01:31 +0000
+Subject: Make t/CairoPath.t more robust
+
+The end of a path that took a round trip into cairo and back might differ
+for different versions of cairo.  Hence, compare only the beginning with
+the expected path.
+---
+diff --git a/t/CairoPath.t b/t/CairoPath.t
+index 770e464..27a3aad 100644
+--- a/t/CairoPath.t
++++ b/t/CairoPath.t
+@@ -11,17 +11,11 @@ use strict;
+ use warnings;
+ use Cairo;
+ 
+-use Test::More;
++use Test::More tests => 18;
+ 
+ use constant IMG_WIDTH => 256;
+ use constant IMG_HEIGHT => 256;
+ 
+-if (Cairo::VERSION >= Cairo::VERSION_ENCODE (1, 4, 0)) {
+-  plan tests => 6;
+-} else {
+-  plan skip_all => 'path behavior not predictable on cairo < 1.4';
+-}
+-
+ my $surf = Cairo::ImageSurface->create ('rgb24', IMG_WIDTH, IMG_HEIGHT);
+ my $cr = Cairo::Context->create ($surf);
+ 
+@@ -40,14 +34,7 @@ my $expected_path = [
+ ];
+ 
+ my $path = $cr->copy_path;
+-is_deeply ($path, $expected_path);
+-
+-sub paths_agree {
+-  my ($cr, $path, $expected_path) = @_;
+-  $cr->new_path;
+-  $cr->append_path ($path);
+-  is_deeply ($cr->copy_path, $expected_path);
+-}
++paths_agree ($path, $expected_path);
+ 
+ # Modifying single point values.
+ foreach ($path, $expected_path) {
+@@ -57,21 +44,21 @@ foreach ($path, $expected_path) {
+   $_->[2]{points}[2][0] = 99;
+   $_->[2]{points}[2][1] = 1010;
+ }
+-paths_agree ($cr, $path, $expected_path);
++path_round_trip_ok ($cr, $path, $expected_path);
+ 
+ # Modifying single points.
+ foreach ($path, $expected_path) {
+   $_->[1]{points}[0] = [333, 444];
+   $_->[2]{points}[2] = [77, 88];
+ }
+-paths_agree ($cr, $path, $expected_path);
++path_round_trip_ok ($cr, $path, $expected_path);
+ 
+ # Replacing all points.
+ foreach ($path, $expected_path) {
+   $_->[1]{points} = [[3333, 4444]];
+   $_->[2]{points} = [[55, 66], [77, 88], [99, 1010]];
+ }
+-paths_agree ($cr, $path, $expected_path);
++path_round_trip_ok ($cr, $path, $expected_path);
+ 
+ # Replacing and adding path segments.
+ my @cloned_path = @{$path};
+@@ -86,9 +73,24 @@ foreach (\@cloned_path, $expected_path) {
+     type => 'line-to',
+     points => [[23, 42]] };
+ }
+-paths_agree ($cr, \@cloned_path, $expected_path);
++path_round_trip_ok ($cr, \@cloned_path, $expected_path);
+ 
+ # Passing bare arrays into Cairo.
+ $cr->new_path;
+ $cr->append_path ($expected_path);
+-is_deeply ($cr->copy_path, $expected_path);
++paths_agree ($cr->copy_path, $expected_path);
++
++sub path_round_trip_ok {
++  my ($cr, $path, $expected_path) = @_;
++  $cr->new_path;
++  $cr->append_path ($path);
++  paths_agree ($cr->copy_path, $expected_path);
++}
++
++sub paths_agree {
++  my ($path, $expected_path) = @_;
++  # Only the first three entries seem to be reliable across cairo versions.
++  for (0..2) {
++    is_deeply ($path->[$_], $expected_path->[$_]);
++  }
++}
+--
+cgit v0.9.0.2
diff --git a/debian/patches/series b/debian/patches/series
index ee2905d..b23b663 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,3 @@
-fix-CairoPath.t-testsuite.patch
+#fix-CairoPath.t-testsuite.patch
+fix-compiling-and-testing-against-older-versions-of-cairo.patch
+make_t_cairopath.t-more-robust.patch

-- 
Debian packaging of libcairo-perl



More information about the Pkg-perl-cvs-commits mailing list