From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marius Bakke Subject: Re: [PATCH 00/14] Change python-build-system (fixes bug 20765) Date: Fri, 30 Sep 2016 15:39:09 +0100 Message-ID: <87bmz5ih9u.fsf@ike.i-did-not-set--mail-host-address--so-tickle-me> References: <1475071107-10765-1-git-send-email-h.goebel@crazy-compilers.com> <57EBCD98.9020407@goebel-consult.de> <87mvism34v.fsf@ike.i-did-not-set--mail-host-address--so-tickle-me> <57EC008A.4030006@crazy-compilers.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:46710) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bpyyK-0007AC-GS for guix-devel@gnu.org; Fri, 30 Sep 2016 10:39:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bpyyG-0006Ca-3J for guix-devel@gnu.org; Fri, 30 Sep 2016 10:39:32 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:48830) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bpyyD-00065s-MS for guix-devel@gnu.org; Fri, 30 Sep 2016 10:39:28 -0400 In-Reply-To: <57EC008A.4030006@crazy-compilers.com> 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: Hartmut Goebel , guix-devel@gnu.org --=-=-= Content-Type: text/plain Hartmut Goebel writes: > Am 28.09.2016 um 17:54 schrieb Marius Bakke: >> Or push a branch somewhere? > > Branch is now available at > Thanks a lot for doing this! After adding a couple of patches I'm able to build many python packages. Patch #2 mostly emulates NixOS "shim" setup.py[0], required for packages using distutils instead of setuptools. Some packages really don't like the new configure flags however (scons). Perhaps we should have them as default, but if #:configure-flags is set, let them be overridden? Also some packages are missing a dependency on "python-py"[1]. Perhaps we can set up a Hydra channel to deal with the fallout? Cheers, Marius 0: https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/interpreters/python/run_setup.py 1: https://pypi.python.org/pypi/py/1.4.31 --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-guix-python-build-system-fix-configure-flag-append-f.patch >From a12000dd320cebeb920a4f790fe9206a2b6bda41 Mon Sep 17 00:00:00 2001 From: Marius Bakke Date: Thu, 29 Sep 2016 18:29:21 +0100 Subject: [PATCH 1/2] guix: python-build-system: fix configure flag append (followup to dba07a8d1) --- guix/build/python-build-system.scm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/guix/build/python-build-system.scm b/guix/build/python-build-system.scm index 8d4d6d3..d07b83f 100644 --- a/guix/build/python-build-system.scm +++ b/guix/build/python-build-system.scm @@ -65,11 +65,11 @@ #:allow-other-keys) "Install a given Python package." (let* ((out (assoc-ref outputs "out")) - (params (append (list (string-append "--prefix=" out)) - "--single-version-externally-managed" - "--root=/" + (params (append (list (string-append "--prefix=" out) + "--single-version-externally-managed" + "--root=/") configure-flags))) - (call-setuppy "install" params))) + (call-setuppy "install" params))) (define* (wrap #:key inputs outputs #:allow-other-keys) (define (list-of-files dir) -- 2.10.0 --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0002-guix-python-build-system-Import-setuptools-before-ca.patch >From 84fa3e8be3d3d868ddb9278a96807086415b754d Mon Sep 17 00:00:00 2001 From: Marius Bakke Date: Thu, 29 Sep 2016 18:41:35 +0100 Subject: [PATCH 2/2] guix: python-build-system: Import setuptools before calling `setup.py'. This is needed for packages using "distutils" instead of "setuptools" since the former does not understand the "--single-version-externally-managed" flag. Also export __file__ since it will be unset when setup.py is called from python "exec". * guix/build/python-build-system.scm (call-setuppy): extend "python setup.py" call to import setuptools, export __file__, and call setup.py from setuptools python environment. --- guix/build/python-build-system.scm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/guix/build/python-build-system.scm b/guix/build/python-build-system.scm index d07b83f..4362c48 100644 --- a/guix/build/python-build-system.scm +++ b/guix/build/python-build-system.scm @@ -42,7 +42,11 @@ (begin (format #t "running \"python setup.py\" with command ~s and parameters ~s~%" command params) - (zero? (apply system* "python" "setup.py" command params))) + (zero? (apply system* "python" + "-c" (string-append "import setuptools;" + "__file__='setup.py';" + "exec(open('setup.py').read())") + command params))) (error "no setup.py found"))) (define* (build #:rest empty) -- 2.10.0 --=-=-=--