From ea0c9410f9aeb510fb96d63d6278d4b9a1311190 Mon Sep 17 00:00:00 2001 From: hobbyquaker Date: Sat, 6 Mar 2021 19:57:03 +0100 Subject: [PATCH] add aarch64, remove armv6l --- build.sh | 5 +++-- build_addon.sh | 12 ++---------- prebuild.sh | 38 +++++++++++++++++++++----------------- 3 files changed, 26 insertions(+), 29 deletions(-) diff --git a/build.sh b/build.sh index 7eb41588..167e0253 100755 --- a/build.sh +++ b/build.sh @@ -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 diff --git a/build_addon.sh b/build_addon.sh index 0888a00f..e90be1a2 100755 --- a/build_addon.sh +++ b/build_addon.sh @@ -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} ;; @@ -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 @@ -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 diff --git a/prebuild.sh b/prebuild.sh index 07649df5..5adad78d 100755 --- a/prebuild.sh +++ b/prebuild.sh @@ -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"`