npm architecture

This commit is contained in:
Bob Mottram 2017-09-14 12:28:14 +01:00
parent bee662a55d
commit 15b6762f79
1 changed files with 10 additions and 2 deletions

View File

@ -562,13 +562,21 @@ INSTALL_DIR=$HOME/build
INSTALLING_MESH=
install_patchwork() {
NPM_ARCH='ia32'
if [[ $ARCHITECTURE == 'arm'* ]]; then
NPM_ARCH='armv7l'
fi
if [[ $ARCHITECTURE == 'x86_64' || $ARCHITECTURE == 'amd64' ]]; then
NPM_ARCH='x64'
fi
git clone https://github.com/ssbc/patchwork $rootdir/etc/patchwork
cat <<EOF > $rootdir/usr/bin/install_patchwork
#!/bin/bash
cd /etc/patchwork
npm install --arch=ia32 electron
npm install
npm install --arch=$NPM_ARCH electron
npm install --arch=$NPM_ARCH
EOF
chroot "$rootdir" /bin/chmod +x /usr/bin/install_patchwork
chroot "$rootdir" /usr/bin/install_patchwork