diff options
-rw-r--r-- | pkgs/applications/misc/pytrainer/default.nix | 48 | ||||
-rw-r--r-- | pkgs/applications/misc/pytrainer/pytrainer-webkit.patch | 14 | ||||
-rw-r--r-- | pkgs/top-level/all-packages.nix | 2 |
3 files changed, 64 insertions, 0 deletions
diff --git a/pkgs/applications/misc/pytrainer/default.nix b/pkgs/applications/misc/pytrainer/default.nix new file mode 100644 index 0000000000000..843d0ab93d88b --- /dev/null +++ b/pkgs/applications/misc/pytrainer/default.nix @@ -0,0 +1,48 @@ +{ stdenv, fetchurl, pythonPackages, sqlite, gpsbabel }: + +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 { + enableGtk2 = true; + pygtk = pythonPackages.pyGtkGlade; + }; + +in + +pythonPackages.buildPythonPackage rec { + name = "pytrainer-${version}"; + version = "1.10.0"; + + src = fetchurl { + url = "https://github.com/pytrainer/pytrainer/archive/v${version}.tar.gz"; + sha256 = "0l42p630qhymgrcvxgry8chrpzcp6nr3d1vd7vhifh2npfq9l09y"; + }; + + 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 ]; + + pythonPath = with pythonPackages; [ + dateutil lxml matplotlibGtk pyGtkGlade pywebkitgtk + sqlalchemy sqlalchemy_migrate + ]; + + buildInputs = [gpsbabel sqlite] ++ pythonPath; + + # This package contains no binaries to patch or strip. + dontPatchELF = true; + dontStrip = true; + + meta = with stdenv.lib; { + homepage = https://github.com/pytrainer/pytrainer/wiki; + description = "Application for logging and graphing sporting excursions"; + maintainers = [ maintainers.rycee ]; + license = licenses.gpl2Plus; + platforms = platforms.linux; + }; +} diff --git a/pkgs/applications/misc/pytrainer/pytrainer-webkit.patch b/pkgs/applications/misc/pytrainer/pytrainer-webkit.patch new file mode 100644 index 0000000000000..0f894c46a53ba --- /dev/null +++ b/pkgs/applications/misc/pytrainer/pytrainer-webkit.patch @@ -0,0 +1,14 @@ +diff -Nurp pytrainer-1.10.0-orig/pytrainer/extensions/mapviewer.py pytrainer-1.10.0/pytrainer/extensions/mapviewer.py +--- pytrainer-1.10.0-orig/pytrainer/extensions/mapviewer.py 2013-03-31 12:28:29.000000000 +0200 ++++ pytrainer-1.10.0/pytrainer/extensions/mapviewer.py 2014-12-22 11:44:44.367032126 +0100 +@@ -46,7 +46,9 @@ class MapViewer: + logging.debug(">>") + if htmlfile is None: + htmlfile = self.createErrorHtml() +- self.wkview.load_uri("file://%s" % (htmlfile)) ++ content = open(htmlfile, 'r').read() ++ self.wkview.load_string(content, 'text/html', 'UTF-8', 'file:///') ++ #self.wkview.load_uri("file://%s" % (htmlfile)) + #self.box.show_all() + logging.debug("<<") + diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 8688c8679dffe..aba189fc85912 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -2268,6 +2268,8 @@ let inherit python libsexy pkgconfig libxml2 pygtk pango gtk glib; }; + pytrainer = callPackage ../applications/misc/pytrainer { }; + openmpi = callPackage ../development/libraries/openmpi { }; qastools = callPackage ../tools/audio/qastools { |