summary refs log tree commit diff
path: root/pkgs/applications/misc/viking/default.nix
blob: 72c0fefd4e6c56d1588ae2379b0eff3e659611f3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
{ lib, stdenv, fetchurl
, docbook_xml_dtd_45, docbook_xsl, intltool, itstool, libxslt, pkg-config, wrapGAppsHook, yelp-tools
, curl, gdk-pixbuf, gtk3, json-glib, libxml2
, gpsbabel
, withGeoClue ? true, geoclue2
, withGeoTag ? true, gexiv2
, withMagic ? true, file
, withMapnik ? false, mapnik
, withMBTiles ? true, sqlite
, withMd5Hash ? true, nettle
, withOAuth ? true, liboauth
, withRealtimeGPSTracking ? true, gpsd
}:

stdenv.mkDerivation rec {
  pname = "viking";
  version = "1.9";

  src = fetchurl {
    url = "mirror://sourceforge/viking/viking-${version}.tar.bz2";
    sha256 = "0fybpy6k0vmjp231h5ckysl3c0rcnh2afznijwq6y78j4hywyjpy";
  };

  nativeBuildInputs = [ docbook_xml_dtd_45 docbook_xsl intltool itstool libxslt pkg-config wrapGAppsHook yelp-tools ];

  buildInputs = [ curl gdk-pixbuf gtk3 json-glib libxml2 ]
    ++ lib.optional withGeoClue geoclue2
    ++ lib.optional withGeoTag  gexiv2
    ++ lib.optional withMagic   file
    ++ lib.optional withMapnik  mapnik
    ++ lib.optional withMBTiles sqlite
    ++ lib.optional withMd5Hash nettle
    ++ lib.optional withOAuth   liboauth
    ++ lib.optional withRealtimeGPSTracking gpsd;

  configureFlags = [
    (lib.enableFeature withGeoClue "geoclue")
    (lib.enableFeature withGeoTag  "geotag")
    (lib.enableFeature withMagic   "magic")
    (lib.enableFeature withMapnik  "mapnik")
    (lib.enableFeature withMBTiles "mbtiles")
    (lib.enableFeature withMd5Hash "nettle")
    (lib.enableFeature withOAuth   "oauth")
    (lib.enableFeature withRealtimeGPSTracking "realtime-gps-tracking")
  ];

  hardeningDisable = [ "format" ];

  doCheck = true;

  preFixup = ''
    gappsWrapperArgs+=(
      --prefix PATH : ${lib.makeBinPath [ gpsbabel ]}
    )
  '';

  meta = with lib; {
    description = "GPS data editor and analyzer";
    longDescription = ''
      Viking is a free/open source program to manage GPS data.  You
      can import and plot tracks and waypoints, show Openstreetmaps
      and/or Terraserver maps under it, download geocaches for an area
      on the map, make new tracks and waypoints, see real-time GPS
      position, etc.
    '';
    homepage = "https://sourceforge.net/projects/viking/";
    license = licenses.gpl2Plus;
    maintainers = with maintainers; [ pSub sikmir ];
    platforms = with platforms; linux;
  };
}