Skip to content

Commit 01d149f

Browse files
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).
1 parent c121f13 commit 01d149f

7 files changed

Lines changed: 116 additions & 24 deletions

File tree

‎Mac/IDLE/Makefile.in‎

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

2525
BUNDLEBULDER=$(srcdir)/../../Lib/plat-mac/bundlebuilder.py
2626

27-
PYTHONAPPSDIR=/Applications/$(PYTHONFRAMEWORK) $(VERSION)
27+
PYTHONAPPSDIR=@FRAMEWORKINSTALLAPPSPREFIX@/$(PYTHONFRAMEWORK) $(VERSION)
2828

2929
all: IDLE.app
3030

‎Mac/Makefile.in‎

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

2323
# These are normally glimpsed from the previous set
2424
bindir=$(prefix)/bin
25-
PYTHONAPPSDIR=/Applications/$(PYTHONFRAMEWORK) $(VERSION)
25+
PYTHONAPPSDIR=@FRAMEWORKINSTALLAPPSPREFIX@/$(PYTHONFRAMEWORK) $(VERSION)
2626
APPINSTALLDIR=$(prefix)/Resources/Python.app
2727

2828
# 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)/../../Lib/plat-mac/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
all: Python\ Launcher.app

‎Mac/README‎

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,24 @@ the Python distribution.
88
Mac-specific arguments to configure
99
===================================
1010

11-
* ``--enable-framework``
11+
* ``--enable-framework[=DIR]``
1212

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

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

2031
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
@@ -141,6 +141,9 @@ Build
141141

142142
- Issue #8509: Fix quoting in help strings and code snippets in configure.in.
143143

144+
- Issue #3646: It is now easily possible to install a Python framework into
145+
your home directory on MacOSX, see Mac/README for more information.
146+
144147

145148
What's New in Python 2.7 beta 1?
146149
================================

‎configure‎

Lines changed: 59 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#! /bin/sh
2-
# From configure.in Revision: 80443 .
2+
# From configure.in Revision: 80574 .
33
# Guess values for system-dependent variables and create Makefiles.
44
# Generated by GNU Autoconf 2.61 for python 2.7.
55
#
@@ -669,6 +669,7 @@ FRAMEWORKINSTALLLAST
669669
FRAMEWORKALTINSTALLFIRST
670670
FRAMEWORKALTINSTALLLAST
671671
FRAMEWORKUNIXTOOLSPREFIX
672+
FRAMEWORKINSTALLAPPSPREFIX
672673
MACHDEP
673674
SGI_ABI
674675
EXTRAPLATDIR
@@ -2018,18 +2019,55 @@ if test "${enable_framework+set}" = set; then
20182019
enable_framework=
20192020
;;
20202021
*)
2021-
PYTHONFRAMEWORKPREFIX=$enableval
2022+
PYTHONFRAMEWORKPREFIX="${enableval}"
20222023
PYTHONFRAMEWORKINSTALLDIR=$PYTHONFRAMEWORKPREFIX/$PYTHONFRAMEWORKDIR
20232024
FRAMEWORKINSTALLFIRST="frameworkinstallstructure"
20242025
FRAMEWORKALTINSTALLFIRST="frameworkinstallstructure bininstall maninstall"
20252026
FRAMEWORKINSTALLLAST="frameworkinstallmaclib frameworkinstallapps frameworkinstallunixtools"
20262027
FRAMEWORKALTINSTALLLAST="frameworkinstallmaclib frameworkinstallapps frameworkaltinstallunixtools"
2028+
FRAMEWORKINSTALLAPPSPREFIX="/Applications"
20272029

