From efb1ce5cd0098252aa9022220e3ae7de9247e0a1 Mon Sep 17 00:00:00 2001 From: Jiajie Chen Date: Mon, 11 Jul 2022 18:27:09 +0800 Subject: [PATCH] glances: fix tests on darwin Apply changes from https://github.com/nicolargo/glances/pull/2082 --- pkgs/applications/system/glances/default.nix | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/system/glances/default.nix b/pkgs/applications/system/glances/default.nix index dae9d5cd5195..60339bf2e581 100644 --- a/pkgs/applications/system/glances/default.nix +++ b/pkgs/applications/system/glances/default.nix @@ -1,4 +1,4 @@ -{ stdenv, buildPythonApplication, fetchFromGitHub, isPyPy, lib +{ stdenv, buildPythonApplication, fetchFromGitHub, fetchpatch, isPyPy, lib , defusedxml, future, packaging, psutil, setuptools # Optional dependencies: , bottle, pysnmp @@ -20,7 +20,17 @@ buildPythonApplication rec { }; # Some tests fail in the sandbox (they e.g. require access to /sys/class/power_supply): - patches = lib.optional (doCheck && stdenv.isLinux) ./skip-failing-tests.patch; + patches = lib.optional (doCheck && stdenv.isLinux) ./skip-failing-tests.patch + ++ lib.optional (doCheck && stdenv.isDarwin) + [ + # Fix "TypeError: unsupported operand type(s) for +=: 'int' and 'NoneType'" on darwin + # https://github.com/nicolargo/glances/pull/2082 + (fetchpatch { + name = "fix-typeerror-when-testing-on-darwin.patch"; + url = "https://patch-diff.githubusercontent.com/raw/nicolargo/glances/pull/2082.patch"; + sha256 = "sha256-MIePPywZ2dTTqXjf7EJiHlQ7eltiHzgocqrnLeLJwZ4="; + }) + ]; # On Darwin this package segfaults due to mismatch of pure and impure # CoreFoundation. This issues was solved for binaries but for interpreted