Skip to content

Commit

Permalink
add aarch64, remove armv6l
Browse files Browse the repository at this point in the history
  • Loading branch information
hobbyquaker committed Mar 6, 2021
1 parent 80e9d3f commit ea0c941
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 29 deletions.
5 changes: 3 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ echo "installing build dependencies..."
npm install --only=dev --global-style --no-package-lock

./build_addon.sh x86_64
./build_addon.sh i686
./build_addon.sh armv6l
#./build_addon.sh i686
#./build_addon.sh armv6l
./build_addon.sh armv7l
./build_addon.sh aarch64

./build_release_body.sh
./build_change_history.sh
Expand Down
12 changes: 2 additions & 10 deletions build_addon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ case $ARCH in
x86_64)
NODE_NAME=node-v${NODE_VERSION}-linux-x64
;;
i686)
NODE_NAME=node-v${NODE_VERSION}-linux-x86
;;
*)
NODE_NAME=node-v${NODE_VERSION}-linux-${ARCH}
;;
Expand All @@ -28,18 +25,13 @@ case $ARCH in
NODE_URL=https://unofficial-builds.nodejs.org/download/release/v${NODE_VERSION}/${NODE_NAME}.tar.xz
PREBUILT=$BUILD_DIR/prebuilt/$ARCH
;;
i686)
# Todo - Node 14 i686 (32bit) build https://github.com/rdmtc/RedMatic/issues/374
NODE_URL=https://unofficial-builds.nodejs.org/download/release/v${NODE_VERSION}/${NODE_NAME}.tar.xz
PREBUILT=$BUILD_DIR/prebuilt/$ARCH
;;
x86_64)
NODE_URL=https://nodejs.org/dist/v${NODE_VERSION}/${NODE_NAME}.tar.xz
PREBUILT=$BUILD_DIR/prebuilt/$ARCH
;;
*)
NODE_URL=https://nodejs.org/dist/v${NODE_VERSION}/${NODE_NAME}.tar.xz
PREBUILT=$BUILD_DIR/prebuilt/armv6l
PREBUILT=$BUILD_DIR/prebuilt/$ARCH
;;
esac

Expand Down Expand Up @@ -69,7 +61,7 @@ cp $BUILD_DIR/assets/favicon/apple-icon-180x180.png $ADDON_TMP/redmatic/www/
cp $BUILD_DIR/assets/favicon/favicon-96x96.png $ADDON_TMP/redmatic/www/

echo "installing node modules..."
if [ "$ARCH" == "i686" ] || [ "$ARCH" == "x86_64" ]; then
if [ "$ARCH" == "x86_64" ]; then
echo "removing Raspberry Pi specific modules..."
mv $ADDON_TMP/redmatic/lib/package.json $ADDON_TMP/redmatic/lib/package.json.tmp
cat $ADDON_TMP/redmatic/lib/package.json.tmp | jq 'del(.dependencies."node-red-contrib-johnny-five",.dependencies."node-red-contrib-rcswitch2")' > $ADDON_TMP/redmatic/lib/package.json
Expand Down
38 changes: 21 additions & 17 deletions prebuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,31 @@ case "$ARCH" in
REMOTE_PATH="/home/redmatic/redmatic-prebuild"
;;
armv7l)
REMOTE=redmatic@pi-metal
REMOTE=redmatic@debian9-armv7l
REMOTE_PATH="/home/redmatic/redmatic-prebuild"
;;
aarch64)
REMOTE=redmatic@debian9-aarch64
REMOTE_PATH="/home/redmatic/redmatic-prebuild"
;;
esac

#if [ $ARCH == "i686" ]; then
# JQ_CMD='del(.dependencies."node-red-contrib-johnny-five",.dependencies.npm,.dependencies."node-red",.dependencies."@node-red-contrib-themes/midnight-red")'
#else
# JQ_CMD='del(.dependencies.npm,.dependencies."node-red",.dependencies."@node-red-contrib-themes/midnight-red")'
#fi
#
#cat addon_files/redmatic/lib/package.json | jq $JQ_CMD > $DEST/package.json
#
#scp $DEST/package.json $REMOTE:$REMOTE_PATH
#
#ssh -t $REMOTE "cd $REMOTE_PATH ; env JOBS=max npm install --global-style --no-package-lock"
#ssh -t $REMOTE "cd $REMOTE_PATH ; env JOBS=max npm rebuild"
#
#if ! [ $ARCH == "i686" ]; then
# ssh -t $REMOTE "cd $REMOTE_PATH/node_modules/node-red-contrib-johnny-five && npm install --save --unsafe-perm --global-style --production raspi-io"
#fi
if [ $ARCH == "i686" ]; then
JQ_CMD='del(.dependencies."node-red-contrib-johnny-five",.dependencies.npm,.dependencies."node-red",.dependencies."@node-red-contrib-themes/midnight-red")'
else
JQ_CMD='del(.dependencies.npm,.dependencies."node-red",.dependencies."@node-red-contrib-themes/midnight-red")'
fi

cat addon_files/redmatic/lib/package.json | jq $JQ_CMD > $DEST/package.json

scp $DEST/package.json $REMOTE:$REMOTE_PATH

ssh -t $REMOTE "cd $REMOTE_PATH ; env JOBS=max npm install --global-style --no-package-lock"
ssh -t $REMOTE "cd $REMOTE_PATH ; env JOBS=max npm rebuild"

if ! [ $ARCH == "i686" ]; then
ssh -t $REMOTE "cd $REMOTE_PATH/node_modules/node-red-contrib-johnny-five && npm install --save --unsafe-perm --global-style --production raspi-io"
fi

files=`ssh -t $REMOTE "cd $REMOTE_PATH ; find ./ -type f -name \*.node |grep -v obj.target"`

Expand Down

0 comments on commit ea0c941

Please sign in to comment.