-
-
Notifications
You must be signed in to change notification settings - Fork 12.7k
/
Copy pathlibadwaita.rb
71 lines (61 loc) · 2.59 KB
/
libadwaita.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
class Libadwaita < Formula
desc "Building blocks for modern adaptive GNOME applications"
homepage "https://gnome.pages.gitlab.gnome.org/libadwaita/"
url "https://download.gnome.org/sources/libadwaita/1.7/libadwaita-1.7.2.tar.xz"
sha256 "28ee2ff589c6debe47af9da7a56e37c97d6849e003918a4b223f690d25f960be"
license "LGPL-2.1-or-later"
# libadwaita doesn't use GNOME's "even-numbered minor is stable" version
# scheme. This regex is the same as the one generated by the `Gnome` strategy
# but it's necessary to avoid the related version scheme logic.
livecheck do
url :stable
regex(/libadwaita-(\d+(?:\.\d+)+)\.t/i)
end
bottle do
sha256 arm64_sequoia: "a6cd29f65a2523969a6ce60b4b55c26bae9e6d3774280b3a6f8704e7035ab478"
sha256 arm64_sonoma: "8d3b6c45f883b8dbb3f795adf483307beb460543d4f08f684e1dfe35f8ffc700"
sha256 arm64_ventura: "ffa104fca831bb0954dcf9a1a8c2ec837d785c9fb1e8fa61b0bffde29dfd05c7"
sha256 sonoma: "91be86a27e9585bcf6f2dc8c0e3f351c06ebc03cc353324595c63d3713ceabb8"
sha256 ventura: "38b6d3aa98ef9557fea75603fb9f794a0d6c8b8f16329803c82d21b05447e54b"
sha256 arm64_linux: "6157e7bb3add9ea9b45493cad6b4f6cb5f9a9d1f2f7e968285bf1d4a40703685"
sha256 x86_64_linux: "9522ec872c8c4e0b87c7d37e7b311f675b066a8548b66c1187dfa38a314189cc"
end
depends_on "gettext" => :build
depends_on "gobject-introspection" => :build
depends_on "meson" => :build
depends_on "ninja" => :build
depends_on "pkgconf" => [:build, :test]
depends_on "sassc" => :build
depends_on "vala" => :build
depends_on "appstream"
depends_on "fribidi"
depends_on "glib"
depends_on "graphene"
depends_on "gtk4"
depends_on "libsass"
depends_on "pango"
uses_from_macos "python" => :build
on_macos do
depends_on "gettext"
end
def install
system "meson", "setup", "build", "-Dtests=false", *std_meson_args
system "meson", "compile", "-C", "build", "--verbose"
system "meson", "install", "-C", "build"
end
test do
(testpath/"test.c").write <<~C
#include <adwaita.h>
int main(int argc, char *argv[]) {
g_autoptr (AdwApplication) app = NULL;
app = adw_application_new ("org.example.Hello", G_APPLICATION_DEFAULT_FLAGS);
return g_application_run (G_APPLICATION (app), argc, argv);
}
C
flags = shell_output("#{Formula["pkgconf"].opt_bin}/pkgconf --cflags --libs libadwaita-1").strip.split
system ENV.cc, "test.c", "-o", "test", *flags
system "./test", "--help"
# include a version check for the pkg-config files
assert_match version.to_s, (lib/"pkgconfig/libadwaita-1.pc").read
end
end