Skip to content
Open
Show file tree
Hide file tree
Changes from 49 commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
9be1852
Merge pull request #7 from navit-gps/master
OLFDB Feb 14, 2021
a683b53
Merge pull request #8 from navit-gps/master
OLFDB Feb 23, 2021
1d2b254
macosbuild
Feb 25, 2021
832daac
macosbuild
Feb 25, 2021
0241fe4
macosbuild
Feb 25, 2021
56c7f7d
macosbuild
Feb 25, 2021
2df2ec6
macosbuild
Feb 25, 2021
bd90261
macosbuild
Feb 25, 2021
dabcb3f
Added locales to bundle
OLFDB Feb 27, 2021
be09582
conditional vehicle/iphone: build it only when UIKit is available
OLFDB Feb 27, 2021
b78f880
create /usr/local/lib/navit
Feb 27, 2021
6184abc
Use this script on a Mac to setup the build environment and build navit
Feb 27, 2021
24f52c8
Changed build procedure
OLFDB Feb 27, 2021
7c8fa5a
Copy whole macos bundle to /usr/local/bin
Feb 27, 2021
7ff14e5
added imagemagick
Feb 27, 2021
e09e1c2
changes to build
OLFDB Feb 27, 2021
c5d1849
Merge branch 'macosbuild' of https://github.com/OLFDB/navit into maco…
OLFDB Feb 27, 2021
77e0b72
added gpsd
OLFDB Feb 27, 2021
4fffff8
formatting, removed unmaintained info
OLFDB Feb 27, 2021
4f94cd1
correction
OLFDB Feb 27, 2021
ef9b6dc
clean up
OLFDB Feb 27, 2021
6e33c24
build macos target in seperate project to have all bundle files
OLFDB Feb 28, 2021
27c4cfb
build macos target in seperate project to have all bundle files
OLFDB Feb 28, 2021
88e6eef
applied astyle
OLFDB Feb 28, 2021
ba9cd87
fix
Feb 28, 2021
0f74a17
A desktop navit.xml using GTK gui as the default
OLFDB Feb 28, 2021
8891fad
Changed install commands
Feb 28, 2021
0bca626
Changed install commands
Feb 28, 2021
b0e09b7
added
Feb 28, 2021
b88324b
changed install command
Feb 28, 2021
1cf5fda
start gpsd service
Feb 28, 2021
5547a36
added gpsd activation
OLFDB Feb 28, 2021
76ba1b3
create
Feb 28, 2021
2e2d029
# WARNING: head commit changed in the meantime
OLFDB Feb 28, 2021
30f7000
added make install
Feb 28, 2021
dcdd2a8
Use command say for speech
OLFDB Feb 28, 2021
1281233
Update
OLFDB Feb 28, 2021
348403a
Update
OLFDB Feb 28, 2021
bd2c68d
Update
OLFDB Feb 28, 2021
171c177
update
OLFDB Feb 28, 2021
60d671f
update
OLFDB Feb 28, 2021
9c4e88b
update
OLFDB Feb 28, 2021
9fd3cf2
update
OLFDB Feb 28, 2021
603d795
update
OLFDB Feb 28, 2021
0fc9770
Codestyle
OLFDB Feb 28, 2021
0a98852
Merge branch 'trunk' into macosbuild
OLFDB Feb 28, 2021
58bad51
When support/espeak is true the #include "event.h" takes the file from
OLFDB Feb 28, 2021
cec0be8
Merge branch 'trunk' into macosbuild
OLFDB Mar 1, 2021
46411ac
Merge branch 'trunk' into macosbuild
OLFDB May 2, 2021
8efc3f2
-DIOS=0 for macbuild
OLFDB Oct 9, 2021
6744c9f
Updates for macos
OLFDB Oct 9, 2021
a315b58
Added CoreText and CoreImage libraries
OLFDB Oct 9, 2021
e6c21a6
Updates from ios build
OLFDB Oct 9, 2021
94e1664
added -x objective-c for macos and ios build
OLFDB Oct 9, 2021
e439567
changed images_resource custom command
OLFDB Oct 9, 2021
d7574be
build a macos bundle
OLFDB Oct 9, 2021
adda6f5
ios changes
OLFDB Oct 9, 2021
a00d22e
Xcode warning and debug level
OLFDB Oct 9, 2021
b952ea9
Xcode warning
OLFDB Oct 9, 2021
3145713
Check struct transformation is set
OLFDB Oct 9, 2021
fad676b
Changes for ios
OLFDB Oct 9, 2021
1b572b2
Compatibility for macos and iOS
OLFDB Oct 9, 2021
c7fcca1
macos xslt file
OLFDB Oct 9, 2021
b36a050
Merge branch 'macosbuild' of https://github.com/OLFDB/navit into HEAD
OLFDB Oct 9, 2021
f60fc5e
astyle
OLFDB Oct 9, 2021
65fb412
astyle
OLFDB Oct 9, 2021
55c7e2b
astyle
OLFDB Oct 9, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@ cmake_minimum_required(VERSION 3.2)

