-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathwxwidgets.rb
109 lines (93 loc) · 3.71 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" }
revision 2
head "https://github.com/wxWidgets/wxWidgets.git", branch: "master"
livecheck do
url :stable
strategy :github_latest
end
bottle do
root_url "https://ghcr.io/v2/cdalvaro/tap"
sha256 cellar: :any, arm64_sequoia: "5a917d6ec4b790d63d9d509ad4b5f62952cfc572c0a2b6ebde49d0dc57407396"
sha256 cellar: :any, arm64_sonoma: "c95216fcaf1ec7c569ac02475adce7480e6f27673d018d2e57b66ba52d30cc47"
sha256 cellar: :any, ventura: "723b6b7efe2fa9b70edce51edfc6449aea27d8aa86a89ab0666aa884194cedf4"
sha256 cellar: :any_skip_relocation, x86_64_linux: "0416ba85b395d59aeb802520b6f8e5b98f55c857683edd5d0f5670b8b46c1c83"
end
option "with-enable-abort", "Allows to abort a wxProgressDialog"
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 "gtk+3"
depends_on "libsm"
depends_on "mesa-glu"
end
resource "enable_abort" do
url "https://raw.githubusercontent.com/cdalvaro/homebrew-tap/55724bef53cb80b9d6019f50cc915101c460bc48/patches/wxwidgets/enable_abort.diff"
sha256 "2c14fb49da7ab4144fba1793fde80eedcb6201d7bf765d9c1c17b1f0b90851c8"
end
def install
if build.with? "enable-abort"
resource("enable_abort").stage do
system "patch", "-p1", "-d", buildpath, "-i", "#{pwd}/enable_abort.diff"
end
end
# 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