Skip to content

Commit

Permalink
Merge pull request #22 from benmaidel/feature/arm64_support
Browse files Browse the repository at this point in the history
add arm64 support
  • Loading branch information
fmessmer authored Apr 8, 2024
2 parents 5d4c9d1 + fd7eabe commit 0500b77
Showing 1 changed file with 26 additions and 10 deletions.
36 changes: 26 additions & 10 deletions bin/nwjs_install
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ TEMPFILE="nwjs.tar.gz"
mkdir -p ../nwjs
cd ../nwjs

VERSION="v0.42.3" # verified working, to be incremented explicitly
VERSION="v0.60.0" # verified working, to be incremented explicitly

# check if nw is already existing and up-to-date, abort if so
if [ -f nw ]; then
Expand All @@ -30,26 +30,42 @@ fi
ARCH="x64"
if [ `uname -m` == "x86_64" ]; then
ARCH="x64"
elif [ `uname -m` == "aarch64" ]; then
ARCH="arm64"
else
ARCH="ia32"
fi

# ready to go
echo "Downloading nwjs..."
set +e
main_uri="https://dl.nwjs.io/$VERSION/nwjs-$VERSION-$OS-$ARCH.tar.gz"
curl -sL -o $TEMPFILE $main_uri
status=$?
if [ $status -ne 0 ] ; then
echo "Failed to download '$main_uri': $status"
echo "Using mirror instead..."
mirror_uri="https://npm.taobao.org/mirrors/nwjs/$VERSION/nwjs-$VERSION-$OS-$ARCH.tar.gz"
curl -sL -o $TEMPFILE $mirror_uri
if [ "$ARCH" == "arm64" ]; then
main_uri="https://github.com/LeonardLaszlo/nw.js-armv7-binaries/releases/download/nw60-arm64_2022-01-08/nw60-arm64_2022-01-08.tar.gz"
curl -sL -o $TEMPFILE $main_uri
status=$?
if [ $status -ne 0 ] ; then
echo "Failed to download '$mirror_uri': $status"
echo "Failed to download '$main_uri': $status"
exit "$status"
fi
tar -xzf $TEMPFILE --strip-components 1
rm $TEMPFILE
mv docker/dist/nwjs-chrome-ffmpeg-branding/nwjs-v0.60.1-linux-arm64.tar.gz nwjs.tar.gz
rm -rf docker
else
main_uri="https://dl.nwjs.io/$VERSION/nwjs-$VERSION-$OS-$ARCH.tar.gz"
curl -sL -o $TEMPFILE $main_uri
status=$?
if [ $status -ne 0 ] ; then
echo "Failed to download '$main_uri': $status"
echo "Using mirror instead..."
mirror_uri="https://npm.taobao.org/mirrors/nwjs/$VERSION/nwjs-$VERSION-$OS-$ARCH.tar.gz"
curl -sL -o $TEMPFILE $mirror_uri
status=$?
if [ $status -ne 0 ] ; then
echo "Failed to download '$mirror_uri': $status"
exit "$status"
fi
fi
fi
set -e
echo -e "Successfully downloaded nwjs!"
Expand Down

0 comments on commit 0500b77

Please sign in to comment.