Skip to content

Commit 97f4b4f

Browse files
committed
cairo: sync with cairo-devel port
1 parent 221a09a commit 97f4b4f

File tree

6 files changed

+158
-273
lines changed

6 files changed

+158
-273
lines changed

graphics/cairo/Portfile

Lines changed: 92 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
PortSystem 1.0
44
PortGroup debug 1.0
55
PortGroup legacysupport 1.1
6+
PortGroup meson 1.0
67
PortGroup muniversal 1.0
78
PortGroup xcodeversion 1.0
89

@@ -15,103 +16,83 @@ legacysupport.newest_darwin_requires_legacy 10
1516
name cairo
1617
conflicts cairo-devel
1718
set my_name cairo
18-
version 1.17.6
19-
revision 2
20-
checksums rmd160 b02bab53ca0f77bc3b8d095a6bfde56d7ab8c988 \
21-
sha256 4eebc4c2bad0402bc3f501db184417094657d111fb6c06f076a82ea191fe1faf \
22-
size 35055900
19+
version 1.18.4
20+
revision 0
21+
checksums rmd160 757415ba8e1b5df92474644c887865a5ade9fd93 \
22+
sha256 445ed8208a6e4823de1226a74ca319d3600e83f6369f99b14265006599c32ccb \
23+
size 32578804
2324

2425
categories graphics
2526
maintainers {ryandesign @ryandesign} {mascguy @mascguy}
2627
license {LGPL-2.1 MPL-1.1}
2728
homepage https://www.cairographics.org
2829
master_sites ${homepage}/releases/
2930
platforms darwin macosx
30-
use_parallel_build yes
3131
dist_subdir ${my_name}
3232
distname ${my_name}-${version}
3333
use_xz yes
3434

35-
description a vector graphics library with cross-device output support
36-
37-
long_description Cairo is ${description}. It is designed to produce \
35+
description Cairo is a vector graphics library with cross-device output support
36+
long_description ${description}. It is designed to produce \
3837
identical output on all output media while taking \
3938
advantage of display hardware acceleration when \
4039
available (e.g. through the X Render Extension).
4140

42-
depends_build path:bin/pkg-config:pkgconfig
43-
44-
depends_lib path:lib/pkgconfig/pixman-1.pc:libpixman \
45-
path:lib/pkgconfig/glib-2.0.pc:glib2 \
46-
port:fontconfig \
47-
port:freetype \
48-
port:libpng \
49-
port:zlib \
50-
port:expat
51-
52-
minimum_xcodeversions {8 2.4.1}
53-
54-
patchfiles-append cairo-script-interpreter.pc.in.patch
41+
# Disable unexpected download of subprojects
42+
meson.wrap_mode nodownload
5543

56-
# Prevent cairo from using librsvg, libspectre, poppler.
57-
patchfiles-append patch-configure.diff
44+
set py_ver 3.14
45+
set py_ver_nodot [string map {. {}} ${py_ver}]
46+
configure.python ${prefix}/bin/python${py_ver}
5847

59-
# Don't check stderr in configure tests.
60-
patchfiles-append dont-check-stderr.patch
48+
# Upstream patch to correctly set dylib versions
49+
patchfiles-append patch-darwin-dylib-versions.diff
6150