set(MACOSX_BUNDLE_GUI_IDENTIFIER "org.navitproject.navit")
set(MACOSX_BUNDLE_BUNDLE_NAME "Navit")
set(MACOSX_BUNDLE_ICON_FILE "Default.png")
execute_process(COMMAND git describe --tags OUTPUT_VARIABLE MACOSX_BUNDLE_INFO_STRING)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • It should be handled if git is not available and if the build isn't run from a git repo (tar source package for example)
  • Variable should be renamed to GIT_VERSION so if can also be used within config.h.in

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First of all thank you for the feedback. I'm working on it.

message(STATUS "Building with CMake V${CMAKE_VERSION}")
message(STATUS "Git Version: ${MACOSX_BUNDLE_INFO_STRING}")

if (DISABLE_CXX)
project(navit C)
else(DISABLE_CXX)
Expand Down Expand Up @@ -714,12 +718,15 @@ if(WINCE)
set_with_reason(support/espeak "Windows detected" TRUE)
endif()
if (APPLE OR USE_UIKIT)
set_with_reason(vehicle/iphone "apple detected" TRUE)
if (EXISTS "${CMAKE_OSX_SYSROOT}/System/Library/PrivateFrameworks/UIKit.framework")
set_with_reason(vehicle/iphone "apple detected" TRUE)
endif()
set_with_reason(graphics/cocoa "apple detected" TRUE)
if (EXISTS "${CMAKE_OSX_SYSROOT}/System/Library/PrivateFrameworks/VoiceServices.framework")
set_with_reason(speech/iphone "apple detected" TRUE)
endif()
set(BUILD_BUNDLE TRUE CACHE BOOLEAN "build an osx bundle")
set(NAVIT_COMPILE_FLAGS "${NAVIT_COMPILE_FLAGS} -ObjC")
endif()

if(CMAKE_SIZEOF_VOID_P LESS 8)
Expand Down
17 changes: 17 additions & 0 deletions contrib/macos/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
cmake_minimum_required(VERSION 3.2)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this would define another project just for macos. I think we should avoid this and work with components within the main project and use cpack (part of cmake) to install everything where its needs to be

project(macosbundle C)

include(ExternalProject)
ExternalProject_Add(navit CMAKE_ARGS
-Dbinding/python=false SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/../)
ExternalProject_Get_Property(navit BINARY_DIR)
ExternalProject_Get_Property(navit SOURCE_DIR)

