Skip to content

Commit

Permalink
lang/tauthon: Update to 2.8.5
Browse files Browse the repository at this point in the history
PR:		271962
Reported by:	olivier.freebsd@free.fr (maintainer)
  • Loading branch information
Olivier Certner authored and fernape committed Jun 14, 2023
1 parent 2737455 commit 4fd5885
Show file tree
Hide file tree
Showing 13 changed files with 107 additions and 119 deletions.
39 changes: 28 additions & 11 deletions lang/tauthon/Makefile
Expand Up @@ -6,8 +6,7 @@
# -- Olivier Certner <olce.freebsd.ports@certner.fr>
PORTNAME= tauthon
DISTVERSIONPREFIX= v
DISTVERSION= 2.8.3
PORTREVISION= 1
DISTVERSION= 2.8.5
CATEGORIES= lang python

MAINTAINER= olce.freebsd.ports@certner.fr
Expand All @@ -18,7 +17,8 @@ LICENSE= PSFL

DEPRECATED= Uses Python 2.7 codebase

USES= pathfix shebangfix autoreconf ncurses pkgconfig readline ssl tar:xz
USES= pathfix shebangfix autoreconf ncurses pkgconfig readline ssl \
tar:xz compiler
PATHFIX_MAKEFILEIN= Makefile.pre.in

USE_GITHUB= yes
Expand Down Expand Up @@ -54,6 +54,7 @@ MAKE_ARGS+= INSTALL_SHARED="${INSTALL_LIB}" # Strip shared library

PLIST_SUB= ABI=${ABIFLAGS} \
DISTVERSION=${DISTVERSION} \
TAUTHON_VERSION=${TAUTHON_VERSION} \
VERSION_LONG=${VERSION_LONG} \
VERSION_NOMICRO=${VERSION_NOMICRO} \
OSMAJOR=${OSVERSION:C/([0-9]*)[0-9]{5}/\1/} # For plat-freebsd* in pkg-plist. https://bugs.python.org/issue19554
Expand All @@ -65,9 +66,9 @@ OPTIONS_SINGLE_UNICODE= UCS2 UCS4
OPTIONS_SUB= yes

LIBFFI_DESC= Use libffi from ports instead of bundled version
LTO_DESC= Apply Link-Time Optimizations (needs OPTIMIZATIONS)
LTO_DESC= Apply Link-Time Optimizations (implies OPTIMIZATIONS)
NLS_DESC= Enable gettext support for the locale module
OPTIMIZATIONS_DESC= Enable code optimizations and PGO (BROKEN)
OPTIMIZATIONS_DESC= Enable code optimizations (notably PGO)
UCS2_DESC= Enable UCS2 Unicode Strings
UCS4_DESC= Enable UCS4 Unicode Strings
PYMALLOC_DESC= Enable specialized mallocs
Expand All @@ -89,8 +90,6 @@ NLS_LIBS= -L${LOCALBASE}/lib -lintl
NLS_CONFIGURE_ENV_OFF= ac_cv_lib_intl_textdomain=no ac_cv_header_libintl_h=no

OPTIMIZATIONS_CONFIGURE_ENABLE= optimizations
OPTIMIZATIONS_BROKEN= Please disable OPTIMIZATIONS option for now\
(some tests fail and no PGO profile is computed)

PYMALLOC_CONFIGURE_WITH=pymalloc

Expand All @@ -100,13 +99,24 @@ THREADS_LDFLAGS= -lpthread
UCS2_CONFIGURE_ENABLE= unicode=ucs2
UCS4_CONFIGURE_ENABLE= unicode=ucs4

