summaryrefslogtreecommitdiff
path: root/build-box.sh
blob: df4a321268184e0dae8a06c0f94b71432d70969e (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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#!/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]="-Doptimization=2 -Dharfbuzz=true -Dbuild-examples=false -Dbuild-tests=false -Ddrm=true" #-Dwl=true"
   ["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_MAKE"

   ["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
}

function do_flat()
{
    echo -e "\n==== work on ${PURPLE}efl$RESET in ${GREEN}feature/themes/flat$RESET"
    echo -e "  $RED:: git pull$RESET"
    cd core/efl && git co feature/themes/flat && git pull || exit 1
    echo -e "  $RED:: build$RESET EFL theme"
    cd ./data/elementary/themes/ || exit 1
    $PREFIX/bin/edje_cc -id ./img -id ./fdo -fd ./fnt -sd ./snd \
    -l ../../../COPYING -a ../../../AUTHORS \
    -fastcomp default.edc || exit 1
    echo -e "  $RED:: install$RESET EFL theme"
    sudo install default.edj $PREFIX/share/elementary/themes/default.edj
    git co master || exit 1
}

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
do_flat
efl_ctags

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