Skip to content

Commit fd7eabe

Browse files
committedMar 28, 2024
add arm64 support by community build binaries
1 parent 971c634 commit fd7eabe

File tree

1 file changed

+25
-9
lines changed

1 file changed

+25
-9
lines changed
 

‎bin/nwjs_install

+25-9
Original file line numberDiff line numberDiff line change
@@ -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)
Please sign in to comment.