summaryrefslogtreecommitdiff
path: root/build-box.sh
blob: 554cd266cd4a3f89904789595cd4861056b67b76 (plain)
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
#!/bin/bash

ssh-add -l | grep -q 'no idente' && ssh-add $(ls ~/.ssh/*.pub | sed 's/\.pub.*//g' | tr '\n' ' ')

pushd ./jeyzu/scripts
HEAD_PREV=$(git log HEAD~1.. --pretty=format:'%H')
git pull --rebase origin
HEAD_AFTER=$(git log HEAD~1.. --pretty=format:'%H')
popd

if [ "$HEAD_PREV" != "$HEAD_AFTER" -a "x$_UPDATED" = "x" ]
then
   export _UPDATED=1
   exec $0
fi

_FILE_=$(readlink -f $0)
_BASE_=${_FILE_%/*}

PREFIX=/opt/efl
LOCAL_CONF=./efl-build.conf
source "${_BASE_}/build-fcts.sh"
[ -r $LOCAL_CONF ] && source $LOCAL_CONF

declare -a cfgs=(efl e terminology evisum) # clouseau profiler evisum ephoto rage extra eruler enventor edi eflete theme_viewer)
declare -A build_cfgs=(
   ["efl",0]="core/efl"
   ["efl",1]="-Deflone=true -Doptimization=2 -Dharfbuzz=true -Dbuild-examples=false -Dbuild-tests=false -Ddrm=true -Dwl=true -Dmono=false"
   ["efl",2]="USE_MESON"
   ["e",0]="core/enlightenment"
   ["e",1]="-Dwayland=true"
   ["e",2]="USE_MESON"

   ["clouseau",0]="tools/clouseau"
   ["ephoto",0]="apps/ephoto"
   ["ephoto",2]="USE_MESON"
   ["eruler",0]="apps/eruler"
   ["extra",0]="apps/extra"
   ["extra",2]="USE_MESON"
   ["profiler",0]="devs/nikawhite/efl_profiler_viewer"
   ["rage",0]="apps/rage"
   ["rage",2]="USE_MESON"
   ["terminology",0]="apps/terminology"
   ["terminology",2]="USE_MESON"
   ["evisum",0]="apps/evisum"
   ["evisum",2]="USE_MESON"

   ["enventor",0]="tools/enventor"
   ["edi",0]="tools/edi"
   ["edi",2]="USE_MESON"
   ["eflete",0]="tools/eflete"
   ["eflete",1]="--enable-enventor"
   ["theme_viewer",0]="tools/elm-theme-viewer"
)

function build_cfg()
{
   cfg=$1
   build "${build_cfgs["$cfg",0]}" "${build_cfgs["$cfg",1]}" "${build_cfgs["$cfg",2]}"
}

function build_all()
{
   for cfg in "${cfgs[@]}"
   do
      build_cfg $cfg
   done
}

built=0
get_sudo_pwd
for arg in $@
do
   for cfg in "${cfgs[@]}"
   do
      [ "x$arg" = "x$cfg" ] && built=1 && build_cfg $cfg
   done
done
[ $built -eq 0 ] && build_all
efl_ctags

echo -e "\n==== DONE\n"