summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre GRANDIN <pgrandin@users.noreply.github.com>2018-01-09 10:50:07 -0800
committerGitHub <noreply@github.com>2018-01-09 10:50:07 -0800
commite1562ba64f5ec41101dddafa2641f71d4b0c3c72 (patch)
tree1b78c7580530f82f2865df0419f90c7f8b84da2f
parent873504c00a24bdf17db5341e5ae91be9442ec441 (diff)
parent7f55725b43800e3ae7ce48e998350778f7517c6f (diff)
downloadnavit-distance_set_last.return.tar.gz
Merge branch 'trunk' into distance_set_last.returndistance_set_last.return
-rw-r--r--.circleci/config.yml10
-rw-r--r--ci/build_wince.sh16
-rwxr-xr-xcmake/version.cmake66
-rwxr-xr-xcontrib/sailfish/build_on_sailfish_sdk.sh9
-rwxr-xr-xcontrib/sailfish/navit-sailfish.spec2
-rw-r--r--navit/gui/gtk/gui_gtk_action.c4
-rw-r--r--navit/route.c15
7 files changed, 93 insertions, 29 deletions
diff --git a/.circleci/config.yml b/.circleci/config.yml
index b2a27c13e..923bb9137 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -91,14 +91,15 @@ jobs:
bash ci/setup_common_requirements.sh
bash ci/build_win32.sh
build_wince:
- <<: *defaults
+ docker:
+ - image: navit/wince:8.04
steps:
- checkout
- run:
name: Build for Windows CE
- command: |
- bash ci/setup_common_requirements.sh
- bash ci/build_wince.sh
+ command: bash ci/build_wince.sh
+ - store_artifacts:
+ path: wince/output
build_tomtom_minimal:
<<: *defaults
docker:
@@ -146,5 +147,6 @@ workflows:
- build_android_arm
- build_android_x86
- build_win32
+ - build_wince
- build_tomtom_minimal
- build_tomtom_plugin
diff --git a/ci/build_wince.sh b/ci/build_wince.sh
index 7d0b3b471..270583513 100644
--- a/ci/build_wince.sh
+++ b/ci/build_wince.sh
@@ -1,3 +1,17 @@
+#!/bin/sh
+
mkdir wince && cd wince
-cmake ../ -DCMAKE_TOOLCHAIN_FILE=Toolchain/arm-mingw32ce.cmake -DXSLTS=windows -DCACHE_SIZE=10485760 -Dsvg2png_scaling:STRING=16,32 -Dsvg2png_scaling_nav:STRING=32 -Dsvg2png_scaling_flag=16 -DSAMPLE_MAP=n
+cmake ../ -DCMAKE_TOOLCHAIN_FILE=Toolchain/arm-mingw32ce.cmake -DXSLTS=windows -DCACHE_SIZE=10485760 -Dsvg2png_scaling:STRING=16,32 -Dsvg2png_scaling_nav:STRING=32 -Dsvg2png_scaling_flag=16 -DSAMPLE_MAP=y
make
+
+mkdir output
+cp navit/navit.exe output/
+cp navit/navit.xml output/
+cp -r locale/ output/
+cp -r navit/icons/ output
+mkdir output/maps
+cp navit/maps/*.bin output/maps
+cp navit/maps/*.xml output/maps
+
+cd ..
+bash ./navit/script/cabify.sh wince/output/navit.cab wince/
diff --git a/cmake/version.cmake b/cmake/version.cmake
index 8f82d9f61..41c654d33 100755
--- a/cmake/version.cmake
+++ b/cmake/version.cmake
@@ -1,29 +1,67 @@
FIND_PROGRAM(GIT_EXECUTABLE NAMES git git.exe DOC "git command line client")
+FIND_PROGRAM(DATE_EXECUTABLE NAMES date DOC "unix date command")
get_filename_component(SOURCE_DIR ${SRC} PATH)
-string(TIMESTAMP VERSION "%y%m%d%H%M")
+if (GIT_EXECUTABLE)
+ EXECUTE_PROCESS(
+ COMMAND ${GIT_EXECUTABLE} log "--format=%ct" # output as unix timestamp
+ WORKING_DIRECTORY "${SOURCE_DIR}"
+ OUTPUT_VARIABLE GIT_OUTPUT_DATE
+ ERROR_VARIABLE GIT_ERROR
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ ERROR_STRIP_TRAILING_WHITESPACE
+ )
+ if(NOT GIT_OUTPUT_DATE)
+ message(STATUS "Cannot determine current git commit - git error: '${GIT_ERROR}'")
+ set(GIT_OUTPUT_DATE "0000000000")
+ else()
+ EXECUTE_PROCESS(
+ COMMAND ${GIT_EXECUTABLE} log "--format='%h'"
+ WORKING_DIRECTORY "${SOURCE_DIR}"
+ OUTPUT_VARIABLE GIT_OUTPUT_HASH
+ ERROR_VARIABLE GIT_ERROR
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ ERROR_STRIP_TRAILING_WHITESPACE
+ )
+ if(NOT GIT_OUTPUT_HASH)
+ message(STATUS "Cannot determine current git commit - git error: '${GIT_ERROR}'")
+ set(GIT_OUTPUT_HASH "xdevxgitxnotxfound")
+ endif(NOT GIT_OUTPUT_HASH)
+ endif(NOT GIT_OUTPUT_DATE)
+else()
+ message(STATUS "git not found, cannot record git commit")
+ set(GIT_OUTPUT_DATE "0000000000") # To match length of android versionCode
+ set(GIT_OUTPUT_HASH "xdevxgitxnotxfound")
+endif(GIT_EXECUTABLE)
-string(REGEX MATCH "[0-9]+" VERSION_NUM ${VERSION} )
-if(NOT VERSION_NUM)
- message(STATUS "I can't find a release tag. This is probably not Navit's official tree")
- message(STATUS "It's OK, I will default to 0000")
- set(VERSION_NUM "0000")
-endif()
-string(REPLACE "R" "" VERSION_NUM ${VERSION_NUM} )
-if(NOT VERSION_NUM)
- set(VERSION_NUM "0000")
-endif()
+string(REGEX MATCH "^[0-9]+" VERSION_NUM ${GIT_OUTPUT_DATE} )
-string(REGEX MATCH "^[a-z0-9]+" VERSION ${VERSION} )
+EXECUTE_PROCESS(
+ COMMAND ${DATE_EXECUTABLE} "+%y%m%d%H%M" "-d \@${VERSION_NUM}" # output as unix timestamp
+ WORKING_DIRECTORY "${SOURCE_DIR}"
+ OUTPUT_VARIABLE DATE_CONVERT_OUTPUT
+ ERROR_VARIABLE DATE_CONVERT_ERROR
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ ERROR_STRIP_TRAILING_WHITESPACE
+)
+if(NOT DATE_CONVERT_ERROR)
+ string(REGEX MATCH "[0-9]+" VERSION_CODE ${DATE_CONVERT_OUTPUT})
+else(NOT DATE_CONVERT_ERROR)
+ message(FATAL_ERROR "Date convert not working\nError message:\n${DATE_CONVERT_ERROR}")
+endif(NOT DATE_CONVERT_ERROR)
+
+string(REGEX MATCH "[a-z0-9]+" VERSION ${GIT_OUTPUT_HASH} )
if (STRIP_M)
- set(VERSION ${VERSION_NUM})
+ set(VERSION ${VERSION_CODE})
endif()
set(NAVIT_VARIANT "-")
+set(GIT_VERSION VERSION)
set(${NAME} ${VERSION})
-message (STATUS "Git commit: ${${NAME}}")
+message (STATUS "Git commit: ${VERSION}")
+message (STATUS "Git date: ${VERSION_CODE}")
CONFIGURE_FILE(${SRC} ${DST} @ONLY)
diff --git a/contrib/sailfish/build_on_sailfish_sdk.sh b/contrib/sailfish/build_on_sailfish_sdk.sh
index 663d31b48..78cec2385 100755
--- a/contrib/sailfish/build_on_sailfish_sdk.sh
+++ b/contrib/sailfish/build_on_sailfish_sdk.sh
@@ -1,7 +1,10 @@
#! /bin/sh
-#run on the Sailfish OS sdk virtual machine. Check that rpmbuild directory exists.
+#run on the Sailfish OS sdk virtual machine. Check that rpmbuild directory exists. Remember to export VERSION_ID
+
+if [ -z ${VERSION_ID+x} ]; then echo "VERSION_ID not set. Forgot to export VERSION_ID?"; exit 1; fi
+
#arm devices
-sb2 -t SailfishOS-armv7hl -m sdk-build rpmbuild --define "_topdir /home/src1/rpmbuild" --define "navit_source `pwd`/../.." -bb navit-sailfish.spec
+sb2 -t SailfishOS-${VERSION_ID}-armv7hl -m sdk-build rpmbuild --define "_topdir /home/src1/rpmbuild" --define "navit_source `pwd`/../.." -bb navit-sailfish.spec
#intel devices
-sb2 -t SailfishOS-i486 -m sdk-build rpmbuild --define "_topdir /home/src1/rpmbuild" --define "navit_source `pwd`/../.." -bb navit-sailfish.spec
+sb2 -t SailfishOS-${VERSION_ID}-i486 -m sdk-build rpmbuild --define "_topdir /home/src1/rpmbuild" --define "navit_source `pwd`/../.." -bb navit-sailfish.spec
diff --git a/contrib/sailfish/navit-sailfish.spec b/contrib/sailfish/navit-sailfish.spec
index a798aa487..d8799fb41 100755
--- a/contrib/sailfish/navit-sailfish.spec
+++ b/contrib/sailfish/navit-sailfish.spec
@@ -15,6 +15,8 @@ License: GPL
Group: Applications/Productivity
URL: http://navit-projet.org/
+#git is vor version info while building
+BuildRequires: git
BuildRequires: gcc
BuildRequires: cmake
BuildRequires: glib2-devel
diff --git a/navit/gui/gtk/gui_gtk_action.c b/navit/gui/gtk/gui_gtk_action.c
index 0d6acee48..de5128756 100644
--- a/navit/gui/gtk/gui_gtk_action.c
+++ b/navit/gui/gtk/gui_gtk_action.c
@@ -605,6 +605,10 @@ gui_gtk_ui_init(struct gui_priv *this)
toggle_action = GTK_TOGGLE_ACTION(gtk_action_group_get_action(this->base_group, "CursorAction"));
gtk_toggle_action_set_active(toggle_action, attr.u.num);
}
+ if (navit_get_attr(this->nav, attr_follow_cursor, &attr, NULL)) {
+ toggle_action = GTK_TOGGLE_ACTION(gtk_action_group_get_action(this->base_group, "FollowVehicleAction"));
+ gtk_toggle_action_set_active(toggle_action, attr.u.num);
+ }
if (navit_get_attr(this->nav, attr_orientation, &attr, NULL)) {
toggle_action = GTK_TOGGLE_ACTION(gtk_action_group_get_action(this->base_group, "OrientationAction"));
gtk_toggle_action_set_active(toggle_action, attr.u.num != -1);
diff --git a/navit/route.c b/navit/route.c
index fcbbb4d13..3e3bb02ea 100644
--- a/navit/route.c
+++ b/navit/route.c
@@ -1823,12 +1823,10 @@ route_path_add_line(struct route_path *this, struct coord *start, struct coord *
}
/**
- * @brief Inserts a new item into the path
+ * @brief Inserts a new segment into the path
*
- * This function does almost the same as "route_path_add_item()", but identifies
- * the item to add by a segment from the route graph. Another difference is that it "copies" the
- * segment from the route graph, i.e. if the item is segmented, only the segment passed in rgs will
- * be added to the route path, not all segments of the item.
+ * This function adds a new segment to the route path. The segment is copied from the route graph. If
+ * `rgs` is part of a segmented item, only `rgs` will be added to the route path, not the other segments.
*
* The function can be sped up by passing an old path already containing this segment in oldpath -
* the segment will then be extracted from this old path. Please note that in this case the direction
@@ -3328,12 +3326,15 @@ route_crossings_get(struct route *this, struct coord *c)
#endif
+/**
+ * @brief Implementation-specific map rect data
+ */
struct map_rect_priv {
struct route_info_handle *ri;
enum attr_type attr_next;
int pos;
- struct map_priv *mpriv;
- struct item item;
+ struct map_priv *mpriv; /**< The map to which this map rect refers */
+ struct item item; /**< The current item, i.e. the last item returned by the `map_rect_get_item` method */
unsigned int last_coord;
struct route_path *path;
struct route_path_segment *seg,*seg_next;