From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-python+bounces-378-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	by finch.gentoo.org (Postfix) with ESMTP id 3C5A6138937
	for <garchives@archives.gentoo.org>; Sat,  9 Feb 2013 12:03:42 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 146E1E05D9;
	Sat,  9 Feb 2013 12:03:41 +0000 (UTC)
Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183])
	(using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id 3E003E05D9
	for <gentoo-python@lists.gentoo.org>; Sat,  9 Feb 2013 12:03:40 +0000 (UTC)
Received: from pomiocik.lan (77-253-144-194.adsl.inetia.pl [77.253.144.194])
	(using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	(Authenticated sender: mgorny)
	by smtp.gentoo.org (Postfix) with ESMTPSA id 677B733DCDF;
	Sat,  9 Feb 2013 12:03:38 +0000 (UTC)
From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
To: gentoo-python@lists.gentoo.org
Cc: python@gentoo.org,
	=?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
Subject: [gentoo-python] [PATCH] Override egg-info location in out-of-source builds.
Date: Sat,  9 Feb 2013 13:03:33 +0100
Message-Id: <1360411413-7456-1-git-send-email-mgorny@gentoo.org>
X-Mailer: git-send-email 1.8.1.2
Precedence: bulk
List-Post: <mailto:gentoo-python@lists.gentoo.org>
List-Help: <mailto:gentoo-python+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-python+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-python+subscribe@lists.gentoo.org>
List-Id: Discussions centering around the Python ecosystem in Gentoo Linux <gentoo-python.gentoo.org>
X-BeenThere: gentoo-python@gentoo.org
X-BeenThere: gentoo-python@lists.gentoo.org
X-Archives-Salt: e4dcf5e5-ae9f-4bc4-8415-7f2057fb51df
X-Archives-Hash: acbecef6770e840d9660b4e9906cc849

Detect whether egg_info command is available and override the egg-info
file location to BUILD_DIR. This way, there is no risk that egg-info
files between CPython 2.7 and PyPy will collide. Even if that wouldn't
hurt anything :P.
---
 gx86/eclass/distutils-r1.eclass | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/gx86/eclass/distutils-r1.eclass b/gx86/eclass/distutils-r1.eclass
index 27730f5..24589f0 100644
--- a/gx86/eclass/distutils-r1.eclass
+++ b/gx86/eclass/distutils-r1.eclass
@@ -215,6 +215,13 @@ esetup.py() {
 			die 'Out-of-source build requested, yet BUILD_DIR unset.'
 		fi
 
+		# if setuptools is used, adjust egg_info path as well
+		if "${PYTHON:-python}" setup.py --help egg_info &>/dev/null; then
+			add_args+=(
+				egg_info --egg-base "${BUILD_DIR}"
+			)
+		fi
+
 		add_args+=(
 			build
 			--build-base "${BUILD_DIR}"
-- 
1.8.1.2