From e51765b6490669dc1e2bb1a62820633c3dfb039d Mon Sep 17 00:00:00 2001 From: tron Date: Sat, 24 Sep 2011 22:33:25 +0000 Subject: Adapt Rene Hexel's patch for "pupnp" to make this build under NetBSD and FreeBSD with the "lwres" library. This allows us to remove the problematic dependence on the "bind97" package. Fix suggested by OBATA Akio on the "tech-pkg" mailing list. Approved by Thomas Klausner. --- multimedia/mediatomb/Makefile | 8 ++---- multimedia/mediatomb/distinfo | 4 ++- multimedia/mediatomb/patches/patch-aa | 46 +++++++++++++++++++++++++++++++++ multimedia/mediatomb/patches/patch-ab | 48 +++++++++++++++++++++++++++++++++++ 4 files changed, 99 insertions(+), 7 deletions(-) create mode 100644 multimedia/mediatomb/patches/patch-aa create mode 100644 multimedia/mediatomb/patches/patch-ab (limited to 'multimedia') diff --git a/multimedia/mediatomb/Makefile b/multimedia/mediatomb/Makefile index 769b5ac236b..6aae4ff308d 100644 --- a/multimedia/mediatomb/Makefile +++ b/multimedia/mediatomb/Makefile @@ -1,7 +1,7 @@ -# $NetBSD: Makefile,v 1.22 2011/06/10 09:39:57 obache Exp $ +# $NetBSD: Makefile,v 1.23 2011/09/24 22:33:25 tron Exp $ DISTNAME= mediatomb-0.12.1 -PKGREVISION= 4 +PKGREVISION= 5 CATEGORIES= multimedia MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=mediatomb/} @@ -64,10 +64,6 @@ post-install: .include "../../devel/zlib/buildlink3.mk" .include "../../graphics/libexif/buildlink3.mk" .include "../../multimedia/ffmpeg/buildlink3.mk" -.if ${OPSYS} == "NetBSD" -PREFER.bind= pkgsrc # we need the package for the lwres lib -.include "../../net/bind97/buildlink3.mk" -.endif .include "../../textproc/expat/buildlink3.mk" .include "../../www/curl/buildlink3.mk" diff --git a/multimedia/mediatomb/distinfo b/multimedia/mediatomb/distinfo index 65737ff3f42..c1d2f4da564 100644 --- a/multimedia/mediatomb/distinfo +++ b/multimedia/mediatomb/distinfo @@ -1,8 +1,10 @@ -$NetBSD: distinfo,v 1.9 2011/04/24 13:51:52 obache Exp $ +$NetBSD: distinfo,v 1.10 2011/09/24 22:33:25 tron Exp $ SHA1 (mediatomb-0.12.1.tar.gz) = 86e880584cc9c8aaf3926d56048510d1d06e76b4 RMD160 (mediatomb-0.12.1.tar.gz) = ecb61ca2483f76421beef1036ac442b8f805fa96 Size (mediatomb-0.12.1.tar.gz) = 1240612 bytes +SHA1 (patch-aa) = 09eefa3d86e40a5e7364f3b8b9a224ad3b8cf8b6 +SHA1 (patch-ab) = d79db20a98084e2297534d09ede39dd0141a600c SHA1 (patch-af) = ec9261d2ec645a07144f8b927fd57a50175903ca SHA1 (patch-ag) = 4ceebfca5a1f0556b71bee4713cb35726208f27e SHA1 (patch-ba) = ff31a77e71b772be945441d3c9219cd199f5ff83 diff --git a/multimedia/mediatomb/patches/patch-aa b/multimedia/mediatomb/patches/patch-aa new file mode 100644 index 00000000000..0b8769a1d1f --- /dev/null +++ b/multimedia/mediatomb/patches/patch-aa @@ -0,0 +1,46 @@ +$NetBSD: patch-aa,v 1.3 2011/09/24 22:33:25 tron Exp $ + +Avoid dependence on "liblwres". Based on this patch for "pupnp": + +http://pupnp.git.sourceforge.net/git/gitweb.cgi?p=pupnp/pupnp;a=commitdiff;h=5151d4520308f59c71764423c3853a35cf23e279#patch9 + +--- configure.ac.orig 2010-04-07 23:38:51.000000000 +0100 ++++ configure.ac 2011-09-24 23:03:42.000000000 +0100 +@@ -696,20 +696,23 @@ + + AC_CHECK_FUNCS([gethostbyname_r],[], + [ +- AC_CHECK_HEADERS([lwres/netdb.h], +- [ +- AC_CHECK_LIB(lwres, lwres_gethostbyname_r, +- [ +- LWRES_LIBS="-llwres" +- AC_DEFINE(HAVE_LIBLWRES, 1, [lwres library presence]) +- AC_SUBST(LWRES_LIBS) +- ], +- [AC_MSG_ERROR(required library function not found)]) +- ], +- [ +- if ((test $DARWIN_OS -eq 0) && (test $CYGWIN_OS -eq 0) && (test $OPENBSD_OS -eq 0)) ; then +- AC_MSG_ERROR([required header not found]) +- fi ++ AC_CHECK_FUNCS([getaddrinfo],[], ++ [ ++ AC_CHECK_HEADERS([lwres/netdb.h], ++ [ ++ AC_CHECK_LIB(lwres, lwres_gethostbyname_r, ++ [ ++ LWRES_LIBS="-llwres" ++ AC_DEFINE(HAVE_LIBLWRES, 1, [lwres library presence]) ++ AC_SUBST(LWRES_LIBS) ++ ], ++ [AC_MSG_ERROR(required library function not found)]) ++ ], ++ [ ++ if ((test $DARWIN_OS -eq 0) && (test $CYGWIN_OS -eq 0) && (test $OPENBSD_OS -eq 0)) ; then ++ AC_MSG_ERROR([required header not found]) ++ fi ++ ]) + ]) + ]) + diff --git a/multimedia/mediatomb/patches/patch-ab b/multimedia/mediatomb/patches/patch-ab new file mode 100644 index 00000000000..b75cb8b3a57 --- /dev/null +++ b/multimedia/mediatomb/patches/patch-ab @@ -0,0 +1,48 @@ +$NetBSD: patch-ab,v 1.3 2011/09/24 22:33:25 tron Exp $ + +Avoid dependence on "liblwres". Based on this patch for "pupnp": + +http://pupnp.git.sourceforge.net/git/gitweb.cgi?p=pupnp/pupnp;a=commitdiff;h=5151d4520308f59c71764423c3853a35cf23e279#patch9 + +--- tombupnp/upnp/src/genlib/net/uri/uri.c.orig 2010-03-25 14:58:12.000000000 +0000 ++++ tombupnp/upnp/src/genlib/net/uri/uri.c 2011-09-24 23:06:10.000000000 +0100 +@@ -657,11 +657,38 @@ + if ( h == NULL ) { + errCode = 1; + } +-#else ++#elif defined(__linux__) + errCode = gethostbyname_r( temp_host_name, + &h_buf, + temp_hostbyname_buff, + BUFFER_SIZE, &h, &errcode ); ++#else ++{ ++ struct addrinfo hints, *res, *res0; ++ ++ h = NULL; ++ memset(&hints, 0, sizeof(hints)); ++ hints.ai_family = PF_INET; ++ hints.ai_socktype = SOCK_STREAM; ++ errCode = getaddrinfo(temp_host_name, "http", &hints, &res0); ++ ++ if (!errCode) { ++ for (res = res0; res; res = res->ai_next) { ++ if (res->ai_family == PF_INET && ++ res->ai_addr->sa_family == AF_INET) ++ { ++ h = &h_buf; ++ h->h_addrtype = res->ai_addr->sa_family; ++ h->h_length = 4; ++ h->h_addr = (void *) temp_hostbyname_buff; ++ *(struct in_addr *)h->h_addr = ++ ((struct sockaddr_in *)res->ai_addr)->sin_addr; ++ break; ++ } ++ } ++ freeaddrinfo(res0); ++ } ++} + #endif + + if( errCode == 0 ) { -- cgit v1.2.3