From de9c869fb8c1f842bc3dfc4d51f287cb6b644ab2 Mon Sep 17 00:00:00 2001 From: Benjamin Peterson Date: Tue, 1 Jul 2008 18:23:09 +0000 Subject: Hopefully fix make framework install on Mac (see 3174) Removal of the Mac modules broke many of the Mac scripts (including BuildApplet.py) so the building of the Python launcher and IDLE.app was broken. I manually copied built versions of those apps into Mac. Everything else which used Mac modules had to die. --- Mac/IDLE/IDLE.app/Contents/Info.plist | 57 +++++++++++++ Mac/IDLE/IDLE.app/Contents/MacOS/IDLE | 23 ++++++ Mac/IDLE/IDLE.app/Contents/MacOS/Python | 1 + Mac/IDLE/IDLE.app/Contents/PkgInfo | 1 + Mac/IDLE/IDLE.app/Contents/Resources/IDLE.icns | Bin 0 -> 53456 bytes .../Contents/Resources/PythonCompiled.icns | Bin 0 -> 60777 bytes .../IDLE.app/Contents/Resources/PythonSource.icns | Bin 0 -> 54522 bytes Mac/IDLE/IDLE.app/Contents/Resources/idlemain.py | 30 +++++++ Mac/IDLE/Info.plist.in | 55 ------------- Mac/IDLE/Makefile.in | 60 -------------- Mac/IDLE/config-extensions.def | 88 --------------------- Mac/IDLE/config-main.def | 79 ------------------ 12 files changed, 112 insertions(+), 282 deletions(-) create mode 100644 Mac/IDLE/IDLE.app/Contents/Info.plist create mode 100755 Mac/IDLE/IDLE.app/Contents/MacOS/IDLE create mode 120000 Mac/IDLE/IDLE.app/Contents/MacOS/Python create mode 100644 Mac/IDLE/IDLE.app/Contents/PkgInfo create mode 100644 Mac/IDLE/IDLE.app/Contents/Resources/IDLE.icns create mode 100644 Mac/IDLE/IDLE.app/Contents/Resources/PythonCompiled.icns create mode 100644 Mac/IDLE/IDLE.app/Contents/Resources/PythonSource.icns create mode 100644 Mac/IDLE/IDLE.app/Contents/Resources/idlemain.py delete mode 100644 Mac/IDLE/Info.plist.in delete mode 100644 Mac/IDLE/Makefile.in delete mode 100644 Mac/IDLE/config-extensions.def delete mode 100644 Mac/IDLE/config-main.def (limited to 'Mac/IDLE') diff --git a/Mac/IDLE/IDLE.app/Contents/Info.plist b/Mac/IDLE/IDLE.app/Contents/Info.plist new file mode 100644 index 0000000000..a097c1a74c --- /dev/null +++ b/Mac/IDLE/IDLE.app/Contents/Info.plist @@ -0,0 +1,57 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleDocumentTypes + + + CFBundleTypeExtensions + + py + pyw + + CFBundleTypeIconFile + PythonSource.icns + CFBundleTypeName + Python Script + CFBundleTypeRole + Editor + + + CFBundleTypeExtensions + + pyc + pyo + + CFBundleTypeIconFile + PythonCompiled.icns + CFBundleTypeName + Python Bytecode Document + CFBundleTypeRole + Editor + + + CFBundleExecutable + IDLE + CFBundleGetInfoString + 2.6.0, © 001-2006 Python Software Foundation + CFBundleIconFile + IDLE.icns + CFBundleIdentifier + org.python.IDLE + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + IDLE + CFBundlePackageType + APPL + CFBundleShortVersionString + 2.6.0 + CFBundleSignature + ???? + CFBundleVersion + 2.6.0 + + diff --git a/Mac/IDLE/IDLE.app/Contents/MacOS/IDLE b/Mac/IDLE/IDLE.app/Contents/MacOS/IDLE new file mode 100755 index 0000000000..15afffab30 --- /dev/null +++ b/Mac/IDLE/IDLE.app/Contents/MacOS/IDLE @@ -0,0 +1,23 @@ +#!/Library/Frameworks/Python.framework/Versions/3.0/Resources/Python.app/Contents/MacOS/Python + +import sys, os +execdir = os.path.dirname(sys.argv[0]) +executable = os.path.join(execdir, "Python") +resdir = os.path.join(os.path.dirname(execdir), "Resources") +libdir = os.path.join(os.path.dirname(execdir), "Frameworks") +mainprogram = os.path.join(resdir, "idlemain.py") + +sys.argv.insert(1, mainprogram) +if 0 or 0: + os.environ["PYTHONPATH"] = resdir + if 0: + os.environ["PYTHONHOME"] = resdir +else: + pypath = os.getenv("PYTHONPATH", "") + if pypath: + pypath = ":" + pypath + os.environ["PYTHONPATH"] = resdir + pypath +os.environ["PYTHONEXECUTABLE"] = executable +os.environ["DYLD_LIBRARY_PATH"] = libdir +os.environ["DYLD_FRAMEWORK_PATH"] = libdir +os.execve(executable, sys.argv, os.environ) diff --git a/Mac/IDLE/IDLE.app/Contents/MacOS/Python b/Mac/IDLE/IDLE.app/Contents/MacOS/Python new file mode 120000 index 0000000000..c8ff9490e8 --- /dev/null +++ b/Mac/IDLE/IDLE.app/Contents/MacOS/Python @@ -0,0 +1 @@ +/Library/Frameworks/Python.framework/Versions/2.6/Resources/Python.app/Contents/MacOS/Python \ No newline at end of file diff --git a/Mac/IDLE/IDLE.app/Contents/PkgInfo b/Mac/IDLE/IDLE.app/Contents/PkgInfo new file mode 100644 index 0000000000..bd04210fb4 --- /dev/null +++ b/Mac/IDLE/IDLE.app/Contents/PkgInfo @@ -0,0 +1 @@ +APPL???? \ No newline at end of file diff --git a/Mac/IDLE/IDLE.app/Contents/Resources/IDLE.icns b/Mac/IDLE/IDLE.app/Contents/Resources/IDLE.icns new file mode 100644 index 0000000000..c12c9da52a Binary files /dev/null and b/Mac/IDLE/IDLE.app/Contents/Resources/IDLE.icns differ diff --git a/Mac/IDLE/IDLE.app/Contents/Resources/PythonCompiled.icns b/Mac/IDLE/IDLE.app/Contents/Resources/PythonCompiled.icns new file mode 100644 index 0000000000..7d9f3202c7 Binary files /dev/null and b/Mac/IDLE/IDLE.app/Contents/Resources/PythonCompiled.icns differ diff --git a/Mac/IDLE/IDLE.app/Contents/Resources/PythonSource.icns b/Mac/IDLE/IDLE.app/Contents/Resources/PythonSource.icns new file mode 100644 index 0000000000..9e35c1ecbe Binary files /dev/null and b/Mac/IDLE/IDLE.app/Contents/Resources/PythonSource.icns differ diff --git a/Mac/IDLE/IDLE.app/Contents/Resources/idlemain.py b/Mac/IDLE/IDLE.app/Contents/Resources/idlemain.py new file mode 100644 index 0000000000..9b5273899f --- /dev/null +++ b/Mac/IDLE/IDLE.app/Contents/Resources/idlemain.py @@ -0,0 +1,30 @@ +""" +Bootstrap script for IDLE as an application bundle. +""" +import sys, os + +from idlelib.PyShell import main + +# Change the current directory the user's home directory, that way we'll get +# a more useful default location in the open/save dialogs. +os.chdir(os.path.expanduser('~/Documents')) + + +# Make sure sys.executable points to the python interpreter inside the +# framework, instead of at the helper executable inside the application +# bundle (the latter works, but doesn't allow access to the window server) +if sys.executable.endswith('-32'): + sys.executable = os.path.join(sys.prefix, 'bin', 'python-32') +else: + sys.executable = os.path.join(sys.prefix, 'bin', 'python') + +# Look for the -psn argument that the launcher adds and remove it, it will +# only confuse the IDLE startup code. +for idx, value in enumerate(sys.argv): + if value.startswith('-psn_'): + del sys.argv[idx] + break + +#argvemulator.ArgvCollector().mainloop() +if __name__ == '__main__': + main() diff --git a/Mac/IDLE/Info.plist.in b/Mac/IDLE/Info.plist.in deleted file mode 100644 index 58e913c569..0000000000 --- a/Mac/IDLE/Info.plist.in +++ /dev/null @@ -1,55 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleDocumentTypes - - - CFBundleTypeExtensions - - py - pyw - - CFBundleTypeIconFile - PythonSource.icns - CFBundleTypeName - Python Script - CFBundleTypeRole - Editor - - - CFBundleTypeExtensions - - pyc - pyo - - CFBundleTypeIconFile - PythonCompiled.icns - CFBundleTypeName - Python Bytecode Document - CFBundleTypeRole - Editor - - - CFBundleExecutable - IDLE - CFBundleGetInfoString - %VERSION%, © 001-2006 Python Software Foundation - CFBundleIconFile - IDLE.icns - CFBundleIdentifier - org.python.IDLE - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - IDLE - CFBundlePackageType - APPL - CFBundleShortVersionString - %VERSION% - CFBundleVersion - %VERSION% - - diff --git a/Mac/IDLE/Makefile.in b/Mac/IDLE/Makefile.in deleted file mode 100644 index 35f739d00b..0000000000 --- a/Mac/IDLE/Makefile.in +++ /dev/null @@ -1,60 +0,0 @@ -prefix=@prefix@ -CC=@CC@ -LD=@CC@ -BASECFLAGS=@BASECFLAGS@ -OPT=@OPT@ -CFLAGS=$(BASECFLAGS) $(OPT) -LDFLAGS=@LDFLAGS@ -srcdir= @srcdir@ -VERSION= @VERSION@ -UNIVERSALSDK=@UNIVERSALSDK@ -builddir= ../.. -PYTHONFRAMEWORK=@PYTHONFRAMEWORK@ - -RUNSHARED= @RUNSHARED@ -BUILDEXE= @BUILDEXEEXT@ -BUILDPYTHON= $(builddir)/python$(BUILDEXE) - -# Deployment target selected during configure, to be checked -# by distutils -MACOSX_DEPLOYMENT_TARGET=@CONFIGURE_MACOSX_DEPLOYMENT_TARGET@ -@EXPORT_MACOSX_DEPLOYMENT_TARGET@export MACOSX_DEPLOYMENT_TARGET - -BUNDLEBULDER=$(srcdir)/../../Lib/plat-mac/bundlebuilder.py - -PYTHONAPPSDIR=/Applications/$(PYTHONFRAMEWORK) $(VERSION) - -all: IDLE.app - -install: IDLE.app $(srcdir)/config-main.def $(srcdir)/config-extensions.def - test -d "$(DESTDIR)$(PYTHONAPPSDIR)" || mkdir -p "$(DESTDIR)$(PYTHONAPPSDIR)" - -test -d "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app" && rm -r "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app" - cp -PR IDLE.app "$(DESTDIR)$(PYTHONAPPSDIR)" - touch "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app" - cp $(srcdir)/config-main.def "$(DESTDIR)$(prefix)/lib/python$(VERSION)/idlelib/config-main.def" - cp $(srcdir)/config-extensions.def "$(DESTDIR)$(prefix)/lib/python$(VERSION)/idlelib/config-extensions.def" - -clean: - rm -rf IDLE.app - -IDLE.app: \ - $(srcdir)/../Icons/IDLE.icns $(srcdir)/idlemain.py \ - $(srcdir)/../Icons/PythonSource.icns \ - $(srcdir)/../Icons/PythonCompiled.icns Info.plist - rm -fr IDLE.app - $(RUNSHARED) $(BUILDPYTHON) $(BUNDLEBULDER) \ - --builddir=. \ - --name=IDLE \ - --link-exec \ - --plist=Info.plist \ - --mainprogram=$(srcdir)/idlemain.py \ - --iconfile=$(srcdir)/../Icons/IDLE.icns \ - --resource=$(srcdir)/../Icons/PythonSource.icns \ - --resource=$(srcdir)/../Icons/PythonCompiled.icns \ - --python=$(prefix)/Resources/Python.app/Contents/MacOS/Python \ - build - - -Info.plist: $(srcdir)/Info.plist.in - sed 's/%VERSION%/'"`$(RUNSHARED) $(BUILDPYTHON) -c 'import platform; print(platform.python_version())'`"'/g' < $(srcdir)/Info.plist.in > Info.plist - diff --git a/Mac/IDLE/config-extensions.def b/Mac/IDLE/config-extensions.def deleted file mode 100644 index c17f068e2d..0000000000 --- a/Mac/IDLE/config-extensions.def +++ /dev/null @@ -1,88 +0,0 @@ -# config-extensions.def -# -# IDLE reads several config files to determine user preferences. This -# file is the default configuration file for IDLE extensions settings. -# -# Each extension must have at least one section, named after the extension -# module. This section must contain an 'enable' item (=1 to enable the -# extension, =0 to disable it), it may contain 'enable_editor' or 'enable_shell' -# items, to apply it only to editor/shell windows, and may also contain any -# other general configuration items for the extension. -# -# Each extension must define at least one section named ExtensionName_bindings -# or ExtensionName_cfgBindings. If present, ExtensionName_bindings defines -# virtual event bindings for the extension that are not user re-configurable. -# If present, ExtensionName_cfgBindings defines virtual event bindings for the -# extension that may be sensibly re-configured. -# -# If there are no keybindings for a menus' virtual events, include lines like -# <>= (See [CodeContext], below.) -# -# Currently it is necessary to manually modify this file to change extension -# key bindings and default values. To customize, create -# ~/.idlerc/config-extensions.cfg and append the appropriate customized -# section(s). Those sections will override the defaults in this file. -# -# Note: If a keybinding is already in use when the extension is -# loaded, the extension's virtual event's keybinding will be set to ''. -# -# See config-keys.def for notes on specifying keys and extend.txt for -# information on creating IDLE extensions. - -[FormatParagraph] -enable=1 -[FormatParagraph_cfgBindings] -format-paragraph= - -[AutoExpand] -enable=1 -[AutoExpand_cfgBindings] -expand-word= - -[ZoomHeight] -enable=1 -[ZoomHeight_cfgBindings] -zoom-height= - -[ScriptBinding] -enable=1 -[ScriptBinding_cfgBindings] -run-module= -check-module= - -[CallTips] -enable=1 -[CallTips_cfgBindings] -force-open-calltip= -[CallTips_bindings] -try-open-calltip= -refresh-calltip= - -[ParenMatch] -enable=1 -style= expression -flash-delay= 500 -bell= 1 -[ParenMatch_cfgBindings] -flash-paren= -[ParenMatch_bindings] -paren-closed= - -[AutoComplete] -enable=1 -popupwait=2000 -[AutoComplete_cfgBindings] -force-open-completions= -[AutoComplete_bindings] -autocomplete= -try-open-completions= - -[CodeContext] -enable=1 -enable_shell=0 -numlines=3 -visible=0 -bgcolor=LightGray -fgcolor=Black -[CodeContext_bindings] -toggle-code-context= diff --git a/Mac/IDLE/config-main.def b/Mac/IDLE/config-main.def deleted file mode 100644 index 4691a85290..0000000000 --- a/Mac/IDLE/config-main.def +++ /dev/null @@ -1,79 +0,0 @@ -# IDLE reads several config files to determine user preferences. This -# file is the default config file for general idle settings. -# -# When IDLE starts, it will look in -# the following two sets of files, in order: -# -# default configuration -# --------------------- -# config-main.def the default general config file -# config-extensions.def the default extension config file -# config-highlight.def the default highlighting config file -# config-keys.def the default keybinding config file -# -# user configuration -# ------------------- -# ~/.idlerc/config-main.cfg the user general config file -# ~/.idlerc/config-extensions.cfg the user extension config file -# ~/.idlerc/config-highlight.cfg the user highlighting config file -# ~/.idlerc/config-keys.cfg the user keybinding config file -# -# On Windows2000 and Windows XP the .idlerc directory is at -# Documents and Settings\\.idlerc -# -# On Windows98 it is at c:\.idlerc -# -# Any options the user saves through the config dialog will be saved to -# the relevant user config file. Reverting any general setting to the -# default causes that entry to be wiped from the user file and re-read -# from the default file. User highlighting themes or keybinding sets are -# retained unless specifically deleted within the config dialog. Choosing -# one of the default themes or keysets just applies the relevant settings -# from the default file. -# -# Additional help sources are listed in the [HelpFiles] section and must be -# viewable by a web browser (or the Windows Help viewer in the case of .chm -# files). These sources will be listed on the Help menu. The pattern is -# -# You can't use a semi-colon in a menu item or path. The path will be platform -# specific because of path separators, drive specs etc. -# -# It is best to use the Configuration GUI to set up additional help sources! -# Example: -#1 = My Extra Help Source;/usr/share/doc/foo/index.html -#2 = Another Help Source;/path/to/another.pdf - -[General] -editor-on-startup= 0 -autosave= 0 -print-command-posix=lpr %s -print-command-win=start /min notepad /p %s -delete-exitfunc= 1 - -[EditorWindow] -width= 80 -height= 40 -font= courier -font-size= 10 -font-bold= 0 -encoding= none - -[FormatParagraph] -paragraph=70 - -[Indent] -use-spaces= 1 -num-spaces= 4 - -[Theme] -default= 1 -name= IDLE Classic - -[Keys] -default= 1 -name= IDLE Classic OSX - -[History] -cyclic=1 - -[HelpFiles] -- cgit v1.2.1