homebrew-core/Formula/libgee.rb

63 lines
2.0 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 1
bottle do
cellar :any
sha256 "8bda00ec686771f7d42a63085b9e11c93202cc9b90adbbc5f61a699666c99db8" => :mojave
sha256 "d4afb1bbccfd61b0a106595356d5f571a0df6a5fb0fd5e378c8321a46e152c1b" => :high_sierra
sha256 "b70794b96ce5d21dc3dac66f4e0e63177d7507c723d78a786110dc502d7777e1" => :sierra
sha256 "7602f76b0667a7dd1527c01285274c2cca24d5e638b9a0c4a90cbc004d5e097e" => :el_capitan
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