homebrew-core/Formula/libhandy.rb

99 lines
3.1 KiB
Ruby

class Libhandy < Formula
desc "Building blocks for modern adaptive GNOME apps"
homepage "https://gitlab.gnome.org/GNOME/libhandy"
url "https://gitlab.gnome.org/GNOME/libhandy/-/archive/1.6.2/libhandy-1.6.2.tar.gz"
sha256 "42247aac9f06e1083f5b0ea3f114f36f647e1b35b84089ad1b66d89ba2dc777e"
license "LGPL-2.1-or-later"
bottle do
sha256 arm64_monterey: "9bfcb69be81e5aabb383000523e1ef93583822fa0e23884494ac132a9852149a"
sha256 arm64_big_sur: "77f7cc160e8479f1bba4da15bbcd1a29536766c793f8ca201df59c81e2c9d4c0"
sha256 monterey: "301c0abe14b96657a3ec17224df3a73e89adf897eb78efd808a3124b040a0c21"
sha256 big_sur: "024deeb5265f53ef9704418c3460cc0e2e0dc420d5d7e82feb1fdf4f5f4636a0"
sha256 catalina: "d8e95733e8c0d854ba05523cc38cba209971528b57cac86572c5580a689bba56"
sha256 x86_64_linux: "f45efbcfd848c1b75ae8d8cf65307ffbd77a9068d4e25ad1a2fcb30ce906ddff"
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
]
flags << "-lintl" if OS.mac?
system ENV.cc, "test.c", "-o", "test", *flags
# Don't have X/Wayland in Docker
system "./test" if OS.mac?
end
end