diff options
author | marius <marius@FreeBSD.org> | 2014-03-24 23:47:21 +0800 |
---|---|---|
committer | marius <marius@FreeBSD.org> | 2014-03-24 23:47:21 +0800 |
commit | d38918c2a7ec7f5717bf03b3c42662ea1b9c8aac (patch) | |
tree | 71ee2bd47607d270f15a8414624fd48b940fb907 /net-p2p/libtorrent | |
parent | eae97fbf25b83f6040f5e3ef0d0d4b3d3f657ae5 (diff) | |
download | freebsd-ports-gnome-d38918c2a7ec7f5717bf03b3c42662ea1b9c8aac.tar.gz freebsd-ports-gnome-d38918c2a7ec7f5717bf03b3c42662ea1b9c8aac.tar.zst freebsd-ports-gnome-d38918c2a7ec7f5717bf03b3c42662ea1b9c8aac.zip |
Improve the workaround for FreeBSD >= 10 to actually use the base clang.
Mostly based on:
https://raw.github.com/ArchBSD/abs/master/community/libtorrent/PKGBUILD
https://github.com/ArchBSD/abs/raw/master/community/libtorrent/missing_references.diff
https://raw.github.com/ArchBSD/abs/master/community/rtorrent/missing_references.diff
Approved by: bapt (mentor)
Diffstat (limited to 'net-p2p/libtorrent')
-rw-r--r-- | net-p2p/libtorrent/Makefile | 19 | ||||
-rw-r--r-- | net-p2p/libtorrent/files/extra-clang | 90 | ||||
-rw-r--r-- | net-p2p/libtorrent/files/patch-src_net_socket__set.h | 18 | ||||
-rw-r--r-- | net-p2p/libtorrent/files/patch-src_torrent_utils_log.cc | 19 | ||||
-rw-r--r-- | net-p2p/libtorrent/files/patch-src_torrent_utils_log.h | 21 |
5 files changed, 163 insertions, 4 deletions
diff --git a/net-p2p/libtorrent/Makefile b/net-p2p/libtorrent/Makefile index a8959ba4c2dc..e20410b57eae 100644 --- a/net-p2p/libtorrent/Makefile +++ b/net-p2p/libtorrent/Makefile @@ -2,7 +2,7 @@ PORTNAME= libtorrent PORTVERSION= 0.13.2 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= net-p2p MASTER_SITES= http://libtorrent.rakshasa.no/downloads/ \ ${MASTER_SITE_LOCAL} @@ -38,13 +38,24 @@ CONFIGURE_ENV= OPENSSL_LIBS="-L/usr/lib -ssl -crypto" OPENSSL_CFLAGS="-I/usr/inc CONFIGURE_ARGS+= --disable-debug -# Workaround to build on > 10.x -.if ${OSVERSION} >= 1000000 -USE_GCC= yes +# Workaround to build on >= 10.x +.if ${OPSYS} == FreeBSD && ${OSVERSION} >= 1000000 +CXXFLAGS+= -std=c++11 +EXTRA_PATCHES+= ${FILESDIR}/extra-clang .endif post-patch: @${REINPLACE_CMD} -e 's|-O3|${CFLAGS}|' ${WRKSRC}/configure +.if ${OPSYS} == FreeBSD && ${OSVERSION} >= 1000000 + @${FIND} ${WRKSRC} \( -name '*.h' -o -name '*.cc' \) -type f \ + -exec ${REINPLACE_CMD} -e 's/tr1::/std::/g' {} \; \ + -exec ${REINPLACE_CMD} -e 's/std::std::/std::/g' {} \; \ + -exec ${REINPLACE_CMD} -e '/namespace tr1/d' {} \; \ + -exec ${REINPLACE_CMD} -e '/include/s,tr1/,,' {} \; + @${REINPLACE_CMD} -e 's/\.assign/.fill/' \ + ${WRKSRC}/src/torrent/utils/extents.h \ + ${WRKSRC}/src/torrent/utils/log.cc +.endif .if ${PORT_OPTIONS:MKQUEUE} CONFIGURE_ARGS+= --with-kqueue diff --git a/net-p2p/libtorrent/files/extra-clang b/net-p2p/libtorrent/files/extra-clang new file mode 100644 index 000000000000..421abccf7b26 --- /dev/null +++ b/net-p2p/libtorrent/files/extra-clang @@ -0,0 +1,90 @@ +You guys are doing it wrong. And clang is strict about it. +This makes rtorrent link again. + +--- src/data/memory_chunk.cc 2013-12-07 17:21:35.803392000 +0100 ++++ old/data/memory_chunk.cc 2013-12-07 17:47:23.430285373 +0100 +@@ -54,6 +54,29 @@ extern "C" int madvise(void *, size_t, i + + namespace torrent { + ++const int MemoryChunk::prot_exec; ++const int MemoryChunk::prot_read; ++const int MemoryChunk::prot_write; ++const int MemoryChunk::prot_none; ++const int MemoryChunk::map_shared; ++ ++#ifdef USE_MADVISE ++const int MemoryChunk::advice_normal; ++const int MemoryChunk::advice_random; ++const int MemoryChunk::advice_sequential; ++const int MemoryChunk::advice_willneed; ++const int MemoryChunk::advice_dontneed; ++#else ++const int MemoryChunk::advice_normal; ++const int MemoryChunk::advice_random; ++const int MemoryChunk::advice_sequential; ++const int MemoryChunk::advice_willneed; ++const int MemoryChunk::advice_dontneed; ++#endif ++const int MemoryChunk::sync_sync; ++const int MemoryChunk::sync_async; ++const int MemoryChunk::sync_invalidate; ++ + uint32_t MemoryChunk::m_pagesize = getpagesize(); + + inline void +--- src/torrent/data/file.cc 2013-12-07 17:21:35.590392000 +0100 ++++ old/torrent/data/file.cc 2013-12-07 17:45:59.975290599 +0100 +@@ -50,6 +50,15 @@ + + namespace torrent { + ++const int File::flag_active; ++const int File::flag_create_queued; ++const int File::flag_resize_queued; ++const int File::flag_fallocate; ++const int File::flag_previously_created; ++ ++const int File::flag_prioritize_first; ++const int File::flag_prioritize_last; ++ + File::File() : + m_fd(-1), + m_protection(0), +--- src/torrent/download.cc 2013-12-07 17:21:35.721391000 +0100 ++++ old/torrent/download.cc 2013-12-07 17:44:19.498298036 +0100 +@@ -72,6 +72,20 @@ + + namespace torrent { + ++const int DownloadInfo::flag_open; ++const int DownloadInfo::flag_active; ++const int DownloadInfo::flag_compact; ++const int DownloadInfo::flag_accepting_new_peers; ++const int DownloadInfo::flag_accepting_seeders; ++const int DownloadInfo::flag_private; ++const int DownloadInfo::flag_meta_download; ++const int DownloadInfo::flag_pex_enabled; ++const int DownloadInfo::flag_pex_active; ++ ++const int DownloadInfo::public_flags; ++ ++const uint32_t DownloadInfo::unlimited; ++ + const DownloadInfo* Download::info() const { return m_ptr->info(); } + const download_data* Download::data() const { return m_ptr->data(); } + +--- src/torrent/peer/connection_list.cc 2013-12-07 17:21:35.676392000 +0100 ++++ old/torrent/peer/connection_list.cc 2013-12-07 17:44:32.385410379 +0100 +@@ -60,6 +60,11 @@ + + namespace torrent { + ++const int ConnectionList::disconnect_available; ++const int ConnectionList::disconnect_quick; ++const int ConnectionList::disconnect_unwanted; ++const int ConnectionList::disconnect_delayed; ++ + ConnectionList::ConnectionList(DownloadMain* download) : + m_download(download), m_minSize(50), m_maxSize(100) { + } diff --git a/net-p2p/libtorrent/files/patch-src_net_socket__set.h b/net-p2p/libtorrent/files/patch-src_net_socket__set.h new file mode 100644 index 000000000000..417682ad42eb --- /dev/null +++ b/net-p2p/libtorrent/files/patch-src_net_socket__set.h @@ -0,0 +1,18 @@ +--- src/net/socket_set.h.orig 2012-01-19 11:19:26.000000000 +0100 ++++ src/net/socket_set.h 2014-02-02 19:05:15.000000000 +0100 +@@ -53,12 +53,12 @@ + + // Propably should rename to EventSet... + +-class SocketSet : private std::vector<Event*, rak::cacheline_allocator<> > { ++class SocketSet : private std::vector<Event*, rak::cacheline_allocator<Event *> > { + public: + typedef uint32_t size_type; + +- typedef std::vector<Event*, rak::cacheline_allocator<> > base_type; +- typedef std::vector<size_type, rak::cacheline_allocator<> > Table; ++ typedef std::vector<Event*, rak::cacheline_allocator<Event *> > base_type; ++ typedef std::vector<size_type, rak::cacheline_allocator<size_type> > Table; + + static const size_type npos = static_cast<size_type>(-1); + diff --git a/net-p2p/libtorrent/files/patch-src_torrent_utils_log.cc b/net-p2p/libtorrent/files/patch-src_torrent_utils_log.cc new file mode 100644 index 000000000000..01102fbd17ab --- /dev/null +++ b/net-p2p/libtorrent/files/patch-src_torrent_utils_log.cc @@ -0,0 +1,19 @@ +--- src/torrent/utils/log.cc.orig 2012-03-20 16:10:16.000000000 +0100 ++++ src/torrent/utils/log.cc 2014-02-02 18:49:35.000000000 +0100 +@@ -158,6 +158,7 @@ + va_list ap; + unsigned int buffer_size = 4096; + char buffer[buffer_size]; ++ char *bufp = buffer; + char* first = buffer; + + if (hash != NULL && subsystem != NULL) { +@@ -176,7 +177,7 @@ + pthread_mutex_lock(&log_mutex); + std::for_each(m_first, m_last, tr1::bind(&log_slot::operator(), + tr1::placeholders::_1, +- buffer, ++ bufp, + std::distance(buffer, first), + std::distance(log_groups.begin(), this))); + if (dump_data != NULL) diff --git a/net-p2p/libtorrent/files/patch-src_torrent_utils_log.h b/net-p2p/libtorrent/files/patch-src_torrent_utils_log.h new file mode 100644 index 000000000000..9f26e740d13a --- /dev/null +++ b/net-p2p/libtorrent/files/patch-src_torrent_utils_log.h @@ -0,0 +1,21 @@ +--- src/torrent/utils/log.h.orig 2012-04-20 08:41:43.000000000 +0200 ++++ src/torrent/utils/log.h 2014-02-02 18:40:40.000000000 +0100 +@@ -124,15 +124,15 @@ + + #define lt_log_print(log_group, ...) \ + if (torrent::log_groups[log_group].valid()) \ +- torrent::log_groups[log_group].internal_print(NULL, NULL, NULL, NULL, __VA_ARGS__); ++ torrent::log_groups[log_group].internal_print(NULL, NULL, NULL, 0, __VA_ARGS__); + + #define lt_log_print_info(log_group, log_info, log_subsystem, ...) \ + if (torrent::log_groups[log_group].valid()) \ +- torrent::log_groups[log_group].internal_print(&log_info->hash(), log_subsystem, NULL, NULL, __VA_ARGS__); ++ torrent::log_groups[log_group].internal_print(&log_info->hash(), log_subsystem, NULL, 0, __VA_ARGS__); + + #define lt_log_print_data(log_group, log_data, log_subsystem, ...) \ + if (torrent::log_groups[log_group].valid()) \ +- torrent::log_groups[log_group].internal_print(&log_data->hash(), log_subsystem, NULL, NULL, __VA_ARGS__); ++ torrent::log_groups[log_group].internal_print(&log_data->hash(), log_subsystem, NULL, 0, __VA_ARGS__); + + #define lt_log_print_dump(log_group, log_dump_data, log_dump_size, ...) \ + if (torrent::log_groups[log_group].valid()) \ |