Skip to content
Permalink
Browse files

fix node-red-node-sqlite prebuild (#223)

  • Loading branch information...
hobbyquaker committed Jun 18, 2019
1 parent 083d434 commit 5ae431c19c5492e28f9803e734dbda28d4a41bd3
@@ -47,9 +47,20 @@ echo "installing additional Node-RED nodes..."
cd $ADDON_TMP/redmatic/var
npm install --silent --no-package-lock --production --no-optional --global-style

echo "cleanup node_modules..."
rm -r $ADDON_TMP/redmatic/lib/node_modules/node-red-node-sqlite/node_modules/sqlite3/lib/binding
rm -r $ADDON_TMP/redmatic/lib/node_modules/node-red-node-sqlite/node_modules/sqlite3/deps
echo "installing www node modules"
cd $ADDON_TMP/redmatic/www
npm install --silent --no-package-lock --production --no-optional

cd $BUILD_DIR
if [ $1 == "--licenses" ]; then
echo "compiling 3rd party licenses"
node update_licenses.js
exit 0
fi

#echo "cleanup node_modules..."
#rm -r $ADDON_TMP/redmatic/lib/node_modules/node-red-node-sqlite/node_modules/sqlite3/lib/binding
#rm -r $ADDON_TMP/redmatic/lib/node_modules/node-red-node-sqlite/node_modules/sqlite3/deps
#$PRUNE $ADDON_TMP/redmatic/lib/node_modules
#$PRUNE $ADDON_TMP/redmatic/var/node_modules

@@ -61,10 +72,6 @@ ln -s redmatic/bin/update_addon ./
echo "bundling packages..."
node $BUILD_DIR/bundle-pkgs.js

echo "installing www node modules"
cd $ADDON_TMP/redmatic/www
npm install --silent --no-package-lock --production --no-optional

echo "adapt Node-RED..."
rm -r $ADDON_TMP/redmatic/lib/node_modules/node-red/node_modules/@node-red/nodes/core/hardware

@@ -4,27 +4,15 @@ DEST="prebuilt/armv6l"
REMOTE="root@pi-black"
REMOTE_PATH="/root/redmatic-prebuild"

cat addon_files/redmatic/lib/package.json | jq 'del(.dependencies.npm,.dependencies."node-red")' > $DEST/package.json
cat addon_files/redmatic/lib/package.json | jq 'del(.dependencies.npm,.dependencies."node-red",.dependencies."node-red-contrib-theme-midnight-red")' > $DEST/package.json

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

ssh -t $REMOTE "cd $REMOTE_PATH ; npm install --global-style --unsafe-perm"
ssh -t $REMOTE "cd $REMOTE_PATH/node_modules/node-red-contrib-johnny-five ; npm install --save --unsafe-perm --global-style --production raspi-io"
ssh -t $REMOTE "cd $REMOTE_PATH/node_modules/node-red-contrib-johnny-five ; npm install --save --unsafe-perm --global-style --production pinoccio-io"
ssh -t $REMOTE "cd $REMOTE_PATH/node_modules/node-red-contrib-johnny-five ; npm install --save --unsafe-perm --global-style --production bean-io"
ssh -t $REMOTE "cd $REMOTE_PATH/node_modules/node-red-contrib-johnny-five ; npm install --save --unsafe-perm --global-style --production blend-micro-io"
ssh -t $REMOTE "cd $REMOTE_PATH/node_modules/node-red-contrib-johnny-five ; npm install --save --unsafe-perm --global-style --production imp-io"
ssh -t $REMOTE "cd $REMOTE_PATH/node_modules/node-red-contrib-johnny-five ; npm install --save --unsafe-perm --global-style --production particle-io"
ssh -t $REMOTE "cd $REMOTE_PATH ; npm install --global-style --unsafe-perm --no-package-lock"
ssh -t $REMOTE "cd $REMOTE_PATH/node_modules/node-red-node-sqlite ; npm install --unsafe-perm --build-from-source --no-package-lock sqlite3"

rm -r ${DEST}/lib/node_modules

scp $REMOTE:/usr/bin/pig2vcd $DEST/bin/
scp $REMOTE:/usr/bin/pigpiod $DEST/bin/
scp $REMOTE:/usr/bin/pigs $DEST/bin/
scp $REMOTE:/usr/lib/libpigpiod_if2.so $DEST/lib/
scp $REMOTE:/usr/lib/libpigpiod_if.so $DEST/lib/
scp $REMOTE:/usr/lib/libpigpio.so $DEST/lib/

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

while read -r binary; do
@@ -34,8 +22,24 @@ while read -r binary; do
scp -q ${from} ${dest} && echo "${binary}"
done <<< "$files"

cp -R $DEST/lib/node_modules/node-red-contrib-zigbee/node_modules/cc-znp/node_modules/@serialport $DEST/lib/node_modules/node-red-contrib-zigbee/node_modules/


#scp $REMOTE:/usr/bin/pig2vcd $DEST/bin/
#scp $REMOTE:/usr/bin/pigpiod $DEST/bin/
#scp $REMOTE:/usr/bin/pigs $DEST/bin/
#scp $REMOTE:/usr/lib/libpigpiod_if2.so $DEST/lib/
#scp $REMOTE:/usr/lib/libpigpiod_if.so $DEST/lib/
#scp $REMOTE:/usr/lib/libpigpio.so $DEST/lib/

ssh -t $REMOTE "cd $REMOTE_PATH/node_modules/node-red-contrib-johnny-five ; npm install --save --unsafe-perm --global-style --production raspi-io"
#ssh -t $REMOTE "cd $REMOTE_PATH/node_modules/node-red-contrib-johnny-five ; npm install --save --unsafe-perm --global-style --production pinoccio-io"
#ssh -t $REMOTE "cd $REMOTE_PATH/node_modules/node-red-contrib-johnny-five ; npm install --save --unsafe-perm --global-style --production bean-io"
#ssh -t $REMOTE "cd $REMOTE_PATH/node_modules/node-red-contrib-johnny-five ; npm install --save --unsafe-perm --global-style --production blend-micro-io"
#ssh -t $REMOTE "cd $REMOTE_PATH/node_modules/node-red-contrib-johnny-five ; npm install --save --unsafe-perm --global-style --production imp-io"
#ssh -t $REMOTE "cd $REMOTE_PATH/node_modules/node-red-contrib-johnny-five ; npm install --save --unsafe-perm --global-style --production particle-io"

scp -r $REMOTE:$REMOTE_PATH/node_modules/node-red-contrib-johnny-five/node_modules $DEST/lib/node_modules/node-red-contrib-johnny-five

cp -R $DEST/lib/node_modules/node-red-contrib-zigbee/node_modules/cc-znp/node_modules/@serialport $DEST/lib/node_modules/node-red-contrib-zigbee/node_modules/

git add $DEST/lib
Binary file not shown.
Binary file not shown.

0 comments on commit 5ae431c

Please sign in to comment.
You can’t perform that action at this time.