Bug 179217 - net-im/libjingle: Fix build with clang
Summary: net-im/libjingle: Fix build with clang
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Martin Wilke
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-02 19:10 UTC by tkato432
Modified: 2013-06-09 18:00 UTC (History)
0 users

See Also:


Attachments
file.diff (3.67 KB, patch)
2013-06-02 19:10 UTC, tkato432
no flags Details | Diff
net-im_libjingle.diff (4.48 KB, patch)
2013-06-04 18:57 UTC, tkato432
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description tkato432 2013-06-02 19:10:03 UTC
- Fix build with clang
- Add LICENSE
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2013-06-02 19:10:52 UTC
Responsible Changed
From-To: freebsd-ports-bugs->miwi

miwi@ wants this submitter's PRs (via the GNATS Auto Assign Tool)
Comment 2 Martin Wilke freebsd_committer freebsd_triage 2013-06-04 09:17:17 UTC
State Changed
From-To: open->feedback

fails with clang on 10(amd64|i386) 
http://po.miwibox.org:1288/bulk/latest-per-pkg/libjingle/0.4.0_1/
Comment 3 tkato432 2013-06-04 18:57:20 UTC
Here is the corrected patch.
Comment 4 dfilter service freebsd_committer freebsd_triage 2013-06-09 17:53:56 UTC
Author: miwi
Date: Sun Jun  9 16:53:42 2013
New Revision: 320349
URL: http://svnweb.freebsd.org/changeset/ports/320349

Log:
  - Fix build with clang
  - Add LICENSE
  
  PR:		179217
  Submitted by:	Ports Fury

Added:
  head/net-im/libjingle/files/patch-talk__base__openssladapter.cpp   (contents, props changed)
Modified:
  head/net-im/libjingle/Makefile   (contents, props changed)
  head/net-im/libjingle/files/patch-talk__base__stringutils.h   (contents, props changed)

Modified: head/net-im/libjingle/Makefile
==============================================================================
--- head/net-im/libjingle/Makefile	Sun Jun  9 16:50:22 2013	(r320348)
+++ head/net-im/libjingle/Makefile	Sun Jun  9 16:53:42 2013	(r320349)
@@ -10,6 +10,9 @@ MASTER_SITES=	SF
 MAINTAINER=	ports@FreeBSD.org
 COMMENT=	Google Talk's implementation of Jingle and Jingle-Audio
 
+LICENSE=	BSD
+LICENSE_FILE=	${WRKSRC}/COPYING
+
 LIB_DEPENDS=	speex:${PORTSDIR}/audio/speex \
 		ilbc:${PORTSDIR}/net/ilbc \
 		ortp:${PORTSDIR}/net/linphone-base \
@@ -19,26 +22,25 @@ CONFLICTS=	krb4-[0-9]* krb5-[0-9]* heimd
 		clusterit-[0-9]* pcp-[0-9]* synce-librapi2-[0-9]*
 
 USES=		pkgconfig
+USE_DOS2UNIX=	README
 USE_GNOME=	glib20
 USE_OPENSSL=	yes
-USE_AUTOTOOLS=	libtool
-USE_DOS2UNIX=	README
 USE_GMAKE=	yes
-GNU_CONFIGURE=	yes
-CONFIGURE_ARGS=	--with-ilbc=${LOCALBASE} \
-		--with-speex=${LOCALBASE}
-CONFIGURE_ENV=	PKG_CONFIG="${PKG_CONFIG}" \
-		EXPAT_CFLAGS="-I${LOCALBASE}/include" \
+USE_AUTOTOOLS=	libtool
+CONFIGURE_ENV=	EXPAT_CFLAGS="-I${LOCALBASE}/include" \
 		EXPAT_LIBS="-L${LOCALBASE}/lib -lexpat" \
-		GLIB_CFLAGS="$$(${PKG_CONFIG} --cflags glib-2.0)" \
-		GLIB_LIBS="$$(${PKG_CONFIG} --libs glib-2.0)" \
+		GLIB_CFLAGS="$$(pkg-config --cflags glib-2.0)" \
+		GLIB_LIBS="$$(pkg-config --libs glib-2.0)" \
 		ILBC_CFLAGS="-I${LOCALBASE}/include/ilbc" \
 		ILBC_LIBS="-L${LOCALBASE}/lib -lilbc" \
