homebrew-core/Formula/glade.rb

123 lines
3.4 KiB
Ruby

class Glade < Formula
desc "RAD tool for the GTK+ and GNOME environment"
homepage "https://glade.gnome.org/"
url "https://download.gnome.org/sources/glade/3.38/glade-3.38.0.tar.xz"
sha256 "4a914c5c0b19c2e52fd4ad15077d406dbfd6ad0245e239d7390bf87f27d9103c"
license "LGPL-2.1-or-later"
livecheck do
url :stable
end
bottle do
sha256 "6515685fbaeb74c04c1f4675cf17d9c54cce4af36e170c2f9aca1959621a65a4" => :catalina
sha256 "90865743d18a4b8d279188bbc43b0f33a96c1bdc0ee842e8e359ac8d73beec7c" => :mojave
sha256 "f848a368c7db196b03c15e59ca6b01b2c48aaed710c7adb81594a5e3aab4347a" => :high_sierra
end
depends_on "docbook-xsl" => :build
depends_on "gobject-introspection" => :build
depends_on "itstool" => :build
depends_on "meson" => :build
depends_on "ninja" => :build
depends_on "pkg-config" => :build
depends_on "adwaita-icon-theme"
depends_on "gettext"
depends_on "gtk+3"
depends_on "gtk-mac-integration"
depends_on "hicolor-icon-theme"
depends_on "libxml2"
def install
# Find our docbook catalog
ENV["XML_CATALOG_FILES"] = "#{etc}/xml/catalog"
# Disable icon-cache update
ENV["DESTDIR"] = "/"
mkdir "build" do
system "meson", *std_meson_args, "-Dintrospection=true", "-Dgladeui=true", ".."
system "ninja"
system "ninja", "install"
end
end
def post_install
system "#{Formula["gtk+3"].opt_bin}/gtk3-update-icon-cache", "-f", "-t", "#{HOMEBREW_PREFIX}/share/icons/hicolor"
end
test do
# executable test (GUI)
system "#{bin}/glade", "--version"
# API test
(testpath/"test.c").write <<~EOS
#include <gladeui/glade.h>
int main(int argc, char *argv[]) {
gboolean glade_util_have_devhelp();
return 0;
}
EOS
ENV.libxml2
atk = Formula["atk"]
cairo = Formula["cairo"]
fontconfig = Formula["fontconfig"]
freetype = Formula["freetype"]
gdk_pixbuf = Formula["gdk-pixbuf"]
gettext = Formula["gettext"]
glib = Formula["glib"]
gtkx3 = Formula["gtk+3"]
harfbuzz = Formula["harfbuzz"]
libepoxy = Formula["libepoxy"]
libpng = Formula["libpng"]
pango = Formula["pango"]
pcre = Formula["pcre"]
pixman = Formula["pixman"]
flags = (ENV.cflags || "").split + (ENV.cppflags || "").split + (ENV.ldflags || "").split
flags += %W[
-I#{atk.opt_include}/atk-1.0
-I#{cairo.opt_include}/cairo
-I#{fontconfig.opt_include}
-I#{freetype.opt_include}/freetype2
-I#{gdk_pixbuf.opt_include}/gdk-pixbuf-2.0
-I#{gettext.opt_include}
-I#{glib.opt_include}/gio-unix-2.0/
-I#{glib.opt_include}/glib-2.0
-I#{glib.opt_lib}/glib-2.0/include
-I#{gtkx3.opt_include}/gtk-3.0
-I#{harfbuzz.opt_include}/harfbuzz
-I#{include}/libgladeui-2.0
-I#{libepoxy.opt_include}
-I#{libpng.opt_include}/libpng16
-I#{pango.opt_include}/pango-1.0
-I#{pcre.opt_include}
-I#{pixman.opt_include}/pixman-1
-D_REENTRANT
-L#{atk.opt_lib}
-L#{cairo.opt_lib}
-L#{gdk_pixbuf.opt_lib}
-L#{gettext.opt_lib}
-L#{glib.opt_lib}
-L#{gtkx3.opt_lib}
-L#{lib}
-L#{pango.opt_lib}
-latk-1.0
-lcairo
-lcairo-gobject
-lgdk-3
-lgdk_pixbuf-2.0
-lgio-2.0
-lgladeui-2
-lglib-2.0
-lgobject-2.0
-lgtk-3
-lintl
-lpango-1.0
-lpangocairo-1.0
-lxml2
]
system ENV.cc, "test.c", "-o", "test", *flags
system "./test"
end
end