unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Ricardo Wurmus <rekado@elephly.net>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: guix-devel@gnu.org
Subject: Re: [PATCH] Add gtklick.
Date: Sat, 27 Feb 2016 10:17:46 +0100	[thread overview]
Message-ID: <87vb5aeclh.fsf@elephly.net> (raw)
In-Reply-To: <87r3fzxct2.fsf@gnu.org>


Ludovic Courtès <ludo@gnu.org> writes:

> Ricardo Wurmus <rekado@elephly.net> skribis:
>
>> From 76cb9cb91b76f4bb723030d3d5a63238cdf98e20 Mon Sep 17 00:00:00 2001
>> From: Ricardo Wurmus <rekado@elephly.net>
>> Date: Thu, 25 Feb 2016 09:45:05 +0100
>> Subject: [PATCH 1/3] gnu: Add pyliblo.
>>
>> * gnu/packages/audio.scm (python-pyliblo, python2-pyliblo): New
>>   variables.
>
> [...]
>
>> +    (home-page "http://das.nasophon.de/pyliblo/")
>> +    (synopsis "Python bindings for the liblo OSC library")
>
> Maybe just “Python bindings for liblo”, and…
>
>> +    (description
>> +     "Pyliblo is a Python wrapper for the liblo OSC library.  It supports
>
> “… for the liblo Open Sound Control (OSC) library.”

Okay.

>> From 1dc15ad2e3776904ff8b838add00d66d9671b48a Mon Sep 17 00:00:00 2001
>> From: Ricardo Wurmus <rekado@elephly.net>
>> Date: Fri, 26 Feb 2016 08:05:40 +0100
>> Subject: [PATCH 2/3] gnu: python2-pygtk: Add libglade to inputs.
>>
>> * gnu/packages/gtk.scm (python2-pygtk)[inputs]: Add "libglade".
>
> OK.
>
>> From cfda70fdd6448980df9ba4c22894198366a2846d Mon Sep 17 00:00:00 2001
>> From: Ricardo Wurmus <rekado@elephly.net>
>> Date: Thu, 25 Feb 2016 09:46:01 +0100
>> Subject: [PATCH 3/3] gnu: Add gtklick.
>>
>> * gnu/packages/music.scm (gtklick): New variable.
>
> [...]
>
>> +       (modify-phases %standard-phases
>> +         (add-before 'build 'add-sitedirs
>> +           ;; .pth files are not automatically interpreted unless the
>> +           ;; directories containing them are added as "sites".  The directories
>> +           ;; are then added to those in the PYTHONPATH.  This is required for
>> +           ;; the operation of pygtk.
>
> Strangely, other users of pygtk don’t do that, no?  What’s special here?

Some do (and I don’t know why).  I lifted this phase from “solfege”,
which also won’t run without this.

>> +           (lambda _
>> +             (substitute* "gtklick/gtklick.py"
>> +               (("import pygtk")
>> +                "import pygtk, site, sys
>> +for path in [path for path in sys.path if 'site-packages' in path]: site.addsitedir(path)"))))
>
> I guess it’s a list comprehension, but I’m a bit confused by the syntax
> and the various ‘path’.  Oh well.  :-)

The Scheme equivalent is something like this:

    (for-each site.addsitedir
              (filter (cut string-contains <> "site-packages")
                      sys.path))

The bracketed expression in Python is like the ‘(filter ...)’
expression.

I don’t know if this could be expressed any clearer in plain Python
without making this much longer.

~~ Ricardo

  reply	other threads:[~2016-02-27  9:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-26  7:10 [PATCH] Add gtklick Ricardo Wurmus
2016-02-26 23:38 ` Ludovic Courtès
2016-02-27  9:17   ` Ricardo Wurmus [this message]
2016-02-28 15:48     ` Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87vb5aeclh.fsf@elephly.net \
    --to=rekado@elephly.net \
    --cc=guix-devel@gnu.org \
    --cc=ludo@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).