3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/applications/misc/navit/default.nix

59 lines
2.2 KiB
Nix
Raw Normal View History

2018-08-22 19:10:32 +01:00
{ stdenv, fetchFromGitHub, pkgconfig, gtk2, SDL, fontconfig, freetype, imlib2, SDL_image, libGLU_combined,
libXmu, freeglut, pcre, dbus-glib, glib, librsvg, freeimage, libxslt,
qtbase, qtquickcontrols, qtsvg, qtdeclarative, qtlocation, qtsensors, qtmultimedia, qtspeech, espeak,
cairo, gdk_pixbuf, pango, atk, patchelf, fetchurl, bzip2,
python, gettext, quesoglc, gd, postgresql, cmake, shapelib, SDL_ttf, fribidi}:
stdenv.mkDerivation rec {
2018-08-22 19:10:32 +01:00
name = "navit-${version}";
version = "0.5.1";
src = fetchFromGitHub {
owner = "navit-gps";
repo = "navit";
rev = "v${version}";
sha256 = "0jf2gjh2sszr5y5c2wvamfj2qggi2y5k3ynb32pak9vhf5xyl5xj";
};
2018-08-22 19:10:32 +01: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";
};
2018-08-22 19:10:32 +01:00
#hardeningDisable = [ "format" ];
NIX_CFLAGS_COMPILE = [ "-I${SDL.dev}/include/SDL" ];
2016-02-12 13:04:31 +00:00
2018-08-22 19:10:32 +01:00
# TODO: fix speech options.
cmakeFlags = [ "-DSAMPLE_MAP=n " "-DCMAKE_BUILD_TYPE=RelWithDebInfo" "-Dsupport/espeak=FALSE" "-Dspeech/qt5_espeak=FALSE" ];
2016-08-27 22:58:06 +01:00
2018-08-22 19:10:32 +01:00
buildInputs = [ gtk2 SDL fontconfig freetype imlib2 SDL_image libGLU_combined freeimage libxslt
libXmu freeglut python gettext quesoglc gd postgresql qtbase SDL_ttf fribidi pcre qtquickcontrols
espeak qtmultimedia qtspeech qtsensors qtlocation qtdeclarative qtsvg dbus-glib librsvg shapelib glib
cairo gdk_pixbuf pango atk ];
2016-08-27 22:58:06 +01:00
2018-08-22 19:10:32 +01:00
nativeBuildInputs = [ pkgconfig cmake patchelf bzip2 ];
# we dont want blank screen by defaut
postInstall = ''
# emulate DSAMPLE_MAP
mkdir -p $out/share/navit/maps/maps
bzcat "${sample_map}" | $out/bin/maptool "$out/share/navit/maps/osm_bbox_11.3,47.9,11.7,48.2.bin"
'';
2018-08-22 19:10:32 +01:00
# TODO: fix upstream?
postFixup = ''
for lib in $(find "$out/lib/navit/" -iname "*.so" ); do
patchelf --set-rpath ${stdenv.lib.makeLibraryPath buildInputs} $lib
done
'';
2018-08-22 19:10:32 +01:00
meta = with stdenv.lib; {
homepage = http://www.navit-project.org;
description = "Car navigation system with routing engine using OSM maps";
2018-08-22 19:10:32 +01:00
license = licenses.gpl2;
maintainers = [ maintainers.genesis ];
platforms = platforms.linux;
};
}