homebrew-core/Formula/libhandy.rb

102 lines
3.0 KiB
Ruby

class Libhandy < Formula
desc "Building blocks for modern adaptive GNOME apps"
homepage "https://gitlab.gnome.org/GNOME/libhandy"
url "https://download.gnome.org/sources/libhandy/1.4/libhandy-1.4.0.tar.xz"
sha256 "2676d51fa1fa40fdee7497d3e763fefa18b0338bffcd2ee32e7f7e633c885446"
license "LGPL-2.1-or-later"
bottle do
sha256 arm64_big_sur: "67c5f4982894646b07942c0f387443c2aac2813167aaa3de9197cd760fc93e5b"
sha256 big_sur: "337f9be107164821d8436c443c20dcb79d66bc3268fac909ace2878432bcc652"
sha256 catalina: "2e04f3f8004ac544fea47905a65a6597908b8ced6dadd5c330d87b8a310951d9"
sha256 mojave: "a8972dc9efc8c2d6a6fe0f038ebda941a741c3e0d7be57b51b9c634120d1a479"
sha256 x86_64_linux: "17515106b873bbdbc591ca0daca12c043485e6a52b478cff912f9a835620c825"
end
depends_on "gettext" => :build
depends_on "gobject-introspection" => :build
depends_on "meson" => :build
depends_on "ninja" => :build
depends_on "pkg-config" => :build
depends_on "vala" => :build
depends_on "gtk+3"
def install
mkdir "build" do
system "meson", *std_meson_args, "-Dglade_catalog=disabled", ".."
system "ninja", "-v"
system "ninja", "install", "-v"
end
end
test do
(testpath/"test.c").write <<~EOS
#include <gtk/gtk.h>
#include <handy.h>
int main(int argc, char *argv[]) {
gtk_init (&argc, &argv);
hdy_init ();
HdyLeaflet *leaflet = HDY_LEAFLET (hdy_leaflet_new ());
return 0;
}
EOS
atk = Formula["atk"]
cairo = Formula["cairo"]
fontconfig = Formula["fontconfig"]
freetype = Formula["freetype"]
gdk_pixbuf = Formula["gdk-pixbuf"]
gettext = Formula["gettext"]
glib = Formula["glib"]
gtk = Formula["gtk+3"]
harfbuzz = Formula["harfbuzz"]
libpng = Formula["libpng"]
pango = Formula["pango"]
pixman = Formula["pixman"]
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}/glib-2.0
-I#{glib.opt_lib}/glib-2.0/include
-I#{gtk.opt_include}/gtk-3.0
-I#{gtk.opt_lib}/gtk-3.0/include
-I#{harfbuzz.opt_include}/harfbuzz
-I#{include}/libhandy-1
-I#{libpng.opt_include}/libpng16
-I#{lib}/libhandy-1/include
-I#{pango.opt_include}/pango-1.0
-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#{gtk.opt_lib}
-L#{lib}
-L#{pango.opt_lib}
-latk-1.0
-lcairo
-lgdk_pixbuf-2.0
-lgio-2.0
-lglib-2.0
-lgobject-2.0
-lgtk-3
-lhandy-1
-lpango-1.0
-lpangocairo-1.0
]
on_macos do
flags << "-lintl"
end
system ENV.cc, "test.c", "-o", "test", *flags
# Don't have X/Wayland in Docker
on_macos do
system "./test"
end
end
end