homebrew-core/Formula/libgee.rb

60 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.0.tar.xz"
sha256 "21308ba3ed77646dda2e724c0e8d5a2f8d101fb05e078975a532d7887223c2bb"
bottle do
cellar :any
sha256 "def51b848030a5079529f08b9886177e93fa88133b39a7db5fc94f681cbca19d" => :sierra
sha256 "cd590c7857ad9bc2485d057cf7d4ec1e55555af4875479bfa7a416ddc02618ec" => :el_capitan
sha256 "c05334f4f4a72e3185ea1130a10ab939dce5ba3cf7d40a9056fc1973957c5dd3" => :yosemite
end
depends_on "pkg-config" => :build
depends_on "vala" => :build
depends_on "gobject-introspection"
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.undent
#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