navit: add supports, xkdb, and many fixes
This commit is contained in:
parent
cca5717170
commit
866f9bb578
|
@ -0,0 +1,13 @@
|
||||||
|
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||||
|
index 763f75b..defa74a 100755
|
||||||
|
--- a/CMakeLists.txt
|
||||||
|
+++ b/CMakeLists.txt
|
||||||
|
@@ -212,7 +212,7 @@ CHECK_INCLUDE_FILES(endian.h HAVE_ENDIAN_H)
|
||||||
|
CHECK_INCLUDE_FILES(stdint.h HAVE_STDINT_H)
|
||||||
|
CHECK_INCLUDE_FILES(byteswap.h HAVE_BYTESWAP_H)
|
||||||
|
CHECK_LIBRARY_EXISTS(gypsy gypsy_control_get_default "" GYPSY_FOUND)
|
||||||
|
-CHECK_INCLUDE_FILES(libspeechd.h HAVE_LIBSPEECHD)
|
||||||
|
+CHECK_INCLUDE_FILES(speech-dispatcher/libspeechd.h HAVE_LIBSPEECHD)
|
||||||
|
CHECK_INCLUDE_FILES(sys/socket.h HAVE_SOCKET)
|
||||||
|
CHECK_INCLUDE_FILES(sys/shm.h HAVE_SHMEM)
|
||||||
|
CHECK_FUNCTION_EXISTS(snprintf HAVE_SNPRINTF)
|
|
@ -1,9 +1,21 @@
|
||||||
{ stdenv, fetchFromGitHub, pkgconfig, gtk2, SDL, fontconfig, freetype, imlib2, SDL_image, libGLU_combined,
|
{ stdenv, fetchFromGitHub, pkgconfig, gtk2, fontconfig, freetype, imlib2
|
||||||
libXmu, freeglut, pcre, dbus-glib, glib, librsvg, freeimage, libxslt,
|
, SDL_image, libGLU_combined, libXmu, freeglut, pcre, dbus, dbus-glib, glib
|
||||||
qtbase, qtquickcontrols, qtsvg, qtdeclarative, qtlocation, qtsensors, qtmultimedia, qtspeech, espeak,
|
, librsvg, freeimage, libxslt, cairo, gdk_pixbuf, pango
|
||||||
cairo, gdk_pixbuf, pango, atk, patchelf, fetchurl, bzip2,
|
, atk, patchelf, fetchurl, bzip2, python, gettext, quesoglc
|
||||||
python, gettext, quesoglc, gd, postgresql, cmake, shapelib, SDL_ttf, fribidi}:
|
, 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
|
||||||
|
}:
|
||||||
|
|
||||||
|
assert speechdSupport -> speechd != null;
|
||||||
|
|
||||||
|
with stdenv.lib;
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
name = "navit-${version}";
|
name = "navit-${version}";
|
||||||
version = "0.5.1";
|
version = "0.5.1";
|
||||||
|
@ -21,34 +33,53 @@ stdenv.mkDerivation rec {
|
||||||
sha256 = "0vg6b6rhsa2cxqj4rbhfhhfss71syhnfa6f1jg2i2d7l88dm5x7d";
|
sha256 = "0vg6b6rhsa2cxqj4rbhfhhfss71syhnfa6f1jg2i2d7l88dm5x7d";
|
||||||
};
|
};
|
||||||
|
|
||||||
#hardeningDisable = [ "format" ];
|
patches = [ ./CMakeLists.txt.patch ];
|
||||||
NIX_CFLAGS_COMPILE = [ "-I${SDL.dev}/include/SDL" ];
|
|
||||||
|
|
||||||
# TODO: fix speech options.
|
NIX_CFLAGS_COMPILE = optional sdlSupport "-I${SDL.dev}/include/SDL"
|
||||||
cmakeFlags = [ "-DSAMPLE_MAP=n " "-DCMAKE_BUILD_TYPE=RelWithDebInfo" "-Dsupport/espeak=FALSE" "-Dspeech/qt5_espeak=FALSE" ];
|
++ optional speechdSupport "-I${speechd}/include/speech-dispatcher";
|
||||||
|
|
||||||
buildInputs = [ gtk2 SDL fontconfig freetype imlib2 SDL_image libGLU_combined freeimage libxslt
|
# we choose only cmdline and speech-dispatcher speech options.
|
||||||
libXmu freeglut python gettext quesoglc gd postgresql qtbase SDL_ttf fribidi pcre qtquickcontrols
|
# espeak builtins is made for non-cmdline OS as winCE
|
||||||
espeak qtmultimedia qtspeech qtsensors qtlocation qtdeclarative qtsvg dbus-glib librsvg shapelib glib
|
cmakeFlags = [
|
||||||
cairo gdk_pixbuf pango atk ];
|
"-DSAMPLE_MAP=n " "-DCMAKE_BUILD_TYPE=RelWithDebInfo"
|
||||||
|
"-Dspeech/qt5_espeak=FALSE" "-Dsupport/espeak=FALSE"
|
||||||
|
];
|
||||||
|
|
||||||
nativeBuildInputs = [ pkgconfig cmake patchelf bzip2 ];
|
buildInputs = [
|
||||||
|
gtk2 fontconfig freetype imlib2 libGLU_combined freeimage
|
||||||
|
libxslt libXmu freeglut python gettext quesoglc gd
|
||||||
|
fribidi pcre dbus dbus-glib librsvg shapelib glib
|
||||||
|
cairo gdk_pixbuf pango atk
|
||||||
|
] ++ optionals sdlSupport [ SDL SDL_ttf SDL_image ]
|
||||||
|
++ optional postgresqlSupport postgresql
|
||||||
|
++ optional speechdSupport speechd
|
||||||
|
++ optionals qtSupport [
|
||||||
|
qtquickcontrols qtmultimedia qtspeech qtsensors
|
||||||
|
qtbase qtlocation qtdeclarative qtsvg
|
||||||
|
];
|
||||||
|
|
||||||
|
nativeBuildInputs = [ makeWrapper pkgconfig cmake patchelf bzip2 ];
|
||||||
|
|
||||||
# we dont want blank screen by defaut
|
# we dont want blank screen by defaut
|
||||||
postInstall = ''
|
postInstall = ''
|
||||||
# emulate DSAMPLE_MAP
|
# emulate DSAMPLE_MAP
|
||||||
mkdir -p $out/share/navit/maps/maps
|
mkdir -p $out/share/navit/maps/
|
||||||
bzcat "${sample_map}" | $out/bin/maptool "$out/share/navit/maps/osm_bbox_11.3,47.9,11.7,48.2.bin"
|
bzcat "${sample_map}" | $out/bin/maptool "$out/share/navit/maps/osm_bbox_11.3,47.9,11.7,48.2.bin"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# TODO: fix upstream?
|
# TODO: fix upstream?
|
||||||
postFixup = ''
|
postFixup = ''
|
||||||
for lib in $(find "$out/lib/navit/" -iname "*.so" ); do
|
for lib in $(find "$out/lib/navit/" -iname "*.so" ); do
|
||||||
patchelf --set-rpath ${stdenv.lib.makeLibraryPath buildInputs} $lib
|
patchelf --set-rpath ${makeLibraryPath buildInputs} $lib
|
||||||
done
|
done
|
||||||
|
wrapProgram $out/bin/navit \
|
||||||
|
--prefix PATH : ${makeBinPath (
|
||||||
|
optional xkbdSupport xkbd
|
||||||
|
++ optional espeakSupport espeak
|
||||||
|
++ optional speechdSupport speechd ) }
|
||||||
'';
|
'';
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
meta = {
|
||||||
homepage = http://www.navit-project.org;
|
homepage = http://www.navit-project.org;
|
||||||
description = "Car navigation system with routing engine using OSM maps";
|
description = "Car navigation system with routing engine using OSM maps";
|
||||||
license = licenses.gpl2;
|
license = licenses.gpl2;
|
||||||
|
|
Loading…
Reference in New Issue