62-
# Backport from 1.17.8 as that release is a major change
63-
# https://gitlab.freedesktop.org/cairo/cairo/-/merge_requests/316
64-
patchfiles-append memory-leak.patch
65-
66-
# https://trac.macports.org/ticket/34137
67-
compiler.blacklist-append {clang < 318.0.61}
68-
69-
if {![info exists universal_possible]} {
70-
set universal_possible [expr {${os.universal_supported} && [llength ${configure.universal_archs}] >= 2}]
71-
}
72-
# https://trac.macports.org/ticket/27011
73-
if {${configure.build_arch} eq "x86_64" || (${universal_possible} && [variant_isset universal] && "x86_64" in ${configure.universal_archs})} {
74-
compiler.blacklist-append gcc-4.0
51+
post-patch {
52+
fs-traverse f ${worksrcpath} {
53+
if {[string match *.py ${f}]} {
54+
ui_info "patching env python3: ${f}"
55+
reinplace -q "s|/usr/bin/env python3$|${configure.python}|" ${f}
56+
}
57+
}
7558
}
7659

77-
configure.args --disable-gl \
78-
--disable-quartz \
79-
--disable-quartz-font \
80-
--disable-quartz-image \
81-
--disable-silent-rules \
82-
--disable-symbol-lookup \
83-
--disable-xlib \
84-
--disable-xlib-xcb \
85-
--disable-xcb \
86-
--disable-xcb-shm \
87-
--without-x \
88-
--enable-ft \
89-
--enable-pdf \
90-
--enable-png \
91-
--enable-ps \
92-
--enable-script \
93-
--enable-svg \
94-
--enable-tee \
95-
--enable-xml
96-
97-
# Prevent cairo from using ghostscript.
98-
configure.args-append ac_cv_prog_GS=""
99-
100-
# Prevent cairo from using lzo2 because its GPL license makes cairo's effective license GPL too.
101-
configure.args-append ac_cv_lib_lzo2_lzo2a_decompress=no
102-
103-
variant opengl requires x11 description {Add OpenGL graphics interface} {
104-
depends_lib-append port:mesa
105-
106-
configure.args-replace --disable-gl --enable-gl
107-
configure.args-append --enable-glx
108-
}
60+
depends_build-append \
61+
path:bin/pkg-config:pkgconfig \
62+
port:python${py_ver_nodot}
63+
64+
depends_lib-append \
65+
port:expat \
66+
port:fontconfig \
67+
port:freetype \
68+
path:lib/pkgconfig/glib-2.0.pc:glib2 \
69+
path:lib/pkgconfig/pixman-1.pc:libpixman \
70+
port:libpng \
71+
port:lzo2 \
72+
port:zlib
73+
74+
# https://gitlab.freedesktop.org/cairo/cairo/-/issues/843
75+
compiler.c_standard 2011
76+
77+
configure.args-append \
78+
-Dfontconfig=enabled \
79+
-Dfreetype=enabled \
80+
-Dglib=enabled \
81+
-Dlzo=enabled \
82+
-Dpng=enabled \
83+
-Dquartz=disabled \
84+
-Dspectre=disabled \
85+
-Dsymbol-lookup=disabled \
86+
-Dtee=enabled \
87+
-Dtests=disabled \
88+
-Dxcb=disabled \
89+
-Dxlib=disabled \
90+
-Dxlib-xcb=disabled
10991

11092
platform macosx {
11193
variant quartz {
112-
configure.args-replace --disable-quartz --enable-quartz
113-
configure.args-replace --disable-quartz-font --enable-quartz-font
114-
configure.args-replace --disable-quartz-image --enable-quartz-image
94+
configure.args-replace \
95+
-Dquartz=disabled -Dquartz=enabled
11596
}
11697

11798
default_variants +quartz
@@ -120,24 +101,44 @@ platform macosx {
120101
variant_set quartz
121102
}
122103

123-
if {[string match *gcc-4.* ${configure.compiler}]} {
124-
# gcc-4 defaults to gnu89 which is "ISO C90 plus GNU extensions". We need gnu99.
125-
# https://gitlab.freedesktop.org/cairo/cairo/-/merge_requests/264
126-
configure.cflags-append -std=gnu99
127-
}
128-
129104
variant x11 {
130-
depends_lib-append port:xrender \
105+
depends_lib-append \
131106
port:xorg-libXext \
132-
port:xorg-xcb-util
133-
134-
configure.args-replace --disable-xcb --enable-xcb
135-
configure.args-replace --disable-xlib --enable-xlib
136-
configure.args-replace --disable-xlib-xcb --enable-xlib-xcb
137-
configure.args-replace --without-x --with-x
138-
configure.args-append --enable-xlib-xrender \
139-
--x-include=${prefix}/include \
140-
--x-lib=${prefix}/lib
107+
port:xorg-xcb-util \
108+
port:xrender
109+
110+
configure.args-replace -Dxcb=disabled -Dxcb=enabled
111+
configure.args-replace -Dxlib=disabled -Dxlib=enabled
112+
configure.args-replace -Dxlib-xcb=disabled -Dxlib-xcb=enabled
113+
}
114+
115+
proc port_test_ver_check {p_name p_ver p_rev} {
116+
if { [catch {set port_ver_info [lindex [registry_active ${p_name}] 0]}] } {
117+
error "Tests require that ${p_name} be active; install, then re-run tests"
118+
} else {
119+
set test_ver ${p_ver}_${p_rev}
120+
set port_ver [lindex ${port_ver_info} 1]_[lindex ${port_ver_info} 2]
121+
ui_info "port_test_ver_check: ${p_name}: test_ver: ${test_ver}; port_ver: ${port_ver}"
122+
123+
if { [vercmp ${port_ver} ${test_ver}] != 0 } {
124+
error "Tests require installed version of ${p_name} to match port; update, then re-run tests"
125+
}
126+
}
127+
}
128+
129+
variant tests description {Enable tests} {
130+
pre-configure {
131+
port_test_ver_check ${subport} ${version} ${revision}
132+
}
133+
134+
depends_build-append \
135+
port:ghostscript \
136+
path:lib/pkgconfig/librsvg-2.0.pc:librsvg \
137+
path:lib/pkgconfig/poppler.pc:poppler
138+
139+
configure.args-replace -Dtests=disabled -Dtests=enabled
140+
141+
test.run yes
141142
}
142143

143144
default_variants +x11
@@ -147,9 +148,6 @@ if {${os.platform} ne "darwin" || ${os.subplatform} ne "macosx"} {
147148
variant_set x11
148149
}
149150

150-
test.run yes
151-
test.target check
152-
153151
livecheck.type regex
154152
livecheck.url ${homepage}/news/
155-
livecheck.regex ${my_name}-(\[0-9\]+\\.\[0-9\]*\[02468\]\\.\[0-9\]+)
153+
livecheck.regex ${my_name}-(\[0-9.\]+)

graphics/cairo/files/cairo-script-interpreter.pc.in.patch

Lines changed: 0 additions & 11 deletions
This file was deleted.

graphics/cairo/files/dont-check-stderr.patch

Lines changed: 0 additions & 109 deletions
This file was deleted.

graphics/cairo/files/memory-leak.patch

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)