summaryrefslogtreecommitdiff
path: root/databases
diff options
context:
space:
mode:
authorfhajny <fhajny@pkgsrc.org>2015-09-07 11:52:56 +0000
committerfhajny <fhajny@pkgsrc.org>2015-09-07 11:52:56 +0000
commitb4442114c2e33c10fc3645b16f3e1257bd2f45b7 (patch)
tree56c9f3d067a9a228e9c2dae2775257af54401970 /databases
parentcd8976fe997de657b8abb82e77cecbd990bebcfd (diff)
downloadpkgsrc-b4442114c2e33c10fc3645b16f3e1257bd2f45b7.tar.gz
Fix NetBSD<7 build issue by re-using a patch from lang/nodejs (v8).
Diffstat (limited to 'databases')
-rw-r--r--databases/mongodb/distinfo3
-rw-r--r--databases/mongodb/patches/patch-src_third__party_v8-3.25_src_platform_semaphore.cc48
2 files changed, 50 insertions, 1 deletions
diff --git a/databases/mongodb/distinfo b/databases/mongodb/distinfo
index 9edee8b291d..2f445effac5 100644
--- a/databases/mongodb/distinfo
+++ b/databases/mongodb/distinfo
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.5 2015/08/26 05:03:00 fhajny Exp $
+$NetBSD: distinfo,v 1.6 2015/09/07 11:52:56 fhajny Exp $
SHA1 (mongodb-src-r3.0.6.tar.gz) = b80acf2cd63b3bce27d860581ce17a3aad2b8ea8
RMD160 (mongodb-src-r3.0.6.tar.gz) = 3e3dc920c0790826b54d02e5a82faace48da9e9f
@@ -13,5 +13,6 @@ SHA1 (patch-src_mongo_util_intrusive__counter.h) = d242db05708c999bd19f2751bdc88
SHA1 (patch-src_third__party_s2_base_port.h) = 8e715efbfcacaba51d957c21aa32ccfd3cc4f736
SHA1 (patch-src_third__party_v8-3.25_SConscript) = a8da59130c36b2be3b89498ba0b23b1c7c9ab9e6
SHA1 (patch-src_third__party_v8-3.25_src_platform-posix.cc) = 2fa27016a9af828d1c01815739770918a2d53d16
+SHA1 (patch-src_third__party_v8-3.25_src_platform_semaphore.cc) = 1875441d4d7daed8ac49ef935d3cb138e29ddadd
SHA1 (patch-src_third__party_wiredtiger_SConscript) = b9ed24d0c05e812d66941f94a77cf4c91f55d43b
SHA1 (patch-src_third__party_wiredtiger_build__netbsd_wiredtiger__config.h) = e41064c0ff7268efc795782312ff413295cbcba7
diff --git a/databases/mongodb/patches/patch-src_third__party_v8-3.25_src_platform_semaphore.cc b/databases/mongodb/patches/patch-src_third__party_v8-3.25_src_platform_semaphore.cc
new file mode 100644
index 00000000000..6a69720e4b0
--- /dev/null
+++ b/databases/mongodb/patches/patch-src_third__party_v8-3.25_src_platform_semaphore.cc
@@ -0,0 +1,48 @@
+$NetBSD: patch-src_third__party_v8-3.25_src_platform_semaphore.cc,v 1.1 2015/09/07 11:52:56 fhajny Exp $
+
+Work around lack of sem_timedwait(3) in NetBSD < 6.99.4.
+Adapted from d4f11c0cf476dd854eaebec1cbacb1afc7bea18e of the Chromium V8 sources.
+
+--- src/third_party/v8-3.25/src/platform/semaphore.cc.orig 2015-08-24 00:39:52.000000000 +0000
++++ src/third_party/v8-3.25/src/platform/semaphore.cc
+@@ -32,9 +32,14 @@
+ #include <mach/task.h>
+ #endif
+
++#if V8_OS_NETBSD
++#include <sys/param.h> // for __NetBSD_Version__
++#endif
++
+ #include <errno.h>
+
+ #include "checks.h"
++#include "platform/elapsed-timer.h"
+ #include "platform/time.h"
+
+ namespace v8 {
+@@ -129,6 +134,17 @@ void Semaphore::Wait() {
+
+
+ bool Semaphore::WaitFor(const TimeDelta& rel_time) {
++#if V8_OS_NACL || (V8_OS_NETBSD && __NetBSD_Version__ - 0 < 699000400)
++ // PNaCL and older NetBSD doesn't support sem_timedwait, do ugly busy waiting.
++ ElapsedTimer timer;
++ timer.Start();
++ do {
++ int result = sem_trywait(&native_handle_);
++ if (result == 0) return true;
++ DCHECK(errno == EAGAIN || errno == EINTR);
++ } while (!timer.HasExpired(rel_time));
++ return false;
++#else
+ // Compute the time for end of timeout.
+ const Time time = Time::NowFromSystemTime() + rel_time;
+ const struct timespec ts = time.ToTimespec();
+@@ -152,6 +168,7 @@ bool Semaphore::WaitFor(const TimeDelta&
+ ASSERT_EQ(-1, result);
+ ASSERT_EQ(EINTR, errno);
+ }
++#endif
+ }
+
+ #elif V8_OS_WIN