guix-devel
[Top][All Lists]
Advanced

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

Re: Python-build-system does not honour phases


From: Andreas Enge
Subject: Re: Python-build-system does not honour phases
Date: Tue, 10 Sep 2013 21:27:25 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

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 via email to

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