61 lines
1.9 KiB
Ruby
61 lines
1.9 KiB
Ruby
class Libgee < Formula
|
|
desc "Collection library providing GObject-based interfaces"
|
|
homepage "https://wiki.gnome.org/Projects/Libgee"
|
|
url "https://download.gnome.org/sources/libgee/0.20/libgee-0.20.1.tar.xz"
|
|
sha256 "bb2802d29a518e8c6d2992884691f06ccfcc25792a5686178575c7111fea4630"
|
|
revision 2
|
|
|
|
bottle do
|
|
cellar :any
|
|
sha256 "4653b354ea0d94644d7513ec272cd32a19f6a62d24e1a9459513c562e77cd015" => :mojave
|
|
sha256 "98cceed95e7149d47d582970872896150aca66dda0f26915785dc24ce58de5b0" => :high_sierra
|
|
sha256 "cd38211f0a12c738e8537e94aeca8dfe992062ed3e9d44cc2a15148a57eefd6c" => :sierra
|
|
end
|
|
|
|
depends_on "gobject-introspection" => :build
|
|
depends_on "pkg-config" => :build
|
|
depends_on "vala" => :build
|
|
depends_on "glib"
|
|
|
|
def install
|
|
# ensures that the gobject-introspection files remain within the keg
|
|
inreplace "gee/Makefile.in" do |s|
|
|
s.gsub! "@HAVE_INTROSPECTION_TRUE@girdir = @INTROSPECTION_GIRDIR@",
|
|
"@HAVE_INTROSPECTION_TRUE@girdir = $(datadir)/gir-1.0"
|
|
s.gsub! "@HAVE_INTROSPECTION_TRUE@typelibdir = @INTROSPECTION_TYPELIBDIR@",
|
|
"@HAVE_INTROSPECTION_TRUE@typelibdir = $(libdir)/girepository-1.0"
|
|
end
|
|
|
|
system "./configure", "--prefix=#{prefix}",
|
|
"--disable-dependency-tracking"
|
|
system "make", "install"
|
|
end
|
|
|
|
test do
|
|
(testpath/"test.c").write <<~EOS
|
|
#include <gee.h>
|
|
|
|
int main(int argc, char *argv[]) {
|
|
GType type = gee_traversable_stream_get_type();
|
|
return 0;
|
|
}
|
|
EOS
|
|
gettext = Formula["gettext"]
|
|
glib = Formula["glib"]
|
|
flags = %W[
|
|
-I#{gettext.opt_include}
|
|
-I#{glib.opt_include}/glib-2.0
|
|
-I#{glib.opt_lib}/glib-2.0/include
|
|
-I#{include}/gee-0.8
|
|
-L#{gettext.opt_lib}
|
|
-L#{glib.opt_lib}
|
|
-L#{lib}
|
|
-lgee-0.8
|
|
-lglib-2.0
|
|
-lgobject-2.0
|
|
-lintl
|
|
]
|
|
system ENV.cc, "test.c", "-o", "test", *flags
|
|
system "./test"
|
|
end
|
|
end
|