pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/net/libtorrent Add patch by Joerg Sonnenberger with sm...
details: https://anonhg.NetBSD.org/pkgsrc/rev/4b324f938eec
branches: trunk
changeset: 559939:4b324f938eec
user: tron <tron%pkgsrc.org@localhost>
date: Thu Jun 04 19:15:46 2009 +0000
description:
Add patch by Joerg Sonnenberger with small modification by myself that
addresses the API difference in kqueue(2) between NetBSD and FreeBSD.
Turn on kqueue(2) support now that it actually works under NetBSD.
diffstat:
net/libtorrent/Makefile | 6 ++--
net/libtorrent/distinfo | 3 +-
net/libtorrent/patches/patch-ab | 57 +++++++++++++++++++++++++++++++++++++++++
3 files changed, 62 insertions(+), 4 deletions(-)
diffs (95 lines):
diff -r dd49656e9864 -r 4b324f938eec net/libtorrent/Makefile
--- a/net/libtorrent/Makefile Thu Jun 04 18:40:23 2009 +0000
+++ b/net/libtorrent/Makefile Thu Jun 04 19:15:46 2009 +0000
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.32 2009/06/04 14:04:08 tron Exp $
+# $NetBSD: Makefile,v 1.33 2009/06/04 19:15:46 tron Exp $
DISTNAME= libtorrent-0.12.2
-PKGREVISION= 1
+PKGREVISION= 2
CATEGORIES= net
MASTER_SITES= ${HOMEPAGE:=downloads/}
@@ -21,7 +21,7 @@
.include "../../mk/bsd.prefs.mk"
-.if ${OPSYS} == "DragonFly" || ${OPSYS} == "FreeBSD" || ${OPSYS} == "OpenBSD"
+.if !empty(OPSYS:M*BSD) || ${OPSYS} == "DragonFly"
CONFIGURE_ARGS+= --with-kqueue
.endif
diff -r dd49656e9864 -r 4b324f938eec net/libtorrent/distinfo
--- a/net/libtorrent/distinfo Thu Jun 04 18:40:23 2009 +0000
+++ b/net/libtorrent/distinfo Thu Jun 04 19:15:46 2009 +0000
@@ -1,6 +1,7 @@
-$NetBSD: distinfo,v 1.22 2009/04/10 09:06:20 tron Exp $
+$NetBSD: distinfo,v 1.23 2009/06/04 19:15:46 tron Exp $
SHA1 (libtorrent-0.12.2.tar.gz) = a53d2c671e9f2dd971d0622d5b3672da91c46ef9
RMD160 (libtorrent-0.12.2.tar.gz) = 88cdc415f98afd8b87fa6d7330906737c3e434fa
Size (libtorrent-0.12.2.tar.gz) = 585374 bytes
SHA1 (patch-aa) = d864808b9e9524b3a7f72bcc1b465d4e6b2d4f4a
+SHA1 (patch-ab) = 161a2b0d354ba326a82a2747050b8f323ea420a6
diff -r dd49656e9864 -r 4b324f938eec net/libtorrent/patches/patch-ab
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/net/libtorrent/patches/patch-ab Thu Jun 04 19:15:46 2009 +0000
@@ -0,0 +1,57 @@
+$NetBSD: patch-ab,v 1.9 2009/06/04 19:15:47 tron Exp $
+
+Deal with the kqueue(2) API differences between NetBSD and the other BSDs.
+
+--- src/torrent/poll_kqueue.cc.orig 2008-05-07 13:19:13.000000000 +0100
++++ src/torrent/poll_kqueue.cc 2009-06-04 18:10:50.000000000 +0100
+@@ -57,6 +57,12 @@
+
+ #ifdef USE_KQUEUE
+
++#ifdef __NetBSD__
++typedef uintptr_t kevent_udata_t;
++#else
++typedef void *kevent_udata_t;
++#endif
++
+ inline uint32_t
+ PollKQueue::event_mask(Event* e) {
+ return m_table[e->file_descriptor()];
+@@ -83,7 +89,7 @@
+
+ struct kevent* itr = m_changes + (m_changedEvents++);
+
+- EV_SET(itr, event->file_descriptor(), mask, op, 0, 0, event);
++ EV_SET(itr, event->file_descriptor(), mask, op, 0, 0, (kevent_udata_t)event);
+ }
+
+ PollKQueue*
+@@ -146,10 +152,10 @@
+
+ // Also check current mask.
+
+- if (itr->filter == EVFILT_READ && itr->udata != NULL && event_mask((Event*)itr->udata) & flag_read)
++ if (itr->filter == EVFILT_READ && itr->udata != (kevent_udata_t)NULL && event_mask((Event*)itr->udata) & flag_read)
+ ((Event*)itr->udata)->event_read();
+
+- if (itr->filter == EVFILT_WRITE && itr->udata != NULL && event_mask((Event*)itr->udata) & flag_write)
++ if (itr->filter == EVFILT_WRITE && itr->udata != (kevent_udata_t)NULL && event_mask((Event*)itr->udata) & flag_write)
+ ((Event*)itr->udata)->event_write();
+ }
+
+@@ -173,10 +179,12 @@
+ throw internal_error("PollKQueue::close(...) called but the file descriptor is active");
+
+ for (struct kevent *itr = m_events, *last = m_events + m_waitingEvents; itr != last; ++itr)
+- if (itr->udata == event)
+- itr->udata = NULL;
++ if (itr->udata == (kevent_udata_t)event)
++ itr->udata = (kevent_udata_t)NULL;
++
++ struct kevent *oitr = m_changes;
+
+- m_changedEvents = std::remove_if(m_changes, m_changes + m_changedEvents, rak::equal(event, rak::mem_ref(&kevent::udata))) - m_changes;
++ m_changedEvents = std::remove_if(m_changes, m_changes + m_changedEvents, rak::equal((kevent_udata_t)event, rak::mem_ref(&kevent::udata))) - m_changes;
+ }
+
+ // Use custom defines for EPOLL* to make the below code compile with
Home |
Main Index |
Thread Index |
Old Index