summaryrefslogtreecommitdiff
path: root/graphics
diff options
context:
space:
mode:
authortron <tron@pkgsrc.org>2012-06-16 20:52:18 +0000
committertron <tron@pkgsrc.org>2012-06-16 20:52:18 +0000
commit0469cdc89f778dfde724079f899b25162c193c27 (patch)
tree2830a98bbbfab1a428c14817fe386345a7492aaa /graphics
parentd6e6b688099e1856929fead3621b3a335d5beefd (diff)
downloadpkgsrc-0469cdc89f778dfde724079f899b25162c193c27.tar.gz
Fix 32 bit build under Mac OS X Lion.
Diffstat (limited to 'graphics')
-rw-r--r--graphics/cairo/distinfo4
-rw-r--r--graphics/cairo/patches/patch-src_cairo-quartz-font.c69
-rw-r--r--graphics/cairo/patches/patch-src_cairo-quartz.h19
3 files changed, 91 insertions, 1 deletions
diff --git a/graphics/cairo/distinfo b/graphics/cairo/distinfo
index a14210c66ef..5e2dde06e2b 100644
--- a/graphics/cairo/distinfo
+++ b/graphics/cairo/distinfo
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.58 2011/02/15 11:30:47 drochner Exp $
+$NetBSD: distinfo,v 1.59 2012/06/16 20:52:18 tron Exp $
SHA1 (cairo-1.10.2.tar.gz) = ccce5ae03f99c505db97c286a0c9a90a926d3c6e
RMD160 (cairo-1.10.2.tar.gz) = 8c8de00120398fe2b3a60a08ff59a464b2eebf47
@@ -6,3 +6,5 @@ Size (cairo-1.10.2.tar.gz) = 23558405 bytes
SHA1 (patch-aa) = f211b2a5fce4ff65f280f79fbb78e1a530b9b165
SHA1 (patch-ab) = 03a6199a0e0de1fe3701900ea76ce3f0bfdddca0
SHA1 (patch-ac) = 151c682245004902cf42ba141e3743592691dfb9
+SHA1 (patch-src_cairo-quartz-font.c) = 0a4bb75c3d2382020e1f491ff99985993a02bbc6
+SHA1 (patch-src_cairo-quartz.h) = 089ce2fe351724a06986512b2080ae4dc2543b9a
diff --git a/graphics/cairo/patches/patch-src_cairo-quartz-font.c b/graphics/cairo/patches/patch-src_cairo-quartz-font.c
new file mode 100644
index 00000000000..b15df878f21
--- /dev/null
+++ b/graphics/cairo/patches/patch-src_cairo-quartz-font.c
@@ -0,0 +1,69 @@
+$NetBSD: patch-src_cairo-quartz-font.c,v 1.1 2012/06/16 20:52:18 tron Exp $
+
+Fix 32 bit build under Mac OS X Lion. Patch taken from here:
+
+http://cgit.freedesktop.org/cairo/commit/?id=8664df767cb9dbe48647f9853e3dcf551701d3ca
+
+--- src/cairo-quartz-font.c.orig 2010-12-25 14:21:34.000000000 +0000
++++ src/cairo-quartz-font.c 2012-06-16 21:46:19.000000000 +0100
+@@ -90,6 +90,9 @@
+ static int (*CGFontGetDescentPtr) (CGFontRef fontRef) = NULL;
+ static int (*CGFontGetLeadingPtr) (CGFontRef fontRef) = NULL;
+
++/* Not public anymore in 64-bits nor in 10.7 */
++static ATSFontRef (*FMGetATSFontRefFromFontPtr) (FMFont iFont) = NULL;
++
+ static cairo_bool_t _cairo_quartz_font_symbol_lookup_done = FALSE;
+ static cairo_bool_t _cairo_quartz_font_symbols_present = FALSE;
+
+@@ -127,6 +130,8 @@
+ CGContextGetAllowsFontSmoothingPtr = dlsym(RTLD_DEFAULT, "CGContextGetAllowsFontSmoothing");
+ CGContextSetAllowsFontSmoothingPtr = dlsym(RTLD_DEFAULT, "CGContextSetAllowsFontSmoothing");
+
++ FMGetATSFontRefFromFontPtr = dlsym(RTLD_DEFAULT, "FMGetATSFontRefFromFont");
++
+ if ((CGFontCreateWithFontNamePtr || CGFontCreateWithNamePtr) &&
+ CGFontGetGlyphBBoxesPtr &&
+ CGFontGetGlyphsForUnicharsPtr &&
+@@ -777,7 +782,6 @@
+ return ffont->cgFont;
+ }
+
+-#ifndef __LP64__
+ /*
+ * compat with old ATSUI backend
+ */
+@@ -798,15 +802,22 @@
+ cairo_font_face_t *
+ cairo_quartz_font_face_create_for_atsu_font_id (ATSUFontID font_id)
+ {
+- ATSFontRef atsFont = FMGetATSFontRefFromFont (font_id);
+- CGFontRef cgFont = CGFontCreateWithPlatformFont (&atsFont);
+- cairo_font_face_t *ff;
++ quartz_font_ensure_symbols();
+
+- ff = cairo_quartz_font_face_create_for_cgfont (cgFont);
++ if (FMGetATSFontRefFromFontPtr != NULL) {
++ ATSFontRef atsFont = FMGetATSFontRefFromFontPtr (font_id);
++ CGFontRef cgFont = CGFontCreateWithPlatformFont (&atsFont);
++ cairo_font_face_t *ff;
+
+- CGFontRelease (cgFont);
++ ff = cairo_quartz_font_face_create_for_cgfont (cgFont);
++
++ CGFontRelease (cgFont);
+
+- return ff;
++ return ff;
++ } else {
++ _cairo_error_throw (CAIRO_STATUS_NO_MEMORY);
++ return (cairo_font_face_t *)&_cairo_font_face_nil;
++ }
+ }
+
+ /* This is the old name for the above function, exported for compat purposes */
+@@ -817,4 +828,3 @@
+ {
+ return cairo_quartz_font_face_create_for_atsu_font_id (font_id);
+ }
+-#endif
diff --git a/graphics/cairo/patches/patch-src_cairo-quartz.h b/graphics/cairo/patches/patch-src_cairo-quartz.h
new file mode 100644
index 00000000000..b6bb0e26db6
--- /dev/null
+++ b/graphics/cairo/patches/patch-src_cairo-quartz.h
@@ -0,0 +1,19 @@
+$NetBSD: patch-src_cairo-quartz.h,v 1.1 2012/06/16 20:52:18 tron Exp $
+
+Fix 32 bit build under Mac OS X Lion. Patch taken from here:
+
+http://cgit.freedesktop.org/cairo/commit/?id=8664df767cb9dbe48647f9853e3dcf551701d3ca
+
+--- src/cairo-quartz.h.orig 2010-06-18 12:47:13.000000000 +0100
++++ src/cairo-quartz.h 2012-06-16 21:46:19.000000000 +0100
+@@ -66,10 +66,8 @@
+ cairo_public cairo_font_face_t *
+ cairo_quartz_font_face_create_for_cgfont (CGFontRef font);
+
+-#ifndef __LP64__
+ cairo_public cairo_font_face_t *
+ cairo_quartz_font_face_create_for_atsu_font_id (ATSUFontID font_id);
+-#endif
+
+ #endif /* CAIRO_HAS_QUARTZ_FONT */
+