[Tizen][Build] Move jhbuild handling to build_desktop.sh
authorBalazs Kelemen <b.kelemen@samsung.com>
Thu, 11 Sep 2014 20:07:11 +0000 (16:07 -0400)
committerYoungsoo Choi <kenshin.choi@samsung.com>
Tue, 10 Jul 2018 06:57:09 +0000 (06:57 +0000)
This is desktop specific so better if the desktop specific script handles it.
Also this removed some duplication. Additional goodie is stamp file for jhbuild
to avoid rerunning it once it is already done.

Bug: http://107.108.218.239/bugzilla/show_bug.cgi?id=6110

Change-Id: I5adbd8ce265849edb82286c349497db73eea543f
Signed-off-by: Balazs Kelemen <b.kelemen@samsung.com>
tizen_src/build/build_desktop.sh
tizen_src/build/gyp_chromiumefl.sh

index 84592e5..3652907 100755 (executable)
@@ -7,15 +7,7 @@ source ${SCRIPTDIR}/common.sh
 
 host_arch=$(getHostArch)
 
-GYP_GENERATOR_OUTPUT=${TOPDIR}/"out.${host_arch}"
-
-JHBUILD_DEPS="${GYP_GENERATOR_OUTPUT}/Dependencies/Root"
-
-if [ "${host_arch}" == "x64" ]; then
-  _LIBDIR=lib64
-elif [ "${host_arch}" == "ia32" ]; then
-  _LIBDIR=lib
-fi
+export GYP_GENERATOR_OUTPUT=${TOPDIR}/"out.${host_arch}"
 
 usage() {
 cat << EOF
@@ -61,6 +53,12 @@ if echo "$@" | grep -cq '\-\-ccache'; then
   USE_CCACHE=1
 fi
 
+JHBUILD_STAMPFILE="${GYP_GENERATOR_OUTPUT}/Dependencies/jhbuild.stamp"
+
+if echo "$@" | grep -cq '\-\-force-jhbuild'; then
+  rm -f $JHBUILD_STAMPFILE
+fi
+
 if echo "$@" | grep -cq '\-\-debug'; then
   BUILD_SUBDIRECTORY=Debug
 fi
@@ -71,6 +69,22 @@ JOBS=$(echo "$@" | \grep -Eo '\-j\s*[1-9]([0-9]*)')
 
 set -e
 
+JHBUILD_DEPS="${GYP_GENERATOR_OUTPUT}/Dependencies/Root"
+if [ "${host_arch}" == "x64" ]; then
+  _LIBDIR=lib64
+elif [ "${host_arch}" == "ia32" ]; then
+  _LIBDIR=lib
+fi
+export PKG_CONFIG_PATH="${JHBUILD_DEPS}/${_LIBDIR}/pkgconfig"
+
+if [ ! -f "$JHBUILD_STAMPFILE" ]; then
+  jhbuild --no-interact -f ${SCRIPTDIR}/jhbuild/jhbuildrc
+
+  if [ "$?" == "0" ]; then
+    echo "Yay! jhbuild done!" > $JHBUILD_STAMPFILE
+  fi
+fi
+
 if [ "$SKIP_GYP" == "0" ]; then
   ${TOPDIR}/build/gyp_chromiumefl.sh
 fi
index b1daf21..05e5e9b 100755 (executable)
@@ -8,8 +8,7 @@ source ${SCRIPTDIR}/common.sh
 host_arch=$(getHostArch)
 target=desktop
 
-#need to be exported because it is used by jhbuild
-export GYP_GENERATOR_OUTPUT=${TOPDIR}/"out.${host_arch}"
+GYP_GENERATOR_OUTPUT=${TOPDIR}/"out.${host_arch}"
 
 if echo "$@" | grep -cq '\-\Dbuilding_for_tizen_mobile=1'; then
   GYP_GENERATOR_OUTPUT=${TOPDIR}/"out.mobile.${host_arch}"
@@ -20,18 +19,6 @@ if echo "$@" | grep -cq '\-\Dbuilding_for_tizen_tv=1'; then
   target=tv
 fi
 
-if [ "$target" == "desktop" ]; then
-  JHBUILD_DEPS="${GYP_GENERATOR_OUTPUT}/Dependencies/Root"
-
-  if [ "${host_arch}" == "x64" ]; then
-    _LIBDIR=lib64
-  elif [ "${host_arch}" == "ia32" ]; then
-    _LIBDIR=lib
-  fi
-
-  export PKG_CONFIG_PATH="${JHBUILD_DEPS}/${_LIBDIR}/pkgconfig"
-fi
-
 set -e
 
 if [ ! -e ${TOPDIR}/src/build/util/LASTCHANGE.blink ]; then
@@ -103,11 +90,6 @@ else
 
 fi
 
-
-if [ "$target" == "desktop" ]; then
-  jhbuild --no-interact -f ${SCRIPTDIR}/jhbuild/jhbuildrc
-fi
-
 set -x
 ${TOPDIR}/build/gyp_chromiumefl \
                                  $COMMON_GYP_PARAMETERS \