/
gnome-autoar.rb
79 lines (72 loc) 路 2.76 KB
/
gnome-autoar.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
class GnomeAutoar < Formula
desc "GNOME library for archive handling"
homepage "https://github.com/GNOME/gnome-autoar"
url "https://download.gnome.org/sources/gnome-autoar/0.4/gnome-autoar-0.4.4.tar.xz"
sha256 "c0afbe333bcf3cb1441a1f574cc8ec7b1b8197779145d4edeee2896fdacfc3c2"
license "LGPL-2.1-or-later"
revision 1
# gnome-autoar doesn't seem to follow the typical GNOME version format where
# even-numbered minor versions are stable, so we override the default regex
# from the `Gnome` strategy.
livecheck do
url :stable
regex(/gnome-autoar[._-]v?(\d+(?:\.\d+)+)\.t/i)
end
bottle do
sha256 cellar: :any, arm64_sonoma: "06419877711b70b28bfefab656263799dc2e171385758835c8a3f3fb9c96a383"
sha256 cellar: :any, arm64_ventura: "92031670a7ac7d4e194682d50b5d1e82e8f8649dde19666f51df72c15e6a1f50"
sha256 cellar: :any, arm64_monterey: "30c9eba06e7b6aad5c74ef031f6464200d74afa66dc7cf456dad9ad84b5b9b9b"
sha256 cellar: :any, sonoma: "5d4ec86efc0c3643cf9c2928f9c1bd124bc911fdeb591a1f7be94ada8357b510"
sha256 cellar: :any, ventura: "105dd6c94a1b2663cfc9f2f20763530ab2f6de724da58f4023e8297b33b2faa9"
sha256 cellar: :any, monterey: "5604b33340461e53b24bd9e9152356864bb21282605b562c2c2a8214a4bb7994"
sha256 x86_64_linux: "6787a6ab007ee12dccedee1c9be590a1e15d6bac032906b1225cee26cd9d31d1"
end
depends_on "meson" => :build
depends_on "ninja" => :build
depends_on "pkg-config" => :build
depends_on "gtk+3"
depends_on "libarchive"
def install
system "meson", "setup", "build", *std_meson_args
system "meson", "compile", "-C", "build", "--verbose"
system "meson", "install", "-C", "build"
end
def post_install
system "#{Formula["glib"].opt_bin}/glib-compile-schemas", "#{HOMEBREW_PREFIX}/share/glib-2.0/schemas"
end
test do
(testpath/"test.c").write <<~EOS
#include <gnome-autoar/gnome-autoar.h>
int main(int argc, char *argv[]) {
GType type = autoar_extractor_get_type();
return 0;
}
EOS
gettext = Formula["gettext"]
glib = Formula["glib"]
libarchive = Formula["libarchive"]
pcre = Formula["pcre"]
flags = (ENV.cflags || "").split + (ENV.cppflags || "").split + (ENV.ldflags || "").split
flags += %W[
-I#{gettext.opt_include}
-I#{glib.opt_include}/glib-2.0
-I#{glib.opt_lib}/glib-2.0/include
-I#{include}/gnome-autoar-0
-I#{libarchive.opt_include}
-I#{pcre.opt_include}
-D_REENTRANT
-L#{gettext.opt_lib}
-L#{glib.opt_lib}
-L#{libarchive.opt_lib}
-L#{lib}
-larchive
-lgio-2.0
-lglib-2.0
-lgnome-autoar-0
-lgobject-2.0
]
flags << "-lintl" if OS.mac?
system ENV.cc, "test.c", "-o", "test", *flags
system "./test"
end
end