Gentoo Archives: gentoo-python

From: "Michał Górny" <mgorny@g.o>
To: gentoo-python@l.g.o
Cc: python@g.o, "Michał Górny" <mgorny@g.o>
Subject: [gentoo-python] [PATCH] Override egg-info location in out-of-source builds.
Date: Sat, 09 Feb 2013 12:03:42
Message-Id: 1360411413-7456-1-git-send-email-mgorny@gentoo.org
1 Detect whether egg_info command is available and override the egg-info
2 file location to BUILD_DIR. This way, there is no risk that egg-info
3 files between CPython 2.7 and PyPy will collide. Even if that wouldn't
4 hurt anything :P.
5 ---
6 gx86/eclass/distutils-r1.eclass | 7 +++++++
7 1 file changed, 7 insertions(+)
8
9 diff --git a/gx86/eclass/distutils-r1.eclass b/gx86/eclass/distutils-r1.eclass
10 index 27730f5..24589f0 100644
11 --- a/gx86/eclass/distutils-r1.eclass
12 +++ b/gx86/eclass/distutils-r1.eclass
13 @@ -215,6 +215,13 @@ esetup.py() {
14 die 'Out-of-source build requested, yet BUILD_DIR unset.'
15 fi
16
17 + # if setuptools is used, adjust egg_info path as well
18 + if "${PYTHON:-python}" setup.py --help egg_info &>/dev/null; then
19 + add_args+=(
20 + egg_info --egg-base "${BUILD_DIR}"
21 + )
22 + fi
23 +
24 add_args+=(
25 build
26 --build-base "${BUILD_DIR}"
27 --
28 1.8.1.2

Replies