100 lines
3.2 KiB
Ruby
100 lines
3.2 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.8.1/libhandy-1.8.1.tar.gz"
|
|
sha256 "ae6b00e038542987de969fdf34aab4b9063a85f861017614539d8fab5d94a7a6"
|
|
license "LGPL-2.1-or-later"
|
|
|
|
bottle do
|
|
sha256 arm64_ventura: "39679ec8fce079fc0f411fe8a32b3548579f514f076ba10882d3c8562fe901a0"
|
|
sha256 arm64_monterey: "c16cbf318c00f7c1afe8bc085b7f9db8a13608e296d1a963001a1051bf10eb37"
|
|
sha256 arm64_big_sur: "8e65b4c5fd0c053df960826292e9a6f6aa59409af4eb966b5b9ce35708fb760e"
|
|
sha256 ventura: "860d3d87e47b85db4ab56aec37d152c34107155ecb3e4922356b33928736f18e"
|
|
sha256 monterey: "19d5dbefe91bec96e155222d38f5785b71778ce6b88c8e1567e099754e35f1c8"
|
|
sha256 big_sur: "3bfe48e27586f0e5737444c9921d0b17678dce5c42b70758ae196482ec8fa65b"
|
|
sha256 x86_64_linux: "f1cbf2606ce4b16cce57c9fafcc1e8227f2332fa615880678e672e0dd9fb2c96"
|
|
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
|