20282030
if test "x${prefix}" = "xNONE" ; then
20292031
FRAMEWORKUNIXTOOLSPREFIX="${ac_default_prefix}"
2032+
20302033
else
20312034
FRAMEWORKUNIXTOOLSPREFIX="${prefix}"
20322035
fi
2036+
2037+
case "${enableval}" in
2038+
/System*)
2039+
FRAMEWORKINSTALLAPPSPREFIX="/Applications"
2040+
if test "${prefix}" = "NONE" ; then
2041+
# See below
2042+
FRAMEWORKUNIXTOOLSPREFIX="/usr"
2043+
fi
2044+
;;
2045+
2046+
/Library*)
2047+
FRAMEWORKINSTALLAPPSPREFIX="/Applications"
2048+
;;
2049+
2050+
*/Library/Frameworks)
2051+
MDIR="`dirname "${enableval}"`"
2052+
MDIR="`dirname "${MDIR}"`"
2053+
FRAMEWORKINSTALLAPPSPREFIX="${MDIR}/Applications"
2054+
2055+
if test "${prefix}" = "NONE"; then
2056+
# User hasn't specified the
2057+
# --prefix option, but wants to install
2058+
# the framework in a non-default location,
2059+
# ensure that the compatibility links get
2060+
# installed relative to that prefix as well
2061+
# instead of in /usr/local.
2062+
FRAMEWORKUNIXTOOLSPREFIX="${MDIR}"
2063+
fi
2064+
;;
2065+
2066+
*)
2067+
FRAMEWORKINSTALLAPPSPREFIX="/Applications"
2068+
;;
2069+
esac
2070+
20332071
prefix=$PYTHONFRAMEWORKINSTALLDIR/Versions/$VERSION
20342072

20352073
# Add files for Mac specific code to the list of output
@@ -2077,6 +2115,7 @@ fi
20772115

20782116

20792117

2118+
20802119
##AC_ARG_WITH(dyld,
20812120
## AC_HELP_STRING(--with-dyld,
20822121
## Use (OpenStep|Rhapsody) dynamic linker))
@@ -3899,7 +3938,7 @@ else
38993938
{ echo "$as_me:$LINENO: result: no" >&5
39003939
echo "${ECHO_T}no" >&6; }
39013940
fi
3902-
rm -f conftest*
3941+
rm -f -r conftest*
39033942

39043943

39053944

@@ -5471,7 +5510,7 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
54715510
else
54725511
ac_cv_header_stdc=no
54735512
fi
5474-
rm -f conftest*
5513+
rm -f -r conftest*
54755514

54765515
fi
54775516

@@ -5492,7 +5531,7 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
54925531
else
54935532
ac_cv_header_stdc=no
54945533
fi
5495-
rm -f conftest*
5534+
rm -f -r conftest*
54965535

54975536
fi
54985537

@@ -6592,7 +6631,7 @@ _ACEOF
65926631

65936632

65946633
fi
6595-
rm -f conftest*
6634+
rm -f -r conftest*
65966635

65976636
{ echo "$as_me:$LINENO: result: $was_it_defined" >&5
65986637
echo "${ECHO_T}$was_it_defined" >&6; }
@@ -7129,7 +7168,7 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
71297168
else
71307169
ac_cv_type_uid_t=no
71317170
fi
7132-
rm -f conftest*
7171+
rm -f -r conftest*
71337172

71347173
fi
71357174
{ echo "$as_me:$LINENO: result: $ac_cv_type_uid_t" >&5
@@ -15952,7 +15991,7 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1595215991
else
1595315992
unistd_defines_pthreads=no
1595415993
fi
15955-
rm -f conftest*
15994+
rm -f -r conftest*
1595615995

1595715996
{ echo "$as_me:$LINENO: result: $unistd_defines_pthreads" >&5
1595815997
echo "${ECHO_T}$unistd_defines_pthreads" >&6; }
@@ -17566,7 +17605,7 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1756617605
$EGREP "yes" >/dev/null 2>&1; then
1756717606
ipv6type=$i
1756817607
fi
17569-
rm -f conftest*
17608+
rm -f -r conftest*
1757017609

1757117610
;;
1757217611
kame)
@@ -17589,7 +17628,7 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1758917628
ipv6libdir=/usr/local/v6/lib
1759017629
ipv6trylibc=yes
1759117630
fi
17592-
rm -f conftest*
17631+
rm -f -r conftest*
1759317632

