guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: New package: python-glances


From: Stefan Reichör
Subject: Re: New package: python-glances
Date: Fri, 16 Sep 2016 21:50:23 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Leo Famulari <address@hidden> writes:

> On Tue, Sep 13, 2016 at 10:02:37PM +0200, Stefan Reichör wrote:
>> Subject: [PATCH] gnu: Add python-glances
>
> Thank you for this patch!
>
> For Python software, we like to add packages for both the Python 3 and
> Python 2 versions, if the software supports it. The PyPi page [0]
> suggests that Glances does work on both Python 2 and 3.
>
>> +  (native-inputs
>> +   `(("python-setuptools" ,python-setuptools)))
>
> I tried building without setuptools, and the build did succeed. However,
> setuptools is probably required for the Python 2 variant of the package.
>
> There is a recent example of how to do this in the commit "gnu: Add
> python-lit, python2-lit." (243db8245e6d8ee6aae80ce4606fb58cb8b23443).
>
> Can you send an updated patch that adds both python-glances and
> python2-glances using the method demonstrated there?

Thanks for your review.
You are correct the python2 version requires setuptools. I followed your
suggestion and added the python2-glances variant.

Stefan.

>From 369f06a41dc76c9016d1ca0565af28becef4ae63 Mon Sep 17 00:00:00 2001
From: Stefan Reichoer <address@hidden>
Date: Fri, 16 Sep 2016 21:43:32 +0200
Subject: [PATCH] gnu: Add python-glances, python2-glances.

---
 gnu/packages/python.scm | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 2f349c8..5e4dad0 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -27,6 +27,7 @@
 ;;; Copyright © 2016 Dylan Jeffers <address@hidden@openmailbox.org>
 ;;; Copyright © 2016 David Craven <address@hidden>
 ;;; Copyright © 2016 Marius Bakke <address@hidden>
+;;; Copyright © 2016 Stefan Reichoer <address@hidden>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -420,6 +421,40 @@ pidof, tty, taskset, pmap.")
 (define-public python2-psutil
   (package-with-python2 python-psutil))
 
+(define-public python-glances
+  (package
+  (name "python-glances")
+  (version "2.7.1")
+  (source
+    (origin
+      (method url-fetch)
+      (uri (pypi-uri "Glances" version))
+      (sha256
+        (base32
+          "11jbq40g8alsbirnd4kiagznqg270247i0m8qhi48ldf2i5xppxg"))))
+  (build-system python-build-system)
+  (inputs
+   `(("python-psutil" ,python-psutil)))
+  (home-page
+    "https://github.com/nicolargo/glances";)
+  (synopsis
+    "A cross-platform curses-based monitoring tool")
+  (description
+    "Glances is a curses-based monitoring tool for GNU/Linux or BSD
+OS. Glances uses the PsUtil library to get information from your
+system. It monitors CPU, load, memory, network bandwidth, disk I/O,
+disk use, process.")
+  (license license:lgpl3+)
+  (properties `((python2-variant . ,(delay python2-glances))))))
+
+(define-public python2-glances
+  (let ((base (package-with-python2 (strip-python2-variant python-glances))))
+    (package
+      (inherit base)
+      (native-inputs
+       `(("python2-setuptools" ,python2-setuptools)
+         ,@(package-native-inputs base))))))
+
 (define-public python-passlib
   (package
     (name "python-passlib")
-- 
2.7.4


reply via email to

[Prev in Thread] Current Thread [Next in Thread]