Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 26 Oct 2021 18:48:52 GMT
From:      Piotr Kubaj <pkubaj@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: 981564583497 - main - net/cjdns: fix build on powerpc64*
Message-ID:  <202110261848.19QImqrt031580@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by pkubaj:

URL: https://cgit.FreeBSD.org/ports/commit/?id=9815645834977fe2ada5052d3c81881b7624bed7

commit 9815645834977fe2ada5052d3c81881b7624bed7
Author:     Piotr Kubaj <pkubaj@FreeBSD.org>
AuthorDate: 2021-10-26 18:46:41 +0000
Commit:     Piotr Kubaj <pkubaj@FreeBSD.org>
CommitDate: 2021-10-26 18:46:41 +0000

    net/cjdns: fix build on powerpc64*
    
    On powerpc64 and powerpc64le systems, os.cpus(), gets defined to []:
    > cpus = os.cpus()
    []
    
    It has type object:
    > typeof cpus
    'object'
    
    This causes jobs to be 0:
    > Math.floor((typeof cpus === 'undefined' ? 1 : cpus.length) * 1.25);
    0
    
    Change it so that instead of comparing type to undefined, we compare to 0:
    > Math.floor((os.cpus() == 0 ? 1 : cpus.length) * 1.25);
    1
---
 net/cjdns/Makefile                           |  2 --
 net/cjdns/files/patch-node__build_builder.js | 11 +++++++++++
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/net/cjdns/Makefile b/net/cjdns/Makefile
index d796f6e75a8b..71b31f5a14d6 100644
--- a/net/cjdns/Makefile
+++ b/net/cjdns/Makefile
@@ -11,8 +11,6 @@ COMMENT=	Routing engine designed for security, scalability, speed
 LICENSE=	GPLv3
 LICENSE_FILE=	${WRKSRC}/LICENSE
 
-BROKEN_powerpc64=	fails to install: cjdns-cjdns-v20.3/cjdroute: No such file or directory
-
 BUILD_DEPENDS=	node:www/node \
 		bash:shells/bash
 
diff --git a/net/cjdns/files/patch-node__build_builder.js b/net/cjdns/files/patch-node__build_builder.js
new file mode 100644
index 000000000000..e67ae0da7927
--- /dev/null
+++ b/net/cjdns/files/patch-node__build_builder.js
@@ -0,0 +1,11 @@
+--- node_build/builder.js.orig	2021-10-26 18:19:15 UTC
++++ node_build/builder.js
+@@ -779,7 +779,7 @@ module.exports.configure = function (
+     // if it returns undefined let's just assume 1
+     // workaround, nodejs seems to be broken on openbsd (undefined result after second call)
+     const cpus = Os.cpus();
+-    const jobs = Math.floor((typeof cpus === 'undefined' ? 1 : cpus.length) * 1.25);
++    const jobs = Math.floor((cpus == 0 ? 1 : cpus.length) * 1.25);
+ 
+     const pctx /*:Builder_PreCtx_t*/ = {
+         buildStage: (_x,_y)=>{},



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202110261848.19QImqrt031580>