[Python-checkins] r80647 - in python/trunk: Mac/IDLE/Makefile.in Mac/Makefile.in Mac/PythonLauncher/Makefile.in Mac/README Misc/NEWS configure configure.in

ronald.oussoren python-checkins at python.org
Fri Apr 30 13:20:15 CEST 2010


Author: ronald.oussoren
Date: Fri Apr 30 13:20:14 2010
New Revision: 80647

Log:
Fix for issue #3646: with this patch it is possible to do a
framework install of Python in your home directory (on OSX):

   $ configure --enable-framework=${HOME}/Library/Frameworks
   $ make && make install

Without this patch the framework would get installed just fine,
but 'make install' would try to install the application bundles
and command-line tools outside the user's home, which doesn't work
for non-admin users (and is bad form anyway).


Modified:
   python/trunk/Mac/IDLE/Makefile.in
   python/trunk/Mac/Makefile.in
   python/trunk/Mac/PythonLauncher/Makefile.in
   python/trunk/Mac/README
   python/trunk/Misc/NEWS
   python/trunk/configure
   python/trunk/configure.in

Modified: python/trunk/Mac/IDLE/Makefile.in
==============================================================================
--- python/trunk/Mac/IDLE/Makefile.in	(original)
+++ python/trunk/Mac/IDLE/Makefile.in	Fri Apr 30 13:20:14 2010
@@ -24,7 +24,7 @@
 
 BUNDLEBULDER=$(srcdir)/../../Lib/plat-mac/bundlebuilder.py
 
-PYTHONAPPSDIR=/Applications/$(PYTHONFRAMEWORK) $(VERSION)
+PYTHONAPPSDIR=@FRAMEWORKINSTALLAPPSPREFIX@/$(PYTHONFRAMEWORK) $(VERSION)
 
 all: IDLE.app
 

Modified: python/trunk/Mac/Makefile.in
==============================================================================
--- python/trunk/Mac/Makefile.in	(original)
+++ python/trunk/Mac/Makefile.in	Fri Apr 30 13:20:14 2010
@@ -22,7 +22,7 @@
 
 # These are normally glimpsed from the previous set
 bindir=$(prefix)/bin
-PYTHONAPPSDIR=/Applications/$(PYTHONFRAMEWORK) $(VERSION)
+PYTHONAPPSDIR=@FRAMEWORKINSTALLAPPSPREFIX@/$(PYTHONFRAMEWORK) $(VERSION)
 APPINSTALLDIR=$(prefix)/Resources/Python.app
 
 # Variables for installing the "normal" unix binaries

Modified: python/trunk/Mac/PythonLauncher/Makefile.in
==============================================================================
--- python/trunk/Mac/PythonLauncher/Makefile.in	(original)
+++ python/trunk/Mac/PythonLauncher/Makefile.in	Fri Apr 30 13:20:14 2010
@@ -21,7 +21,7 @@
 
 BUNDLEBULDER=$(srcdir)/../../Lib/plat-mac/bundlebuilder.py
 
-PYTHONAPPSDIR=/Applications/$(PYTHONFRAMEWORK) $(VERSION)
+PYTHONAPPSDIR=@FRAMEWORKINSTALLAPPSPREFIX@/$(PYTHONFRAMEWORK) $(VERSION)
 OBJECTS=FileSettings.o MyAppDelegate.o MyDocument.o PreferencesWindowController.o doscript.o main.o
 
 all: Python\ Launcher.app

Modified: python/trunk/Mac/README
==============================================================================
--- python/trunk/Mac/README	(original)
+++ python/trunk/Mac/README	Fri Apr 30 13:20:14 2010
@@ -8,13 +8,24 @@
 Mac-specific arguments to configure
 ===================================
 
-* ``--enable-framework``
+* ``--enable-framework[=DIR]``
 
   If this argument is specified the build will create a Python.framework rather
   than a traditional Unix install. See the section
   _`Building and using a framework-based Python on Mac OS X` for more 
   information on frameworks.
 
