[M67 Dev][Tizen] Integrate GN and set up build environment
[platform/framework/web/chromium-efl.git] / tizen_src / build / build_desktop.sh
1 #!/bin/bash
2
3 SCRIPTDIR=$( cd $(dirname $0) ; pwd -P )
4
5 source ${SCRIPTDIR}/common.sh
6 trap 'error_report $0 $LINENO' ERR SIGINT SIGTERM SIGQUIT
7
8 host_arch=$(getHostArch)
9
10 parseHostBuildScriptParams desktop $@
11
12 JHBUILD_STAMPFILE=""
13 if [ -z "$GN_GENERATOR_OUTPUT" ]; then
14   export GN_GENERATOR_OUTPUT=${TOPDIR}/"out.${host_arch}"
15 fi
16 JHBUILD_STAMPFILE="${GN_GENERATOR_OUTPUT}/Dependencies/Root/jhbuild.stamp"
17
18 forceJHBuildIfNeeded() {
19   if [[ $FORCE_JHBUILD == 1 ]]; then
20     rm -f $JHBUILD_STAMPFILE
21     return
22   fi
23
24   # Check if anything in jhbuild is more recent than stamp file.
25   if [ $(find $SCRIPTDIR/jhbuild -type f -newer $JHBUILD_STAMPFILE -print | wc -l) != "0" ]; then
26     rm -f $JHBUILD_STAMPFILE
27   fi
28 }
29
30 forceJHBuildIfNeeded
31
32 JHBUILD_DEPS=""
33 JHBUILD_DEPS="${GN_GENERATOR_OUTPUT}/Dependencies/Root"
34 if [ "${host_arch}" == "x64" ]; then
35   _LIBDIR=lib64
36 elif [ "${host_arch}" == "ia32" ]; then
37   _LIBDIR=lib
38 fi
39 export PKG_CONFIG_PATH="${JHBUILD_DEPS}/${_LIBDIR}/pkgconfig"
40
41 if [ ! -f "$JHBUILD_STAMPFILE" ]; then
42   jhbuild --no-interact -f ${SCRIPTDIR}/jhbuild/jhbuildrc
43
44   if [[ $? == 0 ]]; then
45     echo "Yay! jhbuild done!" > $JHBUILD_STAMPFILE
46   fi
47 fi
48
49 export __GN_CHROMIUMEFL_TARGET=desktop
50
51 hostGnChromiumEfl "deps_include_path=\"${JHBUILD_DEPS}/include\" deps_lib_path=\"${JHBUILD_DEPS}/${_LIBDIR}\""
52
53 export LD_LIBRARY_PATH="${JHBUILD_DEPS}/${_LIBDIR}:$LD_LIBRARY_PATH"
54 export PATH="${JHBUILD_DEPS}/bin:$PATH"
55
56 hostNinja desktop