cairo: sync with cairo-devel port

This commit is contained in:
Bruno Lopes
2026-04-07 13:54:16 -03:00
committed by Renee Otten
parent 0ef83f128c
commit 2841d90a12
6 changed files with 156 additions and 271 deletions
+90 -92
View File
@@ -3,6 +3,7 @@
PortSystem 1.0
PortGroup debug 1.0
PortGroup legacysupport 1.1
PortGroup meson 1.0
PortGroup muniversal 1.0
PortGroup xcodeversion 1.0
@@ -15,11 +16,11 @@ legacysupport.newest_darwin_requires_legacy 10
name cairo
conflicts cairo-devel
set my_name cairo
version 1.17.6
revision 2
checksums rmd160 b02bab53ca0f77bc3b8d095a6bfde56d7ab8c988 \
sha256 4eebc4c2bad0402bc3f501db184417094657d111fb6c06f076a82ea191fe1faf \
size 35055900
version 1.18.4
revision 0
checksums rmd160 757415ba8e1b5df92474644c887865a5ade9fd93 \
sha256 445ed8208a6e4823de1226a74ca319d3600e83f6369f99b14265006599c32ccb \
size 32578804
categories graphics
maintainers {ryandesign @ryandesign} {mascguy @mascguy}
@@ -27,91 +28,71 @@ license {LGPL-2.1 MPL-1.1}
homepage https://www.cairographics.org
master_sites ${homepage}/releases/
platforms darwin macosx
use_parallel_build yes
dist_subdir ${my_name}
distname ${my_name}-${version}
use_xz yes
description a vector graphics library with cross-device output support
long_description Cairo is ${description}. It is designed to produce \
description Cairo is a vector graphics library with cross-device output support
long_description ${description}. It is designed to produce \
identical output on all output media while taking \
advantage of display hardware acceleration when \
available (e.g. through the X Render Extension).
depends_build path:bin/pkg-config:pkgconfig
# Disable unexpected download of subprojects
meson.wrap_mode nodownload
depends_lib path:lib/pkgconfig/pixman-1.pc:libpixman \
path:lib/pkgconfig/glib-2.0.pc:glib2 \
set py_ver 3.14
set py_ver_nodot [string map {. {}} ${py_ver}]
configure.python ${prefix}/bin/python${py_ver}
# Upstream patch to correctly set dylib versions
patchfiles-append patch-darwin-dylib-versions.diff
post-patch {
fs-traverse f ${worksrcpath} {
if {[string match *.py ${f}]} {
ui_info "patching env python3: ${f}"
reinplace -q "s|/usr/bin/env python3$|${configure.python}|" ${f}
}
}
}
depends_build-append \
path:bin/pkg-config:pkgconfig \
port:python${py_ver_nodot}
depends_lib-append \
port:expat \
port:fontconfig \
port:freetype \
path:lib/pkgconfig/glib-2.0.pc:glib2 \
path:lib/pkgconfig/pixman-1.pc:libpixman \
port:libpng \
port:zlib \
port:expat
port:lzo2 \
port:zlib
minimum_xcodeversions {8 2.4.1}
# https://gitlab.freedesktop.org/cairo/cairo/-/issues/843
compiler.c_standard 2011
patchfiles-append cairo-script-interpreter.pc.in.patch
# Prevent cairo from using librsvg, libspectre, poppler.
patchfiles-append patch-configure.diff
# Don't check stderr in configure tests.
patchfiles-append dont-check-stderr.patch
# Backport from 1.17.8 as that release is a major change
# https://gitlab.freedesktop.org/cairo/cairo/-/merge_requests/316
patchfiles-append memory-leak.patch
# https://trac.macports.org/ticket/34137
compiler.blacklist-append {clang < 318.0.61}
if {![info exists universal_possible]} {
set universal_possible [expr {${os.universal_supported} && [llength ${configure.universal_archs}] >= 2}]
}
# https://trac.macports.org/ticket/27011
if {${configure.build_arch} eq "x86_64" || (${universal_possible} && [variant_isset universal] && "x86_64" in ${configure.universal_archs})} {
compiler.blacklist-append gcc-4.0
}
configure.args --disable-gl \
--disable-quartz \
--disable-quartz-font \
--disable-quartz-image \
--disable-silent-rules \
--disable-symbol-lookup \
--disable-xlib \
--disable-xlib-xcb \
--disable-xcb \
--disable-xcb-shm \
--without-x \
--enable-ft \
--enable-pdf \
--enable-png \
--enable-ps \
--enable-script \
--enable-svg \
--enable-tee \
--enable-xml
# Prevent cairo from using ghostscript.
configure.args-append ac_cv_prog_GS=""
# Prevent cairo from using lzo2 because its GPL license makes cairo's effective license GPL too.
configure.args-append ac_cv_lib_lzo2_lzo2a_decompress=no
variant opengl requires x11 description {Add OpenGL graphics interface} {
depends_lib-append port:mesa
configure.args-replace --disable-gl --enable-gl
configure.args-append --enable-glx
}
configure.args-append \
-Dfontconfig=enabled \
-Dfreetype=enabled \
-Dglib=enabled \
-Dlzo=enabled \
-Dpng=enabled \
-Dquartz=disabled \
-Dspectre=disabled \
-Dsymbol-lookup=disabled \
-Dtee=enabled \
-Dtests=disabled \
-Dxcb=disabled \
-Dxlib=disabled \
-Dxlib-xcb=disabled
platform macosx {
variant quartz {
configure.args-replace --disable-quartz --enable-quartz
configure.args-replace --disable-quartz-font --enable-quartz-font
configure.args-replace --disable-quartz-image --enable-quartz-image
configure.args-replace \
-Dquartz=disabled -Dquartz=enabled
}
default_variants +quartz
@@ -120,24 +101,44 @@ platform macosx {
variant_set quartz
}
if {[string match *gcc-4.* ${configure.compiler}]} {
# gcc-4 defaults to gnu89 which is "ISO C90 plus GNU extensions". We need gnu99.
# https://gitlab.freedesktop.org/cairo/cairo/-/merge_requests/264
configure.cflags-append -std=gnu99
variant x11 {
depends_lib-append \
port:xorg-libXext \
port:xorg-xcb-util \
port:xrender
configure.args-replace -Dxcb=disabled -Dxcb=enabled
configure.args-replace -Dxlib=disabled -Dxlib=enabled
configure.args-replace -Dxlib-xcb=disabled -Dxlib-xcb=enabled
}
variant x11 {
depends_lib-append port:xrender \
port:xorg-libXext \
port:xorg-xcb-util
proc port_test_ver_check {p_name p_ver p_rev} {
if { [catch {set port_ver_info [lindex [registry_active ${p_name}] 0]}] } {
error "Tests require that ${p_name} be active; install, then re-run tests"
} else {
set test_ver ${p_ver}_${p_rev}
set port_ver [lindex ${port_ver_info} 1]_[lindex ${port_ver_info} 2]
ui_info "port_test_ver_check: ${p_name}: test_ver: ${test_ver}; port_ver: ${port_ver}"
configure.args-replace --disable-xcb --enable-xcb
configure.args-replace --disable-xlib --enable-xlib
configure.args-replace --disable-xlib-xcb --enable-xlib-xcb
configure.args-replace --without-x --with-x
configure.args-append --enable-xlib-xrender \
--x-include=${prefix}/include \
--x-lib=${prefix}/lib
if { [vercmp ${port_ver} ${test_ver}] != 0 } {
error "Tests require installed version of ${p_name} to match port; update, then re-run tests"
}
}
}
variant tests description {Enable tests} {
pre-configure {
port_test_ver_check ${subport} ${version} ${revision}
}
depends_build-append \
port:ghostscript \
path:lib/pkgconfig/librsvg-2.0.pc:librsvg \
path:lib/pkgconfig/poppler.pc:poppler
configure.args-replace -Dtests=disabled -Dtests=enabled
test.run yes
}
default_variants +x11
@@ -147,9 +148,6 @@ if {${os.platform} ne "darwin" || ${os.subplatform} ne "macosx"} {
variant_set x11
}
test.run yes
test.target check
livecheck.type regex
livecheck.url ${homepage}/news/
livecheck.regex ${my_name}-(\[0-9\]+\\.\[0-9\]*\[02468\]\\.\[0-9\]+)
livecheck.regex ${my_name}-(\[0-9.\]+)
@@ -1,11 +0,0 @@
Set exec_prefix in cairo-script-interpreter.pc.in
https://gitlab.freedesktop.org/cairo/cairo/-/merge_requests/324
https://gitlab.freedesktop.org/cairo/cairo/-/commit/a0dfb2c07308c8cdc2aa300a0238bc996d91aa36
--- util/cairo-script/cairo-script-interpreter.pc.in
+++ util/cairo-script/cairo-script-interpreter.pc.in
@@ -1,4 +1,5 @@
prefix=@prefix@
+exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
@@ -1,109 +0,0 @@
Don't check stderr in configure tests as this causes them to fail when
unexpected warnings are emitted, such as deprecation of i386 in Xcode 10.
https://gitlab.freedesktop.org/cairo/cairo/-/issues/121
Updated version of this patch:
https://bugs.freedesktop.org/show_bug.cgi?id=30910#c6
--- configure.orig 2023-02-03 20:33:05.000000000 -0600
+++ configure 2023-02-03 20:38:32.000000000 -0600
@@ -14998,7 +14998,7 @@
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
- if test "x$cairo_cc_stderr" != "x"; then
+ if false; then
cairo_cc_flag=no
fi
@@ -15045,7 +15045,7 @@
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
- if test "x$cairo_cc_stderr" != "x"; then
+ if false; then
cairo_cc_flag=no
fi
@@ -15096,7 +15096,7 @@
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
- if test "x$cairo_cc_stderr" != "x"; then
+ if false; then
cairo_cc_flag=no
fi
@@ -15143,7 +15143,7 @@
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
- if test "x$cairo_cc_stderr" != "x"; then
+ if false; then
cairo_cc_flag=no
fi
@@ -15212,7 +15212,7 @@
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
- if test "x$cairo_cc_stderr" != "x"; then
+ if false; then
cairo_cc_flag=no
fi
@@ -15268,7 +15268,7 @@
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
- if test "x$cairo_cc_stderr" != "x"; then
+ if false; then
cairo_cc_flag=no
fi
@@ -16852,7 +16852,7 @@
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
- if test "x$cairo_cc_stderr" != "x"; then
+ if false; then
cairo_cc_flag=no
fi
@@ -16899,7 +16899,7 @@
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
- if test "x$cairo_cc_stderr" != "x"; then
+ if false; then
cairo_cc_flag=no
fi
@@ -27730,7 +27730,7 @@
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
- if test "x$cairo_cc_stderr" != "x"; then
+ if false; then
cairo_cc_flag=no
fi
@@ -27849,7 +27849,7 @@
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
- if test "x$cairo_cc_stderr" != "x"; then
+ if false; then
cairo_cc_flag=no
fi
@@ -27930,7 +27930,7 @@
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
- if test "x$cairo_cc_stderr" != "x"; then
+ if false; then
cairo_cc_flag=no
fi
-27
View File
@@ -1,27 +0,0 @@
From 243938c61a08dac8911153352e55933e0618581e Mon Sep 17 00:00:00 2001
From: John Ralls <jralls@ceridwen.us>
Date: Sat, 23 Apr 2022 16:38:01 -0700
Subject: [PATCH] [quartz] Destroy local copy of snapshot after attaching it.
Because cairo_surface_snapshot_attach refs the snapshot.
Fixes https://gitlab.freedesktop.org/cairo/cairo/-/issues/562
---
src/cairo-quartz-surface.c | 1 +
1 file changed, 1 insertion(+)
diff --git src/cairo-quartz-surface.c src/cairo-quartz-surface.c
index 5681918c4..fa6d9b1c9 100644
--- src/cairo-quartz-surface.c
+++ src/cairo-quartz-surface.c
@@ -2609,6 +2609,7 @@ _cairo_quartz_surface_snapshot_get_image (cairo_quartz_surface_t *surface)
if (unlikely (!snapshot || cairo_surface_status (snapshot)))
return NULL;
_cairo_surface_attach_snapshot (&surface->base, snapshot, NULL);
+ cairo_surface_destroy (snapshot);
}
return CGImageRetain (((cairo_quartz_snapshot_t*)snapshot)->image);
--
GitLab
-32
View File
@@ -1,32 +0,0 @@
Don't find spectre, poppler, or librsvg even if they're installed.
https://trac.macports.org/ticket/33856
https://lists.macports.org/pipermail/macports-dev/2012-March/018411.html
--- configure.orig 2022-03-18 13:40:22.000000000 -0500
+++ configure 2023-02-03 20:39:58.000000000 -0600
@@ -25179,7 +25179,7 @@
# Keep in sync with meson.build!
-SPECTRE_VERSION_REQUIRED=0.2.0
+SPECTRE_VERSION_REQUIRED=99999
test_ps=no
any2ppm_ps=no
if test "x$use_ps" = "xyes"; then
@@ -25573,7 +25573,7 @@
# poppler-0.17.4 fixes text-pattern and text-transform
# Keep in sync with meson.build!
-POPPLER_VERSION_REQUIRED=0.17.4
+POPPLER_VERSION_REQUIRED=99999
test_pdf=no
any2ppm_pdf=no
if test "x$use_pdf" = "xyes"; then
@@ -25939,7 +25939,7 @@
-LIBRSVG_VERSION_REQUIRED=2.35.0
+LIBRSVG_VERSION_REQUIRED=99999
test_svg=no
any2ppm_svg=no
if test "x$use_svg" = "xyes"; then
@@ -0,0 +1,66 @@
#============================================================================================================
# Source: https://gitlab.freedesktop.org/cairo/cairo/-/merge_requests/334
#
# From: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
# Date: Sun, 19 Jun 2022 13:45:09 -0700
# Subject: [PATCH] meson: Setup darwin dylib versions
#
# autotools-builds of cairo had broken compat/current version management. They had current == compat
# and bumped every release, making them not suitable for distribution as system libraries. In
# transitioning to meson, we're resetting this to a sane versioning scheme.
#============================================================================================================
--- meson.build
+++ meson.build
@@ -24,6 +24,9 @@
cairo_version_sonum = cairo_version_major + 1
cairo_version = cairo_version_major * 10000 + cairo_version_minor * 100 + cairo_version_micro
+# ABI compatibility version should be that used for 1.17.x
+cairo_version_compat = 11709
+
if cairo_version_minor % 2 == 1
# unstable release
cairo_libversion = '@0@.@1@.0'.format(cairo_version_sonum, cairo_version)
@@ -32,6 +35,12 @@
cairo_libversion = '@0@.@1@.@2@'.format(cairo_version_sonum, cairo_version, cairo_version_micro)
endif
+cairo_dylib_ver_compat = '@0@.0.0'.format(cairo_version_compat)
+cairo_dylib_ver_current = '@0@.0.0'.format(cairo_version)
+message('cairo_dylib_ver_compat: ', cairo_dylib_ver_compat)
+message('cairo_dylib_ver_current: ', cairo_dylib_ver_current)
+cairo_darwin_versions = [cairo_dylib_ver_compat, cairo_dylib_ver_current]
+
conf = configuration_data()
cc = meson.get_compiler('c')
--- src/meson.build
+++ src/meson.build
@@ -267,6 +267,7 @@ libcairo = library('cairo', cairo_sources,
link_args: extra_link_args,
soversion: cairo_version_sonum,
version: cairo_libversion,
+ darwin_versions: cairo_darwin_versions,
install: true,
include_directories: incbase,
)
--- util/cairo-gobject/meson.build
+++ util/cairo-gobject/meson.build
@@ -12,6 +12,7 @@
dependencies: [glib_dep, gobject_dep, libcairo_dep],
soversion: cairo_version_sonum,
version: cairo_libversion,
+ darwin_versions: cairo_darwin_versions,
gnu_symbol_visibility: 'hidden',
c_args: ['-DCAIRO_COMPILATION'],
link_args: extra_link_args,
--- util/cairo-script/meson.build
+++ util/cairo-script/meson.build
@@ -30,6 +30,7 @@
dependencies: deps + [libcairo_dep, lzo_dep],
soversion: cairo_version_sonum,
version: cairo_libversion,
+ darwin_versions: cairo_darwin_versions,
c_args: ['-DCAIRO_COMPILATION'],
link_args: extra_link_args,
install: true,