From aa4053891c11d1934e7f91aeb0b423e39250ccd9 Mon Sep 17 00:00:00 2001 From: Stefan Wildemann Date: Sun, 31 Dec 2017 10:59:21 +0100 Subject: Sailfish build on newer SDKs (#388) * Allow building on new sailfish SDK which uses different tool paths * Add notice about exportig VERSION_ID * Add check for VERSION_ID variable. --- contrib/sailfish/build_on_sailfish_sdk.sh | 9 ++++++--- contrib/sailfish/navit-sailfish.spec | 2 ++ 2 files changed, 8 insertions(+), 3 deletions(-) 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 -- cgit v1.2.1 From 77b0b67935ae90d4fcb8f2cf4a07cd6dc1bed9b7 Mon Sep 17 00:00:00 2001 From: Pierre GRANDIN Date: Tue, 2 Jan 2018 12:20:38 -0800 Subject: fix:wince:fixed the wince build (#386) * Switching to a specific image * Fixed typo in circleci config file * Activated wince build * Store build artifacts * Build a samplemap for wince * Added correct shebang header * Switched to a navit org docker image for wince * Generate a cab file --- .circleci/config.yml | 10 ++++++---- ci/build_wince.sh | 16 +++++++++++++++- 2 files changed, 21 insertions(+), 5 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/ -- cgit v1.2.1 From 1315db8a1d02497cad21e71ac0905029e4fe8bd2 Mon Sep 17 00:00:00 2001 From: mvglasow Date: Thu, 4 Jan 2018 21:02:30 +0100 Subject: Refactor:route:Improve documentation Signed-off-by: mvglasow --- navit/route.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) 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; -- cgit v1.2.1 From d9292650e6dc1d7869e0905f7e473e1fc0fec351 Mon Sep 17 00:00:00 2001 From: Charles Curley Date: Mon, 8 Jan 2018 14:27:46 -0700 Subject: fix:gtk:Initialize Follow menu entry correctly. (#390) This should fix http://trac.navit-project.org/ticket/1357 I tested for follow_vehicle set to zero and one, and absent. modified: navit/gui/gtk/gui_gtk_action.c --- navit/gui/gtk/gui_gtk_action.c | 4 ++++ 1 file changed, 4 insertions(+) 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); -- cgit v1.2.1 From 7f55725b43800e3ae7ce48e998350778f7517c6f Mon Sep 17 00:00:00 2001 From: jkoan Date: Tue, 9 Jan 2018 19:37:28 +0100 Subject: fix:android:Use date of commit as version code instead of system time (#376) --- cmake/version.cmake | 66 +++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 52 insertions(+), 14 deletions(-) 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) -- cgit v1.2.1