-
-
Notifications
You must be signed in to change notification settings - Fork 12.4k
/
wxwidgets.rb
109 lines (96 loc) · 3.92 KB
/
wxwidgets.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
class Wxwidgets < Formula
desc "Cross-platform C++ GUI toolkit"
homepage "https://www.wxwidgets.org"
url "https://github.com/wxWidgets/wxWidgets/releases/download/v3.2.6/wxWidgets-3.2.6.tar.bz2"
sha256 "939e5b77ddc5b6092d1d7d29491fe67010a2433cf9b9c0d841ee4d04acb9dce7"
license "LGPL-2.0-or-later" => { with: "WxWindows-exception-3.1" }
head "https://github.com/wxWidgets/wxWidgets.git", branch: "master"
livecheck do
url :stable
strategy :github_latest
end
bottle do
sha256 cellar: :any, arm64_sequoia: "477825cb9a317d0f99e16ba96a5288fd5495af9308ef2b67587833ea4c3434d6"
sha256 cellar: :any, arm64_sonoma: "3e24e13b0986b99ad7db4b72f7235403cf2eac9a6f8d6a8aff5242880f79153a"
sha256 cellar: :any, arm64_ventura: "3b409e2c9e174f7165a143a8891c0c4988901a1dffaea254c30744a47ed3606b"
sha256 cellar: :any, arm64_monterey: "9d6ec48436c89048893710d3974f52279a1077c4379795c14afb1bb160b64fd0"
sha256 cellar: :any, sonoma: "38c049274c539fc0af3c2dcd2f94942b06c6f46f92e5dbdb0472a4950ef75146"
sha256 cellar: :any, ventura: "829da67086e26ce6ce6f94de2c77e453892a0625f55d0babe2fed34e27b62106"
sha256 cellar: :any, monterey: "54bd30c0fc5623a8cbf1f6c318934cc38644396f63c9d8abb7407b05076e7eac"
sha256 cellar: :any_skip_relocation, x86_64_linux: "1b2caf603dfed363a25a93862bcecd9a006ac82fdb3154125ccf1ff860cc5f1a"
end
depends_on "pkg-config" => :build
depends_on "jpeg-turbo"
depends_on "libpng"
depends_on "libtiff"
depends_on "pcre2"
uses_from_macos "expat"
uses_from_macos "zlib"
on_linux do
depends_on "cairo"
depends_on "fontconfig"
depends_on "gdk-pixbuf"
depends_on "glib"
depends_on "gtk+3"
depends_on "libsm"
depends_on "libx11"
depends_on "libxkbcommon"
depends_on "libxtst"
depends_on "libxxf86vm"
depends_on "mesa"
depends_on "mesa-glu"
depends_on "pango"
depends_on "wayland"
end
def install
# Remove all bundled libraries excluding `nanosvg` which isn't available as formula
%w[catch pcre].each { |l| rm_r(buildpath/"3rdparty"/l) }
%w[expat jpeg png tiff zlib].each { |l| rm_r(buildpath/"src"/l) }
args = [
"--prefix=#{prefix}",
"--enable-clipboard",
"--enable-controls",
"--enable-dataviewctrl",
"--enable-display",
"--enable-dnd",
"--enable-graphics_ctx",
"--enable-std_string",
"--enable-svg",
"--enable-unicode",
"--enable-webviewwebkit",
"--with-expat",
"--with-libjpeg",
"--with-libpng",
"--with-libtiff",
"--with-opengl",
"--with-zlib",
"--disable-dependency-tracking",
"--disable-tests",
"--disable-precomp-headers",
# This is the default option, but be explicit
"--disable-monolithic",
]
if OS.mac?
# Set with-macosx-version-min to avoid configure defaulting to 10.5
args << "--with-macosx-version-min=#{MacOS.version}"
args << "--with-osx_cocoa"
args << "--with-libiconv"
# Work around deprecated Carbon API, see
# https://github.com/wxWidgets/wxWidgets/issues/24724
inreplace "src/osx/carbon/dcscreen.cpp", "#if !wxOSX_USE_IPHONE", "#if 0" if MacOS.version >= :sequoia
end
system "./configure", *args
system "make", "install"
# wx-config should reference the public prefix, not wxwidgets's keg
# this ensures that Python software trying to locate wxpython headers
# using wx-config can find both wxwidgets and wxpython headers,
# which are linked to the same place
inreplace bin/"wx-config", prefix, HOMEBREW_PREFIX
# For consistency with the versioned wxwidgets formulae
bin.install_symlink bin/"wx-config" => "wx-config-#{version.major_minor}"
(share/"wx"/version.major_minor).install share/"aclocal", share/"bakefile"
end
test do
system bin/"wx-config", "--libs"
end
end