VERSION_LONG= ${DISTVERSION:S/a/.alpha./:S/b/.beta./:C/^([^a-z]*)\$/\1.final.0/}
VERSION_NOMICRO= ${DISTVERSION:R}
TAUTHON_VERSION= ${DISTVERSION:C/-.*\$//}
VERSION_LONG= ${TAUTHON_VERSION}.final.0
VERSION_NOMICRO= ${TAUTHON_VERSION:R}
NAME_VERSION= tauthon${VERSION_NOMICRO}

DISABLED_MODULES= _bsddb _sqlite3 _tkinter gdbm

.include <bsd.port.options.mk>
.include <bsd.port.pre.mk>

.if !empty(PORT_OPTIONS:MLTO) && ${CC:T} == "cc"
# Tauthon's configure and Makefile recognize which compiler we are using based
# on the executable name.
. if ${CC:T} == ${CC}
CC:=${COMPILER_TYPE}
. else
CC:=${CC:H}/${COMPILER_TYPE}
. endif
.endif

# https://bugs.python.org/issue22521
# https://bugs.python.org/issue23042
Expand Down Expand Up @@ -177,4 +187,11 @@ post-install:
${INSTALL_DATA} ${WRKSRC}/Tools/gdb/libpython.py \
${STAGEDIR}${PREFIX}/lib/lib${NAME_VERSION}.so.1-gdb.py

.include <bsd.port.mk>
.include <bsd.port.post.mk>

.if !empty(PORT_OPTIONS:MLTO) && ${COMPILER_TYPE} == gcc
# These have to be appended after bsd.port.mk appends to them, because we are
# basically overriding what it did on seeing USE_BINUTILS (pulled by USE_GCC).
CONFIGURE_ENV+= AR=${CC:S/^gcc/gcc-ar/} RANLIB=${CC:S/^gcc/gcc-ranlib/}
MAKE_ENV+= AR=${CC:S/^gcc/gcc-ar/} RANLIB=${CC:S/^gcc/gcc-ranlib/}
.endif
6 changes: 3 additions & 3 deletions lang/tauthon/distinfo
@@ -1,3 +1,3 @@
TIMESTAMP = 1622652756
SHA256 (naftaliharris-tauthon-v2.8.3_GH0.tar.gz) = 09a14777b5e7bf503bdc1959a5e9fabbf09781266689213adfc8c535ea4a7c17
SIZE (naftaliharris-tauthon-v2.8.3_GH0.tar.gz) = 17718271
TIMESTAMP = 1685108476
SHA256 (naftaliharris-tauthon-v2.8.5_GH0.tar.gz) = 0d0f2ffd3a912768c138ee7b66e8163df3674f407c92152d09304c3240557dbf
SIZE (naftaliharris-tauthon-v2.8.5_GH0.tar.gz) = 18465302
6 changes: 3 additions & 3 deletions lang/tauthon/files/patch-Doc__library__fcntl.rst
@@ -1,6 +1,6 @@
--- ./Doc/library/fcntl.rst.orig 2014-07-03 21:53:41.473098625 +1000
+++ ./Doc/library/fcntl.rst 2014-07-03 21:54:04.342833056 +1000
@@ -50,7 +50,6 @@ The module defines the following functio
--- Doc/library/fcntl.rst.orig 2023-02-04 10:09:53 UTC
+++ Doc/library/fcntl.rst
@@ -52,7 +52,6 @@ The module defines the following functions:
operations are typically defined in the library module :mod:`termios` and the
argument handling is even more complicated.

Expand Down
Expand Up @@ -3,8 +3,8 @@
# installation.
# Submitted by: mva

--- Lib/distutils/command/build_scripts.py.orig 2014-07-26 09:52:20.000000000 UTC
+++ Lib/distutils/command/build_scripts.py 2014-07-26 09:52:56.000000000 UTC
--- Lib/distutils/command/build_scripts.py.orig 2023-02-04 10:09:53 UTC
+++ Lib/distutils/command/build_scripts.py
@@ -126,6 +126,9 @@ class build_scripts (Command):
file, oldmode, newmode)
os.chmod(file, newmode)
Expand Down
Expand Up @@ -6,12 +6,7 @@
Should solve issue 20397, where using the --record argument results
in files that failed to generate bytecode files are added to the
record file nonetheless.
---
Lib/distutils/command/install_lib.py | 17 +++++++++++++----
Lib/distutils/tests/test_install_lib.py | 8 ++++++--
2 files changed, 19 insertions(+), 6 deletions(-)

--- Lib/distutils/command/install_lib.py.orig 2015-12-05 19:46:56 UTC
--- Lib/distutils/command/install_lib.py.orig 2023-02-04 10:09:53 UTC
+++ Lib/distutils/command/install_lib.py
@@ -168,10 +168,14 @@ class install_lib(Command):
ext = os.path.splitext(os.path.normcase(py_file))[1]
Expand Down
Expand Up @@ -6,14 +6,9 @@
Should solve issue 20397, where using the --record argument results
in files that failed to generate bytecode files are added to the
record file nonetheless.
---
Lib/distutils/command/install_lib.py | 17 +++++++++++++----
Lib/distutils/tests/test_install_lib.py | 8 ++++++--
2 files changed, 19 insertions(+), 6 deletions(-)

