33PortSystem 1.0
44PortGroup debug 1.0
55PortGroup legacysupport 1.1
6+ PortGroup meson 1.0
67PortGroup muniversal 1.0
78PortGroup xcodeversion 1.0
89
@@ -15,103 +16,83 @@ legacysupport.newest_darwin_requires_legacy 10
1516name cairo
1617conflicts cairo-devel
1718set 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
2425categories graphics
2526maintainers {ryandesign @ryandesign} {mascguy @mascguy}
2627license {LGPL-2.1 MPL-1.1}
2728homepage https://www.cairographics.org
2829master_sites ${homepage} /releases/
2930platforms darwin macosx
30- use_parallel_build yes
3131dist_subdir ${my_name}
3232distname ${my_name} -${version}
3333use_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
55-
56- # Prevent cairo from using librsvg, libspectre, poppler.
57- patchfiles-append patch-configure.diff
41+ # Disable unexpected download of subprojects
42+ meson.wrap_mode nodownload
5843
59- # Don't check stderr in configure tests.
60- patchfiles-append dont-check-stderr.patch
44+ set py_ver 3.14
45+ set py_ver_nodot [string map {. {}} ${py_ver} ]
46+ configure.python ${prefix} /bin/python${py_ver}
6147
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
48+ # Upstream patch to correctly set dylib versions
49+ patchfiles-append patch-darwin-dylib-versions.diff
6550
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-devel \
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
11092platform 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-
129104variant 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
143144default_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-
153151livecheck.type regex
154152livecheck.url ${homepage} /news/
155- livecheck.regex ${my_name} -(\[ 0-9\] + \\ . \[ 0-9 \] * \[ 02468 \]\\ . \[ 0-9 \] +)
153+ livecheck.regex ${my_name} -(\[ 0-9. \] +)
0 commit comments