/
Portfile
211 lines (173 loc) · 7.57 KB
/
Portfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4
PortSystem 1.0
PortGroup active_variants 1.1
PortGroup legacysupport 1.1
PortGroup meson 1.0
# O_CLOEXEC
legacysupport.newest_darwin_requires_legacy 10
name gtk4
conflicts gtk4-devel
set my_name gtk4
# GNOME project name
set gname gtk
version 4.14.3
revision 0
categories gnome
license LGPL-2.1+
maintainers {mascguy @mascguy} openmaintainer
description ${my_name} is a companion library to GObject and Gtk+.
long_description ${description} It includes a collection of dazzling Gtk widgets, \
data structures, search engines, a shortcut engine, panels, \
desktop integration, and those missing pieces from common libraries \
that help you write cleaner and safer code
homepage https://gitlab.gnome.org/GNOME/${gname}
set branch [join [lrange [split ${version} .] 0 1] .]
master_sites gnome:sources/${gname}/${branch}/
distname ${gname}-${version}
dist_subdir ${my_name}
use_xz yes
checksums rmd160 058ea1318ea0e21d678a95278e1f19696763ae10 \
sha256 2be5c858bdef1104d37848c9779c089372c8d31503f6efc4b94e53b546fc9a43 \
size 18340444
# Disable unexpected download of subprojects
meson.wrap_mode nodownload
set python_branch 3.12
set python_version [string map {. {}} ${python_branch}]
set port_ver_major [lindex [split ${version} .] 0]
# Specify name of executable for 'rst2man'. MacPorts-specific.
patchfiles-append patch-docs-rst2man.diff
# Don't allow build to promote warnings to errors. Full details in patchfile.
# See: https://trac.macports.org/ticket/67985
patchfiles-append patch-meson-build-debug.diff
post-patch {
reinplace "s|@@PYTHON_VERSION@@|${python_branch}|g" \
docs/reference/gtk/meson.build
# build assumes python3 exists
reinplace "s|^#!/usr/bin/env python3|#!${prefix}/bin/python${python_branch}|" \
build-aux/meson/dist-data.py \
build-aux/meson/gen-profile-conf.py \
build-aux/meson/gen-visibility-macros.py \
demos/gtk-demo/geninclude.py \
gdk/broadway/gen-c-array.py \
gdk/gen-gdk-gresources-xml.py \
gsk/gen-gsk-gresources-xml.py \
gsk/gpu/shaders/generate-header.py \
gsk/gpu/shaders/process-glsl-includes.py \
gtk/gen-gtk-gresources-xml.py \
gtk/gentypefuncs.py \
testsuite/introspection/api.py \
tools/generate-uac-manifest.py
# these are slightly different
reinplace "s|python3|${prefix}/bin/python${python_branch}|" \
examples/squares.py
}
depends_build-append \
port:docbook-xml \
port:docbook-xsl-nons \
port:gettext \
path:lib/pkgconfig/gobject-introspection-1.0.pc:gobject-introspection \
port:pkgconfig \
port:py${python_version}-docutils \
port:sassc
depends_lib-append \
path:lib/pkgconfig/cairo.pc:cairo \
port:fribidi \
path:lib/pkgconfig/gdk-pixbuf-2.0.pc:gdk-pixbuf2 \
port:gettext-runtime \
path:lib/pkgconfig/glib-2.0.pc:glib2 \
port:graphene \
path:lib/pkgconfig/harfbuzz.pc:harfbuzz \
port:hicolor-icon-theme \
port:iso-codes \
port:libepoxy \
path:include/turbojpeg.h:libjpeg-turbo \
port:libpng \
path:lib/pkgconfig/librsvg-2.0.pc:librsvg \
port:mesa \
path:lib/pkgconfig/pango.pc:pango \
port:tiff
license_noconflict gobject-introspection
compiler.c_standard 2011
compiler.cxx_standard 2017
configure.args-append \
-Dbuild-examples=false \
-Dbuild-tests=false \
-Dbuild-testsuite=false \
-Ddocumentation=false \
-Dintrospection=enabled \
-Dman-pages=true \
-Dmedia-gstreamer=disabled \
-Dprint-cups=disabled
# gobject-introspection uses g-ir-scanner, which uses $CC from env
if {${universal_possible} && [variant_isset universal]} {
foreach arch ${configure.universal_archs} {
lappend merger_build_env(${arch}) \
"CC=${configure.cc} -arch ${arch}"
lappend merger_destroot_env(${arch}) \
"CC=${configure.cc} -arch ${arch}"
}
} else {
build.env-append "CC=${configure.cc} ${configure.cc_archflags}"
destroot.env-append "CC=${configure.cc} ${configure.cc_archflags}"
}
variant broadway description {Enable the broadway (HTML5) gdk backend} {
configure.args-append -Dbroadway-backend=true
}
variant quartz conflicts x11 {
require_active_variants path:lib/pkgconfig/cairo.pc:cairo quartz
require_active_variants path:lib/pkgconfig/pango.pc:pango quartz
configure.args-append -Dx11-backend=false -Dmacos-backend=true
if {${os.platform} eq "darwin" && ${os.major} < 16} {
# Add AppKit wrapper header to compiler library paths
configure.cflags-prepend -isystem ${filespath}/old_appkit_compat
configure.cxxflags-prepend -isystem ${filespath}/old_appkit_compat
configure.objcflags-prepend -isystem ${filespath}/old_appkit_compat
configure.objcxxflags-prepend -isystem ${filespath}/old_appkit_compat
}
if {${os.platform} eq "darwin" && ${os.major} < 15} {
depends_build
depends_lib
depends_run
archive_sites
known_fail yes
pre-fetch {
ui_error "${name} +quartz is not supported on this os version at present."
return -code error {unsupported platform}
}
}
}
variant x11 conflicts quartz {
require_active_variants path:lib/pkgconfig/cairo.pc:cairo x11
require_active_variants path:lib/pkgconfig/pango.pc:pango x11
patchfiles-append patch-gtk4-x11.diff
depends_lib-append port:libxkbcommon-x11 \
port:xorg-libXrandr \
port:xorg-libXcursor \
port:xorg-libXinerama \
port:xorg-libXi
configure.args-append -Dx11-backend=true -Dmacos-backend=false
}
if {![variant_isset quartz]} {
# it is somewhat illogical to default to a variant that cannot build, however
# this matches the rest of macports and will tweak users to build as +quartz manually
default_variants +x11
}
variant tests description "build tests" {
depends_test-append port:py${python_version}-gobject3
# NB. Most of the tests fail if gtk4 has already been installed before running them
configure.args-replace -Dbuild-tests=false \
-Dbuild-tests=true
configure.args-replace -Dbuild-testsuite=false \
-Dbuild-testsuite=true
test.run yes
test.cmd meson
test.target test
}
platform darwin 8 {
# meson on Tiger cannot use rpaths, so we workaround with this to find dylib
build.env-append "DYLD_LIBRARY_PATH=${build_dir}/${gname}"
destroot.env-append "DYLD_LIBRARY_PATH=${build_dir}/${gname}"
}
livecheck.type gnome
livecheck.name ${gname}
livecheck.regex "LATEST-IS-(${port_ver_major}\\.\\d*\[02468\](?:\\.\\d+)*)"