summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author <philippe colliot>2014-10-17 15:24:04 +0200
committer <philippe colliot>2014-10-17 15:24:04 +0200
commitdfeb9609b0944109325b554cab2e50a2c7a04079 (patch)
tree1b959349f4987f7047cdf7c9b6fa83a0fafb9950
parent920b83c1ec0248490fff4f73e913e89de2074eb7 (diff)
downloadpoi-service-dfeb9609b0944109325b554cab2e50a2c7a04079.tar.gz
some updates of scripts for ilm migration (preliminary)ready_for_yocto_migration
-rw-r--r--src/navigation/CMakeLists.txt117
-rwxr-xr-xsrc/navigation/script/build.sh111
-rwxr-xr-xsrc/navigation/script/set-env-ilm.sh17
-rw-r--r--src/navigation/script/toolchain.cmake4
-rw-r--r--src/poi-service/poi-server/CMakeLists.txt2
5 files changed, 188 insertions, 63 deletions
diff --git a/src/navigation/CMakeLists.txt b/src/navigation/CMakeLists.txt
index cfef46a..88dd9cb 100644
--- a/src/navigation/CMakeLists.txt
+++ b/src/navigation/CMakeLists.txt
@@ -29,6 +29,7 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR})
set (git_get_src_version git rev-parse HEAD)
set (git_executable ${GIT})
+set (create_file cmake -E touch)
set (svn_executable ${SVN})
set (svn_get_src_version svnversion)
@@ -36,74 +37,126 @@ set (svn_get_src_version svnversion)
set(cmake_create_dir cmake -E make_directory)
# Check if ivi layer management stuff with the right version has been cloned and do it if necessary
-set(layer-management_URL http://git.projects.genivi.org/wayland-ivi-extension.git)
-set(layer-management_VERSION 278437417d1ac0958a800eecfebd2a388d6d9ca7)
-set(layer-management_PATCH_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/patches)
-set(layer-management_PATCH_DUMMY_FILE ${layer-management_SRC_DIR}/.patched)
+# ilm is cloned into sub dir
+set(wayland-ivi-extension_SRC_DIR ${layer-management_SRC_DIR}/wayland-ivi-extension)
+set(weston-ivi-shell_SRC_DIR ${layer-management_SRC_DIR}/weston-ivi-shell)
-if (EXISTS ${layer-management_SRC_DIR})
+# Get the wayland-ivi-extension
+set(wayland-ivi-extension_URL http://git.projects.genivi.org/wayland-ivi-extension.git)
+set(wayland-ivi-extension_VERSION 278437417d1ac0958a800eecfebd2a388d6d9ca7)
+
+if (EXISTS ${wayland-ivi-extension_SRC_DIR})
+ execute_process(
+ COMMAND ${git_get_src_version}
+ WORKING_DIRECTORY "${wayland-ivi-extension_SRC_DIR}"
+ RESULT_VARIABLE result
+ OUTPUT_VARIABLE version
+ )
+ if (${version} MATCHES ${wayland-ivi-extension_VERSION})
+ message(STATUS "version of wayland-ivi-extension up to date")
+ else()
+ message(STATUS "get the right version of wayland-ivi-extension")
+ execute_process(
+ COMMAND "${git_executable}" pull
+ COMMAND "${git_executable}" checkout ${wayland-ivi-extension_VERSION}
+ WORKING_DIRECTORY "${wayland-ivi-extension_SRC_DIR}"
+ RESULT_VARIABLE error_code
+ )
+ if(error_code)
+ message(FATAL_ERROR "Failed to checkout version: '${wayland-ivi-extension_VERSION}'")
+ endif()
+ endif()
+else()
+ message(STATUS "clone wayland-ivi-extension")
+ execute_process(
+ COMMAND "${git_executable}" clone "${wayland-ivi-extension_URL}" "${wayland-ivi-extension_SRC_DIR}"
+ RESULT_VARIABLE error_code
+ )
+ if(error_code)
+ message(FATAL_ERROR "Failed to clone repository: '${wayland-ivi-extension_URL}'")
+ endif()
+ message(STATUS "get the right version of wayland-ivi-extension")
+ execute_process(
+ COMMAND "${git_executable}" pull
+ COMMAND "${git_executable}" checkout ${wayland-ivi-extension_VERSION}
+ WORKING_DIRECTORY "${wayland-ivi-extension_SRC_DIR}"
+ RESULT_VARIABLE error_code
+ )
+ if(error_code)
+ message(FATAL_ERROR "Failed to checkout version: '${wayland-ivi-extension_VERSION}'")
+ endif()
+endif()
+
+# Get the weston-ivi-shell
+set(weston-ivi-shell_URL https://github.com/ntanibata/weston-ivi-shell.git)
+set(weston-ivi-shell_VERSION a3dd3192343e573e9cbf349022cb81b77bfbdaca)
+set(weston-ivi-shell_PATCH_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/patches)
+set(weston-ivi-shell_PATCH_DUMMY_FILE ${weston-ivi-shell_SRC_DIR}/.patched)
+
+if (EXISTS ${weston-ivi-shell_SRC_DIR})
execute_process(
COMMAND ${git_get_src_version}
- WORKING_DIRECTORY "${layer-management_SRC_DIR}"
+ WORKING_DIRECTORY "${weston-ivi-shell_SRC_DIR}"
RESULT_VARIABLE result
OUTPUT_VARIABLE version
)
- if (${version} MATCHES ${layer-management_VERSION})
- message(STATUS "version of layer-management up to date")
+ if (${version} MATCHES ${weston-ivi-shell_VERSION})
+ message(STATUS "version of weston-ivi-shell up to date")
else()
- message(STATUS "get the right version")
+ message(STATUS "get the right version of weston-ivi-shell")
execute_process(
COMMAND "${git_executable}" pull
- COMMAND "${git_executable}" checkout ${layer-management_VERSION}
- WORKING_DIRECTORY "${layer-management_SRC_DIR}"
+ COMMAND "${git_executable}" checkout ${weston-ivi-shell_VERSION}
+ WORKING_DIRECTORY "${weston-ivi-shell_SRC_DIR}"
RESULT_VARIABLE error_code
)
if(error_code)
- message(FATAL_ERROR "Failed to checkout version: '${layer-management_VERSION}'")
+ message(FATAL_ERROR "Failed to checkout version: '${weston-ivi-shell_VERSION}'")
endif()
endif()
else()
- message(STATUS "clone layer-management")
+ message(STATUS "clone weston-ivi-shell")
execute_process(
- COMMAND "${git_executable}" clone "${layer-management_URL}" "${layer-management_SRC_DIR}"
+ COMMAND "${git_executable}" clone "${weston-ivi-shell_URL}" "${weston-ivi-shell_SRC_DIR}"
RESULT_VARIABLE error_code
)
if(error_code)
- message(FATAL_ERROR "Failed to clone repository: '${layer-management_URL}'")
+ message(FATAL_ERROR "Failed to clone repository: '${weston-ivi-shell_URL}'")
endif()
- message(STATUS "get the right version")
+ message(STATUS "get the right version of weston-ivi-shell")
execute_process(
COMMAND "${git_executable}" pull
- COMMAND "${git_executable}" checkout ${layer-management_VERSION}
- WORKING_DIRECTORY "${layer-management_SRC_DIR}"
+ COMMAND "${git_executable}" checkout ${weston-ivi-shell_VERSION}
+ WORKING_DIRECTORY "${weston-ivi-shell_SRC_DIR}"
RESULT_VARIABLE error_code
)
if(error_code)
- message(FATAL_ERROR "Failed to checkout version: '${layer-management_VERSION}'")
+ message(FATAL_ERROR "Failed to checkout version: '${weston-ivi-shell_VERSION}'")
endif()
endif()
set (PATCH_EXECUTABLE patch -p1 -s)
-if (EXISTS ${layer-management_PATCH_DUMMY_FILE})
- message(STATUS "patch already applied")
+if (EXISTS ${weston-ivi-shell_PATCH_DUMMY_FILE})
+ message(STATUS "patch already applied to weston-ivi-shell")
else()
- message(STATUS "apply the patches")
+ message(STATUS "apply the patches to weston-ivi-shell")
execute_process(
- COMMAND ${PATCH_EXECUTABLE} -i ${layer-management_PATCH_SRC_DIR}/0001-client.pro-Disable-create_cmake-configuration.patch
- COMMAND ${PATCH_EXECUTABLE} -i ${layer-management_PATCH_SRC_DIR}/0002-Update-ivi-application.xml-and-fix-inplementation-of.patch
- COMMAND ${create_file} ${layer-management_PATCH_DUMMY_FILE}
+ COMMAND ${PATCH_EXECUTABLE} -i ${weston-ivi-shell_PATCH_SRC_DIR}/0001-client.pro-Disable-create_cmake-configuration.patch
+ COMMAND ${PATCH_EXECUTABLE} -i ${weston-ivi-shell_PATCH_SRC_DIR}/0002-Update-ivi-application.xml-and-fix-inplementation-of.patch
+ COMMAND ${create_file} ${weston-ivi-shell_PATCH_DUMMY_FILE}
TIMEOUT 0.1 #cmake -E touch never ends so add a timeout here
- WORKING_DIRECTORY "${layer-management_SRC_DIR}"
+ WORKING_DIRECTORY "${weston-ivi-shell_SRC_DIR}"
RESULT_VARIABLE error_code
)
- message( STATUS "Patch result: ${error_code}, PROF SOURCE DIR: ${layer-management_SRC_DIR}" )
+ if(error_code)
+ message(FATAL_ERROR "Failed to apply the patch")
+ endif()
endif()
-
# Check if positioning stuff with the right version has been cloned and do it if necessary
# positioning_SRC_DIR is set by cmake -Dpositioning_SRC_DIR=<path to positioning src dir>
set(positioning_URL http://git.projects.genivi.org/lbs/positioning.git)
-set(positioning_VERSION 09698f63ea27a24c533b4c015155ee9ebd7a3026)
+set(positioning_VERSION fde1a780f531389d5a05e3b0486c98ad34df3dcb)
if (EXISTS ${positioning_SRC_DIR})
execute_process(COMMAND ${git_get_src_version}
@@ -113,7 +166,7 @@ if (EXISTS ${positioning_SRC_DIR})
if (${version} MATCHES ${positioning_VERSION})
message(STATUS "version of positioning up to date")
else()
- message(STATUS "get the right version")
+ message(STATUS "get the right version of positioning")
execute_process(
COMMAND "${git_executable}" pull
COMMAND "${git_executable}" checkout ${positioning_VERSION}
@@ -134,7 +187,7 @@ else()
message(FATAL_ERROR "Failed to clone repository: '${positioning_URL}'")
endif()
- message(STATUS "get the right version")
+ message(STATUS "get the right version of positioning")
execute_process(
COMMAND "${git_executable}" pull
COMMAND "${git_executable}" checkout ${positioning_VERSION}
@@ -159,7 +212,7 @@ if (EXISTS ${navit_SRC_DIR})
if (${version} MATCHES ${navit_VERSION})
message(STATUS "version of navit up to date")
else()
- message(STATUS "get the right version")
+ message(STATUS "get the right version of navit")
execute_process(
COMMAND "${svn_executable}" checkout ${navit_URL} navit -r ${navit_VERSION}
WORKING_DIRECTORY "${navit_SRC_DIR}/.."
diff --git a/src/navigation/script/build.sh b/src/navigation/script/build.sh
index d5430d8..dbbf341 100755
--- a/src/navigation/script/build.sh
+++ b/src/navigation/script/build.sh
@@ -38,7 +38,10 @@ SENSORS_SERVICE=sensors-service
ENHANCED_POSITION_SERVICE=enhanced-position-service
NAVIT=navit
IVI_LAYER_MANAGER=ilm
+WAYLAND_IVI_EXTENSION=wayland-ivi-extension
+WESTON_IVI_SHELL=weston-ivi-shell
+SCRIPT_DIR=$PWD
target_root=$PWD/..
target_bin=$PWD/../bin #by default
target_positioning=$PWD/../$POSITIONING #by default
@@ -51,6 +54,9 @@ target_ilm=$PWD/../$IVI_LAYER_MANAGER #by default
NAVIT_FLAGS='-DDISABLE_QT=1 -DSAMPLE_MAP=0 -Dvehicle/null=1 -Dgraphics/qt_qpainter=0'
#
+# by default no ilm
+lm=0
+
set-path()
{
TOP_DIR=$target_root
@@ -114,35 +120,76 @@ set-path()
IVI_LAYER_MANAGER_SRC_DIR=$target_ilm
IVI_LAYER_MANAGER_BIN_DIR=$TOP_BIN_DIR/$IVI_LAYER_MANAGER
+ WAYLAND_IVI_EXTENSION_SRC_DIR=$IVI_LAYER_MANAGER_SRC_DIR/$WAYLAND_IVI_EXTENSION
+ WAYLAND_IVI_EXTENSION_BIN_DIR=$IVI_LAYER_MANAGER_BIN_DIR/$WAYLAND_IVI_EXTENSION
+ WESTON_IVI_SHELL_SRC_DIR=$IVI_LAYER_MANAGER_SRC_DIR/$WESTON_IVI_SHELL
+ WESTON_IVI_SHELL_BIN_DIR=$IVI_LAYER_MANAGER_BIN_DIR/$WESTON_IVI_SHELL
+
}
usage() {
- echo "Usage: ./build.sh Build navigation"
- echo " or: ./build.sh [command])"
- echo " or: ./build.sh [command] <target bin> <target positioning> <target ilm>)"
+ echo "Usage: ./build.sh [command]"
+ echo " or: ./build.sh [command] [paths]"
echo
echo "command:"
- echo " make Build"
- echo " make <target bin> <target positioning>"
+ echo " make Build"
echo " makelm Build with layer manager"
- echo " makelm <target bin> <target positioning> <target ilm> "
- echo " <target bin> Path of the binaries"
- echo " <target positioning> Path of the positioning code"
- echo " <target ilm> Path of the ilm code"
- echo " clean Clean"
- echo " src-clean Clean the cloned sources"
- echo " help Print Help"
+ echo " clean Clean the bin"
+ echo " src-clean Clean the cloned sources and the bin"
+ echo " clone Clone the sources"
+ echo " help Print Help"
+ echo "paths:"
+ echo "(used for remote build)"
+ echo " <target bin> Path of the binaries"
+ echo " <target positioning> Path of the positioning code"
+ echo " <target ilm> Path of the ilm code"
}
-build() {
+clone() {
echo ''
- echo 'Building navigation'
-
- cd $TOP_DIR
+ echo 'Clone/update version of additional sources if needed'
+ cd $TOP_DIR
mkdir -p bin
cd $TOP_BIN_DIR
cmake -Dpositioning_SRC_DIR=$target_positioning -Dlayer-management_SRC_DIR=$target_ilm $TOP_DIR
+}
+
+build() {
+ echo ''
+ echo 'Building navigation'
+
+ clone
+
+ if [ $lm -eq 1 ]; then
+ echo ''
+ echo 'Building layer manager'
+
+ if [ -z $WLD ]; then
+ echo 'need to build QtWayland first'
+ echo 'see the README file for details'
+ exit 1
+ fi
+ cd $TOP_BIN_DIR
+ mkdir -p $IVI_LAYER_MANAGER
+
+ cd $IVI_LAYER_MANAGER_BIN_DIR
+ mkdir -p $WAYLAND_IVI_EXTENSION
+ cd $WAYLAND_IVI_EXTENSION_BIN_DIR
+ cp $SCRIPT_DIR/toolchain.cmake $WAYLAND_IVI_EXTENSION_SRC_DIR
+ cmake -DCMAKE_TOOLCHAIN_FILE=$WAYLAND_IVI_EXTENSION_SRC_DIR/toolchain.cmake $WAYLAND_IVI_EXTENSION_SRC_DIR
+ cmake -DCMAKE_TOOLCHAIN_FILE=$WAYLAND_IVI_EXTENSION_SRC_DIR/toolchain.cmake $WAYLAND_IVI_EXTENSION_SRC_DIR
+ make -j4
+ sudo make install
+
+ cd $IVI_LAYER_MANAGER_BIN_DIR
+ mkdir -p $WESTON_IVI_SHELL
+ cd $WESTON_IVI_SHELL_SRC_DIR
+ ./autogen.sh --prefix=$WESTON_IVI_SHELL_BIN_DIR
+ make -j4
+ sudo make install
+
+ fi
# make navit first, because plugins need navit built stuff
echo ''
@@ -153,14 +200,6 @@ build() {
cmake $NAVIT_FLAGS $NAVIT_SRC_DIR/navit && make
echo ''
- echo 'Building layer manager'
- cd $TOP_BIN_DIR
- mkdir -p $IVI_LAYER_MANAGER
- cd $IVI_LAYER_MANAGER_BIN_DIR
-# cmake $IVI_LAYER_MANAGER_SRC_DIR && make
-# sudo make install
-
- echo ''
echo 'Building positioning'
cd $TOP_BIN_DIR
mkdir -p $POSITIONING
@@ -265,15 +304,16 @@ if [ $# -ge 1 ]; then
if [ $1 = help ]; then
usage
elif [ $1 = make ]; then
- if [ $# -eq 3 ]; then
+ if [ $# -eq 4 ]; then
#use for remote build
target_bin=$(readlink -f $2)
target_positioning=$(readlink -f $3)
+ target_ilm=$(readlink -f $4)
fi
set-path
- lm=0
build
elif [ $1 = makelm ]; then
+ lm=1
if [ $# -eq 4 ]; then
#use for remote build
target_bin=$(readlink -f $2)
@@ -281,20 +321,31 @@ if [ $# -ge 1 ]; then
target_ilm=$(readlink -f $4)
fi
set-path
- lm=1
build
elif [ $1 = clean ]; then
set-path
clean
elif [ $1 = src-clean ]; then
+ if [ $# -eq 4 ]; then
+ #use for remote build
+ target_bin=$(readlink -f $2)
+ target_positioning=$(readlink -f $3)
+ target_ilm=$(readlink -f $4)
+ fi
set-path
src-clean
+ elif [ $1 = clone ]; then
+ if [ $# -eq 4 ]; then
+ #use for remote build
+ target_bin=$(readlink -f $2)
+ target_positioning=$(readlink -f $3)
+ target_ilm=$(readlink -f $4)
+ fi
+ set-path
+ clone
else
usage
fi
-elif [ $# -eq 0 ]; then
- set-path
- build
else
usage
fi
diff --git a/src/navigation/script/set-env-ilm.sh b/src/navigation/script/set-env-ilm.sh
new file mode 100755
index 0000000..362973e
--- /dev/null
+++ b/src/navigation/script/set-env-ilm.sh
@@ -0,0 +1,17 @@
+export WLD=$HOME/usrfs
+
+export QTVER=qt5
+export QTDIR=$WLD/$QTVER
+export QT_PLUGIN_PATH=$QTDIR/lib/plugins
+
+export PATH=$QTDIR/bin:$WLD/bin:$PATH
+
+export LD_LIBRARY_PATH=$QTDIR/lib:$WLD/lib:/usr/lib/i386-linux-gnu
+
+export PKG_CONFIG_PATH=$QTDIR/lib/pkgconfig:$WLD/lib/pkgconfig:$WLD/share/pkgconfig:/usr/lib/i386-linux-gnu/pkgconfig
+
+export ACLOCAL_PATH=$WLD/share/aclocal
+export ACLOCAL="aclocal -I $ACLOCAL_PATH"
+
+
+
diff --git a/src/navigation/script/toolchain.cmake b/src/navigation/script/toolchain.cmake
new file mode 100644
index 0000000..9870df4
--- /dev/null
+++ b/src/navigation/script/toolchain.cmake
@@ -0,0 +1,4 @@
+add_definitions ("-g -O3")
+set (CMAKE_FIND_ROOT_PATH ${WLD}/usrfs)
+set (CMAKE_INSTALL_PREFIX ${WLD}/usrfs)
+
diff --git a/src/poi-service/poi-server/CMakeLists.txt b/src/poi-service/poi-server/CMakeLists.txt
index 74e6c04..ebd24d9 100644
--- a/src/poi-service/poi-server/CMakeLists.txt
+++ b/src/poi-service/poi-server/CMakeLists.txt
@@ -48,7 +48,7 @@ set (git_executable git)
# set(positioning_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../positioning)
# positioning_SRC_DIR is set by cmake -Dpositioning_SRC_DIR=<path to positioning src dir>
set(positioning_URL http://git.projects.genivi.org/lbs/positioning.git)
-set(positioning_VERSION 09698f63ea27a24c533b4c015155ee9ebd7a3026)
+set(positioning_VERSION fde1a780f531389d5a05e3b0486c98ad34df3dcb)
if (EXISTS ${positioning_SRC_DIR})
execute_process(COMMAND ${git_get_src_version}