-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeps.sh
executable file
·64 lines (53 loc) · 1.15 KB
/
deps.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
#! /bin/bash
BASE=`pwd`
function git_dep() {
DEPNAME=$1
REPO=$2
DEP=${BASE}/${DEPNAME}
if [ -d "${DEP}/.git" ]; then
echo "Updating ${DEPNAME}"
cd "${DEP}"
git pull
cd "${BASE}"
else
echo "Checking out ${DEPNAME}"
rm -fr "${DEP}"
git clone "${REPO}" "${DEP}"
fi
}
function darcs_dep() {
DEPNAME=$1
REPO=$2
DEP=${BASE}/${DEPNAME}
if [ -d "${DEP}/_darcs" ]; then
echo "Updating ${DEPNAME}"
cd "${DEP}"
darcs pull -a
cd "${BASE}"
else
echo "Checking out ${DEPNAME}"
rm -fr "${DEP}"
darcs get --lazy "${REPO}" "${DEP}"
fi
}
function http_zip_dep() {
DEPNAME=$1
REPO=$2
DEP=${BASE}/${DEPNAME}
TMP=${DEP}.tmp.zip
if [ -d "${DEP}" ]; then
echo "${DEPNAME} already present"
else
echo "Checking out ${DEPNAME}"
mkdir -p "${DEP}"
cd "${DEP}"
wget -O "${TMP}" "${REPO}"
unzip "${TMP}"
rm -fr "${TMP}"
fi
}
echo "Setting up dependencies in ${BASE}"
darcs_dep GF http://www.grammaticalframework.org/
git_dep JPGF https://github.com/GrammaticalFramework/JPGF.git
git_dep PhraseDroid https://github.com/GrammaticalFramework/PhraseDroid.git
http_zip_dep gtest http://googletest.googlecode.com/files/gtest-1.6.0.zip