15791665 SUNBT7168800 python build turds go in the wrong place
authorDanek Duvall <danek.duvall@oracle.com>
Wed, 14 Nov 2012 14:29:58 -0800
changeset 1057 e04f97962a3d
parent 1056 b2ec61db2a04
child 1058 34d7aaa03423
15791665 SUNBT7168800 python build turds go in the wrong place
components/mercurial/mercurial-GENFRAG.p5m
components/mercurial/mercurial-PYVER.p5m
components/python/mako/mako-PYVER.p5m
components/rdiff-backup/rdiff-backup-26.p5m
components/rdiff-backup/rdiff-backup-27.p5m
make-rules/setup.py.mk
--- a/components/rdiff-backup/rdiff-backup-26.p5m	Wed Nov 14 14:29:54 2012 -0800
+++ b/components/rdiff-backup/rdiff-backup-26.p5m	Wed Nov 14 14:29:58 2012 -0800
@@ -39,10 +39,10 @@
 dir path=usr/lib/python2.6/vendor-packages
 dir path=usr/lib/python2.6/vendor-packages/rdiff_backup
 
-file build/scripts-2.6/rdiff-backup \
+file build/$(MACH32)-2.6/scripts-2.6/rdiff-backup \
     path=usr/bin/rdiff-backup-2.6 \
     pkg.depend.bypass-generate=.*msvcrt.*
-file build/scripts-2.6/rdiff-backup-statistics \
+file build/$(MACH32)-2.6/scripts-2.6/rdiff-backup-statistics \
     path=usr/bin/rdiff-backup-statistics-2.6
 file \
     path=usr/lib/python2.6/vendor-packages/rdiff_backup-$(COMPONENT_VERSION)-py2.6.egg-info
--- a/components/rdiff-backup/rdiff-backup-27.p5m	Wed Nov 14 14:29:54 2012 -0800
+++ b/components/rdiff-backup/rdiff-backup-27.p5m	Wed Nov 14 14:29:58 2012 -0800
@@ -39,10 +39,10 @@
 dir path=usr/lib/python2.7/vendor-packages
 dir path=usr/lib/python2.7/vendor-packages/rdiff_backup
 
-file build/scripts-2.7/rdiff-backup \
+file build/$(MACH32)-2.7/scripts-2.7/rdiff-backup \
     path=usr/bin/rdiff-backup-2.7 \
     pkg.depend.bypass-generate=.*msvcrt.*
-file build/scripts-2.7/rdiff-backup-statistics \
+file build/$(MACH32)-2.7/scripts-2.7/rdiff-backup-statistics \
     path=usr/bin/rdiff-backup-statistics-2.7
 file \
     path=usr/lib/python2.7/vendor-packages/rdiff_backup-$(COMPONENT_VERSION)-py2.7.egg-info
--- a/make-rules/setup.py.mk	Wed Nov 14 14:29:54 2012 -0800
+++ b/make-rules/setup.py.mk	Wed Nov 14 14:29:58 2012 -0800
@@ -48,13 +48,21 @@
 $(BUILD_DIR)/%-2.6/.installed:	$(BUILD_DIR)/%-2.7/.installed
 endif
 
+# Create a distutils config file specific to the combination of build
+# characteristics (bittedness x Python version), and put it in its own
+# directory.  We can set $HOME to point distutils at it later, allowing
+# the install phase to find the temporary build directories.
+CFG=.pydistutils.cfg
+$(BUILD_DIR)/config-%/$(CFG):
+	$(MKDIR) $(@D)
+	echo "[build]\nbuild_base = $(BUILD_DIR)/$*" > [email protected]
+
 # build the configured source
-$(BUILD_DIR)/%/.built:	$(SOURCE_DIR)/.prep
+$(BUILD_DIR)/%/.built:	$(SOURCE_DIR)/.prep $(BUILD_DIR)/config-%/$(CFG)
 	$(RM) -r $(@D) ; $(MKDIR) $(@D)
 	$(COMPONENT_PRE_BUILD_ACTION)
-	(cd $(SOURCE_DIR) ; $(ENV) $(PYTHON_ENV) \
-		$(PYTHON.$(BITS)) ./setup.py build \
-			--build-temp $(@D:$(BUILD_DIR)/%=%))
+	(cd $(SOURCE_DIR) ; $(ENV) HOME=$(BUILD_DIR)/config-$* $(PYTHON_ENV) \
+		$(PYTHON.$(BITS)) ./setup.py build)
 	$(COMPONENT_POST_BUILD_ACTION)
 ifeq   ($(strip $(PARFAIT_BUILD)),yes)
 	-$(PARFAIT) $(SOURCE_DIR)/$(@D:$(BUILD_DIR)/%=%)
@@ -70,9 +78,9 @@
 COMPONENT_INSTALL_ARGS +=	--force
 
 # install the built source into a prototype area
-$(BUILD_DIR)/%/.installed:	$(BUILD_DIR)/%/.built
+$(BUILD_DIR)/%/.installed:	$(BUILD_DIR)/%/.built $(BUILD_DIR)/config-%/$(CFG)
 	$(COMPONENT_PRE_INSTALL_ACTION)
-	(cd $(SOURCE_DIR) ; $(ENV) $(COMPONENT_INSTALL_ENV) \
+	(cd $(SOURCE_DIR) ; $(ENV) HOME=$(BUILD_DIR)/config-$* $(COMPONENT_INSTALL_ENV) \
 		$(PYTHON.$(BITS)) ./setup.py install $(COMPONENT_INSTALL_ARGS))
 	$(COMPONENT_POST_INSTALL_ACTION)
 	$(TOUCH) [email protected]