news/nget: Fix build with Clang and GCC > 4.8

- Remove GCC dependency since it now builds fine with Clang
- Set WRKSRC directly instead of symlinking in post-extract
This commit is contained in:
Tobias Kortkamp 2017-10-14 06:01:53 +00:00
parent e3faed20b2
commit afb62675bf
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=452044
5 changed files with 77 additions and 16 deletions

View File

@ -3,10 +3,10 @@
PORTNAME= nget
PORTVERSION= 0.27.1
PORTREVISION= 3
DISTVERSIONSUFFIX= +uulib
PORTREVISION= 4
CATEGORIES= news
MASTER_SITES= SF
DISTNAME= nget-${PORTVERSION}+uulib
MAINTAINER= ports@FreeBSD.org
COMMENT= Auto-resuming command line nntp file grabber
@ -15,14 +15,17 @@ LICENSE= GPLv2+
LICENSE_FILE= ${WRKSRC}/COPYING
USES= gmake
# Fails to build with GCC 4.9, cf. PR 196913.
USE_GCC= 4.8
GNU_CONFIGURE= yes
# Skip check if the C++ compiler supports exceptions. We know both
# Clang and GCC do. The configure test fails on FreeBSD 10.3 because
# it passes -fhandle-exceptions to the compiler and Clang 3.4.1 does
# not know to ignore it yet.
CONFIGURE_ARGS= my_cv_exceptions=1
OPTIONS_DEFINE= DOCS
post-extract:
@${LN} -s nget-${PORTVERSION} ${WRKDIR}/${DISTNAME}
WRKSRC= ${WRKDIR}/nget-${PORTVERSION}
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/nget ${STAGEDIR}${PREFIX}/bin

View File

