Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)

Add package 'pytrainer'.

authored by

Robert Helgesson and committed by
Bjørn Forsman
b2be4092 35e5f59a

+64
+48
pkgs/applications/misc/pytrainer/default.nix
··· 1 + { stdenv, fetchurl, pythonPackages, sqlite, gpsbabel }: 2 + 3 + let 4 + 5 + # Pytrainer needs a matplotlib with GTK backend. Also ensure we are 6 + # using the pygtk with glade support as needed by pytrainer. 7 + matplotlibGtk = pythonPackages.matplotlib.override { 8 + enableGtk2 = true; 9 + pygtk = pythonPackages.pyGtkGlade; 10 + }; 11 + 12 + in 13 + 14 + pythonPackages.buildPythonPackage rec { 15 + name = "pytrainer-${version}"; 16 + version = "1.10.0"; 17 + 18 + src = fetchurl { 19 + url = "https://github.com/pytrainer/pytrainer/archive/v${version}.tar.gz"; 20 + sha256 = "0l42p630qhymgrcvxgry8chrpzcp6nr3d1vd7vhifh2npfq9l09y"; 21 + }; 22 + 23 + namePrefix = ""; 24 + 25 + # The existing use of pywebkitgtk shows raw HTML text instead of 26 + # map. This patch solves the problems by showing the file from a 27 + # string, which allows setting an explicit MIME type. 28 + patches = [ ./pytrainer-webkit.patch ]; 29 + 30 + pythonPath = with pythonPackages; [ 31 + dateutil lxml matplotlibGtk pyGtkGlade pywebkitgtk 32 + sqlalchemy sqlalchemy_migrate 33 + ]; 34 + 35 + buildInputs = [gpsbabel sqlite] ++ pythonPath; 36 + 37 + # This package contains no binaries to patch or strip. 38 + dontPatchELF = true; 39 + dontStrip = true; 40 + 41 + meta = with stdenv.lib; { 42 + homepage = https://github.com/pytrainer/pytrainer/wiki; 43 + description = "Application for logging and graphing sporting excursions"; 44 + maintainers = [ maintainers.rycee ]; 45 + license = licenses.gpl2Plus; 46 + platforms = platforms.linux; 47 + }; 48 + }
+14
pkgs/applications/misc/pytrainer/pytrainer-webkit.patch
··· 1 + diff -Nurp pytrainer-1.10.0-orig/pytrainer/extensions/mapviewer.py pytrainer-1.10.0/pytrainer/extensions/mapviewer.py 2 + --- pytrainer-1.10.0-orig/pytrainer/extensions/mapviewer.py 2013-03-31 12:28:29.000000000 +0200 3 + +++ pytrainer-1.10.0/pytrainer/extensions/mapviewer.py 2014-12-22 11:44:44.367032126 +0100 4 + @@ -46,7 +46,9 @@ class MapViewer: 5 + logging.debug(">>") 6 + if htmlfile is None: 7 + htmlfile = self.createErrorHtml() 8 + - self.wkview.load_uri("file://%s" % (htmlfile)) 9 + + content = open(htmlfile, 'r').read() 10 + + self.wkview.load_string(content, 'text/html', 'UTF-8', 'file:///') 11 + + #self.wkview.load_uri("file://%s" % (htmlfile)) 12 + #self.box.show_all() 13 + logging.debug("<<") 14 +
+2
pkgs/top-level/all-packages.nix
··· 2268 2268 inherit python libsexy pkgconfig libxml2 pygtk pango gtk glib; 2269 2269 }; 2270 2270 2271 + pytrainer = callPackage ../applications/misc/pytrainer { }; 2272 + 2271 2273 openmpi = callPackage ../development/libraries/openmpi { }; 2272 2274 2273 2275 qastools = callPackage ../tools/audio/qastools {