From 7abfcbd565ff19f9be9eb4a6b5490f50ee7cee76 Mon Sep 17 00:00:00 2001 From: wiz Date: Fri, 11 Dec 2015 12:13:00 +0000 Subject: Fix two problems when building on NetBSD-6.x. Mention upstream bug reports filed for them. Addresses PR 50521 by Uwe Toenjes. While here, add reload command to rc.d script and bump PKGREVISION. --- net/tor/Makefile | 5 ++++- net/tor/distinfo | 3 ++- net/tor/files/tor.in | 4 +++- .../patches/patch-src_common_compat__pthreads.c | 22 ++++++++++++++++++++++ 4 files changed, 31 insertions(+), 3 deletions(-) create mode 100644 net/tor/patches/patch-src_common_compat__pthreads.c (limited to 'net/tor') diff --git a/net/tor/Makefile b/net/tor/Makefile index dc2e224623b..756d5f6aa7f 100644 --- a/net/tor/Makefile +++ b/net/tor/Makefile @@ -1,6 +1,7 @@ -# $NetBSD: Makefile,v 1.106 2015/12/08 13:19:38 wiz Exp $ +# $NetBSD: Makefile,v 1.107 2015/12/11 12:13:00 wiz Exp $ DISTNAME= tor-0.2.7.5 +PKGREVISION= 1 CATEGORIES= net security MASTER_SITES= http://www.torproject.org/dist/ @@ -13,6 +14,8 @@ LICENSE= modified-bsd USE_LANGUAGES= c99 USE_PKGLOCALEDIR= yes +# https://trac.torproject.org/projects/tor/ticket/17818 +USE_TOOLS+= gmake GNU_CONFIGURE= yes CONFIGURE_ENV+= CPP=${CPP:Q} diff --git a/net/tor/distinfo b/net/tor/distinfo index 066481d8396..15eb6b52a09 100644 --- a/net/tor/distinfo +++ b/net/tor/distinfo @@ -1,6 +1,7 @@ -$NetBSD: distinfo,v 1.68 2015/12/08 13:19:38 wiz Exp $ +$NetBSD: distinfo,v 1.69 2015/12/11 12:13:00 wiz Exp $ SHA1 (tor-0.2.7.5.tar.gz) = ff099ddea9b33788d6f6ad8ed7f38479be197086 RMD160 (tor-0.2.7.5.tar.gz) = 964a3d0080684e159a85a2e257a4051667279e5d SHA512 (tor-0.2.7.5.tar.gz) = c57b3ee6ecc36456182c7130db671c5581914cddf973c9460625cd5ecd10d128f3e4832f1520269f6ab145cc0dcb218df2a19fb659b778fb31d9f69de5362678 Size (tor-0.2.7.5.tar.gz) = 4838541 bytes +SHA1 (patch-src_common_compat__pthreads.c) = 6c1be2f8e66e3796272eaad2d8a37ada6aa5e6ff diff --git a/net/tor/files/tor.in b/net/tor/files/tor.in index 20668310acc..6165b2aeb24 100644 --- a/net/tor/files/tor.in +++ b/net/tor/files/tor.in @@ -1,6 +1,6 @@ #!@RCD_SCRIPTS_SHELL@ # -# $NetBSD: tor.in,v 1.4 2015/12/08 13:19:38 wiz Exp $ +# $NetBSD: tor.in,v 1.5 2015/12/11 12:13:00 wiz Exp $ # # PROVIDE: tor # REQUIRE: DAEMON NETWORKING @@ -23,6 +23,7 @@ start_cmd="tor_start" stop_cmd="tor_stop" pidfile="@PKG_HOME@/${name}.pid" restart_cmd="tor_stop ; tor_start" +extra_commands="reload" tor_start () { @@ -42,3 +43,4 @@ then else eval ${start_cmd} fi + diff --git a/net/tor/patches/patch-src_common_compat__pthreads.c b/net/tor/patches/patch-src_common_compat__pthreads.c new file mode 100644 index 00000000000..1be6b88d0c9 --- /dev/null +++ b/net/tor/patches/patch-src_common_compat__pthreads.c @@ -0,0 +1,22 @@ +$NetBSD: patch-src_common_compat__pthreads.c,v 1.1 2015/12/11 12:13:00 wiz Exp $ + +Disable a function that is not there on NetBSD before 7. +https://trac.torproject.org/projects/tor/ticket/17819 + +--- src/common/compat_pthreads.c.orig 2015-11-13 13:33:25.000000000 +0000 ++++ src/common/compat_pthreads.c +@@ -186,12 +186,14 @@ tor_cond_init(tor_cond_t *cond) + } + + #if defined(HAVE_CLOCK_GETTIME) && defined(CLOCK_MONOTONIC) ++#if !defined(__NetBSD__) || (defined(__NetBSD__) && __NetBSD_Version__ > 699999999) + /* Use monotonic time so when we timedwait() on it, any clock adjustment + * won't affect the timeout value. */ + if (pthread_condattr_setclock(&condattr, CLOCK_MONOTONIC)) { + return -1; + } + #endif ++#endif + if (pthread_cond_init(&cond->cond, &condattr)) { + return -1; + } -- cgit v1.2.3