1759417633
;;
1759517634
linux-glibc)
@@ -17610,7 +17649,7 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1761017649
ipv6type=$i;
1761117650
ipv6trylibc=yes
1761217651
fi
17613-
rm -f conftest*
17652+
rm -f -r conftest*
1761417653

1761517654
;;
1761617655
linux-inet6)
@@ -17648,7 +17687,7 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1764817687
ipv6lib=inet6;
1764917688
ipv6libdir=/usr/local/v6/lib
1765017689
fi
17651-
rm -f conftest*
17690+
rm -f -r conftest*
1765217691

1765317692
;;
1765417693
v6d)
@@ -17671,7 +17710,7 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1767117710
ipv6libdir=/usr/local/v6/lib;
1767217711
BASECFLAGS="-I/usr/local/v6/include $BASECFLAGS"
1767317712
fi
17674-
rm -f conftest*
17713+
rm -f -r conftest*
1767517714

1767617715
;;
1767717716
zeta)
@@ -17693,7 +17732,7 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1769317732
ipv6lib=inet6;
1769417733
ipv6libdir=/usr/local/v6/lib
1769517734
fi
17696-
rm -f conftest*
17735+
rm -f -r conftest*
1769717736

1769817737
;;
1769917738
esac
@@ -26239,7 +26278,7 @@ cat >>confdefs.h <<\_ACEOF
2623926278
_ACEOF
2624026279

2624126280
fi
26242-
rm -f conftest*
26281+
rm -f -r conftest*
2624326282

2624426283
cat >conftest.$ac_ext <<_ACEOF
2624526284
/* confdefs.h. */
@@ -26258,7 +26297,7 @@ cat >>confdefs.h <<\_ACEOF
2625826297
_ACEOF
2625926298

2626026299
fi
26261-
rm -f conftest*
26300+
rm -f -r conftest*
2626226301

2626326302
fi
2626426303

@@ -26528,7 +26567,7 @@ cat >>confdefs.h <<\_ACEOF
2652826567
_ACEOF
2652926568

2653026569
fi
26531-
rm -f conftest*
26570+
rm -f -r conftest*
2653226571

2653326572
fi
2653426573

@@ -28478,6 +28517,7 @@ FRAMEWORKINSTALLLAST!$FRAMEWORKINSTALLLAST$ac_delim
2847828517
FRAMEWORKALTINSTALLFIRST!$FRAMEWORKALTINSTALLFIRST$ac_delim
2847928518
FRAMEWORKALTINSTALLLAST!$FRAMEWORKALTINSTALLLAST$ac_delim
2848028519
FRAMEWORKUNIXTOOLSPREFIX!$FRAMEWORKUNIXTOOLSPREFIX$ac_delim
28520+
FRAMEWORKINSTALLAPPSPREFIX!$FRAMEWORKINSTALLAPPSPREFIX$ac_delim
2848128521
MACHDEP!$MACHDEP$ac_delim
2848228522
SGI_ABI!$SGI_ABI$ac_delim
2848328523
EXTRAPLATDIR!$EXTRAPLATDIR$ac_delim
@@ -28521,7 +28561,6 @@ OTHER_LIBTOOL_OPT!$OTHER_LIBTOOL_OPT$ac_delim
2852128561
LIBTOOL_CRUFT!$LIBTOOL_CRUFT$ac_delim
2852228562
SO!$SO$ac_delim
2852328563
LDSHARED!$LDSHARED$ac_delim
28524-
LDCXXSHARED!$LDCXXSHARED$ac_delim
2852528564
_ACEOF
2852628565