@ -1,6 +1,6 @@
--- cache.h 2004-05-29 16:00:08.000000000 -0700
+++ cache.h 2005-09-22 22:37:43.000000000 -0700
@@ -102,7 +102,7 @@
--- cache.h.orig 2004-05-29 23:00:08 UTC
+++ cache.h
@@ -102,7 +102,7 @@ class c_nntp_server_article {
ulong bytes,lines;
c_nntp_server_article(ulong serverid,const c_group_info::ptr &group,ulong articlenum,ulong bytes,ulong lines);
};
@ -9,7 +9,7 @@
typedef pair<c_nntp_server_article*,c_server::ptr> t_real_server_article;
typedef multimap<float,t_real_server_article,greater<float> > t_nntp_server_articles_prioritized;
class c_nntp_part {
@@ -118,7 +118,7 @@
@@ -118,7 +118,7 @@ class c_nntp_part {
c_nntp_server_article *highest_sa=NULL;
float highprio=-10000.0,f;
for (;nsai!=articles.end();++nsai) {
@ -18,7 +18,7 @@
for (t_server_list_range servers = nconfig.getservers(sa->serverid); servers.first!=servers.second; ++servers.first)
if ((f=nconfig.trustsizes->getserverpriority(servers.first->second)) > highprio){
highest_sa=sa;
@@ -137,7 +137,41 @@
@@ -137,15 +137,49 @@ class c_nntp_part {
};
@ -30,7 +30,7 @@
+ const_iterator i = lower_bound(partnum);
+ return (i != end() && (*i)->partnum == partnum);
+ }
+
+ c_nntp_part* part(int partnum) {
+ iterator i = lower_bound(partnum);
+ if (i != end() && (*i)->partnum == partnum)
@ -58,10 +58,10 @@
+ return ((c_nntp_file_parts*)this)->lower_bound(partnum);
+ }
+};
+
//#define FILEFLAG_READ 1
@@ -145,7 +179,7 @@
typedef map<ulong,int> t_server_have_map;
class c_nntp_file : public c_nntp_file_base, public c_refcounted<c_nntp_file>{
public:
@ -70,7 +70,7 @@
int have;
// ulong bytes,lines;
ulong flags;
@@ -161,13 +195,13 @@
@@ -161,13 +195,13 @@ class c_nntp_file : public c_nntp_file_base, public c_
bool iscomplete(void) const {return (have>=req) || maybe_a_textreply();}
void get_server_have_map(t_server_have_map &have_map) const;
// ulong banum(void){assert(!parts.empty());return (*parts.begin()).second->articlenum;}
@ -88,7 +88,16 @@
}\
return b;\
}
@@ -311,9 +345,9 @@
@@ -228,7 +262,7 @@ class c_message_state : public c_refcounted<c_message_
};
#ifdef HAVE_WORKING_HASH_MAP
-typedef hash_map<const char*, c_message_state::ptr, hash<const char*>, eqstr> t_message_state_list;
+typedef hash_map<const char*, c_message_state::ptr, std::hash<const char*>, eqstr> t_message_state_list;
#else
typedef map<const char*, c_message_state::ptr, ltstr> t_message_state_list;
#endif
@@ -311,9 +345,9 @@ class meta_mid_info {
}
void insert(const c_nntp_file::ptr &f){
const string &mid=f->bamid();

View File

@ -0,0 +1,22 @@
https://github.com/Optware/Optware-ng/commit/cf5b5050c989fb4e969167d20e6b135ff2608a87
--- etree.cc.orig 2017-10-14 02:49:56 UTC
+++ etree.cc
@@ -79,7 +79,7 @@ pred<ClassType> *new_comparison(RetType (ClassType::*m
return new Comparison<Op, MemGetter, RetType, ClassType>(member, v);
}
template <template <class A, class B> class Op, class ClassType, class RetType>
-pred<ClassType> *new_comparison(RetType (ClassType::*memberf)(void), RetType v){
+pred<ClassType> *new_comparison(RetType (ClassType::*memberf)(void) const, RetType v){
return new Comparison<Op, MemfuncGetter, RetType, ClassType>(memberf, v);
}
template <class ClassType, class getterT, class T2>
@@ -112,7 +112,7 @@ pred<ClassType> *new_comparison_re(RetType (ClassType:
return new Comparison_re<Op, MemGetter, RetType, ClassType>(member, pattern, flags);
}
template <template <class A, class B> class Op, class ClassType, class RetType>
-pred<ClassType> *new_comparison_re(RetType (ClassType::*memberf)(void), const char *pattern, int flags){
+pred<ClassType> *new_comparison_re(RetType (ClassType::*memberf)(void) const, const char *pattern, int flags){
return new Comparison_re<Op, MemfuncGetter, RetType, ClassType>(memberf, pattern, flags);
}
template <class ClassType, class getterT>

View File

@ -0,0 +1,13 @@
https://github.com/Optware/Optware-ng/commit/cf5b5050c989fb4e969167d20e6b135ff2608a87
--- getter.h.orig 2017-10-14 02:48:48 UTC
+++ getter.h
@@ -35,7 +35,7 @@ class MemGetter {
template <class RetType, class ClassType>
class MemfuncGetter {
private:
- typedef RetType (ClassType::*member_t)(void);
+ typedef RetType (ClassType::*member_t)(void) const;
member_t member;
public:
typedef RetType T;

View File

@ -0,0 +1,14 @@
./par2/par2fileformat.h:89:25: error: flexible array member 'entries' of non-POD element type 'FILEVERIFICATIONENTRY []'
FILEVERIFICATIONENTRY entries[];
--- par2/par2fileformat.h.orig 2017-10-14 03:14:17 UTC
+++ par2/par2fileformat.h
@@ -86,7 +86,7 @@ struct FILEVERIFICATIONPACKET
PACKET_HEADER header;
// Body
MD5Hash fileid; // MD5hash of file_hash_16k, file_length, file_name
- FILEVERIFICATIONENTRY entries[];
+ FILEVERIFICATIONENTRY entries[0];
} PACKED;
// The file description packet is used to record the name of the file,