Skip to content

Commit e51a1dc

Browse files
committed
Improve multiplatform support
1 parent b1d66fb commit e51a1dc

File tree

5 files changed

+48
-6
lines changed

5 files changed

+48
-6
lines changed

.github/workflows/build.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,6 @@ jobs:
6161
runs-on: ubuntu-20.04
6262
container: ruby:2.2
6363
steps:
64-
- name: Install system dependencies
65-
run: apt-get update && apt-get install -y python3
6664
- name: Checkout
6765
uses: actions/checkout@v2
6866
- name: Bundle

build-libv8

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,22 @@ set -u
55

66
version="${1}"
77

8-
NJOBS="${NJOBS:-$(getconf _NPROCESSORS_ONLN 2>/dev/null || true)}"
8+
NJOBS="${NJOBS:-$(getconf _NPROCESSORS_ONLN 2>/dev/null || getconf NPROCESSORS_ONLN 2>/dev/null || true)}"
99
NJOBS="${NJOBS:-1}"
1010

1111
echo "parallel job count: ${NJOBS}"
1212

1313
cd "src/node-${version}"
1414

15-
python2 configure --openssl-no-asm --without-npm --shared --with-intl=small-icu
15+
patch -p1 < ../../py2-icutrim.patch
16+
17+
if which python3 >/dev/null 2>&1; then
18+
PYTHON="${PYTHON:-python3}"
19+
else
20+
PYTHON="${PYTHON:-python2}"
21+
fi
22+
23+
"${PYTHON}" configure --openssl-no-asm --without-npm --shared --with-intl=small-icu
1624
make -j"${NJOBS}"
1725

1826
# taken from

download-node

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,17 @@ set -u
55

66
version="${1}"
77

8+
platform=$(uname)
9+
10+
case "${platform}" in
11+
SunOS)
12+
CURLOPTS="${CURLOPTS:--k}"
13+
;;
14+
*)
15+
CURLOPTS="${CURLOPTS:-}"
16+
;;
17+
esac
18+
819
mkdir -p src
920

10-
curl -L -o "src/node-${version}.tar.gz" "https://github.com/nodejs/node/archive/v${version}.tar.gz"
21+
curl ${CURLOPTS} -L -o "src/node-${version}.tar.gz" "https://github.com/nodejs/node/archive/v${version}.tar.gz"

extract-node

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,15 @@ set -u
55

66
version="${1}"
77

8-
tar -C src -xz -f "src/node-${version}.tar.gz"
8+
platform=$(uname)
9+
10+
case "${platform}" in
11+
SunOS)
12+
TAR="${TAR:-gtar}"
13+
;;
14+
*)
15+
TAR="${TAR:-tar}"
16+
;;
17+
esac
18+
19+
"${TAR}" -C src -xz -f "src/node-${version}.tar.gz"

py2-icutrim.patch

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
--- a/tools/icu/icutrim.py 2020-11-03 16:54:23.000000000 +0100
2+
+++ b/tools/icu/icutrim.py 2020-11-03 16:54:27.000000000 +0100
3+
@@ -316,7 +316,10 @@
4+
erritems = fi.readlines()
5+
fi.close()
6+
#Item zone/zh_Hant_TW.res depends on missing item zone/zh_Hant.res
7+
- pat = re.compile(bytes(r"^Item ([^ ]+) depends on missing item ([^ ]+).*", 'utf-8'))
8+
+ if str == bytes:
9+
+ pat = re.compile(bytes(r"^Item ([^ ]+) depends on missing item ([^ ]+).*"))
10+
+ else:
11+
+ pat = re.compile(bytes(r"^Item ([^ ]+) depends on missing item ([^ ]+).*", 'utf-8'))
12+
for i in range(len(erritems)):
13+
line = erritems[i].strip()
14+
m = pat.match(line)

0 commit comments

Comments
 (0)