--- Lib/distutils/tests/test_install_lib.py.orig 2015-12-05 19:46:57 UTC
--- Lib/distutils/tests/test_install_lib.py.orig 2023-02-04 10:09:53 UTC
+++ Lib/distutils/tests/test_install_lib.py
@@ -64,8 +64,12 @@ class InstallLibTestCase(support.Tempdir
@@ -64,8 +64,12 @@ class InstallLibTestCase(support.TempdirManager,
cmd.distribution.packages = [pkg_dir]
cmd.distribution.script_name = 'setup.py'

Expand Down
12 changes: 6 additions & 6 deletions lang/tauthon/files/patch-Makefile.pre.in
Expand Up @@ -2,12 +2,12 @@
# Description: Link scripts in the same way Python3 does
# Submitted by: mva

--- Makefile.pre.in.orig 2014-06-30 04:05:39.000000000 +0200
+++ Makefile.pre.in 2014-07-26 11:09:46.000000000 +0200
@@ -900,6 +900,12 @@ bininstall: altbininstall
(cd $(DESTDIR)$(LIBPC); $(LN) -s tauthon-$(VERSION).pc tauthon2.pc)
-rm -f $(DESTDIR)$(LIBPC)/tauthon.pc
(cd $(DESTDIR)$(LIBPC); $(LN) -s tauthon2.pc tauthon.pc)
--- Makefile.pre.in.orig 2023-05-26 13:41:44 UTC
+++ Makefile.pre.in
@@ -1003,6 +1003,12 @@ bininstall: altbininstall
(cd $(DESTDIR)$(LIBPC); $(LN) -s tauthon-$(VERSION).pc tauthon2.pc)
-rm -f $(DESTDIR)$(LIBPC)/tauthon.pc
(cd $(DESTDIR)$(LIBPC); $(LN) -s tauthon2.pc tauthon.pc)
+ -rm -f $(DESTDIR)$(BINDIR)/idle
+ (cd $(DESTDIR)$(BINDIR); $(LN) -s idle$(VERSION) idle2)
+ -rm -f $(DESTDIR)$(BINDIR)/pydoc
Expand Down
12 changes: 6 additions & 6 deletions lang/tauthon/files/patch-Misc_python-config.in
@@ -1,7 +1,7 @@
# pythonx.y-config --ldflags out of /usr and missing -L<install_lib_dir>
# https://bugs.python.org/issue7352

--- Misc/python-config.in.orig 2015-10-18 07:24:01 UTC
--- Misc/python-config.in.orig 2023-02-04 10:09:53 UTC
+++ Misc/python-config.in
@@ -21,6 +21,7 @@ except getopt.error:
if not opts:
Expand All @@ -11,11 +11,11 @@
pyver = sysconfig.get_config_var('VERSION')
getvar = sysconfig.get_config_var

@@ -50,6 +51,7 @@ for opt in opt_flags:
# add the prefix/lib/pythonX.Y/config dir, but only if there is no
# shared library in prefix/lib/.
@@ -48,6 +49,7 @@ for opt in opt_flags:
libs += getvar('LIBS').split()
libs += getvar('SYSLIBS').split()
if opt == '--ldflags':
+ libs.insert(0, '-L' + libdir)
if not getvar('Py_ENABLE_SHARED'):
libs.insert(0, '-L' + getvar('LIBPL'))
if not getvar('PYTHONFRAMEWORK'):
libs.extend(getvar('LINKFORSHARED').split())
print ' '.join(libs)
12 changes: 6 additions & 6 deletions lang/tauthon/files/patch-Modules__fcntlmodule.c
@@ -1,6 +1,6 @@
--- ./Modules/fcntlmodule.c.orig 2014-07-03 21:57:10.429953240 +1000
+++ ./Modules/fcntlmodule.c 2014-07-03 21:59:36.517210444 +1000
@@ -98,20 +98,15 @@ fcntl_ioctl(PyObject *self, PyObject *ar
--- Modules/fcntlmodule.c.orig 2023-02-04 10:09:53 UTC
+++ Modules/fcntlmodule.c
@@ -98,20 +98,15 @@ fcntl_ioctl(PyObject *self, PyObject *args)
{
#define IOCTL_BUFSZ 1024
int fd;
Expand All @@ -24,7 +24,7 @@
int arg;
int ret;
char *str;
@@ -119,7 +114,7 @@ fcntl_ioctl(PyObject *self, PyObject *ar
@@ -119,7 +114,7 @@ fcntl_ioctl(PyObject *self, PyObject *args)
int mutate_arg = 1;
char buf[IOCTL_BUFSZ+1]; /* argument plus NUL byte */

Expand All @@ -33,7 +33,7 @@
conv_descriptor, &fd, &code,
&str, &len, &mutate_arg)) {
char *arg;
@@ -170,7 +165,7 @@ fcntl_ioctl(PyObject *self, PyObject *ar
@@ -170,7 +165,7 @@ fcntl_ioctl(PyObject *self, PyObject *args)
}

PyErr_Clear();
Expand All @@ -42,7 +42,7 @@
conv_descriptor, &fd, &code, &str, &len)) {
if (len > IOCTL_BUFSZ) {
PyErr_SetString(PyExc_ValueError,
@@ -192,7 +187,7 @@ fcntl_ioctl(PyObject *self, PyObject *ar
@@ -192,7 +187,7 @@ fcntl_ioctl(PyObject *self, PyObject *args)
PyErr_Clear();
arg = 0;
if (!PyArg_ParseTuple(args,
Expand Down
16 changes: 10 additions & 6 deletions lang/tauthon/files/patch-Modules_posixmodule.c
Expand Up @@ -3,25 +3,29 @@
# https://bugs.python.org/issue38061
# TODO: Upstream

--- Modules/posixmodule.c.orig 2019-10-19 18:38:44 UTC
--- Modules/posixmodule.c.orig 2023-02-04 10:09:53 UTC
+++ Modules/posixmodule.c
@@ -6676,9 +6676,16 @@ posix_closerange(PyObject *self, PyObject *args)
if (!PyArg_ParseTuple(args, "ii:closerange", &fd_from, &fd_to))
@@ -6812,11 +6812,18 @@ posix_closerange(PyObject *self, PyObject *args)
return NULL;
Py_BEGIN_ALLOW_THREADS
_Py_BEGIN_SUPPRESS_IPH
- for (i = fd_from; i < fd_to; i++)
- if (_PyVerify_fd(i))
- if (_PyVerify_fd(i)) {
- errno = 0;
- close(i);
- }
+#ifdef __FreeBSD__
+ if (fd_to >= sysconf(_SC_OPEN_MAX)) {
+ closefrom(fd_from);
+ } else
+#endif
+ {
+ for (i = fd_from; i < fd_to; i++)
+ if (_PyVerify_fd(i))
+ if (_PyVerify_fd(i)) {
+ errno = 0;
+ close(i);
+ }
+ }
_Py_END_SUPPRESS_IPH
Py_END_ALLOW_THREADS
Py_RETURN_NONE;
}
28 changes: 28 additions & 0 deletions lang/tauthon/files/patch-configure
@@ -0,0 +1,28 @@
--- configure.orig 2023-02-04 10:09:53 UTC
+++ configure
@@ -3394,13 +3394,6 @@ printf "%s\n" "#define _NETBSD_SOURCE 1" >>confdefs.h


# The later defininition of _XOPEN_SOURCE and _POSIX_C_SOURCE disables
-# certain features on FreeBSD, so we need __BSD_VISIBLE to re-enable
-# them.
-
-printf "%s\n" "#define __BSD_VISIBLE 1" >>confdefs.h
-
-
-# The later defininition of _XOPEN_SOURCE and _POSIX_C_SOURCE disables
# u_int on Irix 5.3. Defining _BSD_TYPES brings it back.

printf "%s\n" "#define _BSD_TYPES 1" >>confdefs.h
@@ -3785,9 +3778,8 @@ printf "%s\n" "#define _BSD_SOURCE 1" >>confdefs.h
# but used in struct sockaddr.sa_family. Reported by Tim Rice.
SCO_SV/3.2)
define_xopen_source=no;;
- # On FreeBSD 4, the math functions C89 does not cover are never defined
- # with _XOPEN_SOURCE and __BSD_VISIBLE does not re-enable them.
- FreeBSD/4.*)
+ # On FreeBSD, defining _XOPEN_SOURCE to 600 requests a strict environment.
+ FreeBSD/*)
define_xopen_source=no;;
# On MacOS X 10.2, a bug in ncurses.h means that it craps out if
# _XOPEN_EXTENDED_SOURCE is defined. Apparently, this is fixed in 10.3, which
58 changes: 0 additions & 58 deletions lang/tauthon/files/patch-pr192365

This file was deleted.

0 comments on commit 4fd5885

Please sign in to comment.