-		SPEEX_CFLAGS="$$(${PKG_CONFIG} --cflags speex)" \
-		SPEEX_LIBS="$$(${PKG_CONFIG} --libs speex)"
-CPPFLAGS+=	-I${LOCALBASE}/include -I${OPENSSLINC} ${PTHREAD_CFLAGS} -g
+		SPEEX_CFLAGS="$$(pkg-config --cflags speex)" \
+		SPEEX_LIBS="$$(pkg-config --libs speex)"
+CONFIGURE_ARGS=	--with-ilbc=${LOCALBASE} \
+		--with-speex=${LOCALBASE}
 MAKE_JOBS_SAFE=	yes
-LDFLAGS+=-L${LOCALBASE}/lib -L${OPENSSLLIB} ${PTHREAD_LIBS}
+
+CPPFLAGS+=	-I${OPENSSLINC} -I${LOCALBASE}/include -g
+LDFLAGS+=	-L${OPENSSLLIB} -L${LOCALBASE}/lib -pthread
 
 PORTDOCS=	AUTHORS \
 		ChangeLog \
@@ -72,6 +74,12 @@ post-configure:
 		'#define ${feature} 1' >> \
 		${CONFIGURE_WRKSRC}/config.h
 .endfor
+	@${REINPLACE_CMD} -e \
+		'/^int main/s|char\* argv|char** argv|' \
+		${WRKSRC}/talk/base/virtualsocket_unittest.cc
+	@${FIND} ${WRKSRC} -name "Makefile.in" | ${XARGS} ${REINPLACE_CMD} -e \
+		's|`pkg-config --cflags gtk+-2.0`|| ; \
+		 s|-lpthread|-pthread|'
 
 post-install:
 .if ${PORT_OPTIONS:MDOCS}

Added: head/net-im/libjingle/files/patch-talk__base__openssladapter.cpp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net-im/libjingle/files/patch-talk__base__openssladapter.cpp	Sun Jun  9 16:53:42 2013	(r320349)
@@ -0,0 +1,14 @@
+--- talk/base/openssladapter.cc.orig
++++ talk/base/openssladapter.cc
+@@ -641,7 +641,11 @@
+     int extension_nid = OBJ_obj2nid(X509_EXTENSION_get_object(extension));
+ 
+     if (extension_nid == NID_subject_alt_name) {
++#if OPENSSL_VERSION_NUMBER >= 0x10000000L
++      const X509V3_EXT_METHOD* meth = X509V3_EXT_get(extension);
++#else
+       X509V3_EXT_METHOD* meth = X509V3_EXT_get(extension);
++#endif
+       if (!meth)
+         break;
+ 

Modified: head/net-im/libjingle/files/patch-talk__base__stringutils.h
==============================================================================
--- head/net-im/libjingle/files/patch-talk__base__stringutils.h	Sun Jun  9 16:50:22 2013	(r320348)
+++ head/net-im/libjingle/files/patch-talk__base__stringutils.h	Sun Jun  9 16:53:42 2013	(r320349)
@@ -1,5 +1,37 @@
 --- talk/base/stringutils.h.orig	2008-09-06 23:10:21.000000000 -0300
 +++ talk/base/stringutils.h	2008-09-06 23:13:17.000000000 -0300
+@@ -197,15 +197,6 @@
+ }
+ 
+ template<class CTYPE>
+-size_t sprintfn(CTYPE* buffer, size_t buflen, const CTYPE* format, ...) {
+-  va_list args;
+-  va_start(args, format);
+-  size_t len = vsprintfn(buffer, buflen, format, args);
+-  va_end(args);
+-  return len;
+-}
+-
+-template<class CTYPE>
+ size_t vsprintfn(CTYPE* buffer, size_t buflen, const CTYPE* format,
+                  va_list args) {
+   int len = vsnprintf(buffer, buflen, format, args);
+@@ -216,6 +207,15 @@
+   return len;
+ }
+ 
++template<class CTYPE>
++size_t sprintfn(CTYPE* buffer, size_t buflen, const CTYPE* format, ...) {
++  va_list args;
++  va_start(args, format);
++  size_t len = vsprintfn(buffer, buflen, format, args);
++  va_end(args);
++  return len;
++}
++
+ ///////////////////////////////////////////////////////////////////////////////
+ // Allow safe comparing and copying ascii (not UTF-8) with both wide and
+ // non-wide character strings.
 @@ -269,7 +269,7 @@
  template<>
  struct Traits<char> {
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 5 Martin Wilke freebsd_committer freebsd_triage 2013-06-09 17:54:00 UTC
State Changed
From-To: feedback->closed

Committed. Thanks!