3 SCRIPTDIR=$( cd $(dirname $0) ; pwd -P )
4 TOPDIR=$( cd ${SCRIPTDIR}/.. ; pwd -P )
6 source ${SCRIPTDIR}/common.sh
8 host_arch=$(getHostArch)
10 export GYP_GENERATOR_OUTPUT=${TOPDIR}/"out.${host_arch}"
16 Build desktop version of chromium-efl
19 -h, --help Show this message
20 --skip-gyp Skip restore_gyp, jhbuild and gyp_chromium steps
21 --ccache configure ccache installed in your system
22 --skip-ninja Skip ninja step
23 --debug build debug version of chromium-efl (in $GYP_GENERATOR_OUTPUT/Debug instead of default $GYP_GENERATOR_OUTPUT/Release)
24 -jN set number of jobs, just like with make or ninja
28 $0 --skip-gyp --ccache
38 BUILD_SUBDIRECTORY=Release
40 if echo "$@" | grep -cq '\(\(\-\-help\)\|\(\-h\)\)'; then
44 if echo "$@" | grep -cq '\-\-skip-gyp'; then
48 if echo "$@" | grep -cq '\-\-skip-ninja'; then
52 if echo "$@" | grep -cq '\-\-ccache'; then
56 JHBUILD_STAMPFILE="${GYP_GENERATOR_OUTPUT}/Dependencies/jhbuild.stamp"
58 if echo "$@" | grep -cq '\-\-force-jhbuild'; then
59 rm -f $JHBUILD_STAMPFILE
62 if echo "$@" | grep -cq '\-\-debug'; then
63 BUILD_SUBDIRECTORY=Debug
66 # Will be empty string if -j not specified or ill-formatted, otherwise -j and the number argument together.
67 # \grep because folks often alias grep but we want the vanilla behavior.
68 JOBS=$(echo "$@" | \grep -Eo '\-j\s*[1-9]([0-9]*)')
72 JHBUILD_DEPS="${GYP_GENERATOR_OUTPUT}/Dependencies/Root"
73 if [ "${host_arch}" == "x64" ]; then
75 elif [ "${host_arch}" == "ia32" ]; then
78 export PKG_CONFIG_PATH="${JHBUILD_DEPS}/${_LIBDIR}/pkgconfig"
80 if [ ! -f "$JHBUILD_STAMPFILE" ]; then
81 jhbuild --no-interact -f ${SCRIPTDIR}/jhbuild/jhbuildrc
83 if [ "$?" == "0" ]; then
84 echo "Yay! jhbuild done!" > $JHBUILD_STAMPFILE
88 if [ "$SKIP_GYP" == "0" ]; then
89 ${TOPDIR}/build/gyp_chromiumefl.sh
92 if [ "$SKIP_NINJA" == "0" ]; then
93 if [ "$USE_CCACHE" == "1" ]; then
96 source $TOPDIR/build/ccache_env.sh desktop
99 export LD_LIBRARY_PATH="${JHBUILD_DEPS}/${_LIBDIR}:$LD_LIBRARY_PATH"
100 export PATH="${JHBUILD_DEPS}/bin:$PATH"
101 ninja -C ${GYP_GENERATOR_OUTPUT}/${BUILD_SUBDIRECTORY} ${JOBS}