From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andreas Enge Subject: Re: Python-build-system does not honour phases Date: Tue, 10 Sep 2013 21:27:25 +0200 Message-ID: <20130910192725.GA9186@debian> References: <20130907222607.GA28990@debian> <87hadtfzk4.fsf@gnu.org> <20130910082655.GA8621@debian> <20130910132836.GA4248@debian> <87k3iobm2o.fsf@gnu.org> <20130910190717.GA8670@debian> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:60839) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VJTbD-00046t-PI for guix-devel@gnu.org; Tue, 10 Sep 2013 15:27:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VJTb7-0007vj-6K for guix-devel@gnu.org; Tue, 10 Sep 2013 15:27:43 -0400 Content-Disposition: inline In-Reply-To: <20130910190717.GA8670@debian> List-Id: 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-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: Ludovic =?iso-8859-15?Q?Court=E8s?= Cc: guix-devel@gnu.org 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