Skip to content

Commit 0500b77

Browse files
authored
Merge pull request FlexBE#22 from benmaidel/feature/arm64_support
add arm64 support
2 parents 5d4c9d1 + fd7eabe commit 0500b77

File tree

1 file changed

+26
-10
lines changed

1 file changed

+26
-10
lines changed

bin/nwjs_install

+26-10
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ TEMPFILE="nwjs.tar.gz"
44
mkdir -p ../nwjs
55
cd ../nwjs
66

7-
VERSION="v0.42.3" # verified working, to be incremented explicitly
7+
VERSION="v0.60.0" # verified working, to be incremented explicitly
88

99
# check if nw is already existing and up-to-date, abort if so
1010
if [ -f nw ]; then
@@ -30,26 +30,42 @@ fi
3030
ARCH="x64"
3131
if [ `uname -m` == "x86_64" ]; then
3232
ARCH="x64"
33+
elif [ `uname -m` == "aarch64" ]; then
34+
ARCH="arm64"
3335
else
3436
ARCH="ia32"
3537
fi
3638

3739
# ready to go
3840
echo "Downloading nwjs..."
3941
set +e
40-
main_uri="https://dl.nwjs.io/$VERSION/nwjs-$VERSION-$OS-$ARCH.tar.gz"
41-
curl -sL -o $TEMPFILE $main_uri
42-
status=$?
43-
if [ $status -ne 0 ] ; then
44-
echo "Failed to download '$main_uri': $status"
45-
echo "Using mirror instead..."
46-
mirror_uri="https://npm.taobao.org/mirrors/nwjs/$VERSION/nwjs-$VERSION-$OS-$ARCH.tar.gz"
47-
curl -sL -o $TEMPFILE $mirror_uri
42+
if [ "$ARCH" == "arm64" ]; then
43+
main_uri="https://github.com/LeonardLaszlo/nw.js-armv7-binaries/releases/download/nw60-arm64_2022-01-08/nw60-arm64_2022-01-08.tar.gz"
44+
curl -sL -o $TEMPFILE $main_uri
4845
status=$?
4946
if [ $status -ne 0 ] ; then
50-
echo "Failed to download '$mirror_uri': $status"
47+
echo "Failed to download '$main_uri': $status"
5148
exit "$status"
5249
fi
50+
tar -xzf $TEMPFILE --strip-components 1
51+
rm $TEMPFILE
52+
mv docker/dist/nwjs-chrome-ffmpeg-branding/nwjs-v0.60.1-linux-arm64.tar.gz nwjs.tar.gz
53+
rm -rf docker
54+
else
55+
main_uri="https://dl.nwjs.io/$VERSION/nwjs-$VERSION-$OS-$ARCH.tar.gz"
56+
curl -sL -o $TEMPFILE $main_uri
57+
status=$?
58+
if [ $status -ne 0 ] ; then
59+
echo "Failed to download '$main_uri': $status"
60+
echo "Using mirror instead..."
61+
mirror_uri="https://npm.taobao.org/mirrors/nwjs/$VERSION/nwjs-$VERSION-$OS-$ARCH.tar.gz"
62+
curl -sL -o $TEMPFILE $mirror_uri
63+
status=$?
64+
if [ $status -ne 0 ] ; then
65+
echo "Failed to download '$mirror_uri': $status"
66+
exit "$status"
67+
fi
68+
fi
5369
fi
5470
set -e
5571
echo -e "Successfully downloaded nwjs!"

0 commit comments

Comments
 (0)