ports/183163: [patch] net-p2p/linuxdcpp support staging, unbreak build with FreeBSD10

Vladimir Kondratiev wulf at mail.mipt.ru
Mon Oct 21 20:10:00 UTC 2013


>Number:         183163
>Category:       ports
>Synopsis:       [patch] net-p2p/linuxdcpp support staging, unbreak build with FreeBSD10
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Oct 21 20:10:00 UTC 2013
>Closed-Date:
>Last-Modified:
>Originator:     Vladimir Kondratiev
>Release:        
>Organization:
>Environment:
>Description:
1. Support STAGE
2. Fix build with iconv in libc
3. Fix build with libc++
4. Conditionalize libnotify dependence
>How-To-Repeat:

>Fix:


Patch attached with submission follows:

Index: linuxdcpp/Makefile
===================================================================
--- linuxdcpp/Makefile	(revision 331160)
+++ linuxdcpp/Makefile	(working copy)
@@ -2,7 +2,7 @@
 
 PORTNAME=	linuxdcpp
 PORTVERSION=	1.1.0
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	net-p2p
 MASTER_SITES=	http://launchpadlibrarian.net/69733951/
 
@@ -15,16 +15,30 @@
 
 USE_BZIP2=	yes
 USE_GNOME=	libglade2
-USES=		iconv pkgconfig
-USE_SCONS=	yes
+USES=		iconv pkgconfig scons
 USE_OPENSSL=	yes
 PORTDOCS=	*
+DESTDIRNAME=	FAKE_ROOT
 
-SCONS_BUILDENV=	${SCONS_ENV}
+OPTIONS_DEFINE=	NOTIFY DEBUG
+OPTIONS_DEFAULT=NOTIFY
 
-.if defined(WITH_DEBUG)
-SCONS_ARGS=	debug=1
+CCISCLANG_CMD!=	${CXX} --version
+
+.include <bsd.port.options.mk>
+
+.if !empty(CCISCLANG_CMD:M*clang*) && ${OSVERSION} >= 1000054
+EXTRA_PATCHES=	${PATCHDIR}/extra-tr1_namespace.patch
 .endif
 
-NO_STAGE=	yes
+.if ${PORT_OPTIONS:MDEBUG}
+MAKE_ARGS+=	debug=1
+.endif
+
+.if ${PORT_OPTIONS:MNOTIFY}
+LIB_DEPENDS+=	libnotify.so:${PORTSDIR}/devel/libnotify
+.else
+MAKE_ARGS+=	libnotify=0
+.endif
+
 .include <bsd.port.mk>
