Update to cairo-1.17.4.

This commit is contained in:
ajacoutot 2021-10-25 07:21:40 +00:00
parent 30af38cb73
commit a172664f44
11 changed files with 267 additions and 105 deletions

View File

@ -1,16 +1,16 @@
# $OpenBSD: Makefile,v 1.71 2019/07/12 20:46:56 sthen Exp $
# $OpenBSD: Makefile,v 1.72 2021/10/25 07:21:40 ajacoutot Exp $
COMMENT= vector graphics library
DISTNAME= cairo-1.16.0
DISTNAME= cairo-1.17.4
CATEGORIES= graphics
DPB_PROPERTIES= parallel
EXTRACT_SUFX= .tar.xz
SHARED_LIBS += cairo 13.0 # 11602.0
SHARED_LIBS += cairo-gobject 2.0 # 11602.0
SHARED_LIBS += cairo-script-interpreter 2.0 # 11602.0
SHARED_LIBS += cairo 13.1 # 2.11704.0
SHARED_LIBS += cairo-gobject 2.1 # 2.11704.0
SHARED_LIBS += cairo-script-interpreter 2.1 # 2.11704.0
HOMEPAGE= http://cairographics.org/
@ -19,31 +19,35 @@ MAINTAINER= Antoine Jacoutot <ajacoutot@openbsd.org>
# LGPLv2.1 / MPL 1.1
PERMIT_PACKAGE= Yes
WANTLIB += X11 Xau Xdmcp Xext Xrender c expat ffi fontconfig freetype
WANTLIB += glib-2.0 gobject-2.0 iconv intl lzo2 m pcre pixman-1
WANTLIB += png pthread xcb xcb-render xcb-shm z
WANTLIB += X11 Xext Xrender c fontconfig freetype glib-2.0 gobject-2.0
WANTLIB += lzo2 m pixman-1 png pthread xcb xcb-render xcb-shm
WANTLIB += z
MASTER_SITES= https://cairographics.org/releases/ \
https://cairographics.org/snapshots/
MODULES= devel/meson
USE_GMAKE= Yes
LIB_DEPENDS= archivers/lzo2 \
devel/glib2 \
graphics/png
CONFIGURE_STYLE= gnu
CONFIGURE_ENV= LDFLAGS="-L${LOCALBASE}/lib" \
CPPFLAGS="-I${LOCALBASE}/include"
CONFIGURE_ARGS= --disable-valgrind
CONFIGURE_ARGS= -Dspectre=disabled \
-Dtests=disabled
# needed for firefox
CONFIGURE_ARGS += --enable-tee
CONFIGURE_ARGS += -Dtee=enabled
# XXX fatal error: 'lzo/lzo2a.h' file not found
CFLAGS += -I${LOCALBASE}/include
pre-configure:
${SUBST_CMD} ${WRKSRC}/src/cairo.pc.in
${SUBST_CMD} ${WRKSRC}/src/meson.build
# XXX
post-install:
rm ${PREFIX}/lib/cairo/*.{a,la}
chmod +x ${PREFIX}/bin/cairo-trace
.include <bsd.port.mk>

View File

@ -1,2 +1,2 @@
SHA256 (cairo-1.16.0.tar.xz) = Xnsps/ET74cNHj7Pit8h+SM5ZAFgS9oW1EvkXmYFIzE=
SIZE (cairo-1.16.0.tar.xz) = 41997432
SHA256 (cairo-1.17.4.tar.xz) = dLJMHtQ2u+h0mReaOyfEP0FDuGdtitI3pvp4dAGVlwU=
SIZE (cairo-1.17.4.tar.xz) = 41834076

View File

@ -0,0 +1,73 @@
$OpenBSD: patch-meson_build,v 1.1 2021/10/25 07:21:40 ajacoutot Exp $
From 3468c67fe91f0c37e0ec5d335082653a6fa609b6 Mon Sep 17 00:00:00 2001
From: "Jan Alexander Steffens (heftig)" <jan.steffens@gmail.com>
Date: Thu, 25 Feb 2021 01:27:10 +0000
Subject: [PATCH] meson: add xlib-xcb option and disable by default
From e9ccb1d8d095482e4139da658e679d5aad56b184 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= <tim@centricular.com>
Date: Tue, 15 Dec 2020 00:12:55 +0000
Subject: [PATCH] meson: fix library versioning
Last chunk: LD_PRELOAD is supported on OpenBSD
Index: meson.build
--- meson.build.orig
+++ meson.build
@@ -3,8 +3,6 @@ project('cairo', 'c', 'cpp',
version: run_command(find_program('version.py'), check: true).stdout().strip(),
)
-cc = meson.get_compiler('c')
-
# Keep in sync with configure.ac!
freetype_required_version = '>= 9.7.3'
fontconfig_required_version = '>= 2.2.95'
@@ -16,6 +14,27 @@ libudev_required_version = '>= 136'
libdrm_required_version = '>= 2.4'
glib_required_version = '>= 2.14'
+# library versioning
+version_arr = meson.project_version().split('.')
+cairo_version_major = version_arr[0].to_int()
+cairo_version_minor = version_arr[1].to_int()
+cairo_version_micro = version_arr[2].to_int()
+
+# The libtool shared library version stuff.
+# Try and maintain compatibility with the previous library versioning.
+cairo_version_sonum = cairo_version_major + 1
+cairo_version = cairo_version_major * 10000 + cairo_version_minor * 100 + cairo_version_micro
+
+if cairo_version_minor % 2 == 1
+ # unstable release
+ cairo_libversion = '@0@.@1@.0'.format(cairo_version_sonum, cairo_version)
+else
+ # stable release
+ cairo_libversion = '@0@.@1@.@2@'.format(cairo_version_sonum, cairo_version, cairo_version_micro)
+endif
+
+cc = meson.get_compiler('c')
+
if cc.get_id() == 'msvc'
# Basic usage in the cairo type system that causes spammy and useless warnings
add_project_arguments('/wd4244', '/wd4146',
@@ -312,8 +331,7 @@ if xcb_dep.found() and xcb_render_dep.found()
endif
if feature_conf.get('CAIRO_HAS_XCB_SURFACE', 0) == 1 and feature_conf.get('CAIRO_HAS_XLIB_SURFACE', 0) == 1
- # FIXME: automagic
- x11xcb_dep = dependency('x11-xcb', required: false)
+ x11xcb_dep = dependency('x11-xcb', required: get_option('xlib-xcb'))
if x11xcb_dep.found()
deps += [x11xcb_dep]
feature_conf.set('CAIRO_HAS_XLIB_XCB_FUNCTIONS', 1)
@@ -832,7 +850,7 @@ if not ['x86', 'x86_64'].contains(host_machine.cpu_fam
conf.set('ATOMIC_OP_NEEDS_MEMORY_BARRIER', 1)
endif
-have_ld_preload = ['linux', 'freebsd', 'darwin', 'dragonfly'].contains(host_machine.system())
+have_ld_preload = ['linux', 'freebsd', 'darwin', 'dragonfly', 'openbsd'].contains(host_machine.system())
if have_ld_preload and zlib_dep.found() and conf.get('CAIRO_HAS_REAL_PTHREAD', 0) == 1 and conf.get('CAIRO_HAS_DLSYM', 0) == 1
conf.set('CAIRO_HAS_TRACE', 1)

View File

@ -0,0 +1,18 @@
$OpenBSD: patch-meson_options_txt,v 1.1 2021/10/25 07:21:40 ajacoutot Exp $
From 3468c67fe91f0c37e0ec5d335082653a6fa609b6 Mon Sep 17 00:00:00 2001
From: "Jan Alexander Steffens (heftig)" <jan.steffens@gmail.com>
Date: Thu, 25 Feb 2021 01:27:10 +0000
Subject: [PATCH] meson: add xlib-xcb option and disable by default
Index: meson_options.txt
--- meson_options.txt.orig
+++ meson_options.txt
@@ -17,6 +17,7 @@ option('qt', type : 'feature', value : 'disabled')
option('tee', type : 'feature', value : 'disabled')
option('xcb', type : 'feature', value : 'auto')
option('xlib', type : 'feature', value : 'auto')
+option('xlib-xcb', type : 'feature', value : 'disabled')
#option('xml', type : 'feature', value : 'disabled')
option('zlib', type : 'feature', value : 'auto') # script, ps, pdf, xml surfaces

View File

@ -0,0 +1,45 @@
$OpenBSD: patch-src_cairo-image-compositor_c,v 1.3 2021/10/25 07:21:40 ajacoutot Exp $
From 03a820b173ed1fdef6ff14b4468f5dbc02ff59be Mon Sep 17 00:00:00 2001
From: Heiko Lewin <heiko.lewin@worldiety.de>
Date: Tue, 15 Dec 2020 16:48:19 +0100
Subject: [PATCH] Fix mask usage in image-compositor
Index: src/cairo-image-compositor.c
--- src/cairo-image-compositor.c.orig
+++ src/cairo-image-compositor.c
@@ -2610,14 +2610,14 @@ _inplace_src_spans (void *abstract_renderer, int y, in
unsigned num_spans)
{
cairo_image_span_renderer_t *r = abstract_renderer;
- uint8_t *m;
+ uint8_t *m, *base = (uint8_t*)pixman_image_get_data(r->mask);
int x0;
if (num_spans == 0)
return CAIRO_STATUS_SUCCESS;
x0 = spans[0].x;
- m = r->_buf;
+ m = base;
do {
int len = spans[1].x - spans[0].x;
if (len >= r->u.composite.run_length && spans[0].coverage == 0xff) {
@@ -2655,7 +2655,7 @@ _inplace_src_spans (void *abstract_renderer, int y, in
spans[0].x, y,
spans[1].x - spans[0].x, h);
- m = r->_buf;
+ m = base;
x0 = spans[1].x;
} else if (spans[0].coverage == 0x0) {
if (spans[0].x != x0) {
@@ -2684,7 +2684,7 @@ _inplace_src_spans (void *abstract_renderer, int y, in
#endif
}
- m = r->_buf;
+ m = base;
x0 = spans[1].x;
} else {
*m++ = spans[0].coverage;

View File

@ -0,0 +1,31 @@
$OpenBSD: patch-src_cairo-pdf-surface_c,v 1.1 2021/10/25 07:21:40 ajacoutot Exp $
From a3b69a0215fdface0fd5730872a4b3242d979dca Mon Sep 17 00:00:00 2001
From: Uli Schlachter <psychon@znc.in>
Date: Tue, 9 Feb 2021 16:54:35 +0100
Subject: [PATCH] pdf font subset: Generate valid font names
Index: src/cairo-pdf-surface.c
--- src/cairo-pdf-surface.c.orig
+++ src/cairo-pdf-surface.c
@@ -5309,18 +5309,14 @@ _create_font_subset_tag (cairo_scaled_font_subset_t *f
{
uint32_t hash;
int i;
- long numerator;
- ldiv_t d;
hash = _hash_data ((unsigned char *) font_name, strlen(font_name), 0);
hash = _hash_data ((unsigned char *) (font_subset->glyphs),
font_subset->num_glyphs * sizeof(unsigned long), hash);
- numerator = hash;
for (i = 0; i < 6; i++) {
- d = ldiv (numerator, 26);
- numerator = d.quot;
- tag[i] = 'A' + d.rem;
+ tag[i] = 'A' + (hash % 26);
+ hash /= 26;
}
tag[i] = 0;
}

View File

@ -1,11 +0,0 @@
$OpenBSD: patch-src_cairo_pc_in,v 1.1 2013/01/30 13:17:51 brad Exp $
--- src/cairo.pc.in.orig Tue Jan 29 07:56:53 2013
+++ src/cairo.pc.in Tue Jan 29 08:22:13 2013
@@ -8,6 +8,6 @@ Description: Multi-platform 2D graphics library
Version: @VERSION@
@PKGCONFIG_REQUIRES@: @CAIRO_REQUIRES@
-Libs: -L${libdir} -lcairo
+Libs: -L${libdir} -Wl,-rpath-link,${X11BASE}/lib -lcairo
Libs.private: @CAIRO_NONPKGCONFIG_LIBS@
Cflags: -I${includedir}/cairo

View File

@ -0,0 +1,31 @@
$OpenBSD: patch-src_meson_build,v 1.1 2021/10/25 07:21:40 ajacoutot Exp $
From e9ccb1d8d095482e4139da658e679d5aad56b184 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= <tim@centricular.com>
Date: Tue, 15 Dec 2020 00:12:55 +0000
Subject: [PATCH] meson: fix library versioning
Last chunk: properly find X libs are runtime
Index: src/meson.build
--- src/meson.build.orig
+++ src/meson.build
@@ -299,8 +299,8 @@ libcairo = library('cairo', cairo_sources,
c_args: cairo_no_warn_c_args + pthread_c_args + ['-DHAVE_CONFIG_H'],
cpp_args: cairo_no_warn_c_args + pthread_c_args + ['-DHAVE_CONFIG_H'],
link_args: extra_link_args,
- soversion: '2',
- version: '2.' + ''.join(meson.project_version().split('.')) + '.0',
+ soversion: cairo_version_sonum,
+ version: cairo_libversion,
install: true,
include_directories: incbase,
)
@@ -314,6 +314,7 @@ libcairo_dep = declare_dependency(link_with: libcairo,
pkgmod.generate(libcairo,
description: 'Multi-platform 2D graphics library',
subdirs: [meson.project_name()],
+ libraries: ['-Wl,-rpath-link,${X11BASE}/lib'],
)
meson.override_dependency('cairo', libcairo_dep)

View File

@ -0,0 +1,21 @@
$OpenBSD: patch-util_cairo-gobject_meson_build,v 1.1 2021/10/25 07:21:40 ajacoutot Exp $
From e9ccb1d8d095482e4139da658e679d5aad56b184 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= <tim@centricular.com>
Date: Tue, 15 Dec 2020 00:12:55 +0000
Subject: [PATCH] meson: fix library versioning
Index: util/cairo-gobject/meson.build
--- util/cairo-gobject/meson.build.orig
+++ util/cairo-gobject/meson.build
@@ -12,8 +12,8 @@ libcairogobject = library('cairo-gobject', cairo_gobje
include_directories: [incbase, incsrc],
dependencies: [glib_dep, gobject_dep],
link_with: [libcairo],
- soversion: '2',
- version: '2.' + ''.join(meson.project_version().split('.')) + '.0',
+ soversion: cairo_version_sonum,
+ version: cairo_libversion,
install: true,
)

View File

@ -0,0 +1,21 @@
$OpenBSD: patch-util_cairo-script_meson_build,v 1.1 2021/10/25 07:21:40 ajacoutot Exp $
From e9ccb1d8d095482e4139da658e679d5aad56b184 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= <tim@centricular.com>
Date: Tue, 15 Dec 2020 00:12:55 +0000
Subject: [PATCH] meson: fix library versioning
Index: util/cairo-script/meson.build
--- util/cairo-script/meson.build.orig
+++ util/cairo-script/meson.build
@@ -30,8 +30,8 @@ libcairoscript = library('cairo-script-interpreter',
include_directories: [incbase, incsrc],
dependencies: deps,
link_with: [libcairo],
- soversion: '2',
- version: '2.' + ''.join(meson.project_version().split('.')) + '.0',
+ soversion: cairo_version_sonum,
+ version: cairo_libversion,
install: true,
)

View File

@ -1,4 +1,4 @@
@comment $OpenBSD: PLIST,v 1.23 2018/10/20 11:20:54 ajacoutot Exp $
@comment $OpenBSD: PLIST,v 1.24 2021/10/25 07:21:40 ajacoutot Exp $
@bin bin/cairo-sphinx
bin/cairo-trace
include/cairo/
@ -16,19 +16,14 @@ include/cairo/cairo-version.h
include/cairo/cairo-xcb.h
include/cairo/cairo-xlib-xrender.h
include/cairo/cairo-xlib.h
include/cairo/cairo-xml.h
include/cairo/cairo.h
lib/cairo/
lib/cairo/cairo-fdr.so
lib/cairo/cairo-sphinx.so
lib/cairo/libcairo-trace.so
lib/libcairo-gobject.a
lib/libcairo-gobject.la
@so lib/cairo/libcairo-fdr.so
@so lib/cairo/libcairo-sphinx.so
@so lib/cairo/libcairo-trace.so
@lib lib/libcairo-gobject.so.${LIBcairo-gobject_VERSION}
lib/libcairo-script-interpreter.a
lib/libcairo-script-interpreter.la
@lib lib/libcairo-script-interpreter.so.${LIBcairo-script-interpreter_VERSION}
lib/libcairo.a
lib/libcairo.la
@lib lib/libcairo.so.${LIBcairo_VERSION}
lib/pkgconfig/cairo-fc.pc
lib/pkgconfig/cairo-ft.pc
@ -43,71 +38,5 @@ lib/pkgconfig/cairo-xcb-shm.pc
lib/pkgconfig/cairo-xcb.pc
lib/pkgconfig/cairo-xlib-xrender.pc
lib/pkgconfig/cairo-xlib.pc
lib/pkgconfig/cairo-xml.pc
lib/pkgconfig/cairo.pc
share/gtk-doc/html/cairo/
share/gtk-doc/html/cairo/bindings-errors.html
share/gtk-doc/html/cairo/bindings-fonts.html
share/gtk-doc/html/cairo/bindings-memory.html
share/gtk-doc/html/cairo/bindings-overloading.html
share/gtk-doc/html/cairo/bindings-path.html
share/gtk-doc/html/cairo/bindings-patterns.html
share/gtk-doc/html/cairo/bindings-return-values.html
share/gtk-doc/html/cairo/bindings-streams.html
share/gtk-doc/html/cairo/bindings-surfaces.html
share/gtk-doc/html/cairo/cairo-Error-handling.html
share/gtk-doc/html/cairo/cairo-FreeType-Fonts.html
share/gtk-doc/html/cairo/cairo-Image-Surfaces.html
share/gtk-doc/html/cairo/cairo-PDF-Surfaces.html
share/gtk-doc/html/cairo/cairo-PNG-Support.html
share/gtk-doc/html/cairo/cairo-Paths.html
share/gtk-doc/html/cairo/cairo-PostScript-Surfaces.html
share/gtk-doc/html/cairo/cairo-Quartz-(CGFont)-Fonts.html
share/gtk-doc/html/cairo/cairo-Quartz-Surfaces.html
share/gtk-doc/html/cairo/cairo-Raster-Sources.html
share/gtk-doc/html/cairo/cairo-Recording-Surfaces.html
share/gtk-doc/html/cairo/cairo-Regions.html
share/gtk-doc/html/cairo/cairo-SVG-Surfaces.html
share/gtk-doc/html/cairo/cairo-Script-Surfaces.html
share/gtk-doc/html/cairo/cairo-Tags-and-Links.html
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
share/gtk-doc/html/cairo/cairo-XLib-Surfaces.html
share/gtk-doc/html/cairo/cairo-XLib-XRender-Backend.html
share/gtk-doc/html/cairo/cairo-cairo-device-t.html
share/gtk-doc/html/cairo/cairo-cairo-font-face-t.html
share/gtk-doc/html/cairo/cairo-cairo-font-options-t.html
share/gtk-doc/html/cairo/cairo-cairo-matrix-t.html
share/gtk-doc/html/cairo/cairo-cairo-pattern-t.html
share/gtk-doc/html/cairo/cairo-cairo-scaled-font-t.html
share/gtk-doc/html/cairo/cairo-cairo-surface-t.html
share/gtk-doc/html/cairo/cairo-cairo-t.html
share/gtk-doc/html/cairo/cairo-drawing.html
share/gtk-doc/html/cairo/cairo-fonts.html
share/gtk-doc/html/cairo/cairo-support.html
share/gtk-doc/html/cairo/cairo-surfaces.html
share/gtk-doc/html/cairo/cairo-text.html
share/gtk-doc/html/cairo/cairo.devhelp2
share/gtk-doc/html/cairo/home.png
share/gtk-doc/html/cairo/index-1.10.html
share/gtk-doc/html/cairo/index-1.12.html
share/gtk-doc/html/cairo/index-1.14.html
share/gtk-doc/html/cairo/index-1.16.html
share/gtk-doc/html/cairo/index-1.2.html
share/gtk-doc/html/cairo/index-1.4.html
share/gtk-doc/html/cairo/index-1.6.html
share/gtk-doc/html/cairo/index-1.8.html
share/gtk-doc/html/cairo/index-all.html
share/gtk-doc/html/cairo/index.html
share/gtk-doc/html/cairo/language-bindings.html
share/gtk-doc/html/cairo/left-insensitive.png
share/gtk-doc/html/cairo/left.png
share/gtk-doc/html/cairo/right-insensitive.png
share/gtk-doc/html/cairo/right.png
share/gtk-doc/html/cairo/style.css
share/gtk-doc/html/cairo/up-insensitive.png
share/gtk-doc/html/cairo/up.png