3 export SCRIPTDIR=$(readlink -e $(dirname $0))
4 export TOPDIR=$(readlink -f "${SCRIPTDIR}/../..")
5 export CHROME_SRC="${TOPDIR}"
8 echo $(uname -s | sed -e 's/Linux/linux/;s/Darwin/mac/')
11 function getHostArch() {
12 echo $(uname -m | sed -e \
13 's/i.86/ia32/;s/x86_64/x64/;s/amd64/x64/;s/arm.*/arm/;s/i86pc/ia32/;s/aarch64/arm64/')
16 function getPythonVersion() {
17 echo $(python --version 2>&1 | sed -e 's/Python \([0-9]\+\.[0-9]\+\)\.[0-9]\+/\1/')
20 function setIfUndef() {
23 if [ -n "$original" ]; then
31 function hostBuldScriptUsage() {
35 Build non gbs version of chromium-efl
38 -h, --help Show this message
39 --build-ewk-unittests Build ewk unittests
40 --ccache Configure ccache installed in your system
41 --clang Use chromium's clang compiler to build the sources
42 --content-shell Build content_shell application
43 --debug Build debug version of chromium-efl (out.${host_arch}/Debug instead of out.${host_arch}/Release)
44 -jN Set number of jobs, just like with make or ninja
45 --skip-gyp Skip restore_gyp, jhbuild and gyp_chromium steps
46 --skip-ninja Skip ninja step
47 --xwalk Build crosswalk and friends
51 $0 --skip-gyp --ccache
57 function parseHostBuildScriptParams() {
62 export FORCE_JHBUILD=0
64 export BUILD_EWK_UNITTESTS=0
65 export BUILD_CONTENT_SHELL=0
67 export BUILD_SUBDIRECTORY=Release
68 export COMPONENT_BUILD=0
73 while [[ $# > 0 ]]; do
76 hostBuldScriptUsage ${0}
84 source $TOPDIR/tizen_src/build/ccache_env.sh ${platform}
90 export BUILD_CONTENT_SHELL=1
93 export FORCE_JHBUILD=1
98 --build-ewk-unittests)
99 export BUILD_EWK_UNITTESTS=1
102 export BUILD_SUBDIRECTORY="Debug"
108 export COMPONENT_BUILD=1
114 echo "Unknown argument: $1"
122 function hostGypChromiumEfl() {
123 if [[ $SKIP_GYP == 0 ]]; then
125 local COMPONENT_ARG=""
126 if [[ $BUILD_XWALK == 1 ]]; then
129 if [[ $COMPONENT_BUILD == 1 ]]; then
130 COMPONENT_ARG="-Dcomponent=shared_library"
132 ${TOPDIR}/tizen_src/build/gyp_chromiumefl.sh $XWALK_ARG $COMPONENT_ARG $@
136 function hostNinja() {
137 if [[ $SKIP_NINJA == 0 ]]; then
138 TARGETS="chromium-ewk efl_webprocess efl_webview_app ubrowser"
139 if [[ $BUILD_EWK_UNITTESTS == 1 ]]; then
140 TARGETS="$TARGETS ewk_unittests"
142 if [[ $BUILD_CONTENT_SHELL == 1 ]]; then
143 TARGETS="$TARGETS content_shell dump_syms minidump_stackwalk"
145 if [[ $BUILD_XWALK == 1 ]]; then
146 TARGETS="$TARGETS xwalk"
148 BUILDDIR=${GYP_GENERATOR_OUTPUT}/${BUILD_SUBDIRECTORY}
149 ninja -C $BUILDDIR ${JOBS} ${TARGETS}
153 function error_report() {
154 echo "Error: File:$1 Line:$2"
158 function findElementInArray() {
160 for elm in "${@:2}"; do
161 [[ "$elm" = "$1" ]] && return 0;
166 function setupAndExecuteTargetBuild() {
176 # "|| :" means "or always succeeding built-in command"
177 PROFILE=$(echo "$@" | grep -Po "(?<=\-P\s)[^\s]*" || :)
178 ARCHITECTURE=$(echo "$@" | grep -Po "(?<=\-A\s)[^\s]*" || :)
180 if [ "$PROFILE" == "" ]; then
181 if [[ $platform == "mobile" ]]; then
182 PROFILE=tzmb_v3.0_arm64-wayland
183 elif [[ $platform == "mobile_emulator" ]]; then
184 PROFILE=tzmb_v3.0_emulator-wayland
185 elif [[ $platform == "tv" ]]; then
186 PROFILE=tztv_v3.0_arm-wayland
187 elif [[ $platform == "tv_emulator" ]]; then
188 PROFILE=tztv_v3.0_emulator-wayland
190 echo "Cannot set default PROFILE for platform=${platform}"
194 echo "Set the profile : $PROFILE"
196 if [ "$ARCHITECTURE" == "" ]; then
197 if [[ $platform == "mobile" ]]; then
199 elif [[ $platform == "mobile_emulator" ]]; then
201 elif [[ $platform == "tv" ]]; then
203 elif [[ $platform == "tv_emulator" ]]; then
206 echo "Cannot set default ARCHITECTURE for platform=${platform}"
210 echo "Set the architecture : $ARCHITECTURE"
212 if [ "$USE_GLOBAL_GBS_CONF" == "" ]; then
213 CONF_FLAG="--conf ${SCRIPTDIR}/gbs.conf"
217 if [ "$PROFILE" == "tztv_v2.2.1_prehawk" ]; then
218 EXTRA_PACK_OPTS="--extra-packs python-base-x86-arm,python-x86-arm,python-xml-x86-arm"
221 if [ "$(echo "${PROFILE}" | grep -Po "v3.0")" != "" ]; then
222 prepareTizen3Build $PROFILE
226 while [[ $# > 0 ]]; do
227 count=$(( $count + 1 ))
230 ARGS[$count]=--define
231 count=$(( $count + 1 ))
232 ARGS[$count]="_debug_mode 1"
235 ARGS[$count]=--define
236 count=$(( $count + 1 ))
237 ARGS[$count]="_skip_ninja 1"
240 ARGS[$count]=--define
241 count=$(( $count + 1 ))
242 ARGS[$count]="_skip_gyp 1"
245 ARGS[$count]=--define
246 count=$(( $count + 1 ))
247 ARGS[$count]="build_xwalk 1"
250 ARGS[$count]=--define
251 count=$(( $count + 1 ))
252 ARGS[$count]="component_build 1"
266 ln -sf tizen_src/packaging packaging
268 gbs $CONF_FLAG build -P $PROFILE --include-all -A $ARCHITECTURE --incremental "${ARGS[@]}" $BUILD_CONF_OPTS $EXTRA_PACK_OPTS
271 function prepareTizen3Build() {
275 # In case of '_rpmlint 1', build.conf of gbs repo will be used, enabling rpmlint.
276 # Otherwise, locally prepared build.conf will be used, disabling rpmlint.
277 local PREVIOUS_BUILD_CONF_PATH=""
278 local LOCAL_BUILD_CONF_PATH=""
280 if [ "$PROFILE" == "tztv_v3.0_arm-wayland" ]; then
281 PREVIOUS_BUILD_CONF_PATH="/var/tmp/$USER-gbs/tztv_v3.0_arm-walynad.conf"
282 LOCAL_BUILD_CONF_PATH="$TOPDIR/tizen_src/build/tztv_v3.0_arm-wayland.conf"
283 elif [ "$PROFILE" == "tzmb_v3.0_arm-wayland" ]; then
284 PREVIOUS_BUILD_CONF_PATH="/var/tmp/$USER-gbs/tzmb_v3.0_arm-walynad.conf"
285 LOCAL_BUILD_CONF_PATH="$TOPDIR/tizen_src/build/tzmb_v3.0_arm-wayland.conf"
286 elif [ "$PROFILE" == "tzmb_v3.0_arm64-wayland" ]; then
287 PREVIOUS_BUILD_CONF_PATH="/var/tmp/$USER-gbs/tzmb_v3.0_arm64-walynad.conf"
288 LOCAL_BUILD_CONF_PATH="$TOPDIR/tizen_src/build/tzmb_v3.0_arm64-wayland.conf"
291 local PREVIOUS_RPMLINT="!rpmlint"
292 if [ ! -f "$PREVIOUS_BUILD_CONF_PATH" ]; then
294 elif [ "$(grep -Po "\!rpmlint" "$PREVIOUS_BUILD_CONF_PATH" | uniq -d)" != "!rpmlint" ]; then
295 PREVIOUS_RPMLINT="rpmlint"
298 if [ "$LOCAL_BUILD_CONF_PATH" != "" ]; then
299 BUILD_CONF_OPTS="-D $LOCAL_BUILD_CONF_PATH"
302 if [ "$(echo "$@" | grep -Po "_rpmlint\ 1")" == "" ]; then
303 if [ "$PREVIOUS_RPMLINT" == "rpmlint" ]; then
304 BUILD_CONF_OPTS+=" --clean"
308 if [ "$PREVIOUS_RPMLINT" == "!rpmlint" ]; then
309 BUILD_CONF_OPTS="--clean"