From 192c81ab11f8afc392e77aeeb089d0b5e8b6badd Mon Sep 17 00:00:00 2001 From: Mickael Kerjean Date: Sat, 19 May 2018 02:27:32 +1000 Subject: [PATCH] install (android): termux installer - #61 --- .assets/scripts/configure_without_git.js | 19 +++++++++ .assets/scripts/git.js | 1 + .assets/scripts/install_termux.sh | 52 ++++++++++++++++++++++++ 3 files changed, 72 insertions(+) create mode 100644 .assets/scripts/configure_without_git.js create mode 100644 .assets/scripts/git.js create mode 100755 .assets/scripts/install_termux.sh diff --git a/.assets/scripts/configure_without_git.js b/.assets/scripts/configure_without_git.js new file mode 100644 index 00000000..51ac883e --- /dev/null +++ b/.assets/scripts/configure_without_git.js @@ -0,0 +1,19 @@ +const fs = require("fs"), + path = require("path"); + +const lines = fs.readFileSync(path.join(__dirname, "../../config_client.js")) + .toString() + .split("\n"); + +let isGitBlock = false; +for(let i=0, l=lines.length; i Install system dependencies" +apt install -y nodejs git g++ make + + +echo "> Install Nuage" +if [ ! -d "nuage" ]; then + git clone https://github.com/mickael-kerjean/nuage + cd nuage +else + cd nuage + git reset --hard + git pull origin master +fi + + +echo "> Configure Nuage for termux" +# get rid of nodegit until it's working (https://github.com/nodegit/nodegit/issues/1494) +cp .assets/scripts/git.js server/model/backend/git.js +sed -i '/nodegit/d' package.json +node .assets/scripts/configure_without_git.js +# setup node gyp for android build (node-sass compilation) +npm install node-gyp +node node_modules/node-gyp/bin/node-gyp.js configure > /dev/null 2>&1 || true # generate the "~/.node-gyp" +find ~/.node-gyp -name 'common.gypi' -exec sed -i "s/\-fPIE.*/\-fPIC' ],/g" {} \; + + +echo "> Installation" +npm install +npm run build +cat >> $TERMUX_PATH/usr/bin/nuage < Post install " +rm -rf ~/.node-gyp + + +echo "============================" +echo "COMPLETED" \ No newline at end of file