forked from isis-project/isis-project
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·119 lines (107 loc) · 3.12 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
#!/bin/bash
SOURCE="${BASH_SOURCE[0]}"
while [ -L "$SOURCE" ] ; do SOURCE="$(readlink "$SOURCE")"; done
ISIS_PROJECT="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
cd $ISIS_PROJECT
. ./scripts/common/envsetup.sh
SRC="
isis-fonts
npapi-headers
pbnjson
AdapterBase
WebKit
WebKitSupplemental
BrowserServer
BrowserAdapter
enyo-1.0:enyojs
isis-browser
isis-test
"
DEVELOPER=false
PROCCOUNT=$(grep -c processor /proc/cpuinfo)
MIRROR=""
build_usage()
{
echo options:
echo " -d : enables developer mode. Code is checked out from github with read and write permissions"
echo " -j [Integer] : Enables multiprocess builds. Similar to make -j command"
echo " -m [mirror] : Fetch from a mirror for faster builds (example: -m github-mirror.mycompany.com)"
echo " -t [NAME] : Builds only named target"
echo " -p [NAME/all] : Packages the named target in debian format. all will debianize the isis project."
}
while getopts dj:t:p:m: ARG
do
case "$ARG" in
d) DEVELOPER=true;;
j) PROCCOUNT=$OPTARG;;
m) MIRROR=$OPTARG;;
t) SRC=$OPTARG;;
p) export PACKAGE=deb
if [ $OPTARG != "all" ] ; then
SRC=$OPTARG
fi;;
[?]) build_usage
exit -1;;
esac
done
get_qt
for CURRENT in $SRC ; do
REPO=$(echo $CURRENT | awk -F: '{print $1}')
USER=$(echo $CURRENT | awk -F: '{print $2}')
USER=${USER:-isis-project}
BRANCHARG=""
BRANCH=$(echo $CURRENT | awk -F: '{print $3}')
if [ "$BRANCH" != "" ]; then
BRANCHARG="-b ${BRANCH}"
fi
if [ ! -d ../$REPO ] ; then
if [ "$MIRROR" != "" ]; then
git clone $BRANCHARG -o mirror git://$MIRROR/$USER/$REPO.git ../$REPO
pushd ../$REPO
if [ $DEVELOPER = "true" ] ; then
git remote add origin [email protected]:$USER/$REPO.git
else
git remote add origin https://github.com/$USER/$REPO.git
fi
git fetch origin
branch_name="$(git symbolic-ref HEAD 2>/dev/null)"
branch_name=${branch_name##refs/heads/}
git config branch.$branch_name.remote origin
popd
else
if [ $DEVELOPER = "true" ] ; then
git clone $BRANCHARG [email protected]:$USER/$REPO.git ../$REPO
else
git clone $BRANCHARG https://github.com/$USER/$REPO.git ../$REPO
fi
fi
[ "$?" == "0" ] || fail "Failed to checkout: $REPO"
else
echo found ../$REPO
fi
done
cd ./scripts
./build_qt.sh qt $PROCCOUNT
[ "$?" == "0" ] || fail 'Failed to build:qt'
for CURRENT in $SRC ; do
REPO=`echo $CURRENT | awk -F':' '{print $1}'`
if [ -x ./build_$REPO.sh ] ; then
echo building $REPO
if [ ! -z "$PACKAGE" ]; then
echo "Package Instructions for $SRC"
./build_$REPO.sh $REPO $PROCCOUNT $PACKAGE
else
./build_$REPO.sh $REPO $PROCCOUNT
fi
#./build_$REPO.sh $REPO $PROCCOUNT
[ "$?" == "0" ] || fail "Failed to build: $REPO"
else
echo No build script for $REPO
fi
done
cd ..
echo ""
echo "============================================"
echo "Isis-Browser build completed"
echo "============================================"
echo ""