diff --git a/cjdns.libuv-1.0.patch b/cjdns.libuv-1.0.patch new file mode 100644 index 0000000..61f45fb --- /dev/null +++ b/cjdns.libuv-1.0.patch @@ -0,0 +1,36 @@ +diff --git a/util/events/libuv/Pipe.c b/util/events/libuv/Pipe.c +index f702b8d..fdefe0d 100644 +--- a/util/events/libuv/Pipe.c ++++ b/util/events/libuv/Pipe.c +@@ -234,11 +234,6 @@ static void incoming(uv_stream_t* stream, ssize_t nread, const uv_buf_t* buf) + } + } + +-static void incoming2(uv_pipe_t* stream, ssize_t nread, const uv_buf_t* buf, uv_handle_type _) +-{ +- incoming((uv_stream_t*)stream, nread, buf); +-} +- + static void allocate(uv_handle_t* handle, size_t size, uv_buf_t* buf) + { + struct Pipe_pvt* pipe = Identity_check((struct Pipe_pvt*) handle->data); +@@ -257,11 +252,7 @@ static void allocate(uv_handle_t* handle, size_t size, uv_buf_t* buf) + + static int startPipe(struct Pipe_pvt* pipe) + { +- if (pipe->ipc) { +- return uv_read2_start((uv_stream_t*)&pipe->peer, allocate, incoming2); +- } else { +- return uv_read_start((uv_stream_t*)&pipe->peer, allocate, incoming); +- } ++ return uv_read_start((uv_stream_t*)&pipe->peer, allocate, incoming); + } + + static void connected(uv_connect_t* req, int status) +@@ -438,4 +429,4 @@ Er_DEFUN(bool Pipe_exists(const char* path, struct Allocator* errAlloc)) + #endif + Er_ret(((int)(st.st_mode & S_IFMT)) == flag); + } +-} +\ No newline at end of file ++} diff --git a/cjdns.libuv.patch b/cjdns.libuv.patch index 6ca9651..70a9717 100644 --- a/cjdns.libuv.patch +++ b/cjdns.libuv.patch @@ -1,7 +1,8 @@ -diff -up ./node_build/make.js.libuv ./node_build/make.js ---- ./node_build/make.js.libuv 2019-05-02 04:02:32.000000000 -0400 -+++ ./node_build/make.js 2019-09-18 11:01:36.021282700 -0400 -@@ -101,7 +101,7 @@ Builder.configure({ +diff --git a/node_build/make.js b/node_build/make.js +index 5902ccf..fa7c574 100644 +--- a/node_build/make.js ++++ b/node_build/make.js +@@ -91,7 +91,7 @@ Builder.configure({ if (!builder.config.crossCompiling) { if (NO_MARCH_FLAG.indexOf(process.arch) == -1) { @@ -10,16 +11,7 @@ diff -up ./node_build/make.js.libuv ./node_build/make.js } } -@@ -291,7 +291,7 @@ Builder.configure({ - - if (!builder.config.crossCompiling) { - if (NO_MARCH_FLAG.indexOf(process.arch) == -1) { -- args.unshift('-march=native'); -+ args.unshift('-mtune=generic'); - } - } - -@@ -305,7 +305,7 @@ Builder.configure({ +@@ -256,7 +256,7 @@ Builder.configure({ }).nThen(function (waitFor) { @@ -28,7 +20,7 @@ diff -up ./node_build/make.js.libuv ./node_build/make.js if (!android) { builder.config.libs.push('-lpthread'); } -@@ -332,15 +332,13 @@ Builder.configure({ +@@ -283,15 +283,13 @@ Builder.configure({ ); } @@ -46,11 +38,12 @@ diff -up ./node_build/make.js.libuv ./node_build/make.js }).nThen(function (waitFor) { -diff -up ./test/Beacon_test.c.libuv ./test/Beacon_test.c ---- ./test/Beacon_test.c.libuv 2019-05-02 04:02:32.000000000 -0400 -+++ ./test/Beacon_test.c 2019-09-18 10:56:52.757377575 -0400 -@@ -256,7 +256,8 @@ int main() - start(alloc, logger, base, rand, runTest); +diff --git a/test/Beacon_test.c b/test/Beacon_test.c +index 7ffd0f9..277ffd1 100644 +--- a/test/Beacon_test.c ++++ b/test/Beacon_test.c +@@ -271,7 +271,8 @@ int main() + start(Allocator_child(alloc), logger, base, rand, runTest); EventBase_beginLoop(base); - Allocator_free(alloc); @@ -59,42 +52,11 @@ diff -up ./test/Beacon_test.c.libuv ./test/Beacon_test.c return 0; } #endif -diff -up ./util/events/libuv/FileNo.c.libuv ./util/events/libuv/FileNo.c ---- ./util/events/libuv/FileNo.c.libuv 2019-05-02 04:02:32.000000000 -0400 -+++ ./util/events/libuv/FileNo.c 2019-09-18 10:56:52.757377575 -0400 -@@ -77,14 +77,14 @@ static void onClose(uv_handle_t* handle) - #endif - #define ALLOC(buff) (((struct Allocator**) &(buff[-(8 + (((uintptr_t)buff) % 8))]))[0]) - --static void incoming(uv_pipe_t* stream, -+static void incoming(uv_stream_t* stream, - ssize_t nread, -- const uv_buf_t* buf, -- uv_handle_type pending) -+ const uv_buf_t* buf) - { - // Grab out the allocator which was placed there by allocate() - struct Allocator* alloc = buf->base ? ALLOC(buf->base) : NULL; - -+ uv_handle_type pending = uv_pipe_pending_type((uv_pipe_t*) stream); - Assert_true(pending == UV_UNKNOWN_HANDLE); - - if (nread < 0) { -@@ -134,8 +134,8 @@ static void connected(uv_connect_t* req, - fileno->pub.pipePath, uv_strerror(status) ); - uv_close((uv_handle_t*) &fileno->peer, onClose); - -- } else if ((ret = uv_read2_start((uv_stream_t*)&fileno->peer, allocate, incoming))) { -- Log_info(fileno->pub.logger, "uv_read2_start() failed for pipe [%s] [%s]", -+ } else if ((ret = uv_read_start((uv_stream_t*)&fileno->peer, allocate, incoming))) { -+ Log_info(fileno->pub.logger, "uv_read_start() failed for pipe [%s] [%s]", - fileno->pub.pipePath, uv_strerror(ret)); - uv_close((uv_handle_t*) &fileno->peer, onClose); - -diff -up ./util/events/libuv/Timeout.c.libuv ./util/events/libuv/Timeout.c ---- ./util/events/libuv/Timeout.c.libuv 2019-09-18 10:56:52.757377575 -0400 -+++ ./util/events/libuv/Timeout.c 2019-09-18 10:58:31.190730913 -0400 -@@ -68,7 +68,7 @@ static void unlinkTo(struct Timeout* tim +diff --git a/util/events/libuv/Timeout.c b/util/events/libuv/Timeout.c +index 5d3a077..503a378 100644 +--- a/util/events/libuv/Timeout.c ++++ b/util/events/libuv/Timeout.c +@@ -68,7 +68,7 @@ static void unlinkTo(struct Timeout* timeout) /** * The callback to be called by libuv. */ @@ -103,7 +65,7 @@ diff -up ./util/events/libuv/Timeout.c.libuv ./util/events/libuv/Timeout.c { struct Timeout* timeout = Identity_check((struct Timeout*) handle); if (!timeout->isArmed) { return; } -@@ -196,4 +196,4 @@ void Timeout_clearAll(struct EventBase* +@@ -196,4 +196,4 @@ void Timeout_clearAll(struct EventBase* eventBase) int Timeout_isActive(struct Timeout* timeout) { return (timeout && timeout->selfPtr); diff --git a/cjdns.spec b/cjdns.spec index 4d8f2c5..fa4aaac 100644 --- a/cjdns.spec +++ b/cjdns.spec @@ -16,7 +16,7 @@ # Needed to run on openvz and other container systems %bcond_without seccomp # Option to use system libuv instead of bundled libuv-0.11.19 -%bcond_with libuv +%bcond_without libuv # When with_python3 is set, this replaces tools in bin and libexec # with python3 versions, and python2-cjdns has py2 library only. %bcond_with python2 @@ -137,6 +137,8 @@ Patch18: cjdns.libuv.patch Patch20: cjdns.sysctl.patch # gcc-10 no longer allows duplicate globals Patch22: cjdns.gcc10.patch +# Work with libuv 1.0+ +Patch23: cjdns.libuv-1.0.patch %if %{use_marked} BuildRequires: nodejs, nodejs-marked, python3 @@ -305,6 +307,7 @@ cd - #patch16 -b .python3 %if 0%{use_libuv} %patch18 -p1 -b .libuv +%patch23 -p1 -b .libuv-1.0 rm -rf node_build/dependencies/libuv %else rm -rf node_build/dependencies/libuv/build/gyp # use system gyp