65 lines
2.1 KiB
Ruby
65 lines
2.1 KiB
Ruby
class Gupnp < Formula
|
|
desc "Framework for creating UPnP devices and control points"
|
|
homepage "https://wiki.gnome.org/Projects/GUPnP"
|
|
url "https://download.gnome.org/sources/gupnp/1.0/gupnp-1.0.2.tar.xz"
|
|
sha256 "5173fda779111c6b01cd4a5e41b594322be9d04f8c74d3361f0a0c2069c77610"
|
|
revision 1
|
|
|
|
bottle do
|
|
cellar :any
|
|
sha256 "20be1bfad4695855653002badcb5a48c0d69868496898ea331656d0590a8b3e9" => :high_sierra
|
|
sha256 "e8b43cc1b881108f2ee3447a4da9e80e842cc495ba9b2b778817034d8db63fd8" => :sierra
|
|
sha256 "b5efc9bd423c11b952887a8b1b5e51821573c7c85f7a321cee0a7a3e91347b53" => :el_capitan
|
|
end
|
|
|
|
depends_on "pkg-config" => :build
|
|
depends_on "intltool" => :build
|
|
depends_on "gettext"
|
|
depends_on "glib"
|
|
depends_on "libsoup"
|
|
depends_on "gssdp"
|
|
|
|
def install
|
|
system "./configure", "--disable-debug",
|
|
"--disable-dependency-tracking",
|
|
"--disable-silent-rules",
|
|
"--prefix=#{prefix}"
|
|
system "make", "install"
|
|
end
|
|
|
|
test do
|
|
system bin/"gupnp-binding-tool", "--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, 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
|
|
system ENV.cc, "-I#{include}/gupnp-1.0", "-L#{lib}", "-lgupnp-1.0",
|
|
"-I#{Formula["gssdp"].opt_include}/gssdp-1.0",
|
|
"-L#{Formula["gssdp"].opt_lib}", "-lgssdp-1.0",
|
|
"-I#{Formula["glib"].opt_include}/glib-2.0",
|
|
"-I#{Formula["glib"].opt_lib}/glib-2.0/include",
|
|
"-lglib-2.0", "-lgobject-2.0",
|
|
"-I#{Formula["libsoup"].opt_include}/libsoup-2.4",
|
|
"-I/usr/include/libxml2",
|
|
testpath/"test.c", "-o", testpath/"test"
|
|
system "./test"
|
|
end
|
|
end
|