homebrew-core/Formula/geocode-glib.rb
2017-08-08 21:31:43 +02:00

67 lines
2.3 KiB
Ruby

class GeocodeGlib < Formula
desc "GNOME library for gecoding and reverse geocoding"
homepage "https://developer.gnome.org/geocode-glib"
url "https://download.gnome.org/sources/geocode-glib/3.24/geocode-glib-3.24.0.tar.xz"
sha256 "19c1fef4fd89eb4bfe6decca45ac45a2eca9bb7933be560ce6c172194840c35e"
bottle do
sha256 "3af6bf5e3659bfc8dac46ebaecb0417725be9fc7bd134dd3e8353c2df2717eec" => :sierra
sha256 "260248e1447facf30f3f37a3104967d4798a4093ed93b1cff618e8ae62c26c53" => :el_capitan
sha256 "5f50e0e5db2c81fb487586ed701490a2253836cb1804fe051137007bb4af34bd" => :yosemite
end
depends_on "pkg-config" => :build
depends_on "gtk+3"
depends_on "json-glib"
depends_on "libsoup"
depends_on "gobject-introspection"
def install
# forces use of gtk3-update-icon-cache instead of gtk-update-icon-cache. No bugreport should
# be filed for this since it only occurs because Homebrew renames gtk+3's gtk-update-icon-cache
# to gtk3-update-icon-cache in order to avoid a collision between gtk+ and gtk+3.
inreplace "icons/Makefile.in", "gtk-update-icon-cache", "gtk3-update-icon-cache"
system "./configure", "--disable-debug",
"--disable-dependency-tracking",
"--disable-silent-rules",
"--prefix=#{prefix}"
system "make", "install"
# delete icon cache file -> create it post_install
rm share/"icons/gnome/icon-theme.cache"
end
def post_install
system "#{Formula["gtk+3"].opt_bin}/gtk3-update-icon-cache", "-f", "-t", "#{HOMEBREW_PREFIX}/share/icons/gnome"
end
test do
(testpath/"test.c").write <<-EOS.undent
#include <geocode-glib/geocode-glib.h>
int main(int argc, char *argv[]) {
GeocodeLocation *loc = geocode_location_new(1.0, 1.0, 1.0);
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}/geocode-glib-1.0
-D_REENTRANT
-L#{gettext.opt_lib}
-L#{glib.opt_lib}
-L#{lib}
-lgeocode-glib
-lgio-2.0
-lglib-2.0
-lgobject-2.0
-lintl
]
system ENV.cc, "test.c", "-o", "test", *flags
system "./test"
end
end