summary refs log tree commit diff
path: root/pkgs/applications/misc/pytrainer
diff options
context:
space:
mode:
authorRobert Helgesson <robert@rycee.net>2017-09-30 19:03:07 +0200
committerRobert Helgesson <robert@rycee.net>2017-09-30 19:05:35 +0200
commit181c6216d4e2f8bc3c4180f6c2ba291bd6193347 (patch)
tree0eec9f02d6db6db83f62804952fc32f3cca549af /pkgs/applications/misc/pytrainer
parent3763b48cb58ea38b314e583ad1edeaf05b8ac27d (diff)
downloadnixlib-181c6216d4e2f8bc3c4180f6c2ba291bd6193347.tar
nixlib-181c6216d4e2f8bc3c4180f6c2ba291bd6193347.tar.gz
nixlib-181c6216d4e2f8bc3c4180f6c2ba291bd6193347.tar.bz2
nixlib-181c6216d4e2f8bc3c4180f6c2ba291bd6193347.tar.lz
nixlib-181c6216d4e2f8bc3c4180f6c2ba291bd6193347.tar.xz
nixlib-181c6216d4e2f8bc3c4180f6c2ba291bd6193347.tar.zst
nixlib-181c6216d4e2f8bc3c4180f6c2ba291bd6193347.zip
pytrainer: 1.10.0 -> 1.11.0
Also explicitly use python2 and default to running without webkit.
Diffstat (limited to 'pkgs/applications/misc/pytrainer')
-rw-r--r--pkgs/applications/misc/pytrainer/default.nix39
1 files changed, 23 insertions, 16 deletions
diff --git a/pkgs/applications/misc/pytrainer/default.nix b/pkgs/applications/misc/pytrainer/default.nix
index bc6b4e16a378..ecc4c341a686 100644
--- a/pkgs/applications/misc/pytrainer/default.nix
+++ b/pkgs/applications/misc/pytrainer/default.nix
@@ -1,38 +1,45 @@
-{ stdenv, fetchurl, pythonPackages, sqlite, gpsbabel }:
+{ stdenv, fetchFromGitHub, perl, python2Packages, sqlite, gpsbabel
+, withWebKit ? false }:
 
 let
 
   # Pytrainer needs a matplotlib with GTK backend. Also ensure we are
   # using the pygtk with glade support as needed by pytrainer.
-  matplotlibGtk = pythonPackages.matplotlib.override {
+  matplotlibGtk = python2Packages.matplotlib.override {
     enableGtk2 = true;
-    pygtk = pythonPackages.pyGtkGlade;
+    pygtk = python2Packages.pyGtkGlade;
   };
 
 in
 
-pythonPackages.buildPythonApplication rec {
+python2Packages.buildPythonApplication rec {
   name = "pytrainer-${version}";
-  version = "1.10.0";
+  version = "1.11.0";
 
-  src = fetchurl {
-    url = "https://github.com/pytrainer/pytrainer/archive/v${version}.tar.gz";
-    sha256 = "0l42p630qhymgrcvxgry8chrpzcp6nr3d1vd7vhifh2npfq9l09y";
+  src = fetchFromGitHub {
+    owner = "pytrainer";
+    repo = "pytrainer";
+    rev = "v${version}";
+    sha256 = "1x4f1ydjql0aisvxs5kyi9lx35b4q3768dx42fyzq1nxdwzaqyvy";
   };
 
   namePrefix = "";
 
-  # The existing use of pywebkitgtk shows raw HTML text instead of
-  # map. This patch solves the problems by showing the file from a
-  # string, which allows setting an explicit MIME type.
-  patches = [ ./pytrainer-webkit.patch ];
+  patches = [
+    # The test fails in the UTC timezone and C locale.
+    ./fix-test-tz.patch
 
-  propagatedBuildInputs = with pythonPackages; [
-    dateutil lxml matplotlibGtk pyGtkGlade pywebkitgtk
-    sqlalchemy_migrate
+    # The existing use of pywebkitgtk shows raw HTML text instead of
+    # map. This patch solves the problems by showing the file from a
+    # string, which allows setting an explicit MIME type.
+    ./pytrainer-webkit.patch
   ];
 
-  buildInputs = [ gpsbabel sqlite ];
+  propagatedBuildInputs = with python2Packages; [
+    dateutil lxml matplotlibGtk pyGtkGlade sqlalchemy_migrate
+  ] ++ stdenv.lib.optional withWebKit [ pywebkitgtk ];
+
+  buildInputs = [ perl gpsbabel sqlite ];
 
   # This package contains no binaries to patch or strip.
   dontPatchELF = true;