Skip to content

Commit

Permalink
community/nodejs-current: switch to python3 for building
Browse files Browse the repository at this point in the history
  • Loading branch information
timbru31 committed Nov 20, 2019
1 parent a85258b commit 9648603
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 6 deletions.
14 changes: 8 additions & 6 deletions community/nodejs-current/APKBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,22 @@
pkgname=nodejs-current
# The current stable version, i.e. non-LTS.
pkgver=13.1.0
pkgrel=0
pkgrel=1
pkgdesc="JavaScript runtime built on V8 engine - current stable version"
url="https://nodejs.org/"
arch="all !mips64 !mips64el"
license="MIT"
depends="ca-certificates"
depends_dev="libuv"
makedepends="linux-headers python2 paxmark
makedepends="linux-headers python3 paxmark
zlib-dev libuv-dev openssl-dev c-ares-dev nghttp2-dev"
subpackages="$pkgname-dev $pkgname-doc"
provides="nodejs"
replaces="nodejs nodejs-lts" # nodejs-lts for backward compatibility
source="https://nodejs.org/dist/v$pkgver/node-v$pkgver.tar.gz
dont-run-gyp-files-for-bundled-deps.patch
link-with-libatomic-on-mips32.patch
fix-gyp-python3-incompatibility.patch
"
builddir="$srcdir/node-v$pkgver"

Expand All @@ -53,7 +54,7 @@ build() {
mips*) _carchflags="--with-mips-arch-variant=r1 --with-mips-float-abi=soft";;
esac

./configure --prefix=/usr \
./configure --debug -C --prefix=/usr \
$_carchflags \
--shared-zlib \
--shared-libuv \
Expand All @@ -63,9 +64,9 @@ build() {
--openssl-use-def-ca-store

# we need run mksnapshot at build time so paxmark it early.
make -C out mksnapshot BUILDTYPE=Release
make --debug -C out mksnapshot BUILDTYPE=Release
paxmark -m out/Release/mksnapshot
make
make --debug

# paxmark so JIT works
paxmark -m out/Release/node
Expand Down Expand Up @@ -94,4 +95,5 @@ package() {

sha512sums="4d012d4638682ef1c7eac55913b0f997e163c47b0ee57f6364bac9f03772792279c4915545f5a78e75a42e8cd1006133c0eb318bbfe375f71bd4ca19a314dd77 node-v13.1.0.tar.gz
940cc90aaa77a531cde13e31918a9978f9478936c3851038bcdf2869e64de03ce84dec5a46519469a90a8ba2853226825452d23d9347752abdbe04e944c083eb dont-run-gyp-files-for-bundled-deps.patch
9f60928b53447f9590c7065bcdbdd4065d10a06e8451531615791a3bd7d14f9114807e5446e0ec00e2cb7a11a277050345e34636b199db2979d7f022b31ffde4 link-with-libatomic-on-mips32.patch"
9f60928b53447f9590c7065bcdbdd4065d10a06e8451531615791a3bd7d14f9114807e5446e0ec00e2cb7a11a277050345e34636b199db2979d7f022b31ffde4 link-with-libatomic-on-mips32.patch
65a1a22238e9baf2d81ab3d6c08c49aa8e47545915795bc1f129d35d9d59392b1b857dba85683df59956d0727331772de26112fd719fef3b10693b7bb9135e40 fix-gyp-python3-incompatibility.patch"
43 changes: 43 additions & 0 deletions community/nodejs-current/fix-gyp-python3-incompatibility.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
From c0282daa48cf1803c4283998304c563390866c8d Mon Sep 17 00:00:00 2001
From: cclauss <cclauss@me.com>
Date: Sun, 27 Oct 2019 17:42:31 +0100
Subject: [PATCH] gyp: iteritems() -> items() in compile_commands_json.py

PR-URL: https://github.com/nodejs/node-gyp/pull/1947
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
---
gyp/pylib/gyp/generator/compile_commands_json.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/gyp/pylib/gyp/generator/compile_commands_json.py b/tools/gyp/pylib/gyp/generator/compile_commands_json.py
index 575db63c4..1b8490451 100644
--- a/tools/gyp/pylib/gyp/generator/compile_commands_json.py
+++ b/tools/gyp/pylib/gyp/generator/compile_commands_json.py
@@ -43,7 +43,7 @@ def CalculateVariables(default_variables, params):

def AddCommandsForTarget(cwd, target, params, per_config_commands):
output_dir = params['generator_flags']['output_dir']
- for configuration_name, configuration in target['configurations'].iteritems():
+ for configuration_name, configuration in target['configurations'].items():
builddir_name = os.path.join(output_dir, configuration_name)

if IsMac(params):
@@ -92,7 +92,7 @@ def resolve(filename):

def GenerateOutput(target_list, target_dicts, data, params):
per_config_commands = {}
- for qualified_target, target in target_dicts.iteritems():
+ for qualified_target, target in target_dicts.items():
build_file, target_name, toolset = (
gyp.common.ParseQualifiedTarget(qualified_target))
if IsMac(params):
@@ -102,7 +102,7 @@ def GenerateOutput(target_list, target_dicts, data, params):
AddCommandsForTarget(cwd, target, params, per_config_commands)

output_dir = params['generator_flags']['output_dir']
- for configuration_name, commands in per_config_commands.iteritems():
+ for configuration_name, commands in per_config_commands.items():
filename = os.path.join(output_dir,
configuration_name,
'compile_commands.json')

0 comments on commit 9648603

Please sign in to comment.