summary refs log tree commit diff
diff options
context:
space:
mode:
authorRobert Schütz <dev@schuetz-co.de>2021-03-24 15:26:45 +0100
committerRobert Schütz <dev@schuetz-co.de>2021-03-24 21:19:24 +0100
commite4e566907f78c3d2b2573da63a9841ba0bd78bd7 (patch)
tree144a61d530cbbff454d685feb5408055ffdd1ea1
parentf5e8bdd07d1afaabf6b37afc5497b1e498b8046f (diff)
downloadnixpkgs-e4e566907f78c3d2b2573da63a9841ba0bd78bd7.tar
nixpkgs-e4e566907f78c3d2b2573da63a9841ba0bd78bd7.tar.gz
nixpkgs-e4e566907f78c3d2b2573da63a9841ba0bd78bd7.tar.bz2
nixpkgs-e4e566907f78c3d2b2573da63a9841ba0bd78bd7.tar.lz
nixpkgs-e4e566907f78c3d2b2573da63a9841ba0bd78bd7.tar.xz
nixpkgs-e4e566907f78c3d2b2573da63a9841ba0bd78bd7.tar.zst
nixpkgs-e4e566907f78c3d2b2573da63a9841ba0bd78bd7.zip
pytrainer: 2.0.1 -> 2.0.2
-rw-r--r--pkgs/applications/misc/pytrainer/default.nix86
-rw-r--r--pkgs/applications/misc/pytrainer/fix-paths.patch11
2 files changed, 41 insertions, 56 deletions
diff --git a/pkgs/applications/misc/pytrainer/default.nix b/pkgs/applications/misc/pytrainer/default.nix
index 4e1e1f31f19..44b2cd700ec 100644
--- a/pkgs/applications/misc/pytrainer/default.nix
+++ b/pkgs/applications/misc/pytrainer/default.nix
@@ -1,81 +1,77 @@
 { lib
-, fetchFromGitHub
-, perl
 , python3
-, sqlite
-, gpsbabel
+, fetchFromGitHub
+, gdk-pixbuf
 , gnome3
-, gobject-introspection
-, wrapGAppsHook
-, gtk3
-, xvfb_run
-, webkitgtk
+, gpsbabel
 , glib-networking
 , glibcLocales
+, gobject-introspection
+, gtk3
+, perl
+, sqlite
 , tzdata
-, substituteAll
+, webkitgtk
+, wrapGAppsHook
+, xvfb_run
 }:
 
 let
-  # Pytrainer needs a matplotlib with GTK backend.
-  matplotlibGtk = python3.pkgs.matplotlib.override {
-    enableGtk3 = true;
+  python = python3.override {
+    packageOverrides = (self: super: {
+      matplotlib = super.matplotlib.override {
+        enableGtk3 = true;
+      };
+    });
   };
-
-in
-
-python3.pkgs.buildPythonApplication rec {
+in python.pkgs.buildPythonApplication rec {
   pname = "pytrainer";
-  version = "2.0.1";
+  version = "2.0.2";
 
   src = fetchFromGitHub {
     owner = "pytrainer";
     repo = "pytrainer";
     rev = "v${version}";
-    sha256 = "0m2sy3f5pyc4wv1ns31r7vlafqkzp0a2jasaskwrkl6273agbbk9";
+    sha256 = "sha256-i3QC6ct7tS8B0QQjtVqPcd03LLIxo6djQe4YX35syzk=";
   };
 
-  patches = [
-    (substituteAll {
-      src = ./fix-paths.patch;
-      perl = "${perl}/bin/perl";
-    })
-  ];
-
-  postPatch = ''
-    substituteInPlace ./setup.py \
-      --replace "'mysqlclient'," ""
-  '';
-
-  propagatedBuildInputs = with python3.pkgs; [
-    dateutil
-    lxml
-    matplotlibGtk
-    pygobject3
-    sqlalchemy
+  propagatedBuildInputs = with python.pkgs; [
     sqlalchemy_migrate
-    psycopg2
-    requests
-    certifi
+    python-dateutil
+    matplotlib
+    lxml
     setuptools
+    requests
+    gdal
   ];
 
   nativeBuildInputs = [
     gobject-introspection
     wrapGAppsHook
-    xvfb_run
   ];
 
   buildInputs = [
-    gpsbabel
     sqlite
     gtk3
     webkitgtk
     glib-networking
-    glibcLocales
     gnome3.adwaita-icon-theme
+    gdk-pixbuf
+  ];
+
+  makeWrapperArgs = [
+    "--prefix" "PATH" ":" (lib.makeBinPath [ perl gpsbabel ])
   ];
 
+  checkInputs = [
+    glibcLocales
+    perl
+    xvfb_run
+  ] ++ (with python.pkgs; [
+    mysqlclient
+    psycopg2
+  ]);
+
   checkPhase = ''
     env HOME=$TEMPDIR TZDIR=${tzdata}/share/zoneinfo \
       TZ=Europe/Kaliningrad \
@@ -85,9 +81,9 @@ python3.pkgs.buildPythonApplication rec {
   '';
 
   meta = with lib; {
-    homepage = "https://github.com/pytrainer/pytrainer/wiki";
+    homepage = "https://github.com/pytrainer/pytrainer";
     description = "Application for logging and graphing sporting excursions";
-    maintainers = [ maintainers.rycee ];
+    maintainers = with maintainers; [ rycee dotlambda ];
     license = licenses.gpl2Plus;
     platforms = platforms.linux;
   };
diff --git a/pkgs/applications/misc/pytrainer/fix-paths.patch b/pkgs/applications/misc/pytrainer/fix-paths.patch
deleted file mode 100644
index 7781f5aa4be..00000000000
--- a/pkgs/applications/misc/pytrainer/fix-paths.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/imports/file_garminfit.py
-+++ b/imports/file_garminfit.py
-@@ -81,7 +81,7 @@
-         logging.debug(">>")
-         result = False
-         try:
--            result = subprocess.check_output(["perl",
-+            result = subprocess.check_output(["@perl@",
-                                               self.main_data_path+"plugins/garmin-fit/bin/fit2tcx",
-                                               filename])
-         except subprocess.CalledProcessError: