capnproto, bump version (#9511)

This commit is contained in:
Schrijvers Luc
2023-09-23 16:14:29 +00:00
committed by GitHub
parent 0cc313df1e
commit d588c77023
3 changed files with 105 additions and 48 deletions

View File

@@ -6,7 +6,8 @@ COPYRIGHT="2017 Cloudflare, Inc. and contributors"
LICENSE="MIT"
REVISION="1"
SOURCE_URI="https://github.com/capnproto/capnproto/archive/refs/tags/v${portVersion}.tar.gz"
CHECKSUM_SHA256="756262841fa66260c9969e900701cc86720c2548584fb96c8153348fd7edfe69"
CHECKSUM_SHA256="5bdb16f6b389a9e29b04214b9bae1759e8b7fe2b45049d7e3f1f286ba050a200"
SOURCE_DIR="capnproto-$portVersion"
PATCHES="capnproto-$portVersion.patchset"
ARCHITECTURES="all !x86_gcc2"
@@ -108,3 +109,8 @@ INSTALL()
$developDir \
$libDir/cmake
}
TEST()
{
make -C build test
}

View File

@@ -1,47 +0,0 @@
From 3aa998fadddc8dbe4df4c7c8d1c905c87ba27bde Mon Sep 17 00:00:00 2001
From: Han Pengfei <pengphei@qq.com>
Date: Thu, 20 Oct 2022 02:46:51 +0000
Subject: Fix missing pwritev
Signed-off-by: Han Pengfei <pengphei@qq.com>
diff --git a/c++/src/kj/filesystem-disk-unix.c++ b/c++/src/kj/filesystem-disk-unix.c++
index cc19878..8f6d348 100644
--- a/c++/src/kj/filesystem-disk-unix.c++
+++ b/c++/src/kj/filesystem-disk-unix.c++
@@ -403,7 +403,7 @@ public:
static const byte ZEROS[4096] = { 0 };
-#if __APPLE__ || __CYGWIN__ || (defined(__ANDROID__) && __ANDROID_API__ < 24)
+#if __APPLE__ || __CYGWIN__ || (defined(__ANDROID__) && __ANDROID_API__ < 24) || defined(__HAIKU__)
// Mac & Cygwin & Android API levels 23 and lower doesn't have pwritev().
while (size > sizeof(ZEROS)) {
write(offset, ZEROS);
--
2.37.3
From 534327ca766b0ad64689b8df00e2d028884b467a Mon Sep 17 00:00:00 2001
From: Han Pengfei <pengphei@qq.com>
Date: Fri, 28 Oct 2022 02:12:30 +0000
Subject: message: fix sizeof assert for areaspace
Signed-off-by: Han Pengfei <pengphei@qq.com>
diff --git a/c++/src/capnp/message.h b/c++/src/capnp/message.h
index 55a8b2e..a6bfeac 100644
--- a/c++/src/capnp/message.h
+++ b/c++/src/capnp/message.h
@@ -127,7 +127,7 @@ public:
private:
ReaderOptions options;
-#if defined(__EMSCRIPTEN__)
+#if defined(__EMSCRIPTEN__) || defined(__HAIKU__)
static constexpr size_t arenaSpacePadding = 19;
#else
static constexpr size_t arenaSpacePadding = 18;
--
2.37.3

View File

@@ -0,0 +1,98 @@
From 738813fcc720bbd4c9053a58954411a33fe6d71d Mon Sep 17 00:00:00 2001
From: Han Pengfei <pengphei@qq.com>
Date: Thu, 20 Oct 2022 02:46:51 +0000
Subject: Fix missing pwritev
diff --git a/c++/src/kj/filesystem-disk-unix.c++ b/c++/src/kj/filesystem-disk-unix.c++
index 67d7bf2..355ad12 100644
--- a/c++/src/kj/filesystem-disk-unix.c++
+++ b/c++/src/kj/filesystem-disk-unix.c++
@@ -416,7 +416,7 @@ public:
static const byte ZEROS[4096] = { 0 };
-#if __APPLE__ || __CYGWIN__ || (defined(__ANDROID__) && __ANDROID_API__ < 24)
+#if __APPLE__ || __CYGWIN__ || (defined(__ANDROID__) && __ANDROID_API__ < 24) || defined(__HAIKU__)
// Mac & Cygwin & Android API levels 23 and lower doesn't have pwritev().
while (size > sizeof(ZEROS)) {
write(offset, ZEROS);
--
2.37.3
From 5713157be79b8a5d092294a9d75038cd6d16f834 Mon Sep 17 00:00:00 2001
From: Han Pengfei <pengphei@qq.com>
Date: Fri, 28 Oct 2022 02:12:30 +0000
Subject: message: fix sizeof assert for areaspace
diff --git a/c++/src/capnp/message.h b/c++/src/capnp/message.h
index af87aec..c38cb77 100644
--- a/c++/src/capnp/message.h
+++ b/c++/src/capnp/message.h
@@ -127,7 +127,7 @@ public:
private:
ReaderOptions options;
-#if defined(__EMSCRIPTEN__) || (defined(__APPLE__) && defined(__ppc__))
+#if defined(__EMSCRIPTEN__) || defined(__HAIKU__) || (defined(__APPLE__) && defined(__ppc__))
static constexpr size_t arenaSpacePadding = 19;
#else
static constexpr size_t arenaSpacePadding = 18;
--
2.37.3
From bdc99a0b576ff8abc415154128158b31d262c1f1 Mon Sep 17 00:00:00 2001
From: Begasus <begasus@gmail.com>
Date: Sat, 23 Sep 2023 13:29:21 +0200
Subject: Fixes for building and running the tests
diff --git a/c++/CMakeLists.txt b/c++/CMakeLists.txt
index f60cb95..0f6dd81 100644
--- a/c++/CMakeLists.txt
+++ b/c++/CMakeLists.txt
@@ -24,6 +24,10 @@ set(INSTALL_TARGETS_DEFAULT_ARGS
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
)
+if(HAIKU)
+ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lnetwork")
+endif(HAIKU)
+
# Options ======================================================================
option(EXTERNAL_CAPNP "Use the system capnp binary, or the one specified in $CAPNP, instead of using the compiled one." OFF)
diff --git a/c++/src/kj/async-unix-test.c++ b/c++/src/kj/async-unix-test.c++
index 64190c4..7873ddc 100644
--- a/c++/src/kj/async-unix-test.c++
+++ b/c++/src/kj/async-unix-test.c++
@@ -54,6 +54,10 @@
#undef SIGRTMIN
#endif
+#ifndef SIGIO
+# define SIGIO -1
+#endif
+
namespace kj {
namespace {
diff --git a/c++/src/kj/test-helpers.c++ b/c++/src/kj/test-helpers.c++
index 6ae8cd3..ef00d7e 100644
--- a/c++/src/kj/test-helpers.c++
+++ b/c++/src/kj/test-helpers.c++
@@ -45,7 +45,7 @@ bool hasSubstring(StringPtr haystack, StringPtr needle) {
// Hell, doing a query for an embedded null & dispatching to strstr is still cheaper & only
// marginally slower than the purely naiive implementation.
-#if !defined(_WIN32)
+#if !defined(_WIN32) && !defined(__HAIKU__)
return memmem(haystack.begin(), haystack.size(), needle.begin(), needle.size()) != nullptr;
#else
// TODO(perf): This is not the best algorithm for substring matching. strstr can't be used
--
2.37.3