From fc78d8e0a7b6bbb4425f14661c780799148434b8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marcial=20Gai=C3=9Fert?=
 <gaisseml@studi.informatik.uni-stuttgart.de>
Date: Sun, 1 Sep 2019 20:28:08 +0200
Subject: [PATCH 1/4] caffeine-ng: do not run tests

There are no tests anyway. Not finding the tests results in build
failures if using Python 3.
---
 pkgs/tools/X11/caffeine-ng/default.nix | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/pkgs/tools/X11/caffeine-ng/default.nix b/pkgs/tools/X11/caffeine-ng/default.nix
index 57f32ed8225..93f180df52b 100644
--- a/pkgs/tools/X11/caffeine-ng/default.nix
+++ b/pkgs/tools/X11/caffeine-ng/default.nix
@@ -18,6 +18,8 @@ pythonPackages.buildPythonApplication rec {
     setproctitle setuptools setuptools_scm wheel
   ];
 
+  doCheck = false; # There are no tests.
+
   postBuild = ''
     mkdir -p $out/share
     cp -r share $out/

From 85c084d88d507ea041739d60bca78dd82815a3c3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marcial=20Gai=C3=9Fert?=
 <gaisseml@studi.informatik.uni-stuttgart.de>
Date: Sun, 1 Sep 2019 20:29:41 +0200
Subject: [PATCH 2/4] caffeine-ng: use python3

Using python3 is recommended by upstream.
---
 pkgs/tools/X11/caffeine-ng/default.nix | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pkgs/tools/X11/caffeine-ng/default.nix b/pkgs/tools/X11/caffeine-ng/default.nix
index 93f180df52b..090f8015f49 100644
--- a/pkgs/tools/X11/caffeine-ng/default.nix
+++ b/pkgs/tools/X11/caffeine-ng/default.nix
@@ -1,19 +1,19 @@
 { gdk-pixbuf, glib, gobject-introspection, gtk3, lib, libnotify,
-  pythonPackages, wrapGAppsHook
+  python3Packages, wrapGAppsHook
 }:
 
-pythonPackages.buildPythonApplication rec {
+python3Packages.buildPythonApplication rec {
   pname = "caffeine-ng";
   version = "3.4.2";
 
-  src = pythonPackages.fetchPypi{
+  src = python3Packages.fetchPypi{
     inherit pname version;
     sha256="05k8smjlfjcccgmp8qi04l7106k46fs4p8fl5bdqqjwv6pwl7y4w";
   };
 
   nativeBuildInputs = [ wrapGAppsHook glib ];
   buildInputs = [ gdk-pixbuf gobject-introspection libnotify gtk3 ];
-  pythonPath = with pythonPackages; [
+  pythonPath = with python3Packages; [
     dbus-python docopt ewmh pygobject3 pyxdg
     setproctitle setuptools setuptools_scm wheel
   ];

From cdf8247b686378915041b51a67150987418cdd61 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marcial=20Gai=C3=9Fert?=
 <gaisseml@studi.informatik.uni-stuttgart.de>
Date: Wed, 4 Sep 2019 15:37:35 +0200
Subject: [PATCH 3/4] caffeine-ng: remove unneeded dependencies setuptools,
 wheel

---
 pkgs/tools/X11/caffeine-ng/default.nix | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pkgs/tools/X11/caffeine-ng/default.nix b/pkgs/tools/X11/caffeine-ng/default.nix
index 090f8015f49..5a9a74a7388 100644
--- a/pkgs/tools/X11/caffeine-ng/default.nix
+++ b/pkgs/tools/X11/caffeine-ng/default.nix
@@ -15,7 +15,7 @@ python3Packages.buildPythonApplication rec {
   buildInputs = [ gdk-pixbuf gobject-introspection libnotify gtk3 ];
   pythonPath = with python3Packages; [
     dbus-python docopt ewmh pygobject3 pyxdg
-    setproctitle setuptools setuptools_scm wheel
+    setproctitle setuptools_scm
   ];
 
   doCheck = false; # There are no tests.

From d64cdba5b4b4fef528ad640495c392621a197393 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marcial=20Gai=C3=9Fert?=
 <gaisseml@studi.informatik.uni-stuttgart.de>
Date: Thu, 5 Sep 2019 17:44:55 +0200
Subject: [PATCH 4/4] caffeine-ng: move setuptools_scm dependency to
 buildInputs

setuptools_scm is only needed during build, not whilst using the package.
---
 pkgs/tools/X11/caffeine-ng/default.nix | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/pkgs/tools/X11/caffeine-ng/default.nix b/pkgs/tools/X11/caffeine-ng/default.nix
index 5a9a74a7388..b54a7303ff8 100644
--- a/pkgs/tools/X11/caffeine-ng/default.nix
+++ b/pkgs/tools/X11/caffeine-ng/default.nix
@@ -12,10 +12,13 @@ python3Packages.buildPythonApplication rec {
   };
 
   nativeBuildInputs = [ wrapGAppsHook glib ];
-  buildInputs = [ gdk-pixbuf gobject-introspection libnotify gtk3 ];
+  buildInputs = [ 
+    gdk-pixbuf gobject-introspection libnotify gtk3 
+    python3Packages.setuptools_scm
+  ];
   pythonPath = with python3Packages; [
     dbus-python docopt ewmh pygobject3 pyxdg
-    setproctitle setuptools_scm
+    setproctitle 
   ];
 
   doCheck = false; # There are no tests.