>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