Skip to content

Commit 86b33c8

Browse files
Merged revisions 80647 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r80647 | ronald.oussoren | 2010-04-30 13:20:14 +0200 (Fri, 30 Apr 2010) | 11 lines Fix for issue python#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). ........
1 parent 0ea2a46 commit 86b33c8

File tree

6 files changed

+97
-6
lines changed

6 files changed

+97
-6
lines changed

Mac/Makefile.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export MACOSX_DEPLOYMENT_TARGET
2424

2525
# These are normally glimpsed from the previous set
2626
bindir=$(prefix)/bin
27-
PYTHONAPPSDIR=/Applications/$(PYTHONFRAMEWORK) $(VERSION)
27+
PYTHONAPPSDIR=@FRAMEWORKINSTALLAPPSPREFIX@/$(PYTHONFRAMEWORK) $(VERSION)
2828
APPINSTALLDIR=$(prefix)/Resources/Python.app
2929

3030
# Variables for installing the "normal" unix binaries

Mac/PythonLauncher/Makefile.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ MACOSX_DEPLOYMENT_TARGET=@CONFIGURE_MACOSX_DEPLOYMENT_TARGET@
2121

2222
BUNDLEBULDER=$(srcdir)/../Tools/bundlebuilder.py
2323

24-
PYTHONAPPSDIR=/Applications/$(PYTHONFRAMEWORK) $(VERSION)
24+
PYTHONAPPSDIR=@FRAMEWORKINSTALLAPPSPREFIX@/$(PYTHONFRAMEWORK) $(VERSION)
2525
OBJECTS=FileSettings.o MyAppDelegate.o MyDocument.o PreferencesWindowController.o doscript.o main.o
2626

2727
install: Python\ Launcher.app

Mac/README

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,24 @@ MacOSX Notes
55
This document provides a quick overview of some Mac OS X specific features in
66
the Python distribution.
77

8-
* ``--enable-framework``
8+
* ``--enable-framework[=DIR]``
99

1010
If this argument is specified the build will create a Python.framework rather
1111
than a traditional Unix install. See the section
1212
_`Building and using a framework-based Python on Mac OS X` for more
1313
information on frameworks.
1414

15+
If the optional directory argument is specified the framework it installed
16+
into that directory. This can be used to install a python framework into
17+
your home directory::
18+
19+
$ configure --enable-framework=/Users/ronald/Library/Frameworks
20+
$ make && make install
21+
22+
This will install the framework itself in ``/Users/ronald/Library/Frameworks``,
23+
the applications in a subdirectory of ``/Users/ronald/Applications`` and the
24+
command-line tools in ``/Users/ronald/bin``.
25+
1526
* ``--with-framework-name=NAME``
1627

1728
Specify the name for the python framework, defaults to ``Python``. This option

Misc/NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1109,6 +1109,9 @@ Extension Modules
11091109
Build
11101110
-----
11111111

1112+
- Issue #3646: It is now easily possible to install a Python framework into
1113+
your home directory on MacOSX, see Mac/README for more information.
1114+
11121115
- Issue #3928: os.mknod() now available in Solaris, also.
11131116

11141117
- Issue #3326: Build Python without -fno-strict-aliasing when the gcc does not

configure

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#! /bin/sh
2-
# From configure.in Revision: 80481 .
2+
# From configure.in Revision: 80576 .
33
# Guess values for system-dependent variables and create Makefiles.
44
# Generated by GNU Autoconf 2.65 for python 3.2.
55
#
@@ -664,6 +664,7 @@ EXPORT_MACOSX_DEPLOYMENT_TARGET
664664
CONFIGURE_MACOSX_DEPLOYMENT_TARGET
665665
SGI_ABI
666666
MACHDEP
667+
FRAMEWORKINSTALLAPPSPREFIX
667668
FRAMEWORKUNIXTOOLSPREFIX
668669
FRAMEWORKALTINSTALLLAST
669670
FRAMEWORKALTINSTALLFIRST
@@ -2849,18 +2850,55 @@ if test "${enable_framework+set}" = set; then :
28492850
enable_framework=
28502851
;;
28512852
*)
2852-
PYTHONFRAMEWORKPREFIX=$enableval
2853+
PYTHONFRAMEWORKPREFIX="${enableval}"
28532854
PYTHONFRAMEWORKINSTALLDIR=$PYTHONFRAMEWORKPREFIX/$PYTHONFRAMEWORKDIR
28542855
FRAMEWORKINSTALLFIRST="frameworkinstallstructure"
28552856
FRAMEWORKALTINSTALLFIRST="frameworkinstallstructure "
28562857
FRAMEWORKINSTALLLAST="frameworkinstallmaclib frameworkinstallapps frameworkinstallunixtools"
28572858
FRAMEWORKALTINSTALLLAST="frameworkinstallmaclib frameworkinstallapps frameworkaltinstallunixtools"
2859+
FRAMEWORKINSTALLAPPSPREFIX="/Applications"
28582860
28592861
if test "x${prefix}" = "xNONE" ; then
28602862
FRAMEWORKUNIXTOOLSPREFIX="${ac_default_prefix}"
2863+
28612864
else
28622865
FRAMEWORKUNIXTOOLSPREFIX="${prefix}"
28632866
fi
2867+
2868+
case "${enableval}" in
2869+
/System*)
2870+
FRAMEWORKINSTALLAPPSPREFIX="/Applications"
2871+
if test "${prefix}" = "NONE" ; then
2872+
# See below
2873+
FRAMEWORKUNIXTOOLSPREFIX="/usr"
2874+
fi
2875+
;;
2876+
2877+
/Library*)
2878+
FRAMEWORKINSTALLAPPSPREFIX="/Applications"
2879+
;;
2880+
2881+
*/Library/Frameworks)
2882+
MDIR="`dirname "${enableval}"`"
2883+
MDIR="`dirname "${MDIR}"`"
2884+
FRAMEWORKINSTALLAPPSPREFIX="${MDIR}/Applications"
2885+
2886+
if test "${prefix}" = "NONE"; then
2887+
# User hasn't specified the
2888+
# --prefix option, but wants to install
2889+
# the framework in a non-default location,
2890+
# ensure that the compatibility links get
2891+
# installed relative to that prefix as well
2892+
# instead of in /usr/local.
2893+
FRAMEWORKUNIXTOOLSPREFIX="${MDIR}"
2894+
fi
2895+
;;
2896+
2897+
*)
2898+
FRAMEWORKINSTALLAPPSPREFIX="/Applications"
2899+
;;
2900+
esac
2901+
28642902
prefix=$PYTHONFRAMEWORKINSTALLDIR/Versions/$VERSION
28652903
28662904
# Add files for Mac specific code to the list of output
@@ -2906,6 +2944,7 @@ fi
29062944
29072945
29082946
2947+
29092948
##AC_ARG_WITH(dyld,
29102949
## AS_HELP_STRING([--with-dyld],
29112950
## [Use (OpenStep|Rhapsody) dynamic linker]))

