/
vte3.rb
133 lines (114 loc) 路 4.51 KB
/
vte3.rb
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
class Vte3 < Formula
desc "Terminal emulator widget used by GNOME terminal"
homepage "https://wiki.gnome.org/Apps/Terminal/VTE"
url "https://download.gnome.org/sources/vte/0.76/vte-0.76.0.tar.xz"
sha256 "bbce30b8f504370b12d6439c07a82993e97d7e9afe2dd367817cd58ff029ffda"
license "LGPL-2.0-or-later"
bottle do
sha256 arm64_sonoma: "892ea02960bc4181b02063267e27308267efb63ff0072f3fca87fbca07a91846"
sha256 arm64_ventura: "353caf0b86341b7d5598429da93c0c757fed16083ab7953fbcc6b0fb6b60e458"
sha256 arm64_monterey: "61c6b6495a55f0dc3df3a2b21227c9255e3323d3e505afc5dd6472481cff787a"
sha256 sonoma: "ff0df9539f33ce6b1cddf347817579976aee39b6ea6f0dadcaaf3665bb3fa1cc"
sha256 ventura: "04a2a17a3398254911b2abcdf38b388ec04207ccee9d929348141f5e4561c9be"
sha256 monterey: "7930996ddf6e46ab01c7ddf66a2a7e78303bf924c8dda11032140f98c0f2136b"
sha256 x86_64_linux: "d028c7a35181adb95038a83edfb704ac5a4e189eb1deec5f006428f09ea12003"
end
depends_on "gettext" => :build
depends_on "gobject-introspection" => :build
depends_on "meson" => :build
depends_on "ninja" => :build
depends_on "pkg-config" => [:build, :test]
depends_on "vala" => :build
depends_on "fribidi"
depends_on "glib"
depends_on "gnutls"
depends_on "gtk+3"
depends_on "gtk4"
depends_on "icu4c"
depends_on macos: :mojave
depends_on "pango"
depends_on "pcre2"
on_macos do
depends_on "gettext"
end
on_ventura :or_newer do
depends_on "llvm" => :build if DevelopmentTools.clang_build_version <= 1500
end
on_monterey :or_older do
# We use GCC on older macOS as build fails with brew `llvm`.
# Undefined symbols for architecture x86_64:
# "std::__1::__libcpp_verbose_abort(char const*, ...)", referenced from: ...
depends_on "gcc"
fails_with :clang
end
on_linux do
depends_on "linux-headers@5.15" => :build
depends_on "systemd"
end
fails_with :clang do
build 1500
cause "Requires C++20"
end
fails_with :gcc do
version "9"
cause "Requires C++20"
end
# submitted upstream as https://gitlab.gnome.org/tschoonj/vte/merge_requests/1
patch :DATA
def install
ENV.llvm_clang if OS.mac? && MacOS.version >= :ventura && DevelopmentTools.clang_build_version <= 1500
# Work around an Xcode 15 linker issue which causes linkage against LLVM's
# libunwind due to it being present in a library search path.
ENV.remove "HOMEBREW_LIBRARY_PATHS", Formula["llvm"].opt_lib if DevelopmentTools.clang_build_version == 1500
ENV["XML_CATALOG_FILES"] = etc/"xml/catalog"
system "meson", "setup", "build", "-Dgir=true",
"-Dgtk3=true",
"-Dgtk4=true",
"-Dgnutls=true",
"-Dvapi=true",
"-D_b_symbolic_functions=false",
*std_meson_args
system "meson", "compile", "-C", "build", "--verbose"
system "meson", "install", "-C", "build"
end
test do
ENV.clang if OS.mac? && (DevelopmentTools.clang_build_version <= 1200)
(testpath/"test.c").write <<~EOS
#include <vte/vte.h>
int main(int argc, char *argv[]) {
guint v = vte_get_major_version();
return 0;
}
EOS
flags = shell_output("pkg-config --cflags --libs vte-2.91").chomp.split
system ENV.cc, "test.c", "-o", "test", *flags
system "./test"
flags = shell_output("pkg-config --cflags --libs vte-2.91-gtk4").chomp.split
system ENV.cc, "test.c", "-o", "test", *flags
system "./test"
end
end
__END__
diff --git a/meson.build b/meson.build
index e2200a75..df98872f 100644
--- a/meson.build
+++ b/meson.build
@@ -78,6 +78,8 @@ lt_age = vte_minor_version * 100 + vte_micro_version - lt_revision
lt_current = vte_major_version + lt_age
libvte_gtk3_soversion = '@0@.@1@.@2@'.format(libvte_soversion, lt_current, lt_revision)
+osx_version_current = lt_current + 1
+libvte_gtk3_osxversions = [osx_version_current, '@0@.@1@.0'.format(osx_version_current, lt_revision)]
libvte_gtk4_soversion = libvte_soversion.to_string()
# i18n
diff --git a/src/meson.build b/src/meson.build
index 79d4a702..0495dea8 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -224,6 +224,7 @@ if get_option('gtk3')
vte_gtk3_api_name,
sources: libvte_gtk3_sources,
version: libvte_gtk3_soversion,
+ darwin_versions: libvte_gtk3_osxversions,
include_directories: incs,
dependencies: libvte_gtk3_deps,
cpp_args: libvte_gtk3_cppflags,