+  If the optional directory argument is specified the framework it installed
+  into that directory. This can be used to install a python framework into
+  your home directory::
+
+     $ configure --enable-framework=/Users/ronald/Library/Frameworks
+     $ make && make install
+
+  This will install the framework itself in ``/Users/ronald/Library/Frameworks``,
+  the applications in a subdirectory of ``/Users/ronald/Applications`` and the
+  command-line tools in ``/Users/ronald/bin``.
+
 * ``--with-framework-name=NAME``
 
   Specify the name for the python framework, defaults to ``Python``. This option

Modified: python/trunk/Misc/NEWS
==============================================================================
--- python/trunk/Misc/NEWS	(original)
+++ python/trunk/Misc/NEWS	Fri Apr 30 13:20:14 2010
@@ -141,6 +141,9 @@
 
 - Issue #8509: Fix quoting in help strings and code snippets in configure.in.
 
+- Issue #3646: It is now easily possible to install a Python framework into
+  your home directory on MacOSX, see Mac/README for more information.
+
 
 What's New in Python 2.7 beta 1?
 ================================

Modified: python/trunk/configure
==============================================================================
--- python/trunk/configure	(original)
+++ python/trunk/configure	Fri Apr 30 13:20:14 2010
@@ -1,5 +1,5 @@
 #! /bin/sh
-# From configure.in Revision: 80443 .
+# From configure.in Revision: 80574 .
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by GNU Autoconf 2.61 for python 2.7.
 #
@@ -669,6 +669,7 @@
 FRAMEWORKALTINSTALLFIRST
 FRAMEWORKALTINSTALLLAST
 FRAMEWORKUNIXTOOLSPREFIX
+FRAMEWORKINSTALLAPPSPREFIX
 MACHDEP
 SGI_ABI
 EXTRAPLATDIR
@@ -2018,18 +2019,55 @@
 		enable_framework=
 		;;
 	*)
-		PYTHONFRAMEWORKPREFIX=$enableval
+		PYTHONFRAMEWORKPREFIX="${enableval}"
 		PYTHONFRAMEWORKINSTALLDIR=$PYTHONFRAMEWORKPREFIX/$PYTHONFRAMEWORKDIR
 		FRAMEWORKINSTALLFIRST="frameworkinstallstructure"
 		FRAMEWORKALTINSTALLFIRST="frameworkinstallstructure bininstall maninstall"
 		FRAMEWORKINSTALLLAST="frameworkinstallmaclib frameworkinstallapps frameworkinstallunixtools"
 		FRAMEWORKALTINSTALLLAST="frameworkinstallmaclib frameworkinstallapps frameworkaltinstallunixtools"
+		FRAMEWORKINSTALLAPPSPREFIX="/Applications"
 
 		if test "x${prefix}" = "xNONE" ; then
 			FRAMEWORKUNIXTOOLSPREFIX="${ac_default_prefix}"
+
 		else
 			FRAMEWORKUNIXTOOLSPREFIX="${prefix}"
 		fi
+
+		case "${enableval}" in
+		/System*)
+			FRAMEWORKINSTALLAPPSPREFIX="/Applications"
+			if test "${prefix}" = "NONE" ; then
+				# See below
+				FRAMEWORKUNIXTOOLSPREFIX="/usr"
+			fi
+			;;
+
+		/Library*)
+			FRAMEWORKINSTALLAPPSPREFIX="/Applications"
+			;;
+
+		*/Library/Frameworks)
+			MDIR="`dirname "${enableval}"`"
+			MDIR="`dirname "${MDIR}"`"
+			FRAMEWORKINSTALLAPPSPREFIX="${MDIR}/Applications"
+
+			if test "${prefix}" = "NONE"; then
+				# User hasn't specified the
+				# --prefix option, but wants to install
+				# the framework in a non-default location,
+				# ensure that the compatibility links get
+				# installed relative to that prefix as well
+				# instead of in /usr/local.
+				FRAMEWORKUNIXTOOLSPREFIX="${MDIR}"
+			fi
+			;;
+
+		*)
+			FRAMEWORKINSTALLAPPSPREFIX="/Applications"
+			;;
+		esac
+
 		prefix=$PYTHONFRAMEWORKINSTALLDIR/Versions/$VERSION
 
 		# Add files for Mac specific code to the list of output
@@ -2077,6 +2115,7 @@
 
 
 
