Skip to content

Commit

Permalink
include node-red-node-sqlite, cleanup prebuilt, adapt build.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
hobbyquaker committed Aug 10, 2018
1 parent 3f9ea0b commit f005722
Show file tree
Hide file tree
Showing 48 changed files with 20 additions and 9,128 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ dist
.DS_Store
live
CHANGELOG.md
LICENSE_Nodejs
LICENSE_Nodejs
bin/node-prune
3 changes: 2 additions & 1 deletion addon_files/redmatic/lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"private": true,
"dependencies": {
"npm": "6.3.0",
"node-red": "0.18.7"
"node-red": "0.18.7",
"ain2": "2.0.0"
}
}
3 changes: 2 additions & 1 deletion addon_files/redmatic/var/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"node-red-contrib-ccu": "1.1.17",
"node-red-contrib-combine": "1.6.1",
"node-red-contrib-mqtt-json": "1.0.1",
"node-red-contrib-time-range-switch": "0.6.0"
"node-red-contrib-time-range-switch": "0.6.0",
"node-red-node-sqlite": "0.3.0"
}
}
19 changes: 14 additions & 5 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ ADDON_TMP=$BUILD_DIR/addon_tmp

mkdir $ADDON_TMP 2> /dev/null || rm -r $ADDON_TMP/*

#echo "download and install node-prune"
#curl -sfL https://install.goreleaser.com/github.com/tj/node-prune.sh | bash
#PRUNE=$BUILD_DIR/bin/node-prune

echo "download and extract Node.js $NODE_URL ..."
curl --silent $NODE_URL | tar -xJf - -C $ADDON_TMP
Expand All @@ -30,17 +33,24 @@ cp $BUILD_DIR/assets/logo-x-120.png $ADDON_TMP/redmatic/www/
echo "installing node modules..."
cd $ADDON_TMP/redmatic/lib
npm install --silent --no-package-lock --production --no-optional --global-style
npm install --slient --no-package-lock --production --global-style ain2
rm $ADDON_TMP/redmatic/lib/package.json

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/var/node_modules/node-red-node-sqlite/node_modules/sqlite3/lib/binding
rm -r $ADDON_TMP/redmatic/var/node_modules/node-red-node-sqlite/node_modules/sqlite3/deps
#$PRUNE $ADDON_TMP/redmatic/lib/node_modules
#$PRUNE $ADDON_TMP/redmatic/var/node_modules

echo "copying prebuilt binaries to tmp dir..."
cp -r $PREBUILT/* $ADDON_TMP/redmatic/
cd $ADDON_TMP
ln -s redmatic/bin/update_addon ./

echo "installing additional Node-RED nodes..."
cd $ADDON_TMP/redmatic/var
npm install --silent --no-package-lock --production --no-optional --global-style

echo "installing www node modules"
cd $ADDON_TMP/redmatic/www
npm install --silent --no-package-lock --production --no-optional
Expand All @@ -55,7 +65,6 @@ rm -r $ADDON_TMP/redmatic/lib/node_modules/node-red/nodes/core/hardware

cd $BUILD_DIR


echo "creating version files"
MODULES_DIR=$ADDON_TMP/redmatic/lib/node_modules
VERSION_FILE=$ADDON_TMP/redmatic/versions
Expand Down
22 changes: 0 additions & 22 deletions prebuilt/armv6l/lib/node_modules/ain2/LICENSE

This file was deleted.

Loading

0 comments on commit f005722

Please sign in to comment.