On Fri, Oct 31, 2014 at 03:36:18AM -0400, Brad Smith wrote:
> Here is an update to cairo 1.14.0.
>
> OK?
No. Eric already has one and it is in a bulk right now.
Next time, check whether there's already a maintainer.
> Index: Makefile
> ===================================================================
> RCS file: /home/cvs/ports/graphics/cairo/Makefile,v
> retrieving revision 1.53
> diff -u -p -u -p -r1.53 Makefile
> --- Makefile 13 Sep 2014 16:36:53 -0000 1.53
> +++ Makefile 31 Oct 2014 05:43:35 -0000
> @@ -2,8 +2,8 @@
>
> COMMENT= vector graphics library
>
> -DISTNAME= cairo-1.12.16
> -SHARED_LIBS+= cairo 12.2
> +DISTNAME= cairo-1.14.0
> +SHARED_LIBS+= cairo 12.3
> SHARED_LIBS+= cairo-gobject 1.1
> SHARED_LIBS+= cairo-script-interpreter 1.1
> CATEGORIES= graphics
> Index: distinfo
> ===================================================================
> RCS file: /home/cvs/ports/graphics/cairo/distinfo,v
> retrieving revision 1.22
> diff -u -p -u -p -r1.22 distinfo
> --- distinfo 25 Sep 2013 18:07:09 -0000 1.22
> +++ distinfo 31 Oct 2014 05:42:42 -0000
> @@ -1,2 +1,2 @@
> -SHA256 (cairo-1.12.16.tar.xz) = JQWVnrPx3j4YQQI7YVhb/TVoS5czx7ajZD9PTL3m2EY=
> -SIZE (cairo-1.12.16.tar.xz) = 35889824
> +SHA256 (cairo-1.14.0.tar.xz) = LPX4FDLnfqQ1mvnc0PT6830BWTRQE5HDEb/S0ZoBNLc=
> +SIZE (cairo-1.14.0.tar.xz) = 36584076
> Index: patches/patch-src_cairo-cff-subset_c
> ===================================================================
> RCS file: patches/patch-src_cairo-cff-subset_c
> diff -N patches/patch-src_cairo-cff-subset_c
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ patches/patch-src_cairo-cff-subset_c 31 Oct 2014 06:05:55 -0000
> @@ -0,0 +1,126 @@
> +$OpenBSD$
> +
> +CFF: Fix unaligned access
> +
> +--- src/cairo-cff-subset.c.orig Mon Oct 13 21:46:33 2014
> ++++ src/cairo-cff-subset.c Fri Oct 31 02:05:05 2014
> +@@ -433,7 +433,7 @@ cff_index_read (cairo_array_t *index, unsigned char **
> + p = *ptr;
> + if (p + 2 > end_ptr)
> + return CAIRO_INT_STATUS_UNSUPPORTED;
> +- count = be16_to_cpu( *((uint16_t *)p) );
> ++ count = get_unaligned_be16 (p);
> + p += 2;
> + if (count > 0) {
> + offset_size = *p++;
> +@@ -984,14 +984,14 @@ cairo_cff_font_read_fdselect (cairo_cff_font_t *font,
> + for (i = 0; i < font->num_glyphs; i++)
> + font->fdselect[i] = *p++;
> + } else if (type == 3) {
> +- num_ranges = be16_to_cpu( *((uint16_t *)p) );
> ++ num_ranges = get_unaligned_be16 (p);
> + p += 2;
> + for (i = 0; i < num_ranges; i++)
> + {
> +- first = be16_to_cpu( *((uint16_t *)p) );
> ++ first = get_unaligned_be16 (p);
> + p += 2;
> + fd = *p++;
> +- last = be16_to_cpu( *((uint16_t *)p) );
> ++ last = get_unaligned_be16 (p);
> + for (j = first; j < last; j++)
> + font->fdselect[j] = fd;
> + }
> +@@ -1722,7 +1722,7 @@ cairo_cff_font_get_gid_for_cid (cairo_cff_font_t *fon
> + p = font->charset + 1;
> + g = 1;
> + while (g <= (unsigned)font->num_glyphs && p < font->data_end) {
> +- c = be16_to_cpu( *((uint16_t *)p) );
> ++ c = get_unaligned_be16 (p);
> + if (c == cid) {
> + *gid = g;
> + return CAIRO_STATUS_SUCCESS;
> +@@ -1737,7 +1737,7 @@ cairo_cff_font_get_gid_for_cid (cairo_cff_font_t *fon
> + first_gid = 1;
> + p = font->charset + 1;
> + while (first_gid <= (unsigned)font->num_glyphs && p + 2 <
> font->data_end) {
> +- first_cid = be16_to_cpu( *((uint16_t *)p) );
> ++ first_cid = get_unaligned_be16 (p);
> + num_left = p[2];
> + if (cid >= first_cid && cid <= first_cid + num_left) {
> + *gid = first_gid + cid - first_cid;
> +@@ -1753,8 +1753,8 @@ cairo_cff_font_get_gid_for_cid (cairo_cff_font_t *fon
> + first_gid = 1;
> + p = font->charset + 1;
> + while (first_gid <= (unsigned)font->num_glyphs && p + 3 <
> font->data_end) {
> +- first_cid = be16_to_cpu( *((uint16_t *)p) );
> +- num_left = be16_to_cpu( *((uint16_t *)(p+2)) );
> ++ first_cid = get_unaligned_be16 (p);
> ++ num_left = get_unaligned_be16 (p+2);
> + if (cid >= first_cid && cid <= first_cid + num_left) {
> + *gid = first_gid + cid - first_cid;
> + return CAIRO_STATUS_SUCCESS;
> +@@ -2328,7 +2328,7 @@ cairo_cff_font_write_cid_fontdict (cairo_cff_font_t *f
> + unsigned int i;
> + cairo_int_status_t status;
> + unsigned int offset_array;
> +- uint32_t *offset_array_ptr;
> ++ unsigned char *offset_array_ptr;
> + int offset_base;
> + uint16_t count;
> + uint8_t offset_size = 4;
> +@@ -2349,7 +2349,7 @@ cairo_cff_font_write_cid_fontdict (cairo_cff_font_t *f
> + if (unlikely (status))
> + return status;
> + offset_base = _cairo_array_num_elements (&font->output) - 1;
> +- *offset_array_ptr = cpu_to_be32(1);
> ++ put_unaligned_be32(1, offset_array_ptr);
> + offset_array += sizeof(uint32_t);
> + for (i = 0; i < font->num_subset_fontdicts; i++) {
> + status = cff_dict_write (font->fd_dict[font->fd_subset_map[i]],
> +@@ -2357,8 +2357,9 @@ cairo_cff_font_write_cid_fontdict (cairo_cff_font_t *f
> + if (unlikely (status))
> + return status;
> +
> +- offset_array_ptr = (uint32_t *) _cairo_array_index (&font->output,
> offset_array);
> +- *offset_array_ptr = cpu_to_be32(_cairo_array_num_elements
> (&font->output) - offset_base);
> ++ offset_array_ptr = _cairo_array_index (&font->output, offset_array);
> ++ put_unaligned_be32 (_cairo_array_num_elements (&font->output) -
> offset_base,
> ++ offset_array_ptr);
> + offset_array += sizeof(uint32_t);
> + }
> +
> +@@ -2609,7 +2610,7 @@ cairo_cff_font_create_set_widths (cairo_cff_font_t *fo
> + unsigned int i;
> + tt_hhea_t hhea;
> + int num_hmetrics;
> +- unsigned char buf[10];
> ++ uint16_t short_entry;
> + int glyph_index;
> + cairo_int_status_t status;
> +
> +@@ -2629,7 +2630,8 @@ cairo_cff_font_create_set_widths (cairo_cff_font_t *fo
> + status = font->backend->load_truetype_table
> (font->scaled_font_subset->scaled_font,
> + TT_TAG_hmtx,
> + glyph_index *
> long_entry_size,
> +- buf,
> &short_entry_size);
> ++ (unsigned char *)
> &short_entry,
> ++ &short_entry_size);
> + if (unlikely (status))
> + return status;
> + }
> +@@ -2638,11 +2640,12 @@ cairo_cff_font_create_set_widths (cairo_cff_font_t
> *fo
> + status = font->backend->load_truetype_table
> (font->scaled_font_subset->scaled_font,
> + TT_TAG_hmtx,
> + (num_hmetrics - 1)
> * long_entry_size,
> +- buf,
> &short_entry_size);
> ++ (unsigned char *)
> &short_entry,
> ++ &short_entry_size);
> + if (unlikely (status))
> + return status;
> + }
> +- font->widths[i] = be16_to_cpu (*((int16_t*)buf));
> ++ font->widths[i] = be16_to_cpu (short_entry);
> + }
> +
> + return CAIRO_STATUS_SUCCESS;
> Index: patches/patch-src_cairo-image-info_c
> ===================================================================
> RCS file: patches/patch-src_cairo-image-info_c
> diff -N patches/patch-src_cairo-image-info_c
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ patches/patch-src_cairo-image-info_c 31 Oct 2014 06:06:22 -0000
> @@ -0,0 +1,104 @@
> +$OpenBSD$
> +
> +CFF: Fix unaligned access
> +
> +--- src/cairo-image-info.c.orig Wed Sep 25 00:38:54 2013
> ++++ src/cairo-image-info.c Fri Oct 31 02:05:05 2014
> +@@ -39,12 +39,6 @@
> + #include "cairo-error-private.h"
> + #include "cairo-image-info-private.h"
> +
> +-static uint32_t
> +-_get_be32 (const unsigned char *p)
> +-{
> +- return p[0] << 24 | p[1] << 16 | p[2] << 8 | p[3];
> +-}
> +-
> + /* JPEG (image/jpeg)
> + *
> + * http://www.w3.org/Graphics/JPEG/itu-t81.pdf
> +@@ -170,7 +164,7 @@ static const unsigned char _jpx_signature[] = {
> + static const unsigned char *
> + _jpx_next_box (const unsigned char *p)
> + {
> +- return p + _get_be32 (p);
> ++ return p + get_unaligned_be32 (p);
> + }
> +
> + static const unsigned char *
> +@@ -185,8 +179,8 @@ _jpx_match_box (const unsigned char *p, const unsigned
> + uint32_t length;
> +
> + if (p + 8 < end) {
> +- length = _get_be32 (p);
> +- if (_get_be32 (p + 4) == type && p + length < end)
> ++ length = get_unaligned_be32 (p);
> ++ if (get_unaligned_be32 (p + 4) == type && p + length < end)
> + return TRUE;
> + }
> +
> +@@ -208,8 +202,8 @@ _jpx_find_box (const unsigned char *p, const unsigned
> + static void
> + _jpx_extract_info (const unsigned char *p, cairo_image_info_t *info)
> + {
> +- info->height = _get_be32 (p);
> +- info->width = _get_be32 (p + 4);
> ++ info->height = get_unaligned_be32 (p);
> ++ info->width = get_unaligned_be32 (p + 4);
> + info->num_components = (p[8] << 8) + p[9];
> + info->bits_per_component = p[10];
> + }
> +@@ -281,13 +275,13 @@ _cairo_image_info_get_png_info (cairo_image_info_t
> + return CAIRO_INT_STATUS_UNSUPPORTED;
> +
> + p += 4;
> +- if (_get_be32 (p) != PNG_IHDR)
> ++ if (get_unaligned_be32 (p) != PNG_IHDR)
> + return CAIRO_INT_STATUS_UNSUPPORTED;
> +
> + p += 4;
> +- info->width = _get_be32 (p);
> ++ info->width = get_unaligned_be32 (p);
> + p += 4;
> +- info->height = _get_be32 (p);
> ++ info->height = get_unaligned_be32 (p);
> +
> + return CAIRO_STATUS_SUCCESS;
> + }
> +@@ -347,14 +341,14 @@ _jbig2_get_next_segment (const unsigned char *p,
> + if (p + 6 >= end)
> + return NULL;
> +
> +- seg_num = _get_be32 (p);
> ++ seg_num = get_unaligned_be32 (p);
> + *type = p[4] & 0x3f;
> + big_page_size = (p[4] & 0x40) != 0;
> + p += 5;
> +
> + num_segs = p[0] >> 5;
> + if (num_segs == 7) {
> +- num_segs = _get_be32 (p) & 0x1fffffff;
> ++ num_segs = get_unaligned_be32 (p) & 0x1fffffff;
> + ref_seg_bytes = 4 + ((num_segs + 1)/8);
> + } else {
> + ref_seg_bytes = 1;
> +@@ -373,7 +367,7 @@ _jbig2_get_next_segment (const unsigned char *p,
> + if (p + 4 >= end)
> + return NULL;
> +
> +- *data_len = _get_be32 (p);
> ++ *data_len = get_unaligned_be32 (p);
> + p += 4;
> + *data = p;
> +
> +@@ -397,8 +391,8 @@ _jbig2_get_next_segment (const unsigned char *p,
> + static void
> + _jbig2_extract_info (cairo_image_info_t *info, const unsigned char *p)
> + {
> +- info->width = _get_be32 (p);
> +- info->height = _get_be32 (p + 4);
> ++ info->width = get_unaligned_be32 (p);
> ++ info->height = get_unaligned_be32 (p + 4);
> + info->num_components = 1;
> + info->bits_per_component = 1;
> + }
> Index: patches/patch-src_cairo-tor-scan-converter_c
> ===================================================================
> RCS file: patches/patch-src_cairo-tor-scan-converter_c
> diff -N patches/patch-src_cairo-tor-scan-converter_c
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ patches/patch-src_cairo-tor-scan-converter_c 31 Oct 2014 06:04:13
> -0000
> @@ -0,0 +1,17 @@
> +$OpenBSD$
> +
> +tor-scan-converter: can't do_fullrow when intersection in row + 0.5subrow
> +
> +--- src/cairo-tor-scan-converter.c.orig Fri Oct 31 02:02:09 2014
> ++++ src/cairo-tor-scan-converter.c Fri Oct 31 02:02:58 2014
> +@@ -1167,8 +1167,8 @@ can_do_full_row (struct active_list *active)
> +
> + if (e->dy) {
> + struct quorem x = e->x;
> +- x.quo += e->dxdy_full.quo - e->dxdy.quo/2;
> +- x.rem += e->dxdy_full.rem - e->dxdy.rem/2;
> ++ x.quo += e->dxdy_full.quo;
> ++ x.rem += e->dxdy_full.rem;
> + if (x.rem < 0) {
> + x.quo--;
> + x.rem += e->dy;
> Index: patches/patch-src_cairoint_h
> ===================================================================
> RCS file: patches/patch-src_cairoint_h
> diff -N patches/patch-src_cairoint_h
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ patches/patch-src_cairoint_h 31 Oct 2014 06:06:43 -0000
> @@ -0,0 +1,39 @@
> +$OpenBSD$
> +
> +CFF: Fix unaligned access
> +
> +--- src/cairoint.h.orig Mon Oct 13 21:46:33 2014
> ++++ src/cairoint.h Fri Oct 31 02:05:05 2014
> +@@ -240,6 +240,32 @@ be32_to_cpu(uint32_t v)
> +
> + #endif
> +
> ++/* Unaligned big endian access
> ++ */
> ++
> ++static inline uint16_t get_unaligned_be16 (const unsigned char *p)
> ++{
> ++ return p[0] << 8 | p[1];
> ++}
> ++
> ++static inline uint32_t get_unaligned_be32 (const unsigned char *p)
> ++{
> ++ return p[0] << 24 | p[1] << 16 | p[2] << 8 | p[3];
> ++}
> ++
> ++static inline void put_unaligned_be16 (uint16_t v, unsigned char *p)
> ++{
> ++ p[0] = (v >> 8) & 0xff;
> ++ p[1] = v & 0xff;
> ++}
> ++
> ++static inline void put_unaligned_be32 (uint32_t v, unsigned char *p)
> ++{
> ++ p[0] = (v >> 24) & 0xff;
> ++ p[1] = (v >> 16) & 0xff;
> ++ p[2] = (v >> 8) & 0xff;
> ++ p[3] = v & 0xff;
> ++}
> +
> + /* The glibc versions of ispace() and isdigit() are slow in UTF-8 locales.
> + */
> Index: patches/patch-util_cairo-fdr_Makefile_in
> ===================================================================
> RCS file:
> /home/cvs/ports/graphics/cairo/patches/patch-util_cairo-fdr_Makefile_in,v
> retrieving revision 1.3
> diff -u -p -u -p -r1.3 patch-util_cairo-fdr_Makefile_in
> --- patches/patch-util_cairo-fdr_Makefile_in 4 Mar 2013 20:40:19 -0000
> 1.3
> +++ patches/patch-util_cairo-fdr_Makefile_in 31 Oct 2014 05:45:17 -0000
> @@ -1,7 +1,7 @@
> $OpenBSD: patch-util_cairo-fdr_Makefile_in,v 1.3 2013/03/04 20:40:19 eric
> Exp $
> ---- util/cairo-fdr/Makefile.in.orig Thu Jan 31 10:25:59 2013
> -+++ util/cairo-fdr/Makefile.in Sat Feb 2 00:30:35 2013
> -@@ -380,7 +380,7 @@ AM_CPPFLAGS = -I$(top_srcdir)/src \
> +--- util/cairo-fdr/Makefile.in.orig Mon Oct 13 21:47:27 2014
> ++++ util/cairo-fdr/Makefile.in Fri Oct 31 01:44:23 2014
> +@@ -358,7 +358,7 @@ AM_CPPFLAGS = -I$(top_srcdir)/src \
> cairo_fdr_la_SOURCES = fdr.c
> cairo_fdr_la_CPPFLAGS = $(AM_CPPFLAGS)
> cairo_fdr_la_CFLAGS = $(CAIRO_CFLAGS)
> Index: patches/patch-util_cairo-sphinx_Makefile_in
> ===================================================================
> RCS file:
> /home/cvs/ports/graphics/cairo/patches/patch-util_cairo-sphinx_Makefile_in,v
> retrieving revision 1.1
> diff -u -p -u -p -r1.1 patch-util_cairo-sphinx_Makefile_in
> --- patches/patch-util_cairo-sphinx_Makefile_in 1 Jun 2013 12:11:52
> -0000 1.1
> +++ patches/patch-util_cairo-sphinx_Makefile_in 31 Oct 2014 05:45:19
> -0000
> @@ -1,7 +1,7 @@
> $OpenBSD: patch-util_cairo-sphinx_Makefile_in,v 1.1 2013/06/01 12:11:52
> ajacoutot Exp $
> ---- util/cairo-sphinx/Makefile.in.orig Fri May 31 23:28:59 2013
> -+++ util/cairo-sphinx/Makefile.in Fri May 31 23:29:32 2013
> -@@ -390,7 +390,7 @@ AM_CPPFLAGS = -I$(top_srcdir)/src \
> +--- util/cairo-sphinx/Makefile.in.orig Mon Oct 13 21:47:28 2014
> ++++ util/cairo-sphinx/Makefile.in Fri Oct 31 01:44:23 2014
> +@@ -368,7 +368,7 @@ AM_CPPFLAGS = -I$(top_srcdir)/src \
> cairo_sphinx_la_SOURCES = fdr.c
> cairo_sphinx_la_CPPFLAGS = $(AM_CPPFLAGS)
> cairo_sphinx_la_CFLAGS = $(CAIRO_CFLAGS)
> Index: patches/patch-util_cairo-trace_Makefile_in
> ===================================================================
> RCS file:
> /home/cvs/ports/graphics/cairo/patches/patch-util_cairo-trace_Makefile_in,v
> retrieving revision 1.5
> diff -u -p -u -p -r1.5 patch-util_cairo-trace_Makefile_in
> --- patches/patch-util_cairo-trace_Makefile_in 4 Mar 2013 20:40:19
> -0000 1.5
> +++ patches/patch-util_cairo-trace_Makefile_in 31 Oct 2014 05:45:17
> -0000
> @@ -1,7 +1,7 @@
> $OpenBSD: patch-util_cairo-trace_Makefile_in,v 1.5 2013/03/04 20:40:19 eric
> Exp $
> ---- util/cairo-trace/Makefile.in.orig Thu Jan 31 10:26:00 2013
> -+++ util/cairo-trace/Makefile.in Sat Feb 2 00:30:35 2013
> -@@ -400,7 +400,7 @@ libcairo_trace_la_CPPFLAGS = -DCAIRO_TRACE_OUTDIR="\"$
> +--- util/cairo-trace/Makefile.in.orig Mon Oct 13 21:47:28 2014
> ++++ util/cairo-trace/Makefile.in Fri Oct 31 01:44:23 2014
> +@@ -378,7 +378,7 @@ libcairo_trace_la_CPPFLAGS = -DCAIRO_TRACE_OUTDIR="\"$
> $(AM_CPPFLAGS)
>
> libcairo_trace_la_CFLAGS = $(CAIRO_CFLAGS) $(real_pthread_CFLAGS)
> Index: pkg/PLIST
> ===================================================================
> RCS file: /home/cvs/ports/graphics/cairo/pkg/PLIST,v
> retrieving revision 1.16
> diff -u -p -u -p -r1.16 PLIST
> --- pkg/PLIST 1 Jun 2013 12:11:52 -0000 1.16
> +++ pkg/PLIST 31 Oct 2014 05:49:57 -0000
> @@ -27,7 +27,6 @@ lib/libcairo-script-interpreter.la
> lib/libcairo.a
> lib/libcairo.la
> @lib lib/libcairo.so.${LIBcairo_VERSION}
> -lib/pkgconfig/
> lib/pkgconfig/cairo-fc.pc
> lib/pkgconfig/cairo-ft.pc
> lib/pkgconfig/cairo-gobject.pc
> @@ -71,6 +70,7 @@ share/gtk-doc/html/cairo/cairo-Script-Su
> share/gtk-doc/html/cairo/cairo-Transformations.html
> share/gtk-doc/html/cairo/cairo-Types.html
> share/gtk-doc/html/cairo/cairo-User-Fonts.html
> +share/gtk-doc/html/cairo/cairo-Version-Information.html
> share/gtk-doc/html/cairo/cairo-Win32-Fonts.html
> share/gtk-doc/html/cairo/cairo-Win32-Surfaces.html
> share/gtk-doc/html/cairo/cairo-XCB-Surfaces.html
>
> --
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.
>
--
Antoine