homebrew-core/Formula/libpeas.rb

81 lines
2.1 KiB
Ruby

class Libpeas < Formula
desc "GObject plugin library"
homepage "https://developer.gnome.org/libpeas/stable/"
url "https://download.gnome.org/sources/libpeas/1.28/libpeas-1.28.0.tar.xz"
sha256 "42d91993b46ed50f16add6d9577ecc22beb8e2dffa7101e2232c2b63733b8b15"
license "LGPL-2.1-or-later"
livecheck do
url :stable
end
bottle do
sha256 "cee4e628ee60bbf6ddd0c4f83dc411b730e8a3f54a80954951cdec06b1f2980f" => :catalina
sha256 "c8d4fa64f82751999434fd326c736775e39ce3adfc812dd5c89288266cfbd845" => :mojave
sha256 "f6a73c80504d5c846ee9f97495b91bca0d50f4f44e84e79068620f411a116a1d" => :high_sierra
end
depends_on "meson" => :build
depends_on "ninja" => :build
depends_on "pkg-config" => :build
depends_on "vala" => :build
depends_on "glib"
depends_on "gobject-introspection"
depends_on "gtk+3"
depends_on "pygobject3"
depends_on "python@3.8"
def install
args = std_meson_args + %w[
-Dpython3=true
-Dintrospection=true
-Dvapi=true
-Dwidgetry=true
-Ddemos=false
]
mkdir "build" do
system "meson", *args, ".."
system "ninja", "-v"
system "ninja", "install", "-v"
end
end
test do
(testpath/"test.c").write <<~EOS
#include <libpeas/peas.h>
int main(int argc, char *argv[]) {
PeasObjectModule *mod = peas_object_module_new("test", "test", FALSE);
return 0;
}
EOS
gettext = Formula["gettext"]
glib = Formula["glib"]
gobject_introspection = Formula["gobject-introspection"]
libffi = Formula["libffi"]
flags = %W[
-I#{gettext.opt_include}
-I#{glib.opt_include}/glib-2.0
-I#{glib.opt_lib}/glib-2.0/include
-I#{gobject_introspection.opt_include}/gobject-introspection-1.0
-I#{include}/libpeas-1.0
-I#{libffi.opt_lib}/libffi-3.0.13/include
-D_REENTRANT
-L#{gettext.opt_lib}
-L#{glib.opt_lib}
-L#{gobject_introspection.opt_lib}
-L#{lib}
-lgio-2.0
-lgirepository-1.0
-lglib-2.0
-lgmodule-2.0
-lgobject-2.0
-lintl
-lpeas-1.0
]
system ENV.cc, "test.c", "-o", "test", *flags
system "./test"
end
end