3 pushd `dirname $0` > /dev/null
4 export SCRIPTDIR=`pwd -L`
7 export TOPDIR=$(readlink -f "${SCRIPTDIR}/../..")
8 export CHROME_SRC="${TOPDIR}"
15 echo Applying $patchfile in $directory
16 pushd "$directory" > /dev/null
17 patch -p1 $@ < "$patchfile"
21 function getHostOs() {
22 echo $(uname -s | sed -e 's/Linux/linux/;s/Darwin/mac/')
25 function getHostArch() {
26 echo $(uname -m | sed -e \
27 's/i.86/ia32/;s/x86_64/x64/;s/amd64/x64/;s/arm.*/arm/;s/i86pc/ia32/;s/aarch64/arm64/')
30 function getPythonVersion() {
31 echo $(python --version 2>&1 | sed -e 's/Python \([0-9]\+\.[0-9]\+\)\.[0-9]\+/\1/')
34 function setIfUndef() {
37 if [ -n "$original" ]; then
45 function hostBuldScriptUsage() {
49 Build non gbs version of chromium-efl
52 -h, --help Show this message
53 --build-ewk-unittests Build ewk unittests
54 --ccache Configure ccache installed in your system
55 --clang Use chromium's clang compiler to build the sources
56 --content-shell Build content_shell application
57 --debug Build debug version of chromium-efl (out.${host_arch}/Debug instead of out.${host_arch}/Release)
58 -jN Set number of jobs, just like with make or ninja
59 --skip-gyp Skip restore_gyp, jhbuild and gyp_chromium steps
60 --skip-ninja Skip ninja step
61 --xwalk Build crosswalk and friends
65 $0 --skip-gyp --ccache
71 function parseHostBuildScriptParams() {
76 export FORCE_JHBUILD=0
78 export BUILD_EWK_UNITTESTS=0
79 export BUILD_CONTENT_SHELL=0
81 export BUILD_SUBDIRECTORY=Release
86 while [[ $# > 0 ]]; do
89 hostBuldScriptUsage ${0}
97 source $TOPDIR/tizen_src/build/ccache_env.sh ${platform}
103 export BUILD_CONTENT_SHELL=1
106 export FORCE_JHBUILD=1
111 --build-ewk-unittests)
112 export BUILD_EWK_UNITTESTS=1
115 export BUILD_SUBDIRECTORY="Debug"
124 echo "Unknown argument: $1"
132 function hostGypChromiumEfl() {
133 if [[ $SKIP_GYP == 0 ]]; then
135 if [[ $BUILD_XWALK == 1 ]]; then
138 ${TOPDIR}/tizen_src/build/gyp_chromiumefl.sh $XWALK_ARG $@
142 function hostNinja() {
143 if [[ $SKIP_NINJA == 0 ]]; then
144 TARGETS="chromium-ewk efl_webprocess efl_webview_app ubrowser"
145 if [[ $BUILD_EWK_UNITTESTS == 1 ]]; then
146 TARGETS="$TARGETS ewk_unittests"
148 if [[ $BUILD_CONTENT_SHELL == 1 ]]; then
149 TARGETS="$TARGETS content_shell dump_syms minidump_stackwalk"
151 if [[ $BUILD_XWALK == 1 ]]; then
152 TARGETS="$TARGETS xwalk"
154 BUILDDIR=${GYP_GENERATOR_OUTPUT}/${BUILD_SUBDIRECTORY}
155 ninja -C $BUILDDIR ${JOBS} ${TARGETS}
159 function error_report() {
160 echo "Error: File:$1 Line:$2"
164 function findElementInArray() {
166 for elm in "${@:2}"; do
167 [[ "$elm" = "$1" ]] && return 0;
172 function setupAndExecuteTargetBuild() {
178 local DEFAULT_PROFILE_NAME
183 # "|| :" means "or always succeeding built-in command"
184 PROFILE_NAME=$(echo "$@" | grep -Po "(?<=\-P\s)[^\s]*" || :)
186 if [[ $platform == "mobile" ]]; then
187 DEFAULT_PROFILE_NAME=tizenmb_v2.4
189 elif [[ $platform == "tv" ]]; then
190 DEFAULT_PROFILE_NAME=tztv_v3.0_arm-wayland
192 elif [[ $platform == "emulator" ]]; then
193 DEFAULT_PROFILE_NAME=tizen_emulator_v2.4
197 if [ "$PROFILE_NAME" == "" ]; then
198 PROFILE_NAME=$DEFAULT_PROFILE_NAME
201 PROFILE_FLAG="-P $PROFILE_NAME"
203 if [ "$USE_GLOBAL_GBS_CONF" == "" ]; then
204 CONF_FLAG="--conf ${SCRIPTDIR}/gbs.conf"
208 if [ "$PROFILE_NAME" == "tztv_v2.2.1_prehawk" ]; then
209 EXTRA_PACK_OPTS="--extra-packs python-base-x86-arm,python-x86-arm,python-xml-x86-arm"
212 if [ "$(echo "${PROFILE_NAME}" | grep -Po "v3.0")" != "" ]; then
213 prepareTizen3Build $PROFILE_NAME
217 while [[ $# > 0 ]]; do
218 count=$(( $count + 1 ))
221 ARGS[$count]=--define
222 count=$(( $count + 1 ))
223 ARGS[$count]="_debug_mode 1"
226 ARGS[$count]=--define
227 count=$(( $count + 1 ))
228 ARGS[$count]="_skip_ninja 1"
231 ARGS[$count]=--define
232 count=$(( $count + 1 ))
233 ARGS[$count]="_skip_gyp 1"
247 ln -sf tizen_src/packaging packaging
249 gbs $CONF_FLAG build $PROFILE_FLAG --include-all -A $ARCHITECTURE --incremental "${ARGS[@]}" $BUILD_CONF_OPTS $EXTRA_PACK_OPTS
252 function prepareTizen3Build() {
253 local PROFILE_NAME=$1
256 # In case of '_rpmlint 1', build.conf of gbs repo will be used, enabling rpmlint.
257 # Otherwise, locally prepared build.conf will be used, disabling rpmlint.
258 local PREVIOUS_BUILD_CONF_PATH=""
259 local LOCAL_BUILD_CONF_PATH=""
261 if [ "$PROFILE_NAME" == "tztv_v3.0" ]; then
262 PREVIOUS_BUILD_CONF_PATH="/var/tmp/$USER-gbs/tztv_v3.0_arm-x11.conf"
263 LOCAL_BUILD_CONF_PATH="$TOPDIR/tizen_src/build/tztv_v3.0_arm-x11.conf"
264 elif [ "$PROFILE_NAME" == "tzmb_v3.0" ]; then
265 PREVIOUS_BUILD_CONF_PATH="/var/tmp/$USER-gbs/tzmb_v3.0_arm-x11.conf"
266 LOCAL_BUILD_CONF_PATH="$TOPDIR/tizen_src/build/tzmb_v3.0_arm-x11.conf"
267 elif [ "$PROFILE_NAME" == "tztv_v3.0_arm-wayland" ]; then
268 PREVIOUS_BUILD_CONF_PATH="/var/tmp/$USER-gbs/tztv_v3.0_arm-walynad.conf"
269 LOCAL_BUILD_CONF_PATH="$TOPDIR/tizen_src/build/tztv_v3.0_arm-wayland.conf"
270 elif [ "$PROFILE_NAME" == "tzmb_v3.0_arm-wayland" ]; then
271 PREVIOUS_BUILD_CONF_PATH="/var/tmp/$USER-gbs/tzmb_v3.0_arm-walynad.conf"
272 LOCAL_BUILD_CONF_PATH="$TOPDIR/tizen_src/build/tzmb_v3.0_arm-wayland.conf"
275 local PREVIOUS_RPMLINT="!rpmlint"
276 if [ ! -f "$PREVIOUS_BUILD_CONF_PATH" ]; then
278 elif [ "$(grep -Po "\!rpmlint" "$PREVIOUS_BUILD_CONF_PATH" | uniq -d)" != "!rpmlint" ]; then
279 PREVIOUS_RPMLINT="rpmlint"
282 if [ "$LOCAL_BUILD_CONF_PATH" != "" ]; then
283 BUILD_CONF_OPTS="-D $LOCAL_BUILD_CONF_PATH"
286 if [ "$(echo "$@" | grep -Po "_rpmlint\ 1")" == "" ]; then
287 if [ "$PREVIOUS_RPMLINT" == "rpmlint" ]; then
288 BUILD_CONF_OPTS+=" --clean"
292 if [ "$PREVIOUS_RPMLINT" == "!rpmlint" ]; then
293 BUILD_CONF_OPTS="--clean"