-
Notifications
You must be signed in to change notification settings - Fork 17
/
build.sh
executable file
·79 lines (68 loc) · 2.37 KB
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#!/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."