Difference between revisions of "MacOS development"

From Navit's Wiki
Jump to: navigation, search
m (Installation instruction)
m (Reverted edits by Royalsanu (talk) to last revision by KaZeR)
 
(31 intermediate revisions by 16 users not shown)
Line 1: Line 1:
'''Here are some notes about running navit under MacOS.
+
'''Here are some notes about running navit under Apple Mac OSX.'''
This is a draft, feel free to improve it.'''
 
  
  
Line 8: Line 7:
  
 
MacPorts developers suggest to install Xcode Tools from http://developer.apple.com/tools/xcode/ and not from the Mac OSX install disk.
 
MacPorts developers suggest to install Xcode Tools from http://developer.apple.com/tools/xcode/ and not from the Mac OSX install disk.
 +
 +
*[http://www.mac-how.net/ Mac-How]
  
 
Make sure you don't have fink installed on your system, it can confuse MacPorts package building and installation.
 
Make sure you don't have fink installed on your system, it can confuse MacPorts package building and installation.
Line 29: Line 30:
  
  
Install automake, wget, gpsd (if you want gps support), gtk2 and glib2 (for gkt GUI) with
+
Install automake, wget, libtool, gpsd (if you want gps support), gtk2 and glib2 (for gkt GUI) with
   sudo port install automake wget gpsd gtk2 glib2
+
   sudo port install automake wget gpsd gtk2 glib2 libtool
  
Download navit or checkout it from CVS
+
Download navit or checkout it from SVN
  cvs -d:pserver:anonymous@navit.cvs.sourceforge.net:/cvsroot/navit login
+
  svn co https://svn.code.sf.net/p/navit/code/trunk/navit
At the password prompt, just press enter. Then
 
  cvs -z3 -d:pserver:anonymous@navit.cvs.sourceforge.net:/cvsroot/navit co -P navit
 
  
Edit configure.in and add
+
You may also need a header file to handle endian issues (for PPC only)
  -I/opt/local/include -L/opt/local/lib
+
wget https://navit.svn.sourceforge.net/svnroot/navit/tags/R0_1_0/navit/projs/CodeBlocks/Win32Extra/byteswap.h
to the CFLAGS variable (note that the variables occurs 2 times in the file) and change
 
  LIBS="$LIBS -lm -rdynamic"
 
by
 
  LIBS="$LIBS -lm"
 
(on some systems, the "-rdynamic" option ensures that the executable has it's global symbols put into the symbol table. This is already the default
 
behavior on darwin.)
 
  
 
If you want to install navit along the MacPorts packages, you need to use the /opt/local directory as prefix:
 
If you want to install navit along the MacPorts packages, you need to use the /opt/local directory as prefix:
   ./autogen.sh && ./configure --prefix=/opt/local
+
   ./autogen.sh && ./configure --prefix=/opt/local --disable-binding-python
 
 
  
 
type
 
type
Line 56: Line 48:
 
to install it.
 
to install it.
  
Then, you may edit and adapt your navit.xml file (the jokers of the original file are not supported)
+
Then, you may edit and adapt your navit.xml file. The XML maptype is not supported, however normal Navit binfile works perfectly.
 +
 
 +
=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:
 +
 
 +
          <speech type="cmdline" data="speak -vde+f4 '%s'"/>
  
You may replace the <plugins> section of your navit.xml file by
+
This will tell speak to use a female (f) german (de) voice.   
  <plugins>
 
  <plugin path="/opt/local/lib/navit/binding/libbinding_python.dylib"/>
 
  <plugin path="/opt/local/lib/navit/data/libdata_binfile.dylib"/>
 
  <plugin path="/opt/local/lib/navit/data/libdata_mg.dylib"/>
 
  <plugin path="/opt/local/lib/navit/data/libdata_poi_geodownload.dylib"/>
 
  <plugin path="/opt/local/lib/navit/data/libdata_textfile.dylib"/>
 
  <plugin path="/opt/local/lib/navit/graphics/libgraphics_gtk_drawing_area.dylib" />
 
  <plugin path="/opt/local/lib/navit/graphics/libgraphics_null.dylib" active="no"/>
 
  <plugin path="/opt/local/lib/navit/gui/libgui_gtk.dylib" />
 
  <plugin path="/opt/local/lib/navit/osd/libosd_core.dylib" />
 
  <plugin path="/opt/local/lib/navit/speech/libspeech_cmdline.dylib" />
 
  <plugin path="/opt/local/lib/navit/vehicle/libvehicle_demo.dylib" />
 
  <plugin path="/opt/local/lib/navit/vehicle/libvehicle_file.dylib" />
 
  </plugins>
 
and if you want to use the sample maps installed, you may change the maps' path
 
<mapset enabled="yes">
 
  <map type="binfile" enabled="yes" data="/opt/local/share/navit/maps/osm_bbox_11.3,47.9,11.7,48.2.bin"/>
 
   </mapset>
 
  
=Something went wrong?=
 
  
==Malloc error :==
+
=Using xcode=
 +
 
 +
Download one of the [http://download.navit-project.org/navit/src/svn/ svn sources] that don't contain autogen.sh.
 +
 
 +
Open X-Code and create a new project. Cocoa will suffice
 +
 
 +
Add in a new target by clicking the triangle next to "Targets" and selected the location of the navit folder. Delete the previous target.
 +
 
 +
Delete the default files, and add in the navit files.
 +
 
 +
In a terminal, go into the navit folder.
 +
./configure --disable-binding-python --disable-sample-map --disable-maptool
  
param.c:3:20: error: malloc.h: No such file or directory
+
xcode can now build the navit
param.c: In function 'param_add_string':
 
param.c:10: warning: implicit declaration of function 'malloc'
 
param.c:10: warning: incompatible implicit declaration of built-in function 'malloc'
 
  
There is no malloc.h in OS X. All the defs are in stdlib.h. If you want
 
you could make a softlink /opt/local/inlcude/malloc.h to
 
/usr/include/stdlib.h, or just comment the relevants include <malloc.h>
 
  
Both will work. The symlink is maybe easier for now.
+
You can also use [[CMake]].
 +
cd navit && cmake -G Xcode .
  
  ln -s /usr/include/stdlib.h /opt/local/include/malloc.h
+
=Something went wrong?=
  
 +
Please [[Contacts|let us know]].
  
We'll add a platform-test soon to fix it.
+
[[Category:Ports]]

Latest revision as of 17:50, 3 January 2018

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


What you will need[edit]

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.

Make sure you don't have fink installed on your system, it can confuse MacPorts package building and installation.

GTK Gui[edit]

You should only need gtk2 and glib2 via macPorts

SDL Gui[edit]

Untested yet.

Installation instruction[edit]

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

 sudo port -d selfupdate

Open up a terminal

make sure your PATH variables has /opt/local/bin and /opt/local/sbin in it:

 echo $PATH 


Install automake, wget, libtool, gpsd (if you want gps support), gtk2 and glib2 (for gkt GUI) with

 sudo port install automake wget gpsd gtk2 glib2 libtool

Download navit or checkout it from SVN

  svn co https://svn.code.sf.net/p/navit/code/trunk/navit

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

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:

 ./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.

Speech[edit]

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

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

This will tell speak to use a female (f) german (de) voice.


Using xcode[edit]

Download one of the svn sources that don't contain autogen.sh.

Open X-Code and create a new project. Cocoa will suffice

Add in a new target by clicking the triangle next to "Targets" and selected the location of the navit folder. Delete the previous target.

Delete the default files, and add in the navit files.

In a terminal, go into the navit folder.

./configure --disable-binding-python --disable-sample-map --disable-maptool

xcode can now build the navit


You can also use CMake.

cd navit && cmake -G Xcode .

Something went wrong?[edit]

Please let us know.