about summary refs log tree commit diff
path: root/pkgs/applications/misc/viking
diff options
context:
space:
mode:
authorNikolay Korotkiy <sikmir@gmail.com>2020-02-04 01:36:02 +0300
committerNikolay Korotkiy <sikmir@gmail.com>2020-02-04 23:07:14 +0300
commita1caeda72cf45ed1d3ea08619c4afa8889664638 (patch)
tree9f85d0baf90f78ffdc9cc8a31284ad3416eed187 /pkgs/applications/misc/viking
parentca00a3f302710cb1e0317fd11294b773c9385f46 (diff)
viking: 1.7 -> 1.8
Diffstat (limited to 'pkgs/applications/misc/viking')
-rw-r--r--pkgs/applications/misc/viking/default.nix43
1 files changed, 33 insertions, 10 deletions
diff --git a/pkgs/applications/misc/viking/default.nix b/pkgs/applications/misc/viking/default.nix
index c5ba35d974755..9ce37ea8a4672 100644
--- a/pkgs/applications/misc/viking/default.nix
+++ b/pkgs/applications/misc/viking/default.nix
@@ -1,24 +1,47 @@
-{ fetchurl, stdenv, makeWrapper, pkgconfig, intltool, gettext, gtk2, expat, curl
+{ fetchurl, fetchpatch, stdenv, makeWrapper
+, pkgconfig, intltool, gettext, gtk2, expat, curl
 , gpsd, bc, file, gnome-doc-utils, libexif, libxml2, libxslt, scrollkeeper
-, docbook_xml_dtd_412, gexiv2, sqlite, gpsbabel, expect
-, geoclue2, liboauth, nettle }:
+, docbook_xml_dtd_412, gexiv2, gpsbabel, expect
+, withMapnik ? false, mapnik
+, withMBTiles ? true, sqlite
+, withOAuth ? true, liboauth
+, withMd5Hash ? true, nettle
+, withGeoClue ? true, geoclue2 }:
 
 stdenv.mkDerivation rec {
   pname = "viking";
-  version = "1.7";
+  version = "1.8";
 
   src = fetchurl {
     url = "mirror://sourceforge/viking/viking/viking-${version}.tar.bz2";
-    sha256 = "092q2dv0rcz12nh2js1z1ralib1553dmzy9pdrvz9nv2vf61wybw";
+    sha256 = "1a0g0fbj4q5s9p8fv0mqvxws10q3naj81l72sz30vvqpbz6vqp45";
   };
 
+  patches = [
+    # Fix build without mapnik and sqlite https://github.com/viking-gps/viking/pull/79
+    (fetchpatch {
+      url = "https://github.com/viking-gps/viking/commit/995feefcb97bdb1590ed018224cf47ce197fe0c1.patch";
+      sha256 = "1xb0b76kg690fag9mw3yfj5k766jmqp1sm8q4f29n1h3nz5g8izd";
+    })
+  ];
+
   nativeBuildInputs = [ pkgconfig ];
   buildInputs = [ makeWrapper intltool gettext gtk2 expat curl gpsd bc file gnome-doc-utils
-    libexif libxml2 libxslt scrollkeeper docbook_xml_dtd_412 gexiv2 sqlite
-    geoclue2 liboauth nettle
-  ];
+    libexif libxml2 libxslt scrollkeeper docbook_xml_dtd_412 gexiv2
+  ] ++ stdenv.lib.optional withMapnik mapnik
+    ++ stdenv.lib.optional withGeoClue geoclue2
+    ++ stdenv.lib.optional withMd5Hash nettle
+    ++ stdenv.lib.optional withOAuth liboauth
+    ++ stdenv.lib.optional withMBTiles sqlite;
 
-  configureFlags = [ "--disable-scrollkeeper --disable-mapnik" ];
+  configureFlags = [
+    "--disable-scrollkeeper"
+    (stdenv.lib.enableFeature withMapnik "mapnik")
+    (stdenv.lib.enableFeature withGeoClue "geoclue")
+    (stdenv.lib.enableFeature withMd5Hash "nettle")
+    (stdenv.lib.enableFeature withOAuth "oauth")
+    (stdenv.lib.enableFeature withMBTiles "mbtiles")
+  ];
 
   preBuild = ''
     sed -i help/Makefile \
@@ -45,7 +68,7 @@ stdenv.mkDerivation rec {
     '';
     homepage = https://sourceforge.net/projects/viking/;
     license = licenses.gpl2Plus;
-    maintainers = with maintainers; [ pSub ];
+    maintainers = with maintainers; [ pSub sikmir ];
     platforms = with platforms; linux;
   };
 }