Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 80 lines (68 sloc) 2.37 KB
#!/bin/sh
# GPII Linux Build Script
#
# Copyright 2012 OCAD University
#
# Licensed under the New BSD license. You may not use this file except in
# compliance with this License.
#
# The research leading to these results has received funding from the European Union's
# Seventh Framework Programme (FP7/2007-2013)
# under grant agreement no. 289016.
#
# You may obtain a copy of the License at
# https://github.com/GPII/universal/blob/master/LICENSE.txt
echo "This script is deprecated and will be removed in a future release. Please look at using our new grunt tasks."
currentDir=`pwd`
node_modules="../node_modules"
universal="../node_modules/universal"
repoURL="git://github.com/GPII/universal.git"
usbListenerDir="./usbDriveListener"
gpiiStateDir="/var/lib/gpii"
# Clone the necessary GPII framework dependencies from Git.
# TODO: Deal with cut and pastage for directory creation logic.
if [ -d $node_modules ]; then
echo "$node_modules already exists"
else
echo "$node_modules does not exist"
echo "creating $node_modules"
mkdir -p "$node_modules"
fi
if [ -d $universal ]; then
echo "$universal already exists"
else
echo "$universal does not exist"
echo "cloning universal"
git clone "$repoURL" "$universal"
cd $universal
npm install
cd $currentDir
fi
# Compile the GSettings C++ Bridge
cd node_modules/gsettingsBridge/nodegsettings
node-gyp configure build
cd ../../..
# Compile the ALSA C++ Bridge
cd node_modules/alsa/nodealsa
node-gyp configure build
cd ../../..
# Compile the Xrandr C++ Bridge
cd node_modules/xrandr/nodexrandr
node-gyp configure build
cd ../../..
# Create standard directory structure for GPII.
# Note: everything below here must be run as root, since we're installing ourselves centrally.
if [ -d $gpiiStateDir ]; then
echo "$gpiiStateDir already exists"
else
echo "$gpiiStateDir does not exist"
echo "creating $gpiiStateDir"
sudo mkdir -p "$gpiiStateDir"
sudo touch "$gpiiStateDir/log.txt"
sudo chmod a+rw "$gpiiStateDir/log.txt"
fi
# Install the USB Drive User Listener
# TODO: We should install the entire GPII in /usr/local/gpii, not just the USB Listener
sudo cp "$usbListenerDir/gpii-usb-user-listener" /usr/bin/
sudo cp "$usbListenerDir/gpii-usb-user-listener.desktop" /usr/share/applications/
echo "This script is deprecated and will be removed in a future release. Please look at using our new grunt tasks."