diff options
| author | Liam P. White <inkscapebrony@gmail.com> | 2014-10-16 23:36:32 +0000 |
|---|---|---|
| committer | Liam P. White <inkscapebrony@gmail.com> | 2014-10-16 23:36:32 +0000 |
| commit | b2c02c3cd7513b6fad49a0bd0c669f9a581f5cc8 (patch) | |
| tree | 7d37d088e9179f631f22143a980157da49a331a9 /packaging/macosx/ports/lang/python26 | |
| parent | Removed dangerous GTK-mimicking macros. (diff) | |
| parent | update to trunk (r13610) (diff) | |
| download | inkscape-b2c02c3cd7513b6fad49a0bd0c669f9a581f5cc8.tar.gz inkscape-b2c02c3cd7513b6fad49a0bd0c669f9a581f5cc8.zip | |
Merge in osx-packaging-update branch. OS X packaging now works correctly for trunk.
(bzr r13620)
Diffstat (limited to 'packaging/macosx/ports/lang/python26')
12 files changed, 348 insertions, 0 deletions
diff --git a/packaging/macosx/ports/lang/python26/Portfile b/packaging/macosx/ports/lang/python26/Portfile new file mode 100644 index 000000000..c72cd28d5 --- /dev/null +++ b/packaging/macosx/ports/lang/python26/Portfile @@ -0,0 +1,158 @@ +# $Id: Portfile 49077 2009-04-03 07:13:13Z erickt@macports.org $ + +PortSystem 1.0 +PortGroup select 1.0 + +name python26 +version 2.6.1 +revision 100 +set major [lindex [split $version .] 0] +set branch [join [lrange [split ${version} .] 0 1] .] +categories lang +platforms darwin +maintainers blb mcalhoun + +description An interpreted, object-oriented programming language +long_description Python is an interpreted, interactive, object-oriented \ + programming language. + +homepage http://www.python.org/ +master_sites ${homepage}/ftp/python/${version}/ \ + ftp://ftp.python.org/pub/python/${version}/ + +distname Python-${version} +use_bzip2 yes + +checksums md5 e81c2f0953aa60f8062c05a4673f2be0 \ + sha1 419f0cb29e9713ea861dde8c43d107c51329e57b \ + rmd160 497dafaca9c150fca611b0175eeb13c2fc4d3e2d + +# patch-Lib-distutils-dist.py.diff comes from +# <http://bugs.python.org/issue1180> +patchfiles patch-Makefile.pre.in.diff \ + patch-setup.py.diff \ + patch-Lib-cgi.py.diff \ + patch-Lib-distutils-dist.py.diff \ + patch-Mac-IDLE-Makefile.in.diff \ + patch-Mac-Makefile.in.diff \ + patch-Mac-PythonLauncher-Makefile.in.diff \ + patch-Mac-Tools-Doc-setup.py.diff + +depends_lib port:gettext port:zlib port:openssl port:tk \ + port:sqlite3 port:db46 port:ncurses port:gdbm \ + port:bzip2 port:readline + +configure.args --enable-framework=${frameworks_dir} \ + --enable-ipv6 + +use_parallel_build no + +post-patch { + reinplace "s|@@PREFIX@@|${prefix}|g" ${worksrcpath}/Lib/cgi.py + reinplace "s|@@APPLICATIONS_DIR@@|${applications_dir}|g" \ + ${worksrcpath}/Mac/Makefile.in ${worksrcpath}/Mac/IDLE/Makefile.in \ + ${worksrcpath}/Mac/Tools/Doc/setup.py \ + ${worksrcpath}/Mac/PythonLauncher/Makefile.in + + # See http://trac.macports.org/changeset/37861 + reinplace "s|xargs -0 rm -r|/usr/bin/xargs -0 /bin/rm -r|g" \ + ${worksrcpath}/Mac/PythonLauncher/Makefile.in +} + +build.target all + +test.run yes +test.target test + +destroot.target frameworkinstall maninstall + +# ensure that correct compiler is used +build.args-append MAKE="${build.cmd} CC=${configure.cc}" +destroot.args-append MAKE="${destroot.cmd} CC=${configure.cc}" + +select.group python +select.file ${filespath}/python[string map {. {}} ${branch}] + +post-destroot { + set framewpath ${frameworks_dir}/Python.framework + set framewdir ${framewpath}/Versions/${branch} + + foreach dir { Headers Resources Python Versions/Current } { + file delete ${destroot}${framewpath}/${dir} + } + + ln -s ${framewdir}/share/man/man1/python.1 ${destroot}${prefix}/share/man/man1/python${branch}.1 + + # Without this, LINKFORSHARED is set to + # ... $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK) + # (this becomes Python.framework/Versions/2.6/Python) which doesn't + # quite work (see ticket #15099); instead specifically list the + # full path to the proper Python framework file (which becomes + # ${prefix}/Library/Frameworks/Python.framework/Versions/2.6/Python) + reinplace {s|^\(LINKFORSHARED=.*\)$(PYTHONFRAMEWORKDIR).*$|\1 $(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)|} ${destroot}${framewdir}/lib/python${branch}/config/Makefile + + # The framework version.plist isn't currently being installed so + # we'll copy ours for now (see http://trac.macports.org/ticket/18773 and + # http://bugs.python.org/issue4937) + xinstall -m 644 ${filespath}/version.plist \ + ${destroot}${framewdir}/Resources/version.plist +} + +post-activate { + ui_msg "\nTo fully complete your installation and make python $branch the default, please run +\n\tsudo port install python_select \ +\n\tsudo python_select $name\n" +} + +platform darwin { + post-configure { + # See http://trac.macports.org/ticket/18376 + system "cd ${worksrcpath} && ed - pyconfig.h < ${filespath}/pyconfig.ed" + } +} + +platform darwin 7 { + # there is no SystemStubs on 10.3 + post-patch { + reinplace "s|-lSystemStubs||g" ${worksrcpath}/configure \ + ${worksrcpath}/configure.in + } + post-configure { + reinplace "s|-lSystemStubs||g" ${worksrcpath}/Makefile.pre.in \ + ${worksrcpath}/Makefile.pre ${worksrcpath}/Makefile + } + # To avoid GCC incompatibility issue. See http://nxg.me.uk/note/2004/restFP/ (by ebgssth at gmail.com, ticket #13322) + configure.ldflags-append "-lcc_dynamic" +} + +platform darwin 10 { + configure.compiler gcc-4.2 +} + +variant universal { + post-patch { + set universal_arch_flags {} + set arch_run_32bit {} + foreach arch ${universal_archs} { + lappend universal_arch_flags -arch ${arch} + if { ${arch}=="i386" || ${arch}=="ppc" } { + lappend arch_run_32bit -${arch} + } + } + reinplace \ + "s|UNIVERSAL_ARCH_FLAGS=\".*\"|UNIVERSAL_ARCH_FLAGS=\"${universal_arch_flags}\"|" \ + ${worksrcpath}/configure + reinplace \ + "s|ARCH_RUN_32BIT=\".*\"|ARCH_RUN_32BIT=\"arch ${arch_run_32bit}\"|" \ + ${worksrcpath}/configure + } + configure.args-append --enable-universalsdk=${universal_sysroot} +} + +variant ucs4 description {Enable support for UCS4} { + configure.args-append --enable-unicode=ucs4 +} + +#livecheck.check regex +#livecheck.url ${homepage}download/releases/ +#livecheck.regex Python (${branch}(?:\\.\\d+)*) diff --git a/packaging/macosx/ports/lang/python26/files/patch-Lib-cgi.py.diff b/packaging/macosx/ports/lang/python26/files/patch-Lib-cgi.py.diff new file mode 100644 index 000000000..fb861bc82 --- /dev/null +++ b/packaging/macosx/ports/lang/python26/files/patch-Lib-cgi.py.diff @@ -0,0 +1,18 @@ +--- Lib/cgi.py.orig 2006-08-10 19:41:07.000000000 +0200 ++++ Lib/cgi.py 2007-08-21 15:36:54.000000000 +0200 +@@ -1,13 +1,6 @@ +-#! /usr/local/bin/python ++#! @@PREFIX@@/bin/python2.6 + +-# NOTE: the above "/usr/local/bin/python" is NOT a mistake. It is +-# intentionally NOT "/usr/bin/env python". On many systems +-# (e.g. Solaris), /usr/local/bin is not in $PATH as passed to CGI +-# scripts, and /usr/local/bin is the default directory where Python is +-# installed, so /usr/bin/env would be unable to find python. Granted, +-# binary installations by Linux vendors often install Python in +-# /usr/bin. So let those vendors patch cgi.py to match their choice +-# of installation. ++# NOTE: /usr/local/bin/python patched for MacPorts installation + + """Support module for CGI (Common Gateway Interface) scripts. + diff --git a/packaging/macosx/ports/lang/python26/files/patch-Lib-distutils-dist.py.diff b/packaging/macosx/ports/lang/python26/files/patch-Lib-distutils-dist.py.diff new file mode 100644 index 000000000..45276c555 --- /dev/null +++ b/packaging/macosx/ports/lang/python26/files/patch-Lib-distutils-dist.py.diff @@ -0,0 +1,51 @@ +--- Lib/distutils/dist.py.orig 2008-09-03 05:13:56.000000000 -0600 ++++ Lib/distutils/dist.py 2008-10-03 18:33:47.000000000 -0600 +@@ -60,6 +60,7 @@ + ('quiet', 'q', "run quietly (turns verbosity off)"), + ('dry-run', 'n', "don't actually do anything"), + ('help', 'h', "show detailed help message"), ++ ('no-user-cfg', None,'ignore pydistutils.cfg in your home directory'), + ] + + # 'common_usage' is a short (2-3 line) string describing the common +@@ -267,6 +268,12 @@ + else: + sys.stderr.write(msg + "\n") + ++ # no-user-cfg is handled before other command line args ++ # because other args override the config files, and this ++ # one is needed before we can load the config files. ++ # If attrs['script_args'] wasn't passed, assume false. ++ self.want_user_cfg = '--no-user-cfg' not in (self.script_args or []) ++ + self.finalize_options() + + # __init__ () +@@ -327,6 +334,9 @@ + Distutils __inst__.py file lives), a file in the user's home + directory named .pydistutils.cfg on Unix and pydistutils.cfg + on Windows/Mac, and setup.cfg in the current directory. ++ ++ The file in the user's home directory can be disabled with the ++ --no-user-cfg option. + """ + files = [] + check_environ() +@@ -347,7 +357,7 @@ + + # And look for the user config file + user_file = os.path.join(os.path.expanduser('~'), user_filename) +- if os.path.isfile(user_file): ++ if self.want_user_cfg and os.path.isfile(user_file): + files.append(user_file) + + # All platforms support local setup.cfg +@@ -355,6 +365,8 @@ + if os.path.isfile(local_file): + files.append(local_file) + ++ if DEBUG: ++ print "using config files: %s" % ', '.join(files) + return files + + # find_config_files () diff --git a/packaging/macosx/ports/lang/python26/files/patch-Mac-IDLE-Makefile.in.diff b/packaging/macosx/ports/lang/python26/files/patch-Mac-IDLE-Makefile.in.diff new file mode 100644 index 000000000..bafcf4715 --- /dev/null +++ b/packaging/macosx/ports/lang/python26/files/patch-Mac-IDLE-Makefile.in.diff @@ -0,0 +1,11 @@ +--- Mac/IDLE/Makefile.in.orig 2008-07-17 23:48:03.000000000 -0600 ++++ Mac/IDLE/Makefile.in 2008-10-04 19:50:50.000000000 -0600 +@@ -22,7 +22,7 @@ + + BUNDLEBULDER=$(srcdir)/../../Lib/plat-mac/bundlebuilder.py + +-PYTHONAPPSDIR=/Applications/$(PYTHONFRAMEWORK) $(VERSION) ++PYTHONAPPSDIR=@@APPLICATIONS_DIR@@/$(PYTHONFRAMEWORK) $(VERSION) + + all: IDLE.app + diff --git a/packaging/macosx/ports/lang/python26/files/patch-Mac-Makefile.in.diff b/packaging/macosx/ports/lang/python26/files/patch-Mac-Makefile.in.diff new file mode 100644 index 000000000..cfa5f88ff --- /dev/null +++ b/packaging/macosx/ports/lang/python26/files/patch-Mac-Makefile.in.diff @@ -0,0 +1,11 @@ +--- Mac/Makefile.in.orig 2008-07-22 01:06:33.000000000 -0600 ++++ Mac/Makefile.in 2008-10-04 19:51:40.000000000 -0600 +@@ -18,7 +18,7 @@ + + # These are normally glimpsed from the previous set + bindir=$(prefix)/bin +-PYTHONAPPSDIR=/Applications/$(PYTHONFRAMEWORK) $(VERSION) ++PYTHONAPPSDIR=@@APPLICATIONS_DIR@@/$(PYTHONFRAMEWORK) $(VERSION) + APPINSTALLDIR=$(prefix)/Resources/Python.app + + # Variables for installing the "normal" unix binaries diff --git a/packaging/macosx/ports/lang/python26/files/patch-Mac-PythonLauncher-Makefile.in.diff b/packaging/macosx/ports/lang/python26/files/patch-Mac-PythonLauncher-Makefile.in.diff new file mode 100644 index 000000000..be74da903 --- /dev/null +++ b/packaging/macosx/ports/lang/python26/files/patch-Mac-PythonLauncher-Makefile.in.diff @@ -0,0 +1,11 @@ +--- Mac/PythonLauncher/Makefile.in.orig 2008-05-02 13:58:56.000000000 -0600 ++++ Mac/PythonLauncher/Makefile.in 2008-10-04 19:52:27.000000000 -0600 +@@ -21,7 +21,7 @@ + + BUNDLEBULDER=$(srcdir)/../../Lib/plat-mac/bundlebuilder.py + +-PYTHONAPPSDIR=/Applications/$(PYTHONFRAMEWORK) $(VERSION) ++PYTHONAPPSDIR=@@APPLICATIONS_DIR@@/$(PYTHONFRAMEWORK) $(VERSION) + OBJECTS=FileSettings.o MyAppDelegate.o MyDocument.o PreferencesWindowController.o doscript.o main.o + + all: Python\ Launcher.app diff --git a/packaging/macosx/ports/lang/python26/files/patch-Mac-Tools-Doc-setup.py.diff b/packaging/macosx/ports/lang/python26/files/patch-Mac-Tools-Doc-setup.py.diff new file mode 100644 index 000000000..63e4e11d2 --- /dev/null +++ b/packaging/macosx/ports/lang/python26/files/patch-Mac-Tools-Doc-setup.py.diff @@ -0,0 +1,11 @@ +--- Mac/Tools/Doc/setup.py.diff 2008-03-29 09:24:25.000000000 -0600 ++++ Mac/Tools/Doc/setup.py 2008-10-04 19:53:40.000000000 -0600 +@@ -30,7 +30,7 @@ + + MAJOR_VERSION='2.4' + MINOR_VERSION='2.4.1' +-DESTDIR='/Applications/MacPython-%s/PythonIDE.app/Contents/Resources/English.lproj/PythonDocumentation' % MAJOR_VERSION ++DESTDIR='@@APPLICATIONS_DIR@@/MacPython-%s/PythonIDE.app/Contents/Resources/English.lproj/PythonDocumentation' % MAJOR_VERSION + + class DocBuild(build): + def initialize_options(self): diff --git a/packaging/macosx/ports/lang/python26/files/patch-Makefile.pre.in.diff b/packaging/macosx/ports/lang/python26/files/patch-Makefile.pre.in.diff new file mode 100644 index 000000000..60cd69706 --- /dev/null +++ b/packaging/macosx/ports/lang/python26/files/patch-Makefile.pre.in.diff @@ -0,0 +1,31 @@ +--- Makefile.pre.in.orig 2008-06-19 20:47:03.000000000 -0600 ++++ Makefile.pre.in 2008-07-28 19:57:15.000000000 -0600 +@@ -394,8 +394,8 @@ + # Build the shared modules + sharedmods: $(BUILDPYTHON) + @case $$MAKEFLAGS in \ +- *s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py -q build;; \ +- *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \ ++ *s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py -q --no-user-cfg build;; \ ++ *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py --no-user-cfg build;; \ + esac + + # Build static library +@@ -993,7 +993,7 @@ + # Install the dynamically loadable modules + # This goes into $(exec_prefix) + sharedinstall: +- $(RUNSHARED) ./$(BUILDPYTHON) -E $(srcdir)/setup.py install \ ++ $(RUNSHARED) ./$(BUILDPYTHON) -E $(srcdir)/setup.py --no-user-cfg install \ + --prefix=$(prefix) \ + --install-scripts=$(BINDIR) \ + --install-platlib=$(DESTSHARED) \ +@@ -1073,7 +1073,7 @@ + # This installs a few of the useful scripts in Tools/scripts + scriptsinstall: + SRCDIR=$(srcdir) $(RUNSHARED) \ +- ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/setup.py install \ ++ ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/setup.py --no-user-cfg install \ + --prefix=$(prefix) \ + --install-scripts=$(BINDIR) \ + --root=/$(DESTDIR) diff --git a/packaging/macosx/ports/lang/python26/files/patch-setup.py.diff b/packaging/macosx/ports/lang/python26/files/patch-setup.py.diff new file mode 100644 index 000000000..3acb4ac2b --- /dev/null +++ b/packaging/macosx/ports/lang/python26/files/patch-setup.py.diff @@ -0,0 +1,16 @@ +--- setup.py.orig 2008-09-29 18:15:45.000000000 -0600 ++++ setup.py 2008-11-30 23:13:09.000000000 -0700 +@@ -1506,13 +1506,7 @@ + def detect_tkinter(self, inc_dirs, lib_dirs): + # The _tkinter module. + +- # Rather than complicate the code below, detecting and building +- # AquaTk is a separate method. Only one Tkinter will be built on +- # Darwin - either AquaTk, if it is found, or X11 based Tk. + platform = self.get_platform() +- if (platform == 'darwin' and +- self.detect_tkinter_darwin(inc_dirs, lib_dirs)): +- return + + # Assume we haven't found any of the libraries or include files + # The versions with dots are used on Unix, and the versions without diff --git a/packaging/macosx/ports/lang/python26/files/pyconfig.ed b/packaging/macosx/ports/lang/python26/files/pyconfig.ed new file mode 100644 index 000000000..671d0d560 --- /dev/null +++ b/packaging/macosx/ports/lang/python26/files/pyconfig.ed @@ -0,0 +1,2 @@ +g,.*\(HAVE_POLL[_A-Z]*\).*,s,,/* #undef \1 */, +w diff --git a/packaging/macosx/ports/lang/python26/files/python26 b/packaging/macosx/ports/lang/python26/files/python26 new file mode 100644 index 000000000..5be5fa655 --- /dev/null +++ b/packaging/macosx/ports/lang/python26/files/python26 @@ -0,0 +1,12 @@ +bin/python2.6 +bin/pythonw2.6 +bin/python2.6-config +bin/idle2.6 +bin/pydoc2.6 +bin/smtpd2.6.py +- +share/man/man1/python2.6.1.gz +${frameworks_dir}/Library/Frameworks/Python.framework/Versions/2.6 +${frameworks_dir}/Library/Frameworks/Python.framework/Versions/2.6/Headers +${frameworks_dir}/Library/Frameworks/Python.framework/Versions/2.6/Resources +${frameworks_dir}/Library/Frameworks/Python.framework/Versions/2.6/Python diff --git a/packaging/macosx/ports/lang/python26/files/version.plist b/packaging/macosx/ports/lang/python26/files/version.plist new file mode 100644 index 000000000..acdfe5bac --- /dev/null +++ b/packaging/macosx/ports/lang/python26/files/version.plist @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>BuildVersion</key> + <string>1</string> + <key>CFBundleShortVersionString</key> + <string>2.6.1</string> + <key>CFBundleVersion</key> + <string>2.6.1</string> + <key>ProjectName</key> + <string>Python</string> + <key>SourceVersion</key> + <string>2.6.1</string> +</dict> +</plist> |