configure.in

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,18 +179,55 @@ AC_ARG_ENABLE(framework,
179179
enable_framework=
180180
;;
181181
*)
182-
PYTHONFRAMEWORKPREFIX=$enableval
182+
PYTHONFRAMEWORKPREFIX="${enableval}"
183183
PYTHONFRAMEWORKINSTALLDIR=$PYTHONFRAMEWORKPREFIX/$PYTHONFRAMEWORKDIR
184184
FRAMEWORKINSTALLFIRST="frameworkinstallstructure"
185185
FRAMEWORKALTINSTALLFIRST="frameworkinstallstructure "
186186
FRAMEWORKINSTALLLAST="frameworkinstallmaclib frameworkinstallapps frameworkinstallunixtools"
187187
FRAMEWORKALTINSTALLLAST="frameworkinstallmaclib frameworkinstallapps frameworkaltinstallunixtools"
188+
FRAMEWORKINSTALLAPPSPREFIX="/Applications"
188189

189190
if test "x${prefix}" = "xNONE" ; then
190191
FRAMEWORKUNIXTOOLSPREFIX="${ac_default_prefix}"
192+
191193
else
192194
FRAMEWORKUNIXTOOLSPREFIX="${prefix}"
193195
fi
196+
197+
case "${enableval}" in
198+
/System*)
199+
FRAMEWORKINSTALLAPPSPREFIX="/Applications"
200+
if test "${prefix}" = "NONE" ; then
201+
# See below
202+
FRAMEWORKUNIXTOOLSPREFIX="/usr"
203+
fi
204+
;;
205+
206+
/Library*)
207+
FRAMEWORKINSTALLAPPSPREFIX="/Applications"
208+
;;
209+
210+
*/Library/Frameworks)
211+
MDIR="`dirname "${enableval}"`"
212+
MDIR="`dirname "${MDIR}"`"
213+
FRAMEWORKINSTALLAPPSPREFIX="${MDIR}/Applications"
214+
215+
if test "${prefix}" = "NONE"; then
216+
# User hasn't specified the
217+
# --prefix option, but wants to install
218+
# the framework in a non-default location,
219+
# ensure that the compatibility links get
220+
# installed relative to that prefix as well
221+
# instead of in /usr/local.
222+
FRAMEWORKUNIXTOOLSPREFIX="${MDIR}"
223+
fi
224+
;;
225+
226+
*)
227+
FRAMEWORKINSTALLAPPSPREFIX="/Applications"
228+
;;
229+
esac
230+
194231
prefix=$PYTHONFRAMEWORKINSTALLDIR/Versions/$VERSION
195232

196233
# Add files for Mac specific code to the list of output
@@ -227,6 +264,7 @@ AC_SUBST(FRAMEWORKINSTALLLAST)
227264
AC_SUBST(FRAMEWORKALTINSTALLFIRST)
228265
AC_SUBST(FRAMEWORKALTINSTALLLAST)
229266
AC_SUBST(FRAMEWORKUNIXTOOLSPREFIX)
267+
AC_SUBST(FRAMEWORKINSTALLAPPSPREFIX)
230268

231269
##AC_ARG_WITH(dyld,
232270
## AS_HELP_STRING([--with-dyld],

0 commit comments

Comments
 (0)