install(DIRECTORY /usr/local/lib/navit/ DESTINATION ${BINARY_DIR}/navit.app/Contents/Resources)
install(DIRECTORY ${BINARY_DIR}/navit/resources/share/navit/ DESTINATION ${BINARY_DIR}/navit.app/Contents/Resources/share)
install(DIRECTORY ${BINARY_DIR}/navit//resources/share/locale DESTINATION ${BINARY_DIR}/navit.app/Contents/Resources/share)
install(DIRECTORY ${BINARY_DIR}/navit/icons DESTINATION ${BINARY_DIR}/navit.app/Contents/Resources/share)
install(DIRECTORY ${BINARY_DIR}/navit/textures DESTINATION ${BINARY_DIR}/navit.app/Contents/Resources/share)
install(DIRECTORY ${BINARY_DIR}/navit/maps DESTINATION ${BINARY_DIR}/navit.app/Contents/Resources/share)
install(DIRECTORY ${BINARY_DIR}/navit.app DESTINATION /usr/local/bin)
Install(FILES ${SOURCE_DIR}navit/navit_shipped_gtkgui.xml DESTINATION ~/.navit RENAME navit.xml)
75 changes: 25 additions & 50 deletions docs/development/macos_development.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,86 +4,61 @@ MacOS Development

Here are some notes about running navit under Apple Mac OSX.

================================================================================================================================
WARNING: These instructions are currently unmaintained. Please feel free to submit a PR if you manage to build navit on Mac OSX.
================================================================================================================================

What you will need
==================

You need Xcode Tools and MacPorts in order to install navit.

MacPorts developers suggest to install Xcode Tools from http://developer.apple.com/tools/xcode/ and not from the Mac OSX install disk.
See `Mac-How <http://www.mac-how.net/>`_

Make sure you don't have fink installed on your system, it can confuse MacPorts package building and installation.
You need Xcode Tools and homebrew in order to install navit.

* GTK Gui: You should only need gtk2 and glib2 via macPorts
* SDL Gui: Untested yet.
.. code-block:: bash ⚠️ Warning:

Installation instruction
========================
If you have macports or fink installed create and use a new user account to build navit.

Download Xcode Tools from http://developer.apple.com/tools/xcode/ and install it with X11 SDK

Download and Install MacPorts from http://www.macports.org/, or update your version
For convinience there is the script prepare_navit_macos.sh available under the navit/scripts directory.

.. code-block:: bash

sudo port -d selfupdate

Open up a terminal
$ curl https://raw.githubusercontent.com/OLFDB/navit/macosbuild/scripts/prepare_navit_macos.sh -o prepare_navit_macos.sh

make sure your PATH variables has `/opt/local/bin` and `/opt/local/sbin` in it:
Then start the installation procedure:

.. code-block:: bash
.. code-block:: bash

echo $PATH
$ sh prepare_navit_macos.sh


Install automake, wget, libtool, gpsd (if you want gps support), gtk2 and glib2 (for gkt GUI) with
What is working
===============
* internal Gui: Working, but problems with window refresh
* GTK Gui: Working.
* SDL Gui: Untested yet.

.. code-block:: bash

sudo port install automake wget gpsd gtk2 glib2 libtool

Download navit or checkout it from Git

.. code-block:: bash
GPSD
====

git clone [email protected]:navit-gps/navit.git
You have to add the GPS receiver device to gpsd:

You may also need a header file to handle endian issues (for PPC only)

.. code-block:: bash

wget https://navit.svn.sourceforge.net/svnroot/navit/tags/R0_1_0/navit/projs/CodeBlocks/Win32Extra/byteswap.h

If you want to install navit along the MacPorts packages, you need to use the /opt/local directory as prefix:

.. code-block:: bash

./autogen.sh && ./configure --prefix=/opt/local --disable-binding-python

type `make` to build NavIt, and `sudo make install` to install it.

Then, you may edit and adapt your `navit.xml` file. The XML maptype is not supported, however normal Navit binfile works perfectly.
GPSD_SOCKET="/usr/local/var/gpsd.sock" /usr/local/opt/gpsd/sbin/gpsdctl add /dev/tty.usbserial-XYZ

Speech
======

If you want (spoken) directions, get espeak from http://espeak.sourceforge.net, install as advised and use the following snippet in your navit.xml:
If you want (spoken) directions, use the following snippet in your navit.xml:

.. code-block:: xml

<speech type="cmdline" data="speak -vde+f4 '%s'"/>
<speech type="cmdline" data="say '%s'"/>

This will tell speak to use a female (f) german (de) voice.
This will use the native say command. You can list all available voices by typing say -v ? in a terminal.
Change the command to say -v <voicename> if you would like a non standard voice to be used. New voices can be added in system preferences->keyboard->dictation


Using xcode
===========

========================================================================================================================================
WARNING: These instructions are currently outdated. Please feel free to submit a PR if you manage to build navit on Mac OSX using Xcode.
========================================================================================================================================

Download one of the `Git sources <https://github.com/navit-gps/navit>`_ that don't contain autogen.sh.

Open X-Code and create a new project. Cocoa will suffice
Expand Down
16 changes: 12 additions & 4 deletions navit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ include_directories( "${CMAKE_CURRENT_SOURCE_DIR}/support")
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/THIS_IS_THE_NAVIT_WORKING_DIR "\r\nThis File should never appear on binary distributions\r\n" )
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/THIS_IS_THE_NAVIT_WORKING_DIR "\r\nOnly Devs should ever see this file" )

IF(APPLE)
# Fix linking on 10.14+. See https://stackoverflow.com/questions/54068035
LINK_DIRECTORIES(/usr/local/lib)
ENDIF()

