anchor.diff:    dontPatchELF = true;
     dontStrip = true;
   
  +  checkPhase = ''
  +    ${python.interpreter} -m unittest discover
  +  '';
  +
     meta = with stdenv.lib; {
       homepage = https://github.com/pytrainer/pytrainer/wiki;
       description = "Application for logging and graphing sporting excursions";
  
positive.code:     ./pytrainer-webkit.patch
    ];
  
    propagatedBuildInputs = with python2Packages; [
      dateutil lxml matplotlibGtk pyGtkGlade sqlalchemy_migrate
    ] ++ stdenv.lib.optional withWebKit [ pywebkitgtk ];
  
  
negative.code: { stdenv, fetchFromGitHub, perl, python, 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 = python.pkgs.matplotlib.override {
      enableGtk2 = true;
      pygtk = python.pkgs.pyGtkGlade;
    };
  
  in
  
  python.pkgs.buildPythonApplication rec {
    pname = "pytrainer";
    version = "1.11.0";
  
    src = fetchFromGitHub {
  