export SCRIPTDIR=$(readlink -e $(dirname $0))
export TOPDIR=$(readlink -f "${SCRIPTDIR}/../..")
export CHROME_SRC="${TOPDIR}"
+# Please set DEFAULT_TIZEN_VERSION to 'latest' for the latest tizen version
+# or set DEFAULT_TIZEN_VERSION to current tizen version for the others.
+export DEFAULT_TIZEN_VERSION=latest
+
+if [ "$(echo "$@" | grep -e "--tizen")" != "" ]; then
+ tizen_version=$(echo $@ | sed -e 's#.*--tizen_\([0-9.]*\).*#\1#')
+ if $(echo $tizen_version | grep -qe "^[-\?[0-9]\+\.\?[0-9]*$" && echo true || echo false); then
+ DEFAULT_TIZEN_VERSION=$tizen_version
+ else
+ DEFAULT_TIZEN_VERSION=latest
+ fi
+fi
function getHostOs() {
echo $(uname -s | sed -e 's/Linux/linux/;s/Darwin/mac/')
--no-content-shell Don't build content_shell application
--debug Build debug version of chromium-efl (out.${host_arch}/Debug instead of out.${host_arch}/Release)
-jN Set number of jobs, just like with make or ninja
- --skip-gyp Skip restore_gyp, jhbuild and gyp_chromium steps
--skip-ninja Skip ninja step
- --xwalk Build crosswalk and friends
examples:
-$0 --skip-gyp
-$0 --skip-gyp --ccache
+$0 --ccache
$0 --skip-ninja
EOF
exit
function parseHostBuildScriptParams() {
- export SKIP_GYP=0
export USE_CCACHE=0
- export USE_CLANG=0
+ export USE_CLANG=1
export FORCE_JHBUILD=0
export SKIP_NINJA=0
export BUILD_EWK_UNITTESTS=0
export BUILD_CONTENT_SHELL=1
- export BUILD_XWALK=0
- export BUILD_CHROMEDRIVER=0
export BUILD_SUBDIRECTORY=Release
export COMPONENT_BUILD=0
-h|--help)
hostBuldScriptUsage ${0}
;;
- --skip-gyp)
- export SKIP_GYP=1
+ --skip-gn)
+ export SKIP_GN=1
;;
--ccache)
echo using ccache
export USE_CCACHE=1
source $TOPDIR/tizen_src/build/ccache_env.sh ${platform}
;;
- --clang)
- export USE_CLANG=1
+ --gcc)
+ export USE_CLANG=0
;;
--no-content-shell)
export BUILD_CONTENT_SHELL=0
--debug)
export BUILD_SUBDIRECTORY="Debug"
;;
- --xwalk)
- export BUILD_XWALK=1
- ;;
- --chromedriver)
- export BUILD_CHROMEDRIVER=1
- ;;
--component-build)
export COMPONENT_BUILD=1
;;
done
}
-function hostGypChromiumEfl() {
- if [[ $SKIP_GYP == 0 ]]; then
+function hostGnChromiumEfl() {
+ if [[ $SKIP_GN != 1 ]]; then
local XWALK_ARG=""
local COMPONENT_ARG=""
- if [[ $BUILD_XWALK == 1 ]]; then
- XWALK_ARG="--xwalk"
- fi
if [[ $COMPONENT_BUILD == 1 ]]; then
- COMPONENT_ARG="-Dcomponent=shared_library"
+ COMPONENT_ARG="component=shared_library"
fi
- ${TOPDIR}/tizen_src/build/gyp_chromiumefl.sh \
+ ${TOPDIR}/tizen_src/build/gn_chromiumefl.sh \
$XWALK_ARG \
$COMPONENT_ARG \
- -Doutdir="$TOPDIR/out.$(getHostArch)" \
$@
fi
}
if [[ $BUILD_CONTENT_SHELL == 1 ]]; then
TARGETS="$TARGETS content_shell dump_syms minidump_stackwalk"
fi
- if [[ $BUILD_XWALK == 1 ]]; then
- TARGETS="$TARGETS xwalk"
- fi
if [[ $BUILD_CHROMEDRIVER == 1 ]]; then
TARGETS="$TARGETS chromedriver"
fi
- BUILDDIR=${GYP_GENERATOR_OUTPUT}/${BUILD_SUBDIRECTORY}
+ export BUILD_SUBDIRECTORY=""
+ BUILDDIR=${GN_GENERATOR_OUTPUT}/${BUILD_SUBDIRECTORY}
ninja -C $BUILDDIR ${JOBS} ${TARGETS}
fi
}
}
function setupAndExecuteTargetBuild() {
-
local platform="$1"
shift
local PROFILE
local ARCHITECTURE
local CONF_FLAG
- local SPEC_FILE="chromium-efl.spec"
local -a ARGS
- # "|| :" means "or always succeeding built-in command"
- PROFILE=$(echo "$@" | grep -Po "(?<=\-P\s)[^\s]*" || :)
- ARCHITECTURE=$(echo "$@" | grep -Po "(?<=\-A\s)[^\s]*" || :)
-
- if [ "$PROFILE" == "" ]; then
- if [[ $platform == "mobile" ]]; then
- PROFILE=tzmb_v3.0_arm64-wayland
- elif [[ $platform == "mobile_emulator" ]]; then
- PROFILE=tzmb_v3.0_emulator-wayland
- elif [[ $platform == "tv" ]]; then
- PROFILE=tztv_v3.0_arm-wayland
- elif [[ $platform == "tv_emulator" ]]; then
- PROFILE=tztv_v3.0_emulator-wayland
- else
- echo "Cannot set default PROFILE for platform=${platform}"
- exit 1
- fi
- fi
- echo "Set the profile : $PROFILE"
-
- if [ "$ARCHITECTURE" == "" ]; then
- if [[ $platform == "mobile" ]]; then
- ARCHITECTURE=aarch64
- elif [[ $platform == "mobile_emulator" ]]; then
- ARCHITECTURE=i586
- elif [[ $platform == "tv" ]]; then
- ARCHITECTURE=armv7l
- elif [[ $platform == "tv_emulator" ]]; then
- ARCHITECTURE=i586
- else
- echo "Cannot set default ARCHITECTURE for platform=${platform}"
- exit 1
- fi
- fi
- echo "Set the architecture : $ARCHITECTURE"
-
- if [ "$USE_GLOBAL_GBS_CONF" == "" ]; then
- CONF_FLAG="--conf ${SCRIPTDIR}/gbs.conf"
- fi
-
- EXTRA_PACK_OPTS=""
- if [ "$PROFILE" == "tztv_v2.4_product" ]; then
- EXTRA_PACK_OPTS="--extra-packs python-base-x86-arm,python-x86-arm,python-xml-x86-arm"
- fi
-
local count=0
local exclusive_options=0
local RPMLINT=0
local NOINIT=0
+ local MIRROR=0
+
+ # "|| :" means "or always succeeding built-in command"
+ PROFILE=$(echo "$@" | grep -Po "(?<=\-P\s)[^\s]*" | head -1 || :)
+ ARCHITECTURE=$(echo "$@" | grep -Po "(?<=\-A\s)[^\s]*" | head -1 || :)
+ GBS_ROOT=$(echo "$@" | grep -Po "(?<=\-B\s)[^\s]*" | head -1 || :)
+
while [[ $# > 0 ]]; do
count=$(( $count + 1 ))
case "$1" in
count=$(( $count + 1 ))
ARGS[$count]="_skip_ninja 1"
;;
- --skip-gyp)
+ --skip-gn)
ARGS[$count]=--define
count=$(( $count + 1 ))
- ARGS[$count]="_skip_gyp 1"
- ;;
- --xwalk)
- ARGS[$count]=--define
- count=$(( $count + 1 ))
- ARGS[$count]="build_xwalk 1"
+ ARGS[$count]="_skip_gn 1"
;;
--component-build)
ARGS[$count]=--define
count=$(( $count + 1 ))
ARGS[$count]="component_build 1"
;;
- --libs)
- target="libs"
- exclusive_options=$(( $exclusive_options + 1 ))
- ;;
- --crosswalk-bin)
- target="crosswalk-bin"
- exclusive_options=$(( $exclusive_options + 1 ))
- ;;
--gbs-debug)
ARGS[$count]=--debug
;;
- --chromedriver)
- ARGS[$count]=--define
- count=$(( $count + 1 ))
- ARGS[$count]="build_chromedriver 1"
- ;;
--rpmlint)
RPMLINT=1
count=$(( $count + 1 ))
;;
+ --nodebug)
+ ARGS[$count]=--define
+ count=$(( $count + 1 ))
+ ARGS[$count]="_nodebug 1"
+ ;;
--noinit)
NOINIT=1
ARGS[$count]="$1"
count=$(( $count + 1 ))
;;
+ --mirror)
+ MIRROR=1
+ ;;
+ --gcc)
+ ARGS[$count]=--define
+ count=$(( $count + 1 ))
+ ARGS[$count]="_gcc 1"
+ ;;
+ --clang)
+ ARGS[$count]=--define
+ count=$(( $count + 1 ))
+ ARGS[$count]="_clang 1"
+ ;;
+ --standard*)
+ if [ "$DEFAULT_TIZEN_VERSION" == "latest" ]; then
+ echo $1
+ PROFILE=tz_$(echo $1 | sed 's/--//g')
+ elif [ "$DEFAULT_TIZEN_VERSION" == "4.0" ]; then
+ PROFILE=tz_${DEFAULT_TIZEN_VERSION}_$(echo $1 | sed 's/--//g')_$(echo $ARCHITECTURE | grep "i586" -q && echo "ia32" || echo $ARCHITECTURE)
+ else
+ PROFILE=tz_${DEFAULT_TIZEN_VERSION}_$(echo $1 | sed 's/--//g')
+ fi
+ ;;
+ --emulator*)
+ if [ "$DEFAULT_TIZEN_VERSION" == "latest" ]; then
+ PROFILE=tz_$(echo $1 | sed 's/--//g')
+ elif [ "$DEFAULT_TIZEN_VERSION" == "4.0" ]; then
+ PROFILE=tz_${DEFAULT_TIZEN_VERSION}_$(echo $1 | sed 's/--//g')_$(echo $ARCHITECTURE | grep "i586" -q && echo "ia32" || echo $ARCHITECTURE)
+ else
+ PROFILE=tz_${DEFAULT_TIZEN_VERSION}_$(echo $1 | sed 's/--//g')
+ fi
+ ;;
+ --tizen*)
+ ;;
*)
ARGS[$count]="$1"
;;
shift;
done
- if [ "$exclusive_options" -gt 1 ]; then
- echo "ERROR: --libs and --crosswalk-bin are mutually exclusive parameters."
- exit 1
+ if [ "$PROFILE" == "" ]; then
+ if [[ $platform == "mobile" ]]; then
+ PROFILE=tzmb_3.0_target-TM1
+ elif [[ $platform == "tv" ]]; then
+ if [ "$DEFAULT_TIZEN_VERSION" == "latest" ]; then
+ PROFILE=tztv_5.5_arm-musem
+ elif [ "$DEFAULT_TIZEN_VERSION" == "4.0" ]; then
+ PROFILE=tztv_4.0_arm-kantm
+ else
+ PROFILE=tztv_arm-musem
+ fi
+ elif [[ $platform == "da" ]]; then
+ if [ "$DEFAULT_TIZEN_VERSION" == "latest" ]; then
+ PROFILE=tzda_arm-kantm
+ else
+ PROFILE=tzda_${DEFAULT_TIZEN_VERSION}_arm-kantm
+ fi
+ else
+ echo "Cannot set default PROFILE for platform=${platform}"
+ exit 1
+ fi
+ fi
+
+ if [ "$MIRROR" == "1" ]; then
+ PROFILE=${PROFILE}_mirror
fi
- cd $TOPDIR
- rm -f packaging
- ln -sf tizen_src/packaging packaging
+ echo "Set the profile : $PROFILE"
+
+ if [ "$ARCHITECTURE" == "" ]; then
+ if [[ $platform == "mobile" ]]; then
+ ARCHITECTURE=armv7l
+ elif [[ $platform == "mobile_emulator" ]]; then
+ ARCHITECTURE=i586
+ elif [[ $platform == "tv" ]]; then
+ ARCHITECTURE=armv7l
+ elif [[ $platform == "tv_emulator" ]]; then
+ ARCHITECTURE=i586
+ else
+ echo "Cannot set default ARCHITECTURE for platform=${platform}"
+ exit 1
+ fi
+ fi
+ echo "Set the architecture : $ARCHITECTURE"
- if [ "$target" == "libs" ]; then
- SPEC_FILE="chromium-efl-libs.spec"
- elif [ "$target" == "crosswalk-bin" ]; then
- SPEC_FILE="crosswalk-bin.spec"
+ if [ "$(echo "${PROFILE}" | grep -P "muse|kant|jazz|hawk|product")" == "" -a "$NOINIT" == 0 ]; then
+ processRpmlintOption $PROFILE $RPMLINT
fi
+ local BRANCH=$(echo $(basename $(git symbolic-ref HEAD)))
+ if [ "$(echo $BRANCH | grep dev)" != "" ]; then
+ BRANCH=dev
+ elif [ "$(echo $BRANCH | grep beta)" != "" ]; then
+ BRANCH=beta
+ else
+ BRANCH=release
+ fi
+ local CHROMIUM_VERSION=$(echo $(head -n 1 chrome/VERSION) | sed -e 's/MAJOR=//g')
- if [ "$(echo "${PROFILE}" | grep -Po "v3.0")" != "" -a "$NOINIT" == 0 ]; then
- prepareTizen3Build $PROFILE $RPMLINT
+ local GBS_ROOT_OPT=
+ if [ "$USE_GLOBAL_GBS_CONF" == "" ]; then
+ CONF_FLAG="--conf ${SCRIPTDIR}/gbs.conf"
+ if [ "$GBS_ROOT" == "" ]; then
+ GBS_ROOT_OPT="-B ~/GBS-ROOT-M${CHROMIUM_VERSION}-${PROFILE^^}-TIZEN_${DEFAULT_TIZEN_VERSION^^}-${BRANCH^^}"
+ else
+ GBS_ROOT_OPT="-B $GBS_ROOT"
+ fi
fi
- gbs $CONF_FLAG build -P $PROFILE --spec $SPEC_FILE --include-all -A $ARCHITECTURE "${ARGS[@]}" $BUILD_CONF_OPTS $EXTRA_PACK_OPTS --incremental
+ gbs $CONF_FLAG build -P $PROFILE --include-all -A $ARCHITECTURE "${ARGS[@]}" $BUILD_CONF_OPTS --incremental $GBS_ROOT_OPT
}
-function prepareTizen3Build() {
+function processRpmlintOption() {
local PROFILE=$1
local RPMLINT=$2
- BUILD_CONF_OPTS=""
-
- # In case of '_rpmlint 1', build.conf of gbs repo will be used, enabling rpmlint.
- # Otherwise, locally prepared build.conf will be used, disabling rpmlint.
- local PREVIOUS_BUILD_CONF_PATH=""
-
- if [ "$PROFILE" == "tztv_v3.0_arm-wayland" ]; then
- PREVIOUS_BUILD_CONF_PATH="/var/tmp/$USER-gbs/tztv_v3.0_arm_wayland.conf"
- elif [ "$PROFILE" == "tzmb_v3.0_arm-wayland" ]; then
- PREVIOUS_BUILD_CONF_PATH="/var/tmp/$USER-gbs/tzmb_v3.0_arm_wayland.conf"
- elif [ "$PROFILE" == "tzmb_v3.0_arm64-wayland" ]; then
- PREVIOUS_BUILD_CONF_PATH="/var/tmp/$USER-gbs/tzmb_v3.0_arm64_wayland.conf"
- fi
+ local URL_TARGET=
+ export BUILD_CONF_OPTS=
+
+ echo "** Process rpmlint option"
local PREVIOUS_RPMLINT="!rpmlint"
if [ ! -f "$PREVIOUS_BUILD_CONF_PATH" ]; then
BUILD_CONF_DIR=$SCRIPTDIR/build_conf
rm -rf $BUILD_CONF_DIR
mkdir $BUILD_CONF_DIR
- REPO=http://download.tizen.org/snapshots/tizen/$platform/latest/repos/$(echo $ARCHITECTURE | sed -e "s/armv7l/arm/;s/aarch64/arm64/")-wayland/packages/repodata/
+ URL_TARGET=$(echo $PROFILE | sed -e 's#.*\.[0-9]*_\([-a-zA-Z0-9]*\).*#\1#;s/tz_//g')
+ # The latest version doesn't have tizen version in snapshot repository url.
+ if [ "$(echo $DEFAULT_TIZEN_VERSION)" == "latest" ]; then
+ URL_TIZEN_VERSION=
+ else
+ URL_TIZEN_VERSION=$DEFAULT_TIZEN_VERSION-
+ fi
+ REPO=http://download.tizen.org/snapshots/tizen/$URL_TIZEN_VERSION$platform/latest/repos/$URL_TARGET/packages/repodata/
+ echo "** Repo : $REPO"
wget $REPO -O $BUILD_CONF_DIR/index.html > /dev/null 2>&1
- BUILD_CONF_GZ=$(awk -F\" '{ print $6 }' $BUILD_CONF_DIR/index.html | grep "build.conf.gz")
+ BUILD_CONF_GZ=$(grep "build.conf.gz" $BUILD_CONF_DIR/index.html | sed -e 's#.*\=\"\(.*\)\".*#\1#')
BUILD_CONF=$(basename $BUILD_CONF_GZ .gz)
wget $REPO$BUILD_CONF_GZ -P $BUILD_CONF_DIR > /dev/null 2>&1
if [ ! -f "$BUILD_CONF_DIR/$BUILD_CONF_GZ" ]; then