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 --no-content-shell Don't 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=1
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=0
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 \
135 -Dedje_dir="out.$(getHostArch)/${BUILD_SUBDIRECTORY}/resources" \
140 function hostNinja() {
141 if [[ $SKIP_NINJA == 0 ]]; then
142 TARGETS="chromium-ewk efl_webprocess efl_webview_app ubrowser"
143 if [[ $BUILD_EWK_UNITTESTS == 1 ]]; then
144 TARGETS="$TARGETS ewk_unittests"
146 if [[ $BUILD_CONTENT_SHELL == 1 ]]; then
147 TARGETS="$TARGETS content_shell dump_syms minidump_stackwalk"
149 if [[ $BUILD_XWALK == 1 ]]; then
150 TARGETS="$TARGETS xwalk"
152 BUILDDIR=${GYP_GENERATOR_OUTPUT}/${BUILD_SUBDIRECTORY}
153 ninja -C $BUILDDIR ${JOBS} ${TARGETS}
157 function error_report() {
158 echo "Error: File:$1 Line:$2"
162 function findElementInArray() {
164 for elm in "${@:2}"; do
165 [[ "$elm" = "$1" ]] && return 0;
170 function setupAndExecuteTargetBuild() {
178 local SPEC_FILE="chromium-efl.spec"
181 # "|| :" means "or always succeeding built-in command"
182 PROFILE=$(echo "$@" | grep -Po "(?<=\-P\s)[^\s]*" || :)
183 ARCHITECTURE=$(echo "$@" | grep -Po "(?<=\-A\s)[^\s]*" || :)
185 if [ "$PROFILE" == "" ]; then
186 if [[ $platform == "mobile" ]]; then
187 PROFILE=tzmb_v3.0_arm64-wayland
188 elif [[ $platform == "mobile_emulator" ]]; then
189 PROFILE=tzmb_v3.0_emulator-wayland
190 elif [[ $platform == "tv" ]]; then
191 PROFILE=tztv_v3.0_arm-wayland
192 elif [[ $platform == "tv_emulator" ]]; then
193 PROFILE=tztv_v3.0_emulator-wayland
195 echo "Cannot set default PROFILE for platform=${platform}"
199 echo "Set the profile : $PROFILE"
201 if [ "$ARCHITECTURE" == "" ]; then
202 if [[ $platform == "mobile" ]]; then
204 elif [[ $platform == "mobile_emulator" ]]; then
206 elif [[ $platform == "tv" ]]; then
208 elif [[ $platform == "tv_emulator" ]]; then
211 echo "Cannot set default ARCHITECTURE for platform=${platform}"
215 echo "Set the architecture : $ARCHITECTURE"
217 if [ "$USE_GLOBAL_GBS_CONF" == "" ]; then
218 CONF_FLAG="--conf ${SCRIPTDIR}/gbs.conf"
222 if [ "$PROFILE" == "tztv_v2.2.1_prehawk" ]; then
223 EXTRA_PACK_OPTS="--extra-packs python-base-x86-arm,python-x86-arm,python-xml-x86-arm"
226 if [ "$(echo "${PROFILE}" | grep -Po "v3.0")" != "" ]; then
227 prepareTizen3Build $PROFILE
231 local exclusive_options=0
232 while [[ $# > 0 ]]; do
233 count=$(( $count + 1 ))
236 ARGS[$count]=--define
237 count=$(( $count + 1 ))
238 ARGS[$count]="_debug_mode 1"
241 ARGS[$count]=--define
242 count=$(( $count + 1 ))
243 ARGS[$count]="_skip_ninja 1"
246 ARGS[$count]=--define
247 count=$(( $count + 1 ))
248 ARGS[$count]="_skip_gyp 1"
251 ARGS[$count]=--define
252 count=$(( $count + 1 ))
253 ARGS[$count]="build_xwalk 1"
256 ARGS[$count]=--define
257 count=$(( $count + 1 ))
258 ARGS[$count]="component_build 1"
262 exclusive_options=$(( $exclusive_options + 1 ))
265 target="crosswalk-bin"
266 exclusive_options=$(( $exclusive_options + 1 ))
278 if [[ $exclusive_options -gt 1 ]]; then
279 echo "ERROR: --libs and --crosswalk-bin are mutually exclusive parameters."
285 ln -sf tizen_src/packaging packaging
287 if [ "$target" == "libs" ]; then
288 SPEC_FILE="chromium-efl-libs.spec"
289 elif [ "$target" == "crosswalk-bin" ]; then
290 SPEC_FILE="crosswalk-bin.spec"
293 gbs $CONF_FLAG build -P $PROFILE --spec $SPEC_FILE --include-all -A $ARCHITECTURE --incremental "${ARGS[@]}" $BUILD_CONF_OPTS $EXTRA_PACK_OPTS
296 function prepareTizen3Build() {
300 # In case of '_rpmlint 1', build.conf of gbs repo will be used, enabling rpmlint.
301 # Otherwise, locally prepared build.conf will be used, disabling rpmlint.
302 local PREVIOUS_BUILD_CONF_PATH=""
303 local LOCAL_BUILD_CONF_PATH=""
305 if [ "$PROFILE" == "tztv_v3.0_arm-wayland" ]; then
306 PREVIOUS_BUILD_CONF_PATH="/var/tmp/$USER-gbs/tztv_v3.0_arm-walynad.conf"
307 LOCAL_BUILD_CONF_PATH="$TOPDIR/tizen_src/build/tztv_v3.0_arm-wayland.conf"
308 elif [ "$PROFILE" == "tzmb_v3.0_arm-wayland" ]; then
309 PREVIOUS_BUILD_CONF_PATH="/var/tmp/$USER-gbs/tzmb_v3.0_arm-walynad.conf"
310 LOCAL_BUILD_CONF_PATH="$TOPDIR/tizen_src/build/tzmb_v3.0_arm-wayland.conf"
311 elif [ "$PROFILE" == "tzmb_v3.0_arm64-wayland" ]; then
312 PREVIOUS_BUILD_CONF_PATH="/var/tmp/$USER-gbs/tzmb_v3.0_arm64-walynad.conf"
313 LOCAL_BUILD_CONF_PATH="$TOPDIR/tizen_src/build/tzmb_v3.0_arm64-wayland.conf"
316 local PREVIOUS_RPMLINT="!rpmlint"
317 if [ ! -f "$PREVIOUS_BUILD_CONF_PATH" ]; then
319 elif [ "$(grep -Po "\!rpmlint" "$PREVIOUS_BUILD_CONF_PATH" | uniq -d)" != "!rpmlint" ]; then
320 PREVIOUS_RPMLINT="rpmlint"
323 if [ "$LOCAL_BUILD_CONF_PATH" != "" ]; then
324 BUILD_CONF_OPTS="-D $LOCAL_BUILD_CONF_PATH"
327 if [ "$(echo "$@" | grep -Po "_rpmlint\ 1")" == "" ]; then
328 if [ "$PREVIOUS_RPMLINT" == "rpmlint" ]; then
329 BUILD_CONF_OPTS+=" --clean"
333 if [ "$PREVIOUS_RPMLINT" == "!rpmlint" ]; then
334 BUILD_CONF_OPTS="--clean"