Index: linuxdcpp/files/extra-tr1_namespace.patch
===================================================================
--- linuxdcpp/files/extra-tr1_namespace.patch	(revision 0)
+++ linuxdcpp/files/extra-tr1_namespace.patch	(working copy)
@@ -0,0 +1,145 @@
+--- dcpp/stdinc.h.orig	2011-04-17 21:57:09.000000000 +0400
++++ dcpp/stdinc.h	2013-09-13 00:52:28.109069642 +0400
+@@ -123,23 +123,11 @@
+ #include <boost/scoped_array.hpp>
+ #include <boost/noncopyable.hpp>
+ 
+-#if defined(_MSC_VER) || defined(_STLPORT_VERSION)
+-
+ #include <unordered_map>
+ #include <unordered_set>
+ 
+-#elif defined(__GLIBCPP__) || defined(__GLIBCXX__)  // Using GNU C++ library?
+-
+-#include <tr1/unordered_set>
+-#include <tr1/unordered_map>
+-
+-#else
+-#error "Unknown STL, please configure accordingly"
+-#endif
+-
+ namespace dcpp {
+ using namespace std;
+-using namespace std::tr1;
+ }
+ 
+ #endif // !defined(STDINC_H)
+--- dcpp/CID.h.orig	2011-04-17 21:57:09.000000000 +0400
++++ dcpp/CID.h	2013-09-13 00:50:16.544145469 +0400
+@@ -57,7 +57,7 @@
+ 
+ } // namespace dcpp
+ 
+-namespace std { namespace tr1 {
++namespace std {
+ template<>
+ struct hash<dcpp::CID> {
+ 	size_t operator()(const dcpp::CID& rhs) const {
+@@ -65,6 +65,5 @@
+ 	}
+ };
+ }
+-}
+ 
+ #endif // !defined(CID_H)
+--- dcpp/DCPlusPlus.h.orig	2011-04-17 21:57:09.000000000 +0400
++++ dcpp/DCPlusPlus.h	2013-09-13 00:40:46.993081856 +0400
+@@ -85,10 +85,10 @@
+ typedef std::vector<StringPair> StringPairList;
+ typedef StringPairList::iterator StringPairIter;
+ 
+-typedef std::tr1::unordered_map<string, string> StringMap;
++typedef std::unordered_map<string, string> StringMap;
+ typedef StringMap::iterator StringMapIter;
+ 
+-typedef std::tr1::unordered_set<string> StringSet;
++typedef std::unordered_set<string> StringSet;
+ typedef StringSet::iterator StringSetIter;
+ 
+ typedef std::vector<wstring> WStringList;
+--- dcpp/HashValue.h.orig	2011-04-17 21:57:09.000000000 +0400
++++ dcpp/HashValue.h	2013-09-13 00:48:18.173057104 +0400
+@@ -46,12 +46,11 @@
+ 
+ } // namespace dcpp
+ 
+-namespace std { namespace tr1 {
++namespace std {
+ template<typename T>
+ struct hash<dcpp::HashValue<T> > {
+ 	size_t operator()(const dcpp::HashValue<T>& rhs) const { return *(size_t*)rhs.data; }
+ };
+ }
+-}
+ 
+ #endif // !defined(HASH_VALUE_H)
+--- dcpp/User.h.orig	2011-04-17 21:57:09.000000000 +0400
++++ dcpp/User.h	2013-09-13 00:41:44.399176346 +0400
+@@ -148,7 +148,7 @@
+ 	GETSET(UserPtr, user, User);
+ 	GETSET(uint32_t, sid, SID);
+ private:
+-	typedef std::tr1::unordered_map<short, string> InfMap;
++	typedef std::unordered_map<short, string> InfMap;
+ 	typedef InfMap::iterator InfIter;
+ 	InfMap info;
+ 
+--- linux/hub.hh.orig	2011-04-17 21:57:09.000000000 +0400
++++ linux/hub.hh	2013-09-13 00:42:58.801142238 +0400
+@@ -124,8 +124,8 @@
+ 		virtual void on(dcpp::ClientListener::NickTaken, dcpp::Client *) throw();
+ 		virtual void on(dcpp::ClientListener::SearchFlood, dcpp::Client *, const std::string &message) throw();
+ 
+-		std::tr1::unordered_map<std::string, std::string> userMap;
+-		std::tr1::unordered_map<std::string, GtkTreeIter> userIters;
++		std::unordered_map<std::string, std::string> userMap;
++		std::unordered_map<std::string, GtkTreeIter> userIters;
+ 		std::string completionKey;
+ 		dcpp::Client *client;
+ 		TreeView nickView;
+--- linux/favoriteusers.hh.orig	2011-04-17 21:57:09.000000000 +0400
++++ linux/favoriteusers.hh	2013-09-13 00:43:41.371135910 +0400
+@@ -40,7 +40,7 @@
+ 
+ 	private:
+ 		typedef std::map<std::string, std::string> ParamMap;
+-		typedef std::tr1::unordered_map<std::string, GtkTreeIter> UserIters;
++		typedef std::unordered_map<std::string, GtkTreeIter> UserIters;
+ 
+ 		// GUI functions
+ 		bool findUser_gui(const std::string &cid, GtkTreeIter *iter);
+--- linux/downloadqueue.hh.orig	2011-04-17 21:57:09.000000000 +0400
++++ linux/downloadqueue.hh	2013-09-13 00:44:45.300067940 +0400
+@@ -107,8 +107,8 @@
+ 		GtkTreeSelection *fileSelection;
+ 		GdkEventType dirPrevious;
+ 		std::string currentDir;
+-		std::tr1::unordered_map<std::string, std::map<std::string, std::string> > sources;
+-		std::tr1::unordered_map<std::string, std::map<std::string, std::string> > badSources;
++		std::unordered_map<std::string, std::map<std::string, std::string> > sources;
++		std::unordered_map<std::string, std::map<std::string, std::string> > badSources;
+ 		int currentItems;
+ 		int totalItems;
+ 		int64_t currentSize;
+--- linux/wulformanager.hh.orig	2011-04-17 21:57:09.000000000 +0400
++++ linux/wulformanager.hh	2013-09-13 00:45:53.031061474 +0400
+@@ -71,7 +71,7 @@
+ 		std::string path;
+ 		std::vector<FuncBase *> guiFuncs;
+ 		std::vector<FuncBase *> clientFuncs;
+-		std::tr1::unordered_map<std::string, Entry *> entries;
++		std::unordered_map<std::string, Entry *> entries;
+ 		gint guiCondValue;
+ 		gint clientCondValue;
+ 		GCond *guiCond;
+--- linux/search.hh.orig	2011-04-17 21:57:09.000000000 +0400
++++ linux/search.hh	2013-09-13 00:46:32.085057233 +0400
+@@ -142,7 +142,7 @@
+ 		bool onlyFree;
+ 		UserCommandMenu *userCommandMenu;
+ 		GroupType previousGrouping;
+-		std::tr1::unordered_map<std::string, std::vector<dcpp::SearchResultPtr> > results;
++		std::unordered_map<std::string, std::vector<dcpp::SearchResultPtr> > results;
+ };
+ 
+ #else
Index: linuxdcpp/files/patch-SConstruct
===================================================================
--- linuxdcpp/files/patch-SConstruct	(revision 331160)
+++ linuxdcpp/files/patch-SConstruct	(working copy)
@@ -9,7 +9,15 @@
  }
  
  # ----------------------------------------------------------------------
