unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Andreas Enge <andreas@enge.fr>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: guix-devel@gnu.org
Subject: Re: Python-build-system does not honour phases
Date: Tue, 10 Sep 2013 21:27:25 +0200	[thread overview]
Message-ID: <20130910192725.GA9186@debian> (raw)
In-Reply-To: <20130910190717.GA8670@debian>

So the next module python-dateutil works. But again,
   python setup.py install
complains that the path it wishes to install to,
   /nix/store/q637nhgrixha1f8cfl32l6gvviha737g-python2-dateutil-1.5/lib/python2.7/site-packages
does not exist and is not in PYTHONPATH.

So I added the following:
     `(#:phases
         (alist-replace
          'install
          (lambda* (#:key outputs #:allow-other-keys #:rest args)
            (let* ((install (assoc-ref %standard-phases 'install))
                   (out (assoc-ref outputs "out"))
                   (python (assoc-ref %build-inputs "python"))
                   (python-version (string-take (string-take-right python 5) 3))
                   (path (string-append out "/lib/python" python-version
                                        "/site-packages/")))
              (mkdir-p path)
              (setenv "PYTHONPATH" (string-append (getenv "PYTHONPATH") ":" path))
              (apply install args)))
          %standard-phases)))
which is (a refined version of) the expression for python-setuptools.

We need to factor this out. I suggest to do the following:
In the install phase, before running setup.py, we create the directory and
add it to the python path. But this would only be needed for programs creating
modules, and I suppose not for programs that only create executables.

I see two solutions:
- We create the directory anyway, and try to remove it after installation with
  "rmdir -p".
- Or more cleanly, we can add a variable #:module? (default: #f) and create
  the directory only if this variable is set to #t.

What do you think?

Andreas

  reply	other threads:[~2013-09-10 19:27 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-07 22:26 Python-build-system does not honour phases Andreas Enge
2013-09-09 21:35 ` Ludovic Courtès
2013-09-10  8:26   ` Andreas Enge
2013-09-10 13:28     ` Andreas Enge
2013-09-10 17:53       ` Ludovic Courtès
2013-09-10 19:07         ` Andreas Enge
2013-09-10 19:27           ` Andreas Enge [this message]
2013-09-10 21:20             ` Ludovic Courtès
2013-09-10 21:34               ` Andreas Enge
2013-09-11 13:55                 ` Andreas Enge
2013-09-11 17:45                   ` Ludovic Courtès
2013-09-10 17:48     ` Ludovic Courtès
2013-09-10 18:31       ` Andreas Enge
2013-09-10 21:18         ` 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=20130910192725.GA9186@debian \
    --to=andreas@enge.fr \
    --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).