2013-08-06 11:12:45 +00:00
|
|
|
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
|
|
|
|
|
|
|
|
|
|
PortSystem 1.0
|
|
|
|
|
PortGroup select 1.0
|
2021-11-09 12:28:21 +11:00
|
|
|
PortGroup openssl 1.0
|
2019-09-17 15:49:45 +10:00
|
|
|
PortGroup deprecated 1.0
|
2013-08-06 11:12:45 +00:00
|
|
|
|
2016-08-05 16:52:01 +00:00
|
|
|
name python34
|
2013-08-06 11:12:45 +00:00
|
|
|
|
2017-08-12 16:13:35 +03:00
|
|
|
epoch 20170810
|
2018-02-05 16:43:10 +11:00
|
|
|
# Remember to keep py34-tkinter and py34-gdbm's versions sync'd with this
|
2019-03-19 08:18:49 +11:00
|
|
|
version 3.4.10
|
2022-06-07 07:18:40 +10:00
|
|
|
revision 10
|
2013-08-06 11:12:45 +00:00
|
|
|
|
2019-09-17 15:49:45 +10:00
|
|
|
deprecated.eol_version yes
|
|
|
|
|
|
2016-08-05 16:52:01 +00:00
|
|
|
set major [lindex [split $version .] 0]
|
|
|
|
|
set branch [join [lrange [split ${version} .] 0 1] .]
|
|
|
|
|
categories lang
|
|
|
|
|
license PSF
|
2017-09-08 07:35:09 +10:00
|
|
|
maintainers {jmr @jmroot} openmaintainer
|
2013-08-06 11:12:45 +00:00
|
|
|
|
2016-08-05 16:52:01 +00:00
|
|
|
description An interpreted, object-oriented programming language
|
|
|
|
|
long_description Python is an interpreted, interactive, object-oriented \
|
|
|
|
|
programming language.
|
2013-08-06 11:12:45 +00:00
|
|
|
|
2017-12-30 00:54:20 -08:00
|
|
|
homepage https://www.python.org/
|
2016-08-05 16:52:01 +00:00
|
|
|
master_sites ${homepage}ftp/python/${version}/
|
2013-08-06 11:12:45 +00:00
|
|
|
|
2016-08-05 16:52:01 +00:00
|
|
|
distname Python-${version}
|
|
|
|
|
use_xz yes
|
2019-03-19 08:18:49 +11:00
|
|
|
checksums md5 f88a98bce17a03c43a6a5f8a66ab2e62 \
|
|
|
|
|
rmd160 050bb8f215d9b5ed8287b2a9f9faa6448d7513a5 \
|
|
|
|
|
sha256 d46a8f6fe91679e199c671b1b0a30aaf172d2acb5bcab25beb35f16c3d195b4e
|
2013-08-06 11:12:45 +00:00
|
|
|
|
2016-08-05 16:52:01 +00:00
|
|
|
patchfiles patch-setup.py.diff \
|
|
|
|
|
patch-Lib-cgi.py.diff \
|
|
|
|
|
patch-configure.diff \
|
|
|
|
|
patch-Lib-ctypes-macholib-dyld.py.diff \
|
2021-01-02 11:17:56 +01:00
|
|
|
patch-pyconfig.h.in.diff \
|
|
|
|
|
patch-Python-random.c.diff \
|
2016-08-05 16:52:01 +00:00
|
|
|
patch-libedit.diff \
|
2019-04-02 00:32:27 +08:00
|
|
|
patch-openssl11.diff \
|
2016-12-17 13:08:25 +01:00
|
|
|
omit-local-site-packages.patch \
|
2018-08-25 23:50:01 -05:00
|
|
|
patch-Include-pyport.h.diff \
|
2019-11-02 15:27:30 +11:00
|
|
|
uuid-64bit.patch \
|
2020-06-29 23:42:33 +10:00
|
|
|
patch-_osx_support.py.diff \
|
2021-03-16 01:27:58 +11:00
|
|
|
darwin20.diff \
|
2023-09-16 00:42:26 +10:00
|
|
|
sysconfig.py.diff \
|
|
|
|
|
libedit-types.patch
|
2013-08-06 11:12:45 +00:00
|
|
|
|
2024-09-07 16:51:25 +10:00
|
|
|
depends_build path:bin/pkg-config:pkgconfig
|
2018-02-05 16:43:10 +11:00
|
|
|
depends_lib port:bzip2 \
|
|
|
|
|
port:expat \
|
2021-12-26 18:08:36 +11:00
|
|
|
port:gettext-runtime \
|
2018-02-05 16:43:10 +11:00
|
|
|
port:libedit \
|
|
|
|
|
port:libffi \
|
|
|
|
|
port:ncurses \
|
|
|
|
|
port:sqlite3 \
|
|
|
|
|
port:xz \
|
|
|
|
|
port:zlib
|
2016-08-05 16:52:01 +00:00
|
|
|
depends_run port:python_select \
|
|
|
|
|
port:python3_select
|
2013-08-06 11:12:45 +00:00
|
|
|
|
2022-06-07 07:18:40 +10:00
|
|
|
# Don't let the portgroup use -isystem, it breaks lib detection for modules.
|
|
|
|
|
openssl.configure
|
2021-11-09 12:28:21 +11:00
|
|
|
openssl.branch 1.1
|
2022-06-07 07:18:40 +10:00
|
|
|
configure.cppflags-prepend -I[openssl::include_dir]
|
|
|
|
|
configure.ldflags-prepend -L[openssl::lib_dir]
|
2021-11-09 12:28:21 +11:00
|
|
|
|
2024-02-21 04:42:38 +11:00
|
|
|
if {${os.platform} eq "darwin" && ${os.major} >= 20} {
|
|
|
|
|
supported_archs x86_64
|
2021-01-10 03:56:53 +11:00
|
|
|
}
|
|
|
|
|
|
2014-10-30 12:55:25 +00:00
|
|
|
# blacklist llvm-gcc-4.2 compiler known to produce bad code
|
2016-08-05 16:52:01 +00:00
|
|
|
compiler.blacklist *llvm-gcc-4.2
|
2014-10-30 12:55:25 +00:00
|
|
|
|
2013-11-29 18:52:45 +00:00
|
|
|
# ensurepip arg may be removed later, now conflicts with pip and setuptools
|
|
|
|
|
# packages
|
2016-08-05 16:52:01 +00:00
|
|
|
configure.args --enable-framework=${frameworks_dir} \
|
|
|
|
|
--enable-ipv6 \
|
2016-10-11 19:38:22 +00:00
|
|
|
--enable-loadable-sqlite-extensions \
|
2016-08-05 16:52:01 +00:00
|
|
|
--with-computed-gotos \
|
2018-02-05 16:43:10 +11:00
|
|
|
--with-ensurepip=no \
|
|
|
|
|
--with-system-expat \
|
|
|
|
|
--with-system-ffi
|
2013-11-29 18:52:45 +00:00
|
|
|
|
2016-08-05 16:52:01 +00:00
|
|
|
configure.ccache no
|
2022-05-10 22:32:47 +10:00
|
|
|
# pkg-config removes -I flags for paths in CPATH, which confuses python.
|
|
|
|
|
configure.env PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1
|
2013-08-06 11:12:45 +00:00
|
|
|
|
|
|
|
|
post-patch {
|
2016-08-05 16:52:01 +00:00
|
|
|
reinplace "s|@@PREFIX@@|${prefix}|g" \
|
|
|
|
|
${worksrcpath}/Lib/cgi.py \
|
|
|
|
|
${worksrcpath}/Lib/ctypes/macholib/dyld.py
|
2013-08-06 11:12:45 +00:00
|
|
|
|
2016-08-05 16:52:01 +00:00
|
|
|
reinplace "s|/setup.py|/setup.py --no-user-cfg|" ${worksrcpath}/Makefile.pre.in
|
2013-08-06 11:12:45 +00:00
|
|
|
|
2016-08-05 16:52:01 +00:00
|
|
|
# replace /Applications with ${applications_dir}
|
|
|
|
|
reinplace "s|@@APPLICATIONS_DIR@@|${applications_dir}|" \
|
2013-08-06 11:12:45 +00:00
|
|
|
${worksrcpath}/configure
|
|
|
|
|
}
|
|
|
|
|
|
2016-08-05 16:52:01 +00:00
|
|
|
build.target all
|
2013-08-06 11:12:45 +00:00
|
|
|
|
2016-08-05 16:52:01 +00:00
|
|
|
test.run yes
|
|
|
|
|
test.target test
|
2013-08-06 11:12:45 +00:00
|
|
|
|
2016-08-05 16:52:01 +00:00
|
|
|
destroot.target frameworkinstall maninstall
|
2013-08-06 11:12:45 +00:00
|
|
|
|
2015-05-25 21:13:25 +00:00
|
|
|
set pythonNoDot python[string map {. {}} $branch]
|
2016-08-05 16:52:01 +00:00
|
|
|
select.entries [list python python-$pythonNoDot $pythonNoDot] \
|
|
|
|
|
[list python3 python3-$pythonNoDot $pythonNoDot]
|
2015-05-25 21:13:25 +00:00
|
|
|
|
2013-08-06 11:12:45 +00:00
|
|
|
notes "
|
2015-05-25 21:13:25 +00:00
|
|
|
To make this the default Python or Python 3 (i.e., the version run by\
|
|
|
|
|
the 'python' or 'python3' commands), run one or both of:
|
2013-08-06 11:12:45 +00:00
|
|
|
|
2015-05-25 21:13:25 +00:00
|
|
|
sudo port select --set python $pythonNoDot
|
|
|
|
|
sudo port select --set python3 $pythonNoDot
|
2013-08-06 11:12:45 +00:00
|
|
|
"
|
|
|
|
|
|
2018-08-04 18:40:18 +10:00
|
|
|
platform darwin {
|
2016-08-05 16:52:01 +00:00
|
|
|
set framewpath ${frameworks_dir}/Python.framework
|
|
|
|
|
set framewdir ${framewpath}/Versions/${branch}
|
2018-08-04 18:40:18 +10:00
|
|
|
set confdir config-${branch}m
|
2013-08-06 11:12:45 +00:00
|
|
|
|
2016-08-05 16:52:01 +00:00
|
|
|
post-configure {
|
2022-05-10 22:32:47 +10:00
|
|
|
# poll() misbehaves on 10.8 and older
|
2018-02-05 16:43:10 +11:00
|
|
|
# See https://trac.macports.org/ticket/18376
|
2022-05-10 22:32:47 +10:00
|
|
|
if {${os.major} <= 12} {
|
|
|
|
|
system -W ${worksrcpath} "ed - pyconfig.h < ${filespath}/pyconfig.ed"
|
|
|
|
|
}
|
2016-08-05 16:52:01 +00:00
|
|
|
}
|
2020-08-20 18:40:48 +10:00
|
|
|
|
2018-08-04 18:40:18 +10:00
|
|
|
post-destroot {
|
|
|
|
|
foreach dir { Headers Resources Python Versions/Current } {
|
|
|
|
|
file delete ${destroot}${framewpath}/${dir}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ln -s ${framewdir}/share/man/man1/python${branch}.1 ${destroot}${prefix}/share/man/man1/
|
|
|
|
|
ln -s ${framewdir}/lib/pkgconfig/python-${branch}.pc ${destroot}${prefix}/lib/pkgconfig/
|
|
|
|
|
ln -s ${framewdir}/lib/pkgconfig/python-${branch}.pc ${destroot}${prefix}/lib/pkgconfig/python-${branch}m.pc
|
|
|
|
|
|
2022-05-10 22:32:47 +10:00
|
|
|
set libdir ${destroot}${framewdir}/lib/python${branch}
|
|
|
|
|
# Without this, LINKFORSHARED is set to
|
|
|
|
|
# ... $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)
|
|
|
|
|
# (this becomes Python.framework/Versions/3.4/Python) which doesn't
|
|
|
|
|
# work for dependents that incorrectly use this variable to find out
|
|
|
|
|
# how to link against python (see ticket #15099); instead we mirror
|
|
|
|
|
# the behavior of `python-config --ldflags` here.
|
|
|
|
|
set lfs_pattern {^([[:space:]]*'LINKFORSHARED':).*}
|
|
|
|
|
set lfs_replacement "\\1 '-L${framewdir}/lib/python${branch}/${confdir} -lpython${branch}m -ldl -framework CoreFoundation',"
|
|
|
|
|
reinplace -E s|${lfs_pattern}|${lfs_replacement}| \
|
|
|
|
|
${libdir}/_sysconfigdata.py
|
|
|
|
|
|
|
|
|
|
# remove -arch flags from the config
|
|
|
|
|
reinplace -E {s|-arch [a-z0-9_]+||g} \
|
|
|
|
|
${libdir}/_sysconfigdata.py
|
|
|
|
|
|
|
|
|
|
# also remove gettext overlinking
|
|
|
|
|
reinplace "s|-lintl||" \
|
|
|
|
|
${libdir}/_sysconfigdata.py
|
|
|
|
|
|
|
|
|
|
# recompile the modified file
|
|
|
|
|
set python_for_build python.exe
|
|
|
|
|
# executable differs depending on filesystem case sensitivity
|
|
|
|
|
if {![file exists ${worksrcpath}/${python_for_build}]} {
|
|
|
|
|
set python_for_build python
|
|
|
|
|
}
|
|
|
|
|
system -W ${worksrcpath} "env DYLD_FRAMEWORK_PATH=. ./${python_for_build} -E -m compileall -d [shellescape ${framewdir}/lib/python${branch}] [shellescape ${libdir}/_sysconfigdata.py]"
|
|
|
|
|
system -W ${worksrcpath} "env DYLD_FRAMEWORK_PATH=. ./${python_for_build} -E -O -m compileall -d [shellescape ${framewdir}/lib/python${branch}] [shellescape ${libdir}/_sysconfigdata.py]"
|
|
|
|
|
|
2018-08-04 18:40:18 +10:00
|
|
|
# Also make the sysconfig changes in the Makefile
|
|
|
|
|
reinplace {s|^\(LINKFORSHARED=\).*$|\1 -L$(LIBPL) -lpython$(VERSION)$(ABIFLAGS) $(LIBS) $(SYSLIBS)|} \
|
2022-05-10 22:32:47 +10:00
|
|
|
${libdir}/${confdir}/Makefile
|
2018-08-04 18:40:18 +10:00
|
|
|
|
|
|
|
|
reinplace -E {s|-arch [a-z0-9_]+||g} \
|
2022-05-10 22:32:47 +10:00
|
|
|
${libdir}/${confdir}/Makefile
|
2018-08-04 18:40:18 +10:00
|
|
|
|
|
|
|
|
reinplace "s|-lintl||" \
|
2022-05-10 22:32:47 +10:00
|
|
|
${libdir}/${confdir}/Makefile
|
2018-08-04 18:40:18 +10:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
post-destroot {
|
|
|
|
|
foreach unversioned {2to3 idle3 pydoc3 python3 python3-config pyvenv} {
|
|
|
|
|
delete ${destroot}${prefix}/bin/${unversioned}
|
|
|
|
|
}
|
2013-08-06 11:12:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
variant universal {
|
2016-08-05 16:52:01 +00:00
|
|
|
post-patch {
|
|
|
|
|
set universal_arch_flags {}
|
|
|
|
|
set arch_run_32bit {}
|
|
|
|
|
foreach arch ${universal_archs} {
|
|
|
|
|
lappend universal_arch_flags -arch ${arch}
|
|
|
|
|
if {${arch} eq "i386" || ${arch} eq "ppc"} {
|
|
|
|
|
lappend arch_run_32bit -${arch}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
reinplace \
|
|
|
|
|
"s|UNIVERSAL_ARCH_FLAGS=\".*\"|UNIVERSAL_ARCH_FLAGS=\"${universal_arch_flags}\"|" \
|
|
|
|
|
${worksrcpath}/configure
|
2018-02-05 16:43:10 +11:00
|
|
|
if {${arch_run_32bit} ne ""} {
|
2016-08-05 16:52:01 +00:00
|
|
|
reinplace \
|
|
|
|
|
"s|ARCH_RUN_32BIT=\".*\"|ARCH_RUN_32BIT=\"arch ${arch_run_32bit}\"|" \
|
|
|
|
|
${worksrcpath}/configure
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-05-10 22:32:47 +10:00
|
|
|
configure.args-append --enable-universalsdk=${configure.sysroot}
|
2016-08-05 16:52:01 +00:00
|
|
|
post-configure {
|
|
|
|
|
system -W ${worksrcpath} "ed - pyconfig.h < ${filespath}/pyconfig.h-universal.ed"
|
|
|
|
|
}
|
2015-02-26 12:20:31 +00:00
|
|
|
|
|
|
|
|
post-destroot {
|
|
|
|
|
foreach unversioned {python3-32} {
|
|
|
|
|
delete ${destroot}${prefix}/bin/${unversioned}
|
|
|
|
|
}
|
|
|
|
|
}
|
2013-08-06 11:12:45 +00:00
|
|
|
}
|
|
|
|
|
|
2016-08-05 16:52:01 +00:00
|
|
|
livecheck.type regex
|
|
|
|
|
livecheck.url ${homepage}downloads/
|
|
|
|
|
livecheck.regex Python (${branch}(?:\\.\\d+)*)
|