1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-01 01:17:02 +00:00

Port for python version 3.3.

Submitted by:	Kubilay Kocak <koobs.freebsd@gmail.com>
This commit is contained in:
Dmitry Sivachenko 2012-12-20 11:55:54 +00:00
parent 99ee85957f
commit c3793c1fde
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=309312
9 changed files with 5287 additions and 2 deletions

View File

@ -201,7 +201,7 @@ Python_Include_MAINTAINER= python@FreeBSD.org
#
_PYTHON_PORTBRANCH= 2.7
_PYTHON_ALLBRANCHES= 2.7 2.6 3.2 3.1 # preferred first
_PYTHON_ALLBRANCHES= 2.7 2.6 3.3 3.2 3.1 # preferred first
_ZOPE_PORTBRANCH= 2.13
_ZOPE_ALLBRANCHES= 2.13
@ -356,8 +356,19 @@ PYTHON_PORTVERSION= ${PYTHON_DEFAULT_PORTVERSION}
# Propagate the chosen python version to submakes.
.MAKEFLAGS: PYTHON_VERSION=python${_PYTHON_VERSION}
# Python-3.3
.if ${PYTHON_VERSION} == "python3.3"
PYTHON_PORTVERSION?=3.3.0
PYTHON_PORTSDIR= ${PORTSDIR}/lang/python33
PYTHON_REL= 330
PYTHON_SUFFIX= 33
PYTHON_VER= 3.3
.if exists(${PYTHON_CMD}-config)
PYTHON_ABIVER!= ${PYTHON_CMD}-config --abiflags
.endif
# Python-3.2
.if ${PYTHON_VERSION} == "python3.2"
.elif ${PYTHON_VERSION} == "python3.2"
PYTHON_PORTVERSION?=3.2.3
PYTHON_PORTSDIR= ${PORTSDIR}/lang/python32
PYTHON_REL= 323
@ -409,6 +420,7 @@ check-makevars::
@${ECHO} " python2.7 (default)"
@${ECHO} " python3.1"
@${ECHO} " python3.2"
@${ECHO} " python3.3"
@${FALSE}
.endif

233
lang/python33/Makefile Normal file
View File

