diff options
| author | Alex Dunn | 2015-04-23 14:32:52 -0700 |
|---|---|---|
| committer | Mike McQuaid | 2015-04-24 18:23:42 +0100 |
| commit | 2f91fb45b734fc3ac0617583f63aaf257db7b789 (patch) | |
| tree | 783f445815f9dc6ddffc86f7dd7a756a63124d7f | |
| parent | 4b5f6bf30e71ab888046a3edb8d7b7716cc4ea6d (diff) | |
| download | homebrew-2f91fb45b734fc3ac0617583f63aaf257db7b789.tar.bz2 | |
gupnp 0.20.13
Closes #38988.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
| -rw-r--r-- | Library/Formula/gupnp.rb | 69 |
1 files changed, 60 insertions, 9 deletions
diff --git a/Library/Formula/gupnp.rb b/Library/Formula/gupnp.rb index 075694392..438b79531 100644 --- a/Library/Formula/gupnp.rb +++ b/Library/Formula/gupnp.rb @@ -1,9 +1,16 @@ -require "formula" - class Gupnp < Formula - homepage "https://wiki.gnome.org/GUPnP/" - url "http://ftp.gnome.org/pub/gnome/sources/gupnp/0.20/gupnp-0.20.12.tar.xz" - sha1 "fbc23c0fa0df70f44d50b2ed88dc2c4dc06d166c" + homepage "https://wiki.gnome.org/Projects/GUPnP" + url "https://download.gnome.org/sources/gupnp/0.20/gupnp-0.20.13.tar.xz" + sha256 "d779b094f13097a5900689b3587e5b495d79112d0855ed842577acba25c902b3" + + head do + url "https://github.com/GNOME/gupnp.git" + depends_on "automake" => :build + depends_on "autoconf" => :build + depends_on "gnome-common" => :build + depends_on "gtk-doc" => :build + depends_on "libtool" => :build + end bottle do cellar :any @@ -20,10 +27,54 @@ class Gupnp < Formula depends_on "gssdp" def install - system "./configure", "--disable-debug", - "--disable-dependency-tracking", - "--disable-silent-rules", - "--prefix=#{prefix}" + args = %W[ + --disable-debug + --disable-dependency-tracking + --disable-silent-rules + --prefix=#{prefix} + ] + if build.head? + ENV.append "CFLAGS", "-I/usr/include/uuid" + system "./autogen.sh", *args + else + system "./configure", *args + end system "make", "install" end + + test do + system bin/"gupnp-binding-tool", "--help" + (testpath/"test.c").write <<-EOS.undent + #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", + "-I#{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 |