2852728566
if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
@@ -28563,6 +28602,7 @@ _ACEOF
2856328602
ac_delim='%!_!# '
2856428603
for ac_last_try in false false false false false :; do
2856528604
cat >conf$$subs.sed <<_ACEOF
28605+
LDCXXSHARED!$LDCXXSHARED$ac_delim
2856628606
BLDSHARED!$BLDSHARED$ac_delim
2856728607
CCSHARED!$CCSHARED$ac_delim
2856828608
LINKFORSHARED!$LINKFORSHARED$ac_delim
@@ -28593,7 +28633,7 @@ SRCDIRS!$SRCDIRS$ac_delim
2859328633
LTLIBOBJS!$LTLIBOBJS$ac_delim
2859428634
_ACEOF
2859528635

28596-
if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 28; then
28636+
if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 29; then
2859728637
break
2859828638
elif $ac_last_try; then
2859928639
{ { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5

‎configure.in‎

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,18 +190,55 @@ AC_ARG_ENABLE(framework,
190190
enable_framework=
191191
;;
192192
*)
193-
PYTHONFRAMEWORKPREFIX=$enableval
193+
PYTHONFRAMEWORKPREFIX="${enableval}"
194194
PYTHONFRAMEWORKINSTALLDIR=$PYTHONFRAMEWORKPREFIX/$PYTHONFRAMEWORKDIR
195195
FRAMEWORKINSTALLFIRST="frameworkinstallstructure"
196196
FRAMEWORKALTINSTALLFIRST="frameworkinstallstructure bininstall maninstall"
197197
FRAMEWORKINSTALLLAST="frameworkinstallmaclib frameworkinstallapps frameworkinstallunixtools"
198198
FRAMEWORKALTINSTALLLAST="frameworkinstallmaclib frameworkinstallapps frameworkaltinstallunixtools"
199+
FRAMEWORKINSTALLAPPSPREFIX="/Applications"
199200

200201
if test "x${prefix}" = "xNONE" ; then
201202
FRAMEWORKUNIXTOOLSPREFIX="${ac_default_prefix}"
203+
202204
else
203205
FRAMEWORKUNIXTOOLSPREFIX="${prefix}"
204206
fi
207+
208+
case "${enableval}" in
209+
/System*)
210+
FRAMEWORKINSTALLAPPSPREFIX="/Applications"
211+
if test "${prefix}" = "NONE" ; then
212+
# See below
213+
FRAMEWORKUNIXTOOLSPREFIX="/usr"
214+
fi
215+
;;
216+
217+
/Library*)
218+
FRAMEWORKINSTALLAPPSPREFIX="/Applications"
219+
;;
220+
221+
*/Library/Frameworks)
222+
MDIR="`dirname "${enableval}"`"
223+
MDIR="`dirname "${MDIR}"`"
224+
FRAMEWORKINSTALLAPPSPREFIX="${MDIR}/Applications"
225+
226+
if test "${prefix}" = "NONE"; then
227+
# User hasn't specified the
228+
# --prefix option, but wants to install
229+
# the framework in a non-default location,
230+
# ensure that the compatibility links get
231+
# installed relative to that prefix as well
232+
# instead of in /usr/local.
233+
FRAMEWORKUNIXTOOLSPREFIX="${MDIR}"
234+
fi
235+
;;
236+
237+
*)
238+
FRAMEWORKINSTALLAPPSPREFIX="/Applications"
239+
;;
240+
esac
241+
205242
prefix=$PYTHONFRAMEWORKINSTALLDIR/Versions/$VERSION
206243

207244
# Add files for Mac specific code to the list of output
@@ -239,6 +276,7 @@ AC_SUBST(FRAMEWORKINSTALLLAST)
239276
AC_SUBST(FRAMEWORKALTINSTALLFIRST)
240277
AC_SUBST(FRAMEWORKALTINSTALLLAST)
241278
AC_SUBST(FRAMEWORKUNIXTOOLSPREFIX)
279+
AC_SUBST(FRAMEWORKINSTALLAPPSPREFIX)
242280

243281
##AC_ARG_WITH(dyld,
244282
## AC_HELP_STRING(--with-dyld,

0 commit comments

Comments
 (0)