From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Kost Subject: Re: [PATCH 1/2] gnu: wm: Add python-i3-py. Date: Tue, 20 Sep 2016 17:44:28 +0300 Message-ID: <877fa6aawj.fsf@gmail.com> References: <20160919124438.GA19077@sax.terramar.selidor.net> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:56974) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bmMIg-0005KY-OQ for guix-devel@gnu.org; Tue, 20 Sep 2016 10:45:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bmMIb-0004tv-4a for guix-devel@gnu.org; Tue, 20 Sep 2016 10:45:33 -0400 Received: from mail-lf0-f66.google.com ([209.85.215.66]:34808) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bmMIa-0004tF-PM for guix-devel@gnu.org; Tue, 20 Sep 2016 10:45:29 -0400 Received: by mail-lf0-f66.google.com with SMTP id b71so249108lfg.1 for ; Tue, 20 Sep 2016 07:45:28 -0700 (PDT) In-Reply-To: <20160919124438.GA19077@sax.terramar.selidor.net> (Ivan Vilata i. Balaguer's message of "Mon, 19 Sep 2016 14:44:38 +0200") 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: Ivan Vilata i Balaguer Cc: guix-devel@gnu.org Ivan Vilata i Balaguer (2016-09-19 14:44 +0200) wrote: > Thanks to Brendan Tildesley, Leo Famulari and Hartmut Goebel for testing and > advice. > > * gnu/packages/wm.scm (python-i3-py, python2-i3-py): New variables. > --- > gnu/packages/wm.scm | 44 ++++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 44 insertions(+) > > diff --git a/gnu/packages/wm.scm b/gnu/packages/wm.scm > index 6275e6f..39ecb20 100644 > --- a/gnu/packages/wm.scm > +++ b/gnu/packages/wm.scm > @@ -34,6 +34,7 @@ > #:use-module (guix build-system cmake) > #:use-module (guix build-system gnu) > #:use-module (guix build-system haskell) > + #:use-module (guix build-system python) > #:use-module (gnu packages haskell) > #:use-module (gnu packages base) > #:use-module (gnu packages pkg-config) > @@ -202,6 +203,49 @@ from scratch. i3 is primarily targeted at advanced users and > developers.") > (license license:bsd-3))) > > +(define-public python-i3-py > + (package > + (name "python-i3-py") > + (version "0.6.5") > + (source > + (origin > + ;; The latest release is not tagged in Git nor has an entry in PyPi, > + ;; but there is still a clear commit for it, and it's been the last one > + ;; for years. > + (method git-fetch) > + (uri (git-reference > + (url "https://github.com/ziberna/i3-py.git") > + (commit "27f88a616e9ecc340e7d041d3d00782f8a1964c1"))) > + (sha256 > + (base32 > + "1nm719dc2xqlll7vj4c4m7mpjb27lpn3bg3c66gajvnrz2x1nmxs")) > + (file-name (string-append name "-" version "-checkout")))) > + (build-system python-build-system) > + (arguments > + `(#:tests? #f ; no tests yet > + #:phases > + (alist-cons-after > + 'install 'install-doc Nowadays we use 'modify-syntax' instead of calling 'alist-...' procedures directly: (modify-phases %standard-phases (add-after 'install 'install-doc (lambda ...))) > + ;; Copy readme file to documentation directory. > + (lambda* (#:key outputs #:allow-other-keys) > + (let ((doc (string-append (assoc-ref outputs "out") > + "/share/doc/" ,name "-" ,version))) I think it is uncommon to put doc files in a versioned directory, I would just use "share/doc/" > + (mkdir-p doc) > + (copy-file "README.md" (string-append doc "/README.md")))) I think 'instal-file' is more suitable here: (install-file "README.md" doc) Also, please add #t in the end of the phase: if a phase succeeds it should return non-false value, and the value of 'copy-file' (and 'install-file') is not specified. > + %standard-phases))) > + (propagated-inputs > + `(("i3-wm" ,i3-wm))) > + (home-page "https://github.com/ziberna/i3-py") > + (synopsis "Python interface to the i3 window manager") > + (description "This package allows you to interact from a Python program > +with the i3 window manager via its IPC socket. It can send commands and other > +kinds of messages to i3, select the affected containers, filter results and > +subscribe to events.") > + (license license:gpl3+))) > + > +(define-public python2-i3-py > + (package-with-python2 python-i3-py)) > + > (define-public xmonad > (package > (name "xmonad") > -- > > 2.10.0 -- Alex