@ -0,0 +1,233 @@
# New ports collection makefile for: python31
# Date created: 2009-06-28
# Whom: Li-Wen Hsu <lwhsu@FreeBSD.org>
#
# $FreeBSD$
#
PORTNAME= python33
PORTVERSION= 3.3.0
CATEGORIES= lang python ipv6
MASTER_SITES= ${PYTHON_MASTER_SITES}
MASTER_SITE_SUBDIR= ${PYTHON_MASTER_SITE_SUBDIR}
DISTFILES= ${PYTHON_DISTFILE}
MAINTAINER= python@FreeBSD.org
COMMENT= An interpreted object-oriented programming language
DIST_SUBDIR= python
WRKSRC= ${PYTHON_WRKSRC}/portbld.static
PATCH_WRKSRC= ${PYTHON_WRKSRC}
GNU_CONFIGURE= yes
CONFIGURE_SCRIPT= ../configure # must be relative
CONFIGURE_ENV= OPT="${CFLAGS}" SVNVERSION="echo freebsd"
MAKE_ENV= VPATH="${PYTHON_WRKSRC}"
MAKE_JOBS_SAFE= yes
USE_LDCONFIG= yes
INSTALL_TARGET= altinstall
MAN1= ${PYTHON_VERSION}.1
USE_XZ= yes
USE_PYTHON= yes
PYTHON_VERSION= python3.3
PYTHON_NO_DEPENDS= yes
PYABIVER= # default empty, for after appending
SHARED_WRKSRC= ${PYTHON_WRKSRC}/portbld.shared
PLIST_SUB= PYVER=${PYTHON_VERSION:S/python//} \
PYVER_WITHPAT=${PORTVERSION:S/.rc/rc/} \
PYABIVER=${PYABIVER} \
PYTHON_SUFFIX=${PYTHON_SUFFIX}
EXAMPLESDIR= ${PREFIX}/share/examples/${PYTHON_VERSION}
DATADIR= ${PREFIX}/share/${PYTHON_VERSION}
PLATFORMS= plat-freebsd4 plat-freebsd5 plat-freebsd6 \
plat-freebsd7 plat-freebsd8 plat-freebsd9 \
plat-freebsd10
BIN_SCRIPTS= 2to3 idle3 pydoc3
BIN_FILES= python python-shared python-config python-shared-config \
${BIN_SCRIPTS}
BINLINKS_SUB= -e 's,(2to3|idle3|pydoc3),\1-${PYTHON_VER},' \
-e 's,(python-shared|python),\1${PYTHON_VER},'
OPTIONS_DEFINE= THREADS PYMALLOC IPV6 FPECTL EXAMPLES NLS
OPTIONS_DEFAULT= THREADS PYMALLOC IPV6
NLS_DESC= Enable Gettext support for the locale module
.include <bsd.port.pre.mk>
.if ${OSVERSION} < 800505
BUILD_DEPENDS+= xz>0:${PORTSDIR}/archivers/xz # Needed for lzma support
LDFLAGS+= "-L${LOCALBASE}/lib"
CFLAGS+= "-I${LOCALBASE}/include"
.endif
.if ${PYTHON_VERSION} == ${PYTHON_DEFAULT_VERSION} || !exists(${LOCALBASE}/bin/python)
MLINKS= ${PYTHON_VERSION}.1 python.1
PLIST_SUB+= IF_DEFAULT=""
.else
PLIST_SUB+= IF_DEFAULT="@comment "
.endif
.if ${PORT_OPTIONS:MNLS}
USE_GETTEXT= yes
# XXX do not set any LDFLAGS or CFLAGS - this causes pyexpat to fail building
#LDFLAGS+= "-L${LOCALBASE}/lib"
#CFLAGS+= "-I${LOCALBASE}/include"
.else
CONFIGURE_ENV+= ac_cv_lib_intl_textdomain=no ac_cv_header_libintl_h=no
.endif
.if ${PORT_OPTIONS:MTHREADS}
PLIST_SUB+= THREADS=""
CONFIGURE_ARGS+= --with-threads
CFLAGS+= ${PTHREAD_CFLAGS}
LDFLAGS+= ${PTHREAD_LIBS}
.else
PLIST_SUB+= THREADS="@comment "
CONFIGURE_ARGS+= --without-threads
.endif
.if empty(PORT_OPTIONS:MPYMALLOC)
CONFIGURE_ARGS+= --without-pymalloc
.else
PYABIVER:= m${PYABIVER}
.endif
.if ${ARCH} == sparc64
CFLAGS+= -DPYTHON_DEFAULT_RECURSION_LIMIT=900
.endif
# See http://bugs.freebsd.org/115940
.if !exists(/usr/bin/ypcat) || defined(WITHOUT_NIS) # the world with NO_NIS
PLIST_SUB+= NO_NIS="@comment "
WITHOUT_NIS?= detected
.else
PLIST_SUB+= NO_NIS=""
.endif
.if ${PORT_OPTIONS:MIPV6}
CONFIGURE_ARGS+= --enable-ipv6
.else
CONFIGURE_ARGS+= --disable-ipv6
.endif
.if ${PORT_OPTIONS:MFPECTL}
CONFIGURE_ARGS+= --with-fpectl
.endif
pre-patch:
${CP} -r ${PATCH_WRKSRC}/Lib/plat-freebsd8 \
${PATCH_WRKSRC}/Lib/plat-freebsd9
${CP} -r ${PATCH_WRKSRC}/Lib/plat-freebsd8 \
${PATCH_WRKSRC}/Lib/plat-freebsd10
${MKDIR} ${WRKSRC} ${SHARED_WRKSRC}/Modules
.for script in ${BIN_SCRIPTS}
${SED} -e '1s,^.*$$,#!${PREFIX}/bin/${PYTHON_VERSION},' \
${PATCH_WRKSRC}/Tools/scripts/${script} \
> ${WRKDIR}/`${ECHO_CMD} ${script} | ${SED} -E ${BINLINKS_SUB}`
.endfor
${REINPLACE_CMD} -e \
's,/usr/doc/python-docs-,${PREFIX}/share/doc/python,g' \
${PATCH_WRKSRC}/Lib/pydoc.py
${REINPLACE_CMD} -e \
's|^\( *prefixes = .*\)\]$$|\1, "${LOCALBASE}"]|g' \
${PATCH_WRKSRC}/Lib/site.py
${REINPLACE_CMD} -e \
's|^ \(..ASDLGEN.*\)$$| ${TRUE}|g; \
s|[(]LIBDIR[)]/pkgconfig|(prefix)/libdata/pkgconfig|g; \
s|*\(..INSTALL_SCRIPT.*\)python-config$$|#port \1|' \
${PATCH_WRKSRC}/Makefile.pre.in
${SED} -e 's|^#!.*|#!${PREFIX}/bin/${PYTHON_VERSION}|' \
${PATCH_WRKSRC}/Misc/python-config.in > ${WRKDIR}/${PYTHON_VERSION}-config
${SED} -e 's|^#!.*|#!${PREFIX}/bin/${PYTHON_VERSION:S/thon/thon-shared/}|' \
${PATCH_WRKSRC}/Misc/python-config.in > ${WRKDIR}/${PYTHON_VERSION:S/thon/thon-shared/}-config
.if defined(WITH_FPECTL) && ${ARCH} == i386
${MKDIR} ${WRKSRC}/Modules
${ECHO} "fpectl fpectlmodule.c" >> ${WRKSRC}/Modules/Setup.dist
.endif
post-patch:
.if defined(WITHOUT_NIS)
${REINPLACE_CMD} -e \
's/disabled_module_list =[^]]*/&, "nis"/' \
${PATCH_WRKSRC}/setup.py
.endif
post-configure:
${TAR} -C ${WRKSRC} -cf - . | ${TAR} -C ${SHARED_WRKSRC} -xf -
${LN} -sf ${PYTHON_WRKSRC}/Lib ${WRKSRC}/Lib
${SED} -e 's,^\(LDLIBRARY=\).*$$,\1libpython$$(LDVERSION).so,' \
-e 's,^\(BLDLIBRARY=\).*$$,\1-L. -lpython$$(LDVERSION),' \
-e 's,^\(CFLAGSFORSHARED=\).*$$,\1$$(CCSHARED),' \
-e 's,^\(Makefile Modules/config.c:.*\)Makefile.pre,\1,' \
-e 's,^\(.(BUILDPYTHON)\: .*\).(LIBRARY),\1,' \
-e 's,^\(.(BUILDPYTHON):.*\).(LIBRARY),\1,' \
${WRKSRC}/Makefile > ${SHARED_WRKSRC}/Makefile
pre-build:
cd ${SHARED_WRKSRC}; \
${SETENV} ${MAKE_ENV} ${MAKE} lib${PYTHON_VERSION}${PYABIVER}.so python; \
${LN} -f lib${PYTHON_VERSION}${PYABIVER}.so lib${PYTHON_VERSION}${PYABIVER}.so.1; \
${LN} -f python ${PYTHON_VERSION:S/thon/thon-shared/}
pre-su-install:
.for platform in ${PLATFORMS}
${MKDIR} ${PYTHONPREFIX_LIBDIR}/${platform}
.for file in IN.py regen
${INSTALL_DATA} ${WRKSRC}/Lib/${platform}/${file} \
${PYTHONPREFIX_LIBDIR}/${platform}/
.endfor
.endfor
post-install:
@# install config providers
${INSTALL_SCRIPT} ${WRKDIR}/${PYTHON_VERSION}-config ${PREFIX}/bin
${INSTALL_SCRIPT} ${WRKDIR}/${PYTHON_VERSION:S/thon/thon-shared/}-config ${PREFIX}/bin
@# shared version of executable and library
${INSTALL_PROGRAM} ${SHARED_WRKSRC}/lib${PYTHON_VERSION}${PYABIVER}.so.1 \
${PREFIX}/lib
cd ${PREFIX}/lib; ${LN} -sf lib${PYTHON_VERSION}${PYABIVER}.so.1 \
lib${PYTHON_VERSION}${PYABIVER}.so
${LN} -sf ${PREFIX}/lib/lib${PYTHON_VERSION}${PYABIVER}.so ${PYTHONPREFIX_LIBDIR}/config
${INSTALL_PROGRAM} \
${SHARED_WRKSRC}/${PYTHON_VERSION:S/thon/thon-shared/} \
${PREFIX}/bin
@# additional files installing by ports
.for script in ${BIN_SCRIPTS}
${INSTALL_SCRIPT} \
${WRKDIR}/`${ECHO_CMD} ${script} | ${SED} -E ${BINLINKS_SUB}` \
${PREFIX}/bin
.endfor
@${MKDIR} ${MANPREFIX}/man/man1
${INSTALL_MAN} ${PYTHON_WRKSRC}/Misc/python.man \
${MANPREFIX}/man/man1/${PYTHON_VERSION}.1
.if ${PYTHON_VERSION} == ${PYTHON_DEFAULT_VERSION} || !exists(${LOCALBASE}/bin/python)
for f in ${BIN_FILES}; do \
TARGET=`${ECHO_CMD} $$f | ${SED} -E ${BINLINKS_SUB}`; \
cd ${PREFIX}/bin && ${LN} -f $$TARGET $$f; \
done
.endif
.if !defined(NOPORTDATA)
@${MKDIR} ${DATADIR}
@cd ${PYTHON_WRKSRC}; ${TAR} -cf - Tools | \
(cd ${DATADIR}; ${TAR} -xf -)
.endif
@${CAT} ${PKGMESSAGE}
test: build
@cd ${WRKSRC} && ./python -m test -u all -j 1 -w
regression-test: test
.include <bsd.port.post.mk>

2
lang/python33/distinfo Normal file
View File

@ -0,0 +1,2 @@
SHA256 (python/Python-3.3.0.tar.xz) = 09994d2885a8ef61b4b2389527a9805a4a05e3e0f121dbc8e4222f9010f5bbd7
SIZE (python/Python-3.3.0.tar.xz) = 11720732

View File

@ -0,0 +1,25 @@
--- ./Modules/_ctypes/libffi/configure.orig 2012-09-29 18:00:42.000000000 +1000
+++ ./Modules/_ctypes/libffi/configure 2012-10-04 20:21:15.000000000 +1000
@@ -6834,7 +6834,7 @@
rm -rf conftest*
;;
-x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
+amd64-*-freebsd*|x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
# Find out which ABI we are using.
echo 'int i;' > conftest.$ac_ext
@@ -14322,10 +14322,10 @@
$as_echo_n "(cached) " >&6
else
- libffi_cv_as_x86_pcrel=yes
+ libffi_cv_as_x86_pcrel=no
echo '.text; foo: nop; .data; .long foo-.; .text' > conftest.s
- if $CC $CFLAGS -c conftest.s 2>&1 | $EGREP -i 'illegal|warning' > /dev/null; then
- libffi_cv_as_x86_pcrel=no
+ if $CC $CFLAGS -c conftest.s > /dev/null; then
+ libffi_cv_as_x86_pcrel=yes
fi
fi

View File

@ -0,0 +1,53 @@
--- ./Modules/fcntlmodule.c.orig 2012-09-29 18:00:45.000000000 +1000
+++ ./Modules/fcntlmodule.c 2012-10-04 20:21:15.000000000 +1000
@@ -97,20 +97,15 @@
{
#define IOCTL_BUFSZ 1024
int fd;
- /* In PyArg_ParseTuple below, we use the unsigned non-checked 'I'
+ /* In PyArg_ParseTuple below, we use the unsigned non-checked 'k'
format for the 'code' parameter because Python turns 0x8000000
into either a large positive number (PyLong or PyInt on 64-bit
platforms) or a negative number on others (32-bit PyInt)
whereas the system expects it to be a 32bit bit field value
regardless of it being passed as an int or unsigned long on
- various platforms. See the termios.TIOCSWINSZ constant across
- platforms for an example of thise.
-
- If any of the 64bit platforms ever decide to use more than 32bits
- in their unsigned long ioctl codes this will break and need
- special casing based on the platform being built on.
+ various platforms.
*/
- unsigned int code;
+ unsigned long code;
int arg;
int ret;
Py_buffer pstr;
@@ -119,7 +114,7 @@
int mutate_arg = 1;
char buf[IOCTL_BUFSZ+1]; /* argument plus NUL byte */
- if (PyArg_ParseTuple(args, "O&Iw*|i:ioctl",
+ if (PyArg_ParseTuple(args, "O&kw*|i:ioctl",
conv_descriptor, &fd, &code,
&pstr, &mutate_arg)) {
char *arg;
@@ -174,7 +169,7 @@
}
PyErr_Clear();
- if (PyArg_ParseTuple(args, "O&Is*:ioctl",
+ if (PyArg_ParseTuple(args, "O&ks*:ioctl",
conv_descriptor, &fd, &code, &pstr)) {
str = pstr.buf;
len = pstr.len;
@@ -201,7 +196,7 @@
PyErr_Clear();
arg = 0;
if (!PyArg_ParseTuple(args,
- "O&I|i;ioctl requires a file or file descriptor,"
+ "O&k|i;ioctl requires a file or file descriptor,"
" an integer and optionally an integer or buffer argument",
conv_descriptor, &fd, &code, &arg)) {
return NULL;

View File

@ -0,0 +1,73 @@
--- ./setup.py.orig 2012-09-29 18:00:50.000000000 +1000
+++ ./setup.py 2012-10-04 20:21:15.000000000 +1000
@@ -31,7 +31,7 @@
COMPILED_WITH_PYDEBUG = ('--with-pydebug' in sysconfig.get_config_var("CONFIG_ARGS"))
# This global variable is used to hold the list of modules to be disabled.
-disabled_module_list = []
+disabled_module_list = ["_sqlite3", "_tkinter", "_gdbm"]
# File which contains the directory for shared mods (for sys.path fixup
# when running from the build dir, see Modules/getpath.c)
@@ -694,7 +694,7 @@
# use the same library for the readline and curses modules.
if 'curses' in readline_termcap_library:
curses_library = readline_termcap_library
- elif self.compiler.find_library_file(lib_dirs, 'ncursesw'):
+ elif self.compiler.find_library_file(lib_dirs, 'XXXXncursesw'):
curses_library = 'ncursesw'
elif self.compiler.find_library_file(lib_dirs, 'ncurses'):
curses_library = 'ncurses'
@@ -733,7 +733,7 @@
'termcap'):
readline_libs.append('termcap')
exts.append( Extension('readline', ['readline.c'],
- library_dirs=['/usr/lib/termcap'],
+ library_dirs=['/usr/lib','/usr/lib/termcap'],
extra_link_args=readline_extra_link_args,
libraries=readline_libs) )
else:
@@ -1261,7 +1261,7 @@
curses_defines = []
curses_includes = []
panel_library = 'panel'
- if curses_library == 'ncursesw':
+ if curses_library == 'XXXXncursesw':
curses_defines.append(('HAVE_NCURSESW', '1'))
curses_includes.append('/usr/include/ncursesw')
# Bug 1464056: If _curses.so links with ncursesw,
@@ -1285,6 +1285,7 @@
exts.append( Extension('_curses', ['_cursesmodule.c'],
include_dirs=curses_includes,
define_macros=curses_defines,
+ library_dirs = ['/usr/lib'],
libraries = curses_libs) )
elif curses_library == 'curses' and host_platform != 'darwin':
# OSX has an old Berkeley curses, not good enough for
@@ -1298,6 +1299,7 @@
exts.append( Extension('_curses', ['_cursesmodule.c'],
define_macros=curses_defines,
+ library_dirs = ['/usr/lib'],
libraries = curses_libs) )
else:
missing.append('_curses')
@@ -1462,7 +1464,7 @@
macros = dict()
libraries = []
- elif host_platform in ('freebsd4', 'freebsd5', 'freebsd6', 'freebsd7', 'freebsd8'):
+ elif host_platform in ('freebsd7', 'freebsd8', 'freebsd9', 'freebsd10'):
# FreeBSD's P1003.1b semaphore support is very experimental
# and has many known problems. (as of June 2008)
macros = dict()
@@ -2143,8 +2145,7 @@
# If you change the scripts installed here, you also need to
# check the PyBuildScripts command above, and change the links
# created by the bininstall target in Makefile.pre.in
- scripts = ["Tools/scripts/pydoc3", "Tools/scripts/idle3",
- "Tools/scripts/2to3", "Tools/scripts/pyvenv"]
+ scripts = []
)
# --install-platlib

4
lang/python33/pkg-descr Normal file
View File

@ -0,0 +1,4 @@
Python is an interpreted object-oriented programming language, and is
often compared to Tcl, Perl or Scheme.
WWW: http://www.python.org/

10
lang/python33/pkg-message Normal file
View File

@ -0,0 +1,10 @@
====
Note that some of the standard modules are provided as separate
ports since they require extra dependencies:
gdbm databases/py-gdbm
sqlite3 databases/py-sqlite3
tkinter x11-toolkits/py-tkinter
Install them as needed.
====

4873
lang/python33/pkg-plist Normal file

File diff suppressed because it is too large Load Diff