# navit core
set(NAVIT_SRC announcement.c atom.c attr.c cache.c callback.c command.c config_.c coord.c country.c data_window.c debug.c
event.c file.c geom.c graphics.c gui.c item.c layout.c log.c main.c map.c maps.c
Expand Down Expand Up @@ -77,20 +82,23 @@ if(NOT ANDROID)
endif()
endif()
if (BUILD_BUNDLE)
set(EXECUTABLE_NAME navit)
set(APP_ICON_FILE Default.png)
list(APPEND NAVIT_START_SRC resources/share resources/Icon.png resources/Default.png)
add_custom_command(OUTPUT resources/Icon.png COMMAND convert -scale 79x79 -crop 60x60+8+19 ${CMAKE_CURRENT_SOURCE_DIR}/icons/desktop_icons/128x128/navit.png resources/Icon.png)
add_custom_command(OUTPUT resources/Default.png COMMAND convert -scale 79x79 -crop 60x60+8+19 ${CMAKE_CURRENT_SOURCE_DIR}/icons/desktop_icons/128x128/navit.png resources/Default.png)
add_custom_command(OUTPUT resources/Icon.png COMMAND convert -scale 79x79 ${CMAKE_CURRENT_SOURCE_DIR}/icons/desktop_icons/128x128/navit.png resources/Icon.png)
add_custom_command(OUTPUT resources/Default.png COMMAND convert -scale 79x79 ${CMAKE_CURRENT_SOURCE_DIR}/icons/desktop_icons/128x128/navit.png resources/Default.png)
endif()
add_executable(navit ${NAVIT_START_SRC})
target_link_libraries (navit ${NAVIT_LIBNAME})
if(DEFINED NAVIT_BINARY)
set_target_properties(navit PROPERTIES OUTPUT_NAME ${NAVIT_BINARY})
endif(DEFINED NAVIT_BINARY)
if (BUILD_BUNDLE)
target_link_libraries(navit stdc++ "-framework Foundation" objc)
add_custom_command(OUTPUT resources/share COMMAND mkdir -p resources/share)
set_source_files_properties(resources/share resources/Icon.png resources/Default.png PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
set_source_files_properties(${NAVIT_SUPPORT_LIBS} resources/share resources/Icon.png resources/Default.png PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
set_target_properties(navit PROPERTIES MACOSX_BUNDLE TRUE)
set_target_properties(navit PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist)
#set_target_properties(navit PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist)
add_dependencies(navit navit_config_xml_resource)
add_dependencies(navit images_resource)
add_dependencies(navit locale_resource)
Expand Down
2 changes: 1 addition & 1 deletion navit/android.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "config_.h"
#include "command.h"
#include "debug.h"
#include "event.h"
#include "navit/event.h"
#include "callback.h"
#include "country.h"
#include "projection.h"
Expand Down
2 changes: 1 addition & 1 deletion navit/binding/dbus/binding_dbus.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
#include "roadprofile.h"
#include "util.h"
#include "transform.h"
#include "event.h"
#include "navit/event.h"
#include "traffic.h"

static DBusConnection *connection;
Expand Down
2 changes: 1 addition & 1 deletion navit/command.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include "debug.h"
#include "callback.h"
#include "command.h"
#include "event.h"
#include "navit/event.h"
#include "navit_nls.h"

/*
Expand Down
2 changes: 1 addition & 1 deletion navit/event.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

#include <string.h>
#include <stdlib.h>
#include "event.h"
#include "navit/event.h"
#include "plugin.h"
#include "debug.h"

Expand Down
2 changes: 1 addition & 1 deletion navit/event_glib.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

#include <glib.h>
#include "event.h"
#include "navit/event.h"
#include "event_glib.h"
#include "debug.h"
#include "callback.h"
Expand Down
2 changes: 1 addition & 1 deletion navit/graphics.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
#include "util.h"
#include "callback.h"
#include "file.h"
#include "event.h"
#include "navit/event.h"
#include "navit.h"

/**
Expand Down
2 changes: 1 addition & 1 deletion navit/graphics/android/graphics_android.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include "item.h"
#include "xmlconfig.h"
#include "plugin.h"
#include "event.h"
#include "navit/event.h"
#include "debug.h"
#include "callback.h"
#include "android.h"
Expand Down
2 changes: 1 addition & 1 deletion navit/graphics/cocoa/graphics_cocoa.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include "point.h"
#include "window.h"
#include "graphics.h"
#include "event.h"
#include "navit/event.h"
#include "item.h"
#include "callback.h"
#include "color.h"
Expand Down
2 changes: 1 addition & 1 deletion navit/graphics/egl/graphics_egl.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#include "graphics.h"
#include "color.h"
#include "plugin.h"
#include "event.h"
#include "navit/event.h"
#include "debug.h"
#include "callback.h"
#include "keys.h"
Expand Down
19 changes: 17 additions & 2 deletions navit/graphics/gtk_drawing_area/graphics_gtk_drawing_area.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,26 @@
#include <math.h>
#include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h>

#include <cairo.h>
#include <locale.h> /* For WIN32 */
#if !defined(GDK_KEY_Book) || !defined(GDK_Book) || !defined(GDK_Calendar)
#if !defined(__APPLE__)
#include <X11/XF86keysym.h>
#endif
#endif
#ifdef HAVE_IMLIB2
#include <Imlib2.h>
#endif

#ifndef _WIN32
#if !defined(__APPLE__)
#include <gdk/gdkx.h>
#else
#include <gdk/gdkquartz.h>
#endif
#endif
#include "event.h"
#include "navit/event.h" /* in case espeak is enabled the system finds the wrong event.h without navit/ prefix */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can't be the solution, probably wrong include order with espeak?

#include "debug.h"
#include "point.h"
#include "graphics.h"
Expand Down Expand Up @@ -625,7 +632,11 @@ static gint configure(GtkWidget * widget, GdkEventConfigure * event, gpointer us
if (! gra->visible)
return TRUE;
#ifndef _WIN32
#if defined(__APPLE__)
dbg(lvl_debug,"window=%lu", GDK_WINDOW(widget->window));
#else
dbg(lvl_debug,"window=%lu", GDK_WINDOW_XID(widget->window));
#endif
#endif
gra->width=widget->allocation.width;
gra->height=widget->allocation.height;
Expand Down Expand Up @@ -1016,7 +1027,11 @@ static void *get_data(struct graphics_priv *this, char const *type) {
return this->widget;
#ifndef _WIN32
if (!strcmp(type,"xwindow_id"))
#if defined(__APPLE__)
return (void *)GDK_WINDOW(this->win ? this->win->window : this->widget->window);
#else
return (void *)GDK_WINDOW_XID(this->win ? this->win->window : this->widget->window);
#endif
#endif
if (!strcmp(type,"window")) {
char *cp = getenv("NAVIT_XID");
Expand Down Expand Up @@ -1112,7 +1127,7 @@ static struct graphics_priv *graphics_gtk_drawing_area_new(struct navit *nav, st
GtkWidget *draw;
struct attr *attr;

if (! event_request_system("glib","graphics_gtk_drawing_area_new"))
if (event_request_system((const char *)"glib",(const char *)"graphics_gtk_drawing_area_new")==0)
return NULL;

draw=gtk_drawing_area_new();
Expand Down
2 changes: 1 addition & 1 deletion navit/graphics/null/graphics_null.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include "graphics.h"
#include "color.h"
#include "plugin.h"
#include "event.h"
#include "navit/event.h"
#include "debug.h"
#include "window.h"
#include "callback.h"
Expand Down
3 changes: 2 additions & 1 deletion navit/graphics/opengl/graphics_opengl.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#include "graphics.h"
#include "color.h"
#include "plugin.h"
#include "event.h"
#include "navit/event.h"
#include "debug.h"
#include "callback.h"
#include "keys.h"
Expand Down Expand Up @@ -79,6 +79,7 @@ typedef double GLdouble;
#define USE_FLOAT 1
#ifdef __APPLE__
#include <GLUT/glut.h>
# define APIENTRY
#else
#include <GL/glut.h> /* glut.h includes gl.h and glu.h */
#endif
Expand Down
2 changes: 1 addition & 1 deletion navit/graphics/opengl/graphics_opengl_x11.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include <X11/Xutil.h>
#include <glib.h>
#include "debug.h"
#include "event.h"
#include "navit/event.h"
#include "callback.h"
#include "graphics_opengl.h"

Expand Down
2 changes: 1 addition & 1 deletion navit/graphics/qt5/QNavitQuick.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ extern "C" {
#include "callback.h"
#include "color.h"
#include "debug.h"
#include "event.h"
#include "navit/event.h"

#include "point.h" /* needs to be before graphics.h */

Expand Down
2 changes: 1 addition & 1 deletion navit/graphics/qt5/QNavitWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ extern "C" {
#include "callback.h"
#include "color.h"
#include "debug.h"
#include "event.h"
#include "navit/event.h"

#include "point.h" /* needs to be before graphics.h */

Expand Down
Loading