From cb08d25f9bb4f46116d8408d4a3be5b8e05fb76d Mon Sep 17 00:00:00 2001
From: Samuli Suominen <ssuominen@gentoo.org>
Date: Sun, 9 Aug 2009 20:05:12 +0000
Subject: Fix building with GLIBC 2.10+ wrt #280640. (Portage version:
 2.2_rc36/cvs/Linux x86_64)

---
 net-im/licq/ChangeLog                         |   6 +-
 net-im/licq/files/licq-1.3.6-glibc-2.10.patch | 167 ++++++++++++++++++++++++++
 net-im/licq/licq-1.3.6.ebuild                 |   7 +-
 3 files changed, 176 insertions(+), 4 deletions(-)
 create mode 100644 net-im/licq/files/licq-1.3.6-glibc-2.10.patch

(limited to 'net-im')

diff --git a/net-im/licq/ChangeLog b/net-im/licq/ChangeLog
index ac33b1d14fb3..47ed7ddb8d1d 100644
--- a/net-im/licq/ChangeLog
+++ b/net-im/licq/ChangeLog
@@ -1,6 +1,10 @@
 # ChangeLog for net-im/licq
 # Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-im/licq/ChangeLog,v 1.105 2009/07/31 22:07:57 chainsaw Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-im/licq/ChangeLog,v 1.106 2009/08/09 20:05:12 ssuominen Exp $
+
+  09 Aug 2009; Samuli Suominen <ssuominen@gentoo.org> licq-1.3.6.ebuild,
+  +files/licq-1.3.6-glibc-2.10.patch:
+  Fix building with GLIBC 2.10+ wrt #280640.
 
   31 Jul 2009; <chainsaw@gentoo.org> ChangeLog:
   Marked stable on AMD64 as requested by Olivier Crete <tester@gentoo.org>
