-
Couldn't load subscription status.
- Fork 176
Fix for #1088 Macos build issues #1096
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: trunk
Are you sure you want to change the base?
Changes from 49 commits
9be1852
a683b53
1d2b254
832daac
0241fe4
56c7f7d
2df2ec6
bd90261
dabcb3f
be09582
b78f880
6184abc
24f52c8
7c8fa5a
7ff14e5
e09e1c2
c5d1849
77e0b72
4fffff8
4f94cd1
ef9b6dc
6e33c24
27c4cfb
88e6eef
ba9cd87
0f74a17
8891fad
0bca626
b0e09b7
b88324b
1cf5fda
5547a36
76ba1b3
2e2d029
30f7000
dcdd2a8
1281233
348403a
bd2c68d
171c177
60d671f
9c4e88b
9fd3cf2
603d795
0fc9770
0a98852
58bad51
cec0be8
46411ac
8efc3f2
6744c9f
a315b58
e6c21a6
94e1664
e439567
d7574be
adda6f5
a00d22e
b952ea9
3145713
fad676b
1b572b2
c7fcca1
b36a050
f60fc5e
65fb412
55c7e2b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| cmake_minimum_required(VERSION 3.2) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 */ | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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" | ||
|
|
@@ -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; | ||
|
|
@@ -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"); | ||
|
|
@@ -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(); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
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.