+
 ##AC_ARG_WITH(dyld,
 ##            AC_HELP_STRING(--with-dyld,
 ##                           Use (OpenStep|Rhapsody) dynamic linker))
@@ -3899,7 +3938,7 @@
   { echo "$as_me:$LINENO: result: no" >&5
 echo "${ECHO_T}no" >&6; }
 fi
-rm -f conftest*
+rm -f -r conftest*
 
 
 
@@ -5471,7 +5510,7 @@
 else
   ac_cv_header_stdc=no
 fi
-rm -f conftest*
+rm -f -r conftest*
 
 fi
 
@@ -5492,7 +5531,7 @@
 else
   ac_cv_header_stdc=no
 fi
-rm -f conftest*
+rm -f -r conftest*
 
 fi
 
@@ -6592,7 +6631,7 @@
 
 
 fi
-rm -f conftest*
+rm -f -r conftest*
 
 { echo "$as_me:$LINENO: result: $was_it_defined" >&5
 echo "${ECHO_T}$was_it_defined" >&6; }
@@ -7129,7 +7168,7 @@
 else
   ac_cv_type_uid_t=no
 fi
-rm -f conftest*
+rm -f -r conftest*
 
 fi
 { echo "$as_me:$LINENO: result: $ac_cv_type_uid_t" >&5
@@ -15952,7 +15991,7 @@
 else
   unistd_defines_pthreads=no
 fi
-rm -f conftest*
+rm -f -r conftest*
 
     { echo "$as_me:$LINENO: result: $unistd_defines_pthreads" >&5
 echo "${ECHO_T}$unistd_defines_pthreads" >&6; }
@@ -17566,7 +17605,7 @@
   $EGREP "yes" >/dev/null 2>&1; then
   ipv6type=$i
 fi
-rm -f conftest*
+rm -f -r conftest*
 
 			;;
 		kame)
@@ -17589,7 +17628,7 @@
 				ipv6libdir=/usr/local/v6/lib
 				ipv6trylibc=yes
 fi
-rm -f conftest*
+rm -f -r conftest*
 
 			;;
 		linux-glibc)
@@ -17610,7 +17649,7 @@
   ipv6type=$i;
 				ipv6trylibc=yes
 fi
-rm -f conftest*
+rm -f -r conftest*
 
 			;;
 		linux-inet6)
@@ -17648,7 +17687,7 @@
 				ipv6lib=inet6;
 				ipv6libdir=/usr/local/v6/lib
 fi
-rm -f conftest*
+rm -f -r conftest*
 
 			;;
 		v6d)
@@ -17671,7 +17710,7 @@
 				ipv6libdir=/usr/local/v6/lib;
 				BASECFLAGS="-I/usr/local/v6/include $BASECFLAGS"
 fi
-rm -f conftest*
+rm -f -r conftest*
 
 			;;
 		zeta)
@@ -17693,7 +17732,7 @@
 				ipv6lib=inet6;
 				ipv6libdir=/usr/local/v6/lib
 fi
-rm -f conftest*
+rm -f -r conftest*
 
 			;;
 		esac
@@ -26239,7 +26278,7 @@
 _ACEOF
 
 fi
-rm -f conftest*
+rm -f -r conftest*
 
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -26258,7 +26297,7 @@
 _ACEOF
 
 fi
-rm -f conftest*
+rm -f -r conftest*
 
 fi
 
@@ -26528,7 +26567,7 @@
 _ACEOF
 
 fi
-rm -f conftest*
+rm -f -r conftest*
 
 fi
 
@@ -28478,6 +28517,7 @@
 FRAMEWORKALTINSTALLFIRST!$FRAMEWORKALTINSTALLFIRST$ac_delim
 FRAMEWORKALTINSTALLLAST!$FRAMEWORKALTINSTALLLAST$ac_delim
 FRAMEWORKUNIXTOOLSPREFIX!$FRAMEWORKUNIXTOOLSPREFIX$ac_delim
+FRAMEWORKINSTALLAPPSPREFIX!$FRAMEWORKINSTALLAPPSPREFIX$ac_delim
 MACHDEP!$MACHDEP$ac_delim
 SGI_ABI!$SGI_ABI$ac_delim
 EXTRAPLATDIR!$EXTRAPLATDIR$ac_delim
