90 lines
3.3 KiB
Ruby
90 lines
3.3 KiB
Ruby
class Gupnp < Formula
|
|
include Language::Python::Shebang
|
|
|
|
desc "Framework for creating UPnP devices and control points"
|
|
homepage "https://wiki.gnome.org/Projects/GUPnP"
|
|
url "https://download.gnome.org/sources/gupnp/1.4/gupnp-1.4.3.tar.xz"
|
|
sha256 "14eda777934da2df743d072489933bd9811332b7b5bf41626b8032efb28b33ba"
|
|
license "LGPL-2.0-or-later"
|
|
revision 1
|
|
|
|
bottle do
|
|
sha256 cellar: :any, arm64_ventura: "c881ee736478e6b589d986be0170ca74288d72dc1aaf1e8a80c96bc8ce73f54b"
|
|
sha256 cellar: :any, arm64_monterey: "20a8225bd3f69fb56b37b09260e43699ac2ca88529178593c09b3b0ac6a05516"
|
|
sha256 cellar: :any, arm64_big_sur: "cc2a5d6a8a5755eeddf83c5e39be393b9a8597ca4d35b4e230755cf2e25d2d78"
|
|
sha256 cellar: :any, ventura: "34fed8ab99e60430b4fef8b1f51bb0bc2f482f8c9ed7178323a0ee1a35567ce3"
|
|
sha256 cellar: :any, monterey: "bde4dbd7e0104c45f2776b1327fbf06876f98c376549b88221563a5e25b2597a"
|
|
sha256 cellar: :any, big_sur: "a9aacbb2274395fcf56e2d8d18a6f91d342d09fbb1b1cf73e1fe51065b31af3a"
|
|
sha256 cellar: :any, catalina: "ba073cf84ba7e26fa06dd14b4d6a0502650c99e0225822168d784520b2c7b036"
|
|
sha256 x86_64_linux: "710a810a02b204d1570b4b20ed7d4fb625e5d009975f386c8a4a0509daa90389"
|
|
end
|
|
|
|
depends_on "docbook-xsl" => :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 "gettext"
|
|
depends_on "glib"
|
|
depends_on "gssdp"
|
|
depends_on "libsoup@2"
|
|
depends_on "libxml2"
|
|
depends_on "python@3.10"
|
|
|
|
def install
|
|
ENV.prepend_path "PKG_CONFIG_PATH", Formula["libsoup@2"].opt_lib/"pkgconfig"
|
|
ENV.prepend_path "XDG_DATA_DIRS", Formula["libsoup@2"].opt_share
|
|
ENV.prepend_path "XDG_DATA_DIRS", HOMEBREW_PREFIX/"share"
|
|
ENV["XML_CATALOG_FILES"] = etc/"xml/catalog"
|
|
|
|
system "meson", *std_meson_args, "build"
|
|
system "meson", "compile", "-C", "build", "-v"
|
|
system "meson", "install", "-C", "build"
|
|
rewrite_shebang detected_python_shebang, *bin.children
|
|
end
|
|
|
|
test do
|
|
system bin/"gupnp-binding-tool-1.2", "--help"
|
|
(testpath/"test.c").write <<~EOS
|
|
#include <libgupnp/gupnp-control-point.h>
|
|
|
|
static GMainLoop *main_loop;
|
|
|
|
int main (int argc, char **argv)
|
|
{
|
|
GUPnPContext *context;
|
|
GUPnPControlPoint *cp;
|
|
|
|
context = gupnp_context_new (NULL, 0, NULL);
|
|
cp = gupnp_control_point_new
|
|
(context, "urn:schemas-upnp-org:service:WANIPConnection:1");
|
|
|
|
main_loop = g_main_loop_new (NULL, FALSE);
|
|
g_main_loop_unref (main_loop);
|
|
g_object_unref (cp);
|
|
g_object_unref (context);
|
|
|
|
return 0;
|
|
}
|
|
EOS
|
|
|
|
libxml2 = if OS.mac?
|
|
"-I#{MacOS.sdk_path}/usr/include/libxml2"
|
|
else
|
|
"-I#{Formula["libxml2"].include}/libxml2"
|
|
end
|
|
|
|
system ENV.cc, testpath/"test.c", "-I#{include}/gupnp-1.2", "-L#{lib}", "-lgupnp-1.2",
|
|
"-I#{Formula["gssdp"].opt_include}/gssdp-1.2",
|
|
"-L#{Formula["gssdp"].opt_lib}", "-lgssdp-1.2",
|
|
"-I#{Formula["glib"].opt_include}/glib-2.0",
|
|
"-I#{Formula["glib"].opt_lib}/glib-2.0/include",
|
|
"-L#{Formula["glib"].opt_lib}",
|
|
"-lglib-2.0", "-lgobject-2.0",
|
|
"-I#{Formula["libsoup@2"].opt_include}/libsoup-2.4",
|
|
libxml2, "-o", testpath/"test"
|
|
system "./test"
|
|
end
|
|
end
|