diff --git a/net-im/licq/files/licq-1.3.6-glibc-2.10.patch b/net-im/licq/files/licq-1.3.6-glibc-2.10.patch
new file mode 100644
index 000000000000..d732baf324e3
--- /dev/null
+++ b/net-im/licq/files/licq-1.3.6-glibc-2.10.patch
@@ -0,0 +1,167 @@
+diff -ur licq-1.3.6.orig/plugins/msn/src/msn-sb.cpp licq-1.3.6/plugins/msn/src/msn-sb.cpp
+--- licq-1.3.6.orig/plugins/msn/src/msn-sb.cpp	2008-08-17 16:34:41.000000000 +0300
++++ licq-1.3.6/plugins/msn/src/msn-sb.cpp	2009-08-07 14:40:22.000000000 +0300
+@@ -441,7 +441,7 @@
+   const char *szParam = strServer.c_str();
+   char szServer[16];
+   char *szPort;
+-  if ((szPort = strchr(szParam, ':')))
++  if ((szPort = const_cast<char*> (strchr(szParam, ':'))))
+   {
+     strncpy(szServer, szParam, szPort - szParam);
+     szServer[szPort - szParam] = '\0';
+@@ -504,7 +504,7 @@
+   const char *szParam = strServer.c_str();
+   char szServer[16];
+   char *szPort;
+-  if ((szPort = strchr(szParam, ':')))
++  if ((szPort = const_cast<char*> (strchr(szParam, ':'))))
+   {
+     strncpy(szServer, szParam, szPort - szParam);
+     szServer[szPort - szParam] = '\0';
+diff -ur licq-1.3.6.orig/plugins/msn/src/msn-srv.cpp licq-1.3.6/plugins/msn/src/msn-srv.cpp
+--- licq-1.3.6.orig/plugins/msn/src/msn-srv.cpp	2008-08-11 19:06:38.000000000 +0300
++++ licq-1.3.6/plugins/msn/src/msn-srv.cpp	2009-08-07 14:41:08.000000000 +0300
+@@ -76,7 +76,7 @@
+         const char *szParam = strServer.c_str();
+         char szNewServer[16];
+         char *szPort;
+-        if ((szPort = strchr(szParam, ':')))
++        if ((szPort = const_cast<char*> (strchr(szParam, ':'))))
+         {
+           strncpy(szNewServer, szParam, szPort - szParam);
+           szNewServer[szPort - szParam] = '\0';
+diff -ur licq-1.3.6.orig/plugins/msn/src/msn-ssl.cpp licq-1.3.6/plugins/msn/src/msn-ssl.cpp
+--- licq-1.3.6.orig/plugins/msn/src/msn-ssl.cpp	2008-09-07 17:03:53.000000000 +0300
++++ licq-1.3.6/plugins/msn/src/msn-ssl.cpp	2009-08-07 14:41:37.000000000 +0300
+@@ -68,7 +68,7 @@
+   if (strFirstLine == "HTTP/1.1 200 OK")
+   {
+     m_pSSLPacket->ParseHeaders();
+-    char *fromPP = strstr(m_pSSLPacket->GetValue("Authentication-Info").c_str(), "from-PP=");
++    const char *fromPP = strstr(m_pSSLPacket->GetValue("Authentication-Info").c_str(), "from-PP=");
+     char *tag;
+ 
+     if (fromPP == 0)
+@@ -76,7 +76,7 @@
+     else
+     {
+       fromPP+= 9; // skip to the tag
+-      char *endTag = strchr(fromPP, '\'');
++      const char *endTag = strchr(fromPP, '\'');
+       tag = strndup(fromPP, endTag - fromPP); // Thanks, this is all we need
+     }
+ 
+@@ -146,7 +146,7 @@
+ 
+   m_pNexusBuff->ParseHeaders();
+   
+-  char *szLogin = strstr(m_pNexusBuff->GetValue("PassportURLs").c_str(), "DALogin=");
++  const char *szLogin = strstr(m_pNexusBuff->GetValue("PassportURLs").c_str(), "DALogin=");
+   szLogin += 8; // skip to the tag
+   //char *szEndURL = strchr(szLogin, '/');
+   //char *szServer = strndup(szLogin, szEndURL - szLogin); // this is all we need
+diff -ur licq-1.3.6.orig/src/file.cpp licq-1.3.6/src/file.cpp
+--- licq-1.3.6.orig/src/file.cpp	2008-09-13 16:58:45.000000000 +0300
++++ licq-1.3.6/src/file.cpp	2009-08-07 14:43:57.000000000 +0300
+@@ -569,7 +569,7 @@
+   }
+   else
+   {
+-    if ((szPostEquals = strchr(_szLine, '=')) == NULL)
++    if ((szPostEquals = const_cast<char*> (strchr(_szLine, '='))) == NULL)
+     {
+        Warn(INI_ExFORMAT, _szLine);
+        return NULL;
+diff -ur licq-1.3.6.orig/src/icqd-filetransfer.cpp licq-1.3.6/src/icqd-filetransfer.cpp
+--- licq-1.3.6.orig/src/icqd-filetransfer.cpp	2008-07-25 23:34:44.000000000 +0300
++++ licq-1.3.6/src/icqd-filetransfer.cpp	2009-08-07 14:45:06.000000000 +0300
+@@ -106,7 +106,7 @@
+   struct stat buf;
+ 
+   // Remove any path from the filename
+-  if ( (pcNoPath = strrchr(_szFileName, '/')) != NULL)
++  if ( (pcNoPath = const_cast<char*> (strrchr(_szFileName, '/'))) != NULL)
+     m_szFileName = strdup(pcNoPath + 1);
+   else
+     m_szFileName = strdup(_szFileName);
+diff -ur licq-1.3.6.orig/src/icqpacket.cpp licq-1.3.6/src/icqpacket.cpp
+--- licq-1.3.6.orig/src/icqpacket.cpp	2008-08-23 19:04:35.000000000 +0300
++++ licq-1.3.6/src/icqpacket.cpp	2009-08-07 14:29:38.000000000 +0300
+@@ -5874,7 +5874,7 @@
+   }
+ 
+   // Remove path from filename (if it exists)
+-  char *pcEndOfPath = strrchr(_szFilename, '/');
++  const char *pcEndOfPath = strrchr(_szFilename, '/');
+   if (pcEndOfPath != NULL)
+      m_szFilename = strdup(pcEndOfPath + 1);
+   else
+diff -ur licq-1.3.6.orig/src/licq.cpp licq-1.3.6/src/licq.cpp
+--- licq-1.3.6.orig/src/licq.cpp	2008-06-11 21:34:35.000000000 +0300
++++ licq-1.3.6/src/licq.cpp	2009-08-07 14:32:52.000000000 +0300
+@@ -183,14 +183,14 @@
+ /*-----Helper functions for CLicq::UpgradeLicq-----------------------------*/
+ int SelectUserUtility(const struct dirent *d)
+ {
+-  char *pcDot = strrchr(d->d_name, '.');
++  const char *pcDot = strrchr(d->d_name, '.');
+   if (pcDot == NULL) return (0);
+   return (strcmp(pcDot, ".uin") == 0);
+ }
+ 
+ int SelectHistoryUtility(const struct dirent *d)
+ {
+-  char *pcDot = strchr(d->d_name, '.');
++  const char *pcDot = strchr(d->d_name, '.');
+   if (pcDot == NULL) return (0);
+   return (strcmp(pcDot, ".history") == 0 ||
+           strcmp(pcDot, ".history.removed") == 0);
+diff -ur licq-1.3.6.orig/src/rtf.cc licq-1.3.6/src/rtf.cc
+--- licq-1.3.6.orig/src/rtf.cc	2007-06-21 00:41:54.000000000 +0300
++++ licq-1.3.6/src/rtf.cc	2009-08-07 14:38:41.000000000 +0300
+@@ -2141,7 +2141,7 @@
+         return;
+     }
+     if (m_bFontName){
+-        char *pp = strchr(str, ';');
++        const char *pp = strchr(str, ';');
+         unsigned size = strlen(pp);
+         if (pp){
+             size = (pp - str);
+diff -ur licq-1.3.6.orig/src/rtf.ll licq-1.3.6/src/rtf.ll
+--- licq-1.3.6.orig/src/rtf.ll	2007-06-21 00:41:54.000000000 +0300
++++ licq-1.3.6/src/rtf.ll	2009-08-07 14:38:27.000000000 +0300
+@@ -541,7 +541,7 @@
+         return;
+     }
+     if (m_bFontName){
+-        char *pp = strchr(str, ';');
++        const char *pp = strchr(str, ';');
+         unsigned size = strlen(pp);
+         if (pp){
+             size = (pp - str);
+diff -ur licq-1.3.6.orig/src/translate.cpp licq-1.3.6/src/translate.cpp
+--- licq-1.3.6.orig/src/translate.cpp	2008-07-02 17:02:49.000000000 +0300
++++ licq-1.3.6/src/translate.cpp	2009-08-07 14:36:18.000000000 +0300
+@@ -76,7 +76,7 @@
+ bool CTranslator::setTranslationMap(const char* mapFileName)
+ {
+   // Map name is the file name with no path
+-  char* sep = strrchr(mapFileName, '/');
++  const char* sep = strrchr(mapFileName, '/');
+   const char* mapName = (sep == NULL ? mapFileName : sep + 1);
+ 
+   if (strcmp(mapName, "LATIN_1") == 0)
+diff -ur licq-1.3.6.orig/src/utility.cpp licq-1.3.6/src/utility.cpp
+--- licq-1.3.6.orig/src/utility.cpp	2008-07-25 23:34:44.000000000 +0300
++++ licq-1.3.6/src/utility.cpp	2009-08-07 14:34:28.000000000 +0300
+@@ -46,7 +46,7 @@
+ //=====CUtilityManager==========================================================
+ int SelectUtility(const struct dirent *d)
+ {
+-  char *pcDot = strrchr(d->d_name, '.');
++  const char *pcDot = strrchr(d->d_name, '.');
+   if (pcDot == NULL) return (0);
+   return (strcmp(pcDot, ".utility") == 0);
+ }
diff --git a/net-im/licq/licq-1.3.6.ebuild b/net-im/licq/licq-1.3.6.ebuild
index 6c7dc5c1088a..cd59341b97f2 100644
--- a/net-im/licq/licq-1.3.6.ebuild
+++ b/net-im/licq/licq-1.3.6.ebuild
@@ -1,6 +1,6 @@
 # Copyright 1999-2009 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/net-im/licq/licq-1.3.6.ebuild,v 1.7 2009/07/31 22:11:34 chainsaw Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-im/licq/licq-1.3.6.ebuild,v 1.8 2009/08/09 20:05:12 ssuominen Exp $
 
 EAPI="1"
 
@@ -30,6 +30,8 @@ RDEPEND="kde? (
 DEPEND="${RDEPEND}
 	dev-libs/boost"
 
+PATCHES=( "${FILESDIR}/${P}-glibc-2.10.patch" )
+
 _generate_plugins_directories() {
 	PLUGINS="auto-reply email rms"
 	use msn && PLUGINS="${PLUGINS} msn"
@@ -90,7 +92,7 @@ src_install() {
 	# install core
 	einfo "Installing Licq core."
 	emake DESTDIR="${D}" install || die "emake install failed"
-	dodoc ChangeLog INSTALL README* doc/*
+	dodoc README* doc/*
 	# Install the plug-ins
 	for plugin in ${PLUGINS}; do
 		cd "${S}"/plugins/"${plugin}"
@@ -102,7 +104,6 @@ src_install() {
 		einfo "Installing Licq: \"qt4-gui\"."
 		cmake-utils_src_install
 		docinto plugins/qt4-gui
-		dodoc doc/README*
 	fi
 
 	exeinto /usr/share/${PN}/upgrade
-- 
cgit v1.2.3-65-gdbad