From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hartmut Goebel Subject: [PATCH 1/2] gnu: Add python-setproctitle and python2-setproctitle. Date: Sun, 25 Sep 2016 22:24:36 +0200 Message-ID: <1474835077-19700-1-git-send-email-h.goebel@crazy-compilers.com> Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:35593) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1boFye-00087r-Ho for guix-devel@gnu.org; Sun, 25 Sep 2016 16:24:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1boFyb-0000XJ-7V for guix-devel@gnu.org; Sun, 25 Sep 2016 16:24:44 -0400 Received: from mail-out.m-online.net ([212.18.0.9]:46496) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1boFya-0000X7-Tx for guix-devel@gnu.org; Sun, 25 Sep 2016 16:24:41 -0400 Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 3shz936kqKz3hjTw for ; Sun, 25 Sep 2016 22:24:39 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.68]) by mail.m-online.net (Postfix) with ESMTP id 3shz9358t8zvkXb for ; Sun, 25 Sep 2016 22:24:39 +0200 (CEST) Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.68]) (amavisd-new, port 10024) with ESMTP id I40H-GJ26X1D for ; Sun, 25 Sep 2016 22:24:38 +0200 (CEST) Received: from hermia.goebel-consult.de (ppp-188-174-133-89.dynamic.mnet-online.de [188.174.133.89]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPS for ; Sun, 25 Sep 2016 22:24:38 +0200 (CEST) Received: from thisbe.fritz.box (thisbe.fritz.box [192.168.110.23]) by hermia.goebel-consult.de (Postfix) with ESMTP id C260460188 for ; Sun, 25 Sep 2016 22:24:37 +0200 (CEST) List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: guix-devel@gnu.org * gnu/packages/python.scm (python-setproctitle, python2-setproctitle): New variables. --- gnu/packages/python.scm | 58 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index 688a5d4..95a2027 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -10939,3 +10939,61 @@ with an associated set of resolve methods that know how to fetch data.") provide extendible implementations of common aspects of a cloud so that you can focus on building massively scalable web applications.") (license license:expat))) + +(define-public python-setproctitle +(package + (name "python-setproctitle") + (version "1.1.10") + (source + (origin + (method url-fetch) + (uri (pypi-uri "setproctitle" version)) + (sha256 + (base32 + "163kplw9dcrw0lffq1bvli5yws3rngpnvrxrzdw89pbphjjvg0v2")))) + (build-system python-build-system) + (arguments + '(#:phases + (modify-phases %standard-phases + (add-before 'check 'patch-Makefile + ;; Stricly this is only required for the python2 variant. + ;; But adding a phase in an inherited package seems to be + ;; cumbersum. So we patch even for python3. + (lambda _ ;* (#:key inputs #:allow-other-keys) + (let ((nose (assoc-ref %build-inputs "python2-nose"))) + (if nose + (substitute* "Makefile" + (("\\$\\(PYTHON\\) [^ ]which nosetests[^ ] ") + (string-append nose "/bin/nosetests ")))) + #t))) + (replace 'check + (lambda _ + (setenv "PYTHON" (or (which "python3") (which "python"))) + (setenv "PYCONFIG" (or (which "python3-config") (which "python-config"))) + (setenv "CC" "gcc") + ;; No need to extend PYTHONPATH so the built package will + ;; be found, since the Makefile will build anyway + (zero? (system* "make" "check")) + ))))) + (native-inputs + `(("procps" ,procps))) ; required for tests + (home-page + "https://github.com/dvarrazzo/py-setproctitle") + (synopsis "Setproctitle implementation for Python to customize the process title") + (description "The library allows a process to change its title (as +displayed by system tools such as ps and top). + +Changing the title is mostly useful in multi-process systems, for +example when a master process is forked: changing the children's title +allows to identify the task each process is busy with. The technique +is used by PostgreSQL and the OpenSSH Server for example.") + (license license:bsd-3) + (properties `((python2-variant . ,(delay python2-setproctitle)))))) + +(define-public python2-setproctitle + (let ((base (package-with-python2 + (strip-python2-variant python-setproctitle)))) + (package + (inherit base) + (native-inputs `(("python2-nose" ,python2-nose) + ,@(package-native-inputs base)))))) -- 2.7.4