@@ -28521,7 +28561,6 @@
 LIBTOOL_CRUFT!$LIBTOOL_CRUFT$ac_delim
 SO!$SO$ac_delim
 LDSHARED!$LDSHARED$ac_delim
-LDCXXSHARED!$LDCXXSHARED$ac_delim
 _ACEOF
 
   if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
@@ -28563,6 +28602,7 @@
 ac_delim='%!_!# '
 for ac_last_try in false false false false false :; do
   cat >conf$$subs.sed <<_ACEOF
+LDCXXSHARED!$LDCXXSHARED$ac_delim
 BLDSHARED!$BLDSHARED$ac_delim
 CCSHARED!$CCSHARED$ac_delim
 LINKFORSHARED!$LINKFORSHARED$ac_delim
@@ -28593,7 +28633,7 @@
 LTLIBOBJS!$LTLIBOBJS$ac_delim
 _ACEOF
 
-  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 28; then
+  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 29; then
     break
   elif $ac_last_try; then
     { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5

Modified: python/trunk/configure.in
==============================================================================
--- python/trunk/configure.in	(original)
+++ python/trunk/configure.in	Fri Apr 30 13:20:14 2010
@@ -190,18 +190,55 @@
 		enable_framework=
 		;;
 	*)
-		PYTHONFRAMEWORKPREFIX=$enableval
+		PYTHONFRAMEWORKPREFIX="${enableval}"
 		PYTHONFRAMEWORKINSTALLDIR=$PYTHONFRAMEWORKPREFIX/$PYTHONFRAMEWORKDIR
 		FRAMEWORKINSTALLFIRST="frameworkinstallstructure"
 		FRAMEWORKALTINSTALLFIRST="frameworkinstallstructure bininstall maninstall"
 		FRAMEWORKINSTALLLAST="frameworkinstallmaclib frameworkinstallapps frameworkinstallunixtools"
 		FRAMEWORKALTINSTALLLAST="frameworkinstallmaclib frameworkinstallapps frameworkaltinstallunixtools"
+		FRAMEWORKINSTALLAPPSPREFIX="/Applications"
 
 		if test "x${prefix}" = "xNONE" ; then
 			FRAMEWORKUNIXTOOLSPREFIX="${ac_default_prefix}"
+
 		else
 			FRAMEWORKUNIXTOOLSPREFIX="${prefix}"
 		fi
+
+		case "${enableval}" in
+		/System*)
+			FRAMEWORKINSTALLAPPSPREFIX="/Applications"
+			if test "${prefix}" = "NONE" ; then
+				# See below
+				FRAMEWORKUNIXTOOLSPREFIX="/usr"
+			fi
+			;;
+
+		/Library*)
+			FRAMEWORKINSTALLAPPSPREFIX="/Applications"
+			;;
+
+		*/Library/Frameworks)
+			MDIR="`dirname "${enableval}"`"
+			MDIR="`dirname "${MDIR}"`"
+			FRAMEWORKINSTALLAPPSPREFIX="${MDIR}/Applications"
+
+			if test "${prefix}" = "NONE"; then
+				# User hasn't specified the 
+				# --prefix option, but wants to install
+				# the framework in a non-default location,
+				# ensure that the compatibility links get
+				# installed relative to that prefix as well
+				# instead of in /usr/local.
+				FRAMEWORKUNIXTOOLSPREFIX="${MDIR}"
+			fi
+			;;
+
+		*)
+			FRAMEWORKINSTALLAPPSPREFIX="/Applications"
+			;;
+		esac
+
 		prefix=$PYTHONFRAMEWORKINSTALLDIR/Versions/$VERSION
 
 		# Add files for Mac specific code to the list of output
@@ -239,6 +276,7 @@
 AC_SUBST(FRAMEWORKALTINSTALLFIRST)
 AC_SUBST(FRAMEWORKALTINSTALLLAST)
 AC_SUBST(FRAMEWORKUNIXTOOLSPREFIX)
+AC_SUBST(FRAMEWORKINSTALLAPPSPREFIX)
 
 ##AC_ARG_WITH(dyld,
 ##            AC_HELP_STRING(--with-dyld,


More information about the Python-checkins mailing list