-@@ -139,6 +139,12 @@
+@@ -106,6 +106,7 @@
+ vars.AddVariables(
+ 	BoolVariable('debug', 'Compile the program with debug information', 0),
+ 	BoolVariable('release', 'Compile the program with optimizations', 0),
++	BoolVariable('libnotify', 'Enable notifications through libnotify', 1),
+ 	BoolVariable('profile', 'Compile the program with profiling information', 0),
+ 	PathVariable('PREFIX', 'Compile the program with PREFIX as the root for installation', '/usr/local', PathVariable.PathIsDir),
+ 	('FAKE_ROOT', 'Make scons install the program under a fake root', '')
+@@ -139,6 +140,12 @@
  if os.environ.has_key('CFLAGS'):
  	env['CFLAGS'] = os.environ['CFLAGS'].split()
  
@@ -22,3 +30,38 @@
  env['CPPDEFINES'] = [] # Initialize as a list so Append doesn't concat strings
  
  env.SConsignFile('build/sconf/.sconsign')
+@@ -256,21 +263,24 @@
+ 
+ 	if not conf.CheckHeader('iconv.h'):
+ 		Exit(1)
+-	elif conf.CheckLibWithHeader('iconv', 'iconv.h', 'c', 'iconv(0, (const char **)0, 0, (char**)0, 0);'):
+-		conf.env.Append(CPPDEFINES = ('ICONV_CONST', 'const'))
++	else:
++		iconv_lib = 'iconv' if conf.CheckLib('iconv') else '';
++		if conf.CheckLibWithHeader(iconv_lib, 'iconv.h', 'c', 'iconv(0, (const char **)0, 0, (char**)0, 0);'):
++			conf.env.Append(CPPDEFINES = ('ICONV_CONST', 'const'))
+ 
+ 	if conf.CheckHeader(['sys/types.h', 'sys/socket.h', 'ifaddrs.h', 'net/if.h']):
+ 		conf.env.Append(CPPDEFINES = 'HAVE_IFADDRS_H')
+ 
+ 	# TODO: Implement a plugin system so libnotify doesn't have compile-time dependencies
+-	if not conf.CheckPKG('libnotify >= 0.4.1'):
+-		print '\tlibnotify >= 0.4.1 not found, disabling notifications.'
+-		print '\tNote: You might have the lib but not the headers'
+-	else:
+-		conf.env.Append(CPPDEFINES = 'HAVE_LIBNOTIFY')
+-		conf.env.ParseConfig('pkg-config --libs libnotify')
+-		if conf.CheckPKG('libnotify >= 0.7'):
+-			conf.env.Append(CPPDEFINES = 'HAVE_LIBNOTIFY_0_7')
++	if conf.env.get('libnotify'):
++		if not conf.CheckPKG('libnotify >= 0.4.1'):
++			print '\tlibnotify >= 0.4.1 not found, disabling notifications.'
++			print '\tNote: You might have the lib but not the headers'
++		else:
++			conf.env.Append(CPPDEFINES = 'HAVE_LIBNOTIFY')
++			conf.env.ParseConfig('pkg-config --libs libnotify')
++			if conf.CheckPKG('libnotify >= 0.7'):
++				conf.env.Append(CPPDEFINES = 'HAVE_LIBNOTIFY_0_7')
+ 
+ 	conf.CheckBZRRevision()
+ 


>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-ports-bugs mailing list