From 93a524dba0299e2096643635bcf87dc5c23a97aa Mon Sep 17 00:00:00 2001 From: Thiago Kenji Okada Date: Tue, 28 Feb 2023 15:07:27 +0000 Subject: [PATCH 1/2] git-cola: update dependencies and make it work in darwin - `pyinotify` was removed a long time ago: https://github.com/git-cola/git-cola/pull/510 - `sip_4` does not seem to be needed, at least there is no mention at docs and the program seems to works fine without it - `send2trash` added since it is an optional feature: https://github.com/git-cola/git-cola#optional-features The removal of `pyinotify` also makes this build and works in darwin, so removing the `meta.platforms` (will inherit from `buildPythonApplication` instead). --- pkgs/applications/version-management/git-cola/default.nix | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/pkgs/applications/version-management/git-cola/default.nix b/pkgs/applications/version-management/git-cola/default.nix index fb4ebea2480f..08a3989b5bbc 100644 --- a/pkgs/applications/version-management/git-cola/default.nix +++ b/pkgs/applications/version-management/git-cola/default.nix @@ -1,9 +1,6 @@ { lib, fetchFromGitHub, python3Packages, gettext, git, qt5 }: -let - inherit (python3Packages) buildPythonApplication pyqt5 sip_4 pyinotify qtpy; - -in buildPythonApplication rec { +python3Packages.buildPythonApplication rec { pname = "git-cola"; version = "4.1.0"; @@ -15,7 +12,7 @@ in buildPythonApplication rec { }; buildInputs = [ git gettext ]; - propagatedBuildInputs = [ pyqt5 sip_4 pyinotify qtpy ]; + propagatedBuildInputs = with python3Packages; [ pyqt5 qtpy send2trash ]; nativeBuildInputs = [ qt5.wrapQtAppsHook ]; doCheck = false; @@ -28,7 +25,6 @@ in buildPythonApplication rec { homepage = "https://github.com/git-cola/git-cola"; description = "A sleek and powerful Git GUI"; license = licenses.gpl2; - platforms = platforms.linux; maintainers = [ maintainers.bobvanderlinden ]; }; } From 6f1d2013c0f6df93cd0164b3cdcc24eaed5d46f8 Mon Sep 17 00:00:00 2001 From: Thiago Kenji Okada Date: Tue, 28 Feb 2023 16:02:06 +0000 Subject: [PATCH 2/2] git-cola: run tests --- .../version-management/git-cola/default.nix | 22 ++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/pkgs/applications/version-management/git-cola/default.nix b/pkgs/applications/version-management/git-cola/default.nix index 08a3989b5bbc..e9959cd42dee 100644 --- a/pkgs/applications/version-management/git-cola/default.nix +++ b/pkgs/applications/version-management/git-cola/default.nix @@ -1,4 +1,4 @@ -{ lib, fetchFromGitHub, python3Packages, gettext, git, qt5 }: +{ stdenv, lib, fetchFromGitHub, python3Packages, gettext, git, qt5 }: python3Packages.buildPythonApplication rec { pname = "git-cola"; @@ -11,11 +11,23 @@ python3Packages.buildPythonApplication rec { hash = "sha256-s+acQo9b+ZQ31qXBf0m8ajXYuYEQzNybmX9nw+c0DQY="; }; - buildInputs = [ git gettext ]; - propagatedBuildInputs = with python3Packages; [ pyqt5 qtpy send2trash ]; - nativeBuildInputs = [ qt5.wrapQtAppsHook ]; + # TODO: remove in the next release since upstream removed pytest-flake8 + # https://github.com/git-cola/git-cola/commit/6c5c5c6c888ee1a095fc1ca5521af9a03b833205 + postPatch = '' + substituteInPlace pytest.ini \ + --replace "--flake8" "" + ''; - doCheck = false; + propagatedBuildInputs = with python3Packages; [ git pyqt5 qtpy send2trash ]; + nativeBuildInputs = [ gettext qt5.wrapQtAppsHook ]; + nativeCheckInputs = with python3Packages; [ git pytestCheckHook ]; + + disabledTestPaths = [ + "qtpy/" + "contrib/win32" + ] ++ lib.optionals stdenv.isDarwin [ + "cola/inotify.py" + ]; preFixup = '' makeWrapperArgs+=("''${qtWrapperArgs[@]}")