about summary refs log tree commit diff
path: root/pkgs/applications/system/glances/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/applications/system/glances/default.nix')
-rw-r--r--pkgs/applications/system/glances/default.nix37
1 files changed, 18 insertions, 19 deletions
diff --git a/pkgs/applications/system/glances/default.nix b/pkgs/applications/system/glances/default.nix
index 6d8899440d4a..1438e9729af4 100644
--- a/pkgs/applications/system/glances/default.nix
+++ b/pkgs/applications/system/glances/default.nix
@@ -5,20 +5,15 @@
   isPyPy,
   lib,
   defusedxml,
-  future,
-  ujson,
   packaging,
   psutil,
   setuptools,
-  pydantic,
   # Optional dependencies:
   fastapi,
   jinja2,
-  orjson,
   pysnmp,
   hddtemp,
   netifaces, # IP module
-  py-cpuinfo,
   uvicorn,
   requests,
   prometheus-client,
@@ -26,49 +21,53 @@
 
 buildPythonApplication rec {
   pname = "glances";
-  version = "4.1.2.1";
+  version = "4.2.0";
+  pyproject = true;
+
   disabled = isPyPy;
 
   src = fetchFromGitHub {
     owner = "nicolargo";
     repo = "glances";
     rev = "refs/tags/v${version}";
-    hash = "sha256-SlKt+wjzI9QRmMVvbIERuhQuCCaOh7L89WuNUXNhkuI=";
+    hash = "sha256-liyrMaqBgK7UZjWIKIgIFbskTGaWfyrK8L74DKmaDmY=";
   };
 
+  build-system = [ setuptools ];
+
   # On Darwin this package segfaults due to mismatch of pure and impure
   # CoreFoundation. This issues was solved for binaries but for interpreted
   # scripts a workaround below is still required.
   # Relevant: https://github.com/NixOS/nixpkgs/issues/24693
-  makeWrapperArgs = lib.optionals stdenv.isDarwin [
+  makeWrapperArgs = lib.optionals stdenv.hostPlatform.isDarwin [
     "--set"
     "DYLD_FRAMEWORK_PATH"
     "/System/Library/Frameworks"
   ];
 
-  doCheck = true;
-  preCheck = lib.optionalString stdenv.isDarwin ''
-    export DYLD_FRAMEWORK_PATH=/System/Library/Frameworks
+  # some tests fail in darwin sandbox
+  doCheck = !stdenv.hostPlatform.isDarwin;
+
+  checkPhase = ''
+    runHook preCheck
+
+    python unittest-core.py
+
+    runHook postCheck
   '';
 
-  propagatedBuildInputs = [
+  dependencies = [
     defusedxml
-    future
-    ujson
     netifaces
     packaging
     psutil
     pysnmp
-    setuptools
-    py-cpuinfo
-    pydantic
     fastapi
     uvicorn
     requests
     jinja2
-    orjson
     prometheus-client
-  ] ++ lib.optional stdenv.isLinux hddtemp;
+  ] ++ lib.optional stdenv.hostPlatform.isLinux hddtemp;
 
   meta = {
     homepage = "https://nicolargo.github.io/glances/";