2018-08-26 17:18:15 +02:00
|
|
|
{ stdenv, fetchFromGitHub, pkgconfig, gtk2, fontconfig, freetype, imlib2
|
|
|
|
, SDL_image, libGLU_combined, libXmu, freeglut, pcre, dbus, dbus-glib, glib
|
2019-05-22 13:03:39 +02:00
|
|
|
, librsvg, freeimage, libxslt, cairo, gdk-pixbuf, pango
|
2018-08-26 17:18:15 +02:00
|
|
|
, atk, patchelf, fetchurl, bzip2, python, gettext, quesoglc
|
|
|
|
, gd, cmake, shapelib, SDL_ttf, fribidi, makeWrapper
|
|
|
|
, qtquickcontrols, qtmultimedia, qtspeech, qtsensors
|
|
|
|
, qtlocation, qtdeclarative, qtsvg
|
|
|
|
, qtSupport ? false, qtbase #need to fix qt_qpainter
|
|
|
|
, sdlSupport ? true, SDL
|
|
|
|
, xkbdSupport ? true, xkbd
|
|
|
|
, espeakSupport ? true, espeak
|
|
|
|
, postgresqlSupport ? false, postgresql
|
|
|
|
, speechdSupport ? false, speechd ? null
|
|
|
|
}:
|
2018-08-22 20:10:32 +02:00
|
|
|
|
2018-08-26 17:18:15 +02:00
|
|
|
assert speechdSupport -> speechd != null;
|
|
|
|
|
|
|
|
with stdenv.lib;
|
2010-08-22 13:33:57 +02:00
|
|
|
stdenv.mkDerivation rec {
|
2018-08-22 20:10:32 +02:00
|
|
|
name = "navit-${version}";
|
2018-09-01 14:06:47 +02:00
|
|
|
version = "0.5.3";
|
2018-08-22 20:10:32 +02:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "navit-gps";
|
|
|
|
repo = "navit";
|
|
|
|
rev = "v${version}";
|
2018-09-01 14:06:47 +02:00
|
|
|
sha256 = "071drvqzxpxbfh0lf0lra5a97rv8ny40l96n9xl0dx0s8w30j61i";
|
2018-08-22 20:10:32 +02:00
|
|
|
};
|
2010-08-22 13:33:57 +02:00
|
|
|
|
2018-08-22 20:10:32 +02:00
|
|
|
sample_map = fetchurl {
|
|
|
|
url = "http://www.navit-project.org/maps/osm_bbox_11.3,47.9,11.7,48.2.osm.bz2";
|
|
|
|
name = "sample_map.bz2";
|
|
|
|
sha256 = "0vg6b6rhsa2cxqj4rbhfhhfss71syhnfa6f1jg2i2d7l88dm5x7d";
|
2010-08-22 13:33:57 +02:00
|
|
|
};
|
|
|
|
|
2018-08-26 17:18:15 +02:00
|
|
|
patches = [ ./CMakeLists.txt.patch ];
|
|
|
|
|
|
|
|
NIX_CFLAGS_COMPILE = optional sdlSupport "-I${SDL.dev}/include/SDL"
|
|
|
|
++ optional speechdSupport "-I${speechd}/include/speech-dispatcher";
|
2016-02-12 14:04:31 +01:00
|
|
|
|
2018-08-26 17:18:15 +02:00
|
|
|
# we choose only cmdline and speech-dispatcher speech options.
|
|
|
|
# espeak builtins is made for non-cmdline OS as winCE
|
|
|
|
cmakeFlags = [
|
2018-09-01 14:06:47 +02:00
|
|
|
"-DSAMPLE_MAP=n " "-DCMAKE_BUILD_TYPE=Release"
|
2018-08-26 17:18:15 +02:00
|
|
|
"-Dspeech/qt5_espeak=FALSE" "-Dsupport/espeak=FALSE"
|
|
|
|
];
|
2016-08-27 23:58:06 +02:00
|
|
|
|
2018-08-26 17:18:15 +02:00
|
|
|
buildInputs = [
|
|
|
|
gtk2 fontconfig freetype imlib2 libGLU_combined freeimage
|
|
|
|
libxslt libXmu freeglut python gettext quesoglc gd
|
|
|
|
fribidi pcre dbus dbus-glib librsvg shapelib glib
|
2019-05-22 13:03:39 +02:00
|
|
|
cairo gdk-pixbuf pango atk
|
2018-08-26 17:18:15 +02:00
|
|
|
] ++ optionals sdlSupport [ SDL SDL_ttf SDL_image ]
|
|
|
|
++ optional postgresqlSupport postgresql
|
|
|
|
++ optional speechdSupport speechd
|
|
|
|
++ optionals qtSupport [
|
|
|
|
qtquickcontrols qtmultimedia qtspeech qtsensors
|
|
|
|
qtbase qtlocation qtdeclarative qtsvg
|
|
|
|
];
|
2016-08-27 23:58:06 +02:00
|
|
|
|
2018-08-26 17:18:15 +02:00
|
|
|
nativeBuildInputs = [ makeWrapper pkgconfig cmake patchelf bzip2 ];
|
2018-08-22 20:10:32 +02:00
|
|
|
|
|
|
|
# we dont want blank screen by defaut
|
|
|
|
postInstall = ''
|
|
|
|
# emulate DSAMPLE_MAP
|
2018-08-26 17:18:15 +02:00
|
|
|
mkdir -p $out/share/navit/maps/
|
2018-08-22 20:10:32 +02:00
|
|
|
bzcat "${sample_map}" | $out/bin/maptool "$out/share/navit/maps/osm_bbox_11.3,47.9,11.7,48.2.bin"
|
|
|
|
'';
|
2010-08-22 14:07:03 +02:00
|
|
|
|
2018-08-22 20:10:32 +02:00
|
|
|
# TODO: fix upstream?
|
2018-08-27 23:26:06 +02:00
|
|
|
libPath = stdenv.lib.makeLibraryPath ([ stdenv.cc.libc ] ++ buildInputs );
|
2018-08-31 14:14:07 +02:00
|
|
|
postFixup =
|
|
|
|
''
|
2018-09-01 14:06:47 +02:00
|
|
|
find "$out/lib" -type f -name "*.so" -exec patchelf --set-rpath $libPath {} \;
|
2018-08-27 23:26:06 +02:00
|
|
|
|
2018-08-26 17:18:15 +02:00
|
|
|
wrapProgram $out/bin/navit \
|
|
|
|
--prefix PATH : ${makeBinPath (
|
|
|
|
optional xkbdSupport xkbd
|
|
|
|
++ optional espeakSupport espeak
|
|
|
|
++ optional speechdSupport speechd ) }
|
2018-08-22 20:10:32 +02:00
|
|
|
'';
|
2010-08-22 14:01:41 +02:00
|
|
|
|
2018-08-26 17:18:15 +02:00
|
|
|
meta = {
|
2019-04-15 01:25:45 +02:00
|
|
|
homepage = https://www.navit-project.org;
|
2010-08-22 13:33:57 +02:00
|
|
|
description = "Car navigation system with routing engine using OSM maps";
|
2018-08-22 20:10:32 +02:00
|
|
|
license = licenses.gpl2;
|
|
|
|
maintainers = [ maintainers.genesis ];
|
|
|
|
platforms = platforms.linux;
|
2010-08-22 13:33:57 +02:00
|
|
|
};
|
|
|
|
}
|