20674483 change Userland Python default version from 2.6 to 2.7 s11-update
authorJohn Beck <John.Beck@Oracle.COM>
Thu, 12 Mar 2015 07:59:21 -0700
branchs11-update
changeset 3985 6cc44e5834f8
parent 3984 03ec35f09e5b
child 3986 fb4c39333433
20674483 change Userland Python default version from 2.6 to 2.7
components/lcms/Makefile
components/libxml2/Makefile
components/libxslt/Makefile
components/net-snmp/Makefile
components/openscap/Makefile
components/python/ipython/Makefile
make-rules/shared-macros.mk
--- a/components/lcms/Makefile	Wed Mar 18 13:27:20 2015 -0700
+++ b/components/lcms/Makefile	Thu Mar 12 07:59:21 2015 -0700
@@ -51,6 +51,10 @@
 CXXFLAGS += -features=extensions,nestedaccess,tmplrefstatic
 CXXFLAGS += -template=geninlinefuncs
 
+# When 2.6 goes away, we can remove the version line below, as well as the
+# COMPONENT_POST_{CONFIGURE,INSTALL_ACTION} lines below.
+PYTHON_VERSION=2.6
+
 CONFIGURE_ENV += CFLAGS="$(CFLAGS)"
 CONFIGURE_ENV += CXXFLAGS="$(CXXFLAGS)"
 CONFIGURE_ENV += PYTHON="$(PYTHON)"
--- a/components/libxml2/Makefile	Wed Mar 18 13:27:20 2015 -0700
+++ b/components/libxml2/Makefile	Thu Mar 12 07:59:21 2015 -0700
@@ -51,6 +51,9 @@
 CFLAGS +=	$(CPP_LARGEFILES)
 LDFLAGS +=	$(LD_Z_DEFS) $(LD_Z_TEXT) -lpthread
 
+# Once Python 2.6 goes away, the various POST_*_ACTIONs below can be simplified.
+PYTHON_VERSION=2.6
+
 CONFIGURE_OPTIONS += --disable-static
 CONFIGURE_OPTIONS += --with-pic
 CONFIGURE_OPTIONS += --with-threads
--- a/components/libxslt/Makefile	Wed Mar 18 13:27:20 2015 -0700
+++ b/components/libxslt/Makefile	Thu Mar 12 07:59:21 2015 -0700
@@ -47,6 +47,10 @@
 CFLAGS +=	$(CPP_LARGEFILES)
 LDFLAGS +=	$(LD_Z_DEFS) $(LD_Z_TEXT) -lpthread
 
+# When 2.6 goes away, we can remove the version line below, as well as the
+# COMPONENT_POST_{CONFIGURE,INSTALL_ACTION} lines below.
+PYTHON_VERSION=2.6
+
 CONFIGURE_OPTIONS += --disable-static
 CONFIGURE_OPTIONS += --with-pic
 CONFIGURE_OPTIONS += --with-python=$(PYTHON.$(BITS))
--- a/components/net-snmp/Makefile	Wed Mar 18 13:27:20 2015 -0700
+++ b/components/net-snmp/Makefile	Thu Mar 12 07:59:21 2015 -0700
@@ -90,6 +90,11 @@
 COMPONENT_PRE_CONFIGURE_ACTION = \
 	($(CLONEY) $(SOURCE_DIR) $(@D); $(CLONEY) $(COMPONENT_DIR)/sun $(@D)/sun)
 
+# After Python 2.6 goes away, the COMPONENT_POST_{CONFIGURE,INSTALL}_ACTIONs
+# below can go away as well (for INSTALL_ACTION, 32-bit goes away; 64-bit
+# remains).
+PYTHON_VERSION=2.6
+
 # After we have configured, make a copy of the python bits so we
 # can build separate python 2.7 support.
 COMPONENT_POST_CONFIGURE_ACTION = (cd $(@D) ; cp -rp python python2.7)
--- a/components/openscap/Makefile	Wed Mar 18 13:27:20 2015 -0700
+++ b/components/openscap/Makefile	Thu Mar 12 07:59:21 2015 -0700
@@ -42,7 +42,10 @@
 CFLAGS+=		-DNDEBUG
 CFLAGS+=		-DOSCAP_THREAD_SAFE
 
-PYTHON_VERSIONS=	2.7 2.6
+# When Python 2.6 goes away, the _VERSION (singular) line below can go as well,
+# as can the COMPONENT_POST_CONFIGURE_ACTION and possibly more.
+PYTHON_VERSION=		2.6
+PYTHON_VERSIONS=	$(PYTHON2_VERSIONS)
 
 include $(WS_TOP)/make-rules/prep.mk
 include $(WS_TOP)/make-rules/configure.mk
--- a/components/python/ipython/Makefile	Wed Mar 18 13:27:20 2015 -0700
+++ b/components/python/ipython/Makefile	Thu Mar 12 07:59:21 2015 -0700
@@ -20,7 +20,7 @@
 #
 
 #
-# Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
 #
 
 include ../../../make-rules/shared-macros.mk
@@ -38,22 +38,21 @@
 TPNO=			9640
 
 # Syntax issues: not Python 3 ready.
-PYTHON_VERSIONS = 2.7 2.6
+PYTHON_VERSIONS = $(PYTHON2_VERSIONS)
 
 include $(WS_TOP)/make-rules/prep.mk
 include $(WS_TOP)/make-rules/setup.py.mk
 include $(WS_TOP)/make-rules/ips.mk
 
-# Replace "#!/usr/bin/env ..." shebang lines with properly versioned ones.
-COMPONENT_PRE_BUILD_ACTION = \
-	/usr/bin/find $(SOURCE_DIR) -name *.py \
-		-exec $(GSED) -i -e 's/env python/python$(PYTHON_VERSION)/' "{}" \; ;
-
 # Unpack the ipython man pages.
 COMPONENT_POST_UNPACK_ACTION = \
 	(cd $(SOURCE_DIR)/docs/man; /usr/bin/gunzip * )
 
-# common targets
+# Replace "#!/usr/bin/env ..." shebang lines with properly versioned ones.
+COMPONENT_POST_INSTALL_ACTION = \
+	/usr/bin/find $(PROTOUSRLIBDIR)/python$(PYTHON_VERSION) -name *.py \
+		-exec $(GSED) -i -e 's|env python|python$(PYTHON_VERSION)|' "{}" \; ;
+
 build:          $(BUILD_32)
 
 install:        $(INSTALL_32)
--- a/make-rules/shared-macros.mk	Wed Mar 18 13:27:20 2015 -0700
+++ b/make-rules/shared-macros.mk	Thu Mar 12 07:59:21 2015 -0700
@@ -86,12 +86,9 @@
 COMPILER =		studio
 BITS =			32
 
-# If we are building multiple versions of python, make sure that python 2.6
-# is installed last and is the canonical version.  When we change defaults,
-# the new default should go last.  For now, this is most easily done by
-# listing version in descending order.
-PYTHON_VERSION =	2.6
-PYTHON2_VERSIONS =	2.7 2.6
+# The default version should go last.
+PYTHON_VERSION =	2.7
+PYTHON2_VERSIONS =	2.6 2.7
 PYTHON3_VERSIONS =	3.4
 PYTHON_VERSIONS =	$(PYTHON3_VERSIONS) $(PYTHON2_VERSIONS)