ports: python3

Fixes #108
This commit is contained in:
Johannes Schlatow
2018-06-15 12:47:18 +02:00
committed by Norman Feske
parent a564b342c4
commit 2e3f012eca
16 changed files with 1831 additions and 0 deletions

129
src/lib/python3/config.c Normal file
View File

@@ -0,0 +1,129 @@
/* Generated automatically from ./Modules/config.c.in by makesetup. */
/* -*- C -*- ***********************************************
Copyright (c) 2000, BeOpen.com.
Copyright (c) 1995-2000, Corporation for National Research Initiatives.
Copyright (c) 1990-1995, Stichting Mathematisch Centrum.
All rights reserved.
See the file "Misc/COPYRIGHT" for information on usage and
redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
******************************************************************/
/* Module configuration */
/* !!! !!! !!! This file is edited by the makesetup script !!! !!! !!! */
/* This file contains the table of built-in modules.
See create_builtin() in import.c. */
#include "Python.h"
#ifdef __cplusplus
extern "C" {
#endif
extern PyObject* PyInit__signal(void);
extern PyObject* PyInit__struct(void);
extern PyObject* PyInit_atexit(void);
extern PyObject* PyInit_posix(void);
extern PyObject* PyInit_errno(void);
extern PyObject* PyInit_pwd(void);
extern PyObject* PyInit__sre(void);
extern PyObject* PyInit__codecs(void);
extern PyObject* PyInit_zipimport(void);
extern PyObject* PyInit__symtable(void);
extern PyObject* PyInit_xxsubtype(void);
extern PyObject* PyInit_math(void);
extern PyObject* PyInit_time(void);
extern PyObject* PyInit__operator(void);
extern PyObject* PyInit_zlib(void);
extern PyObject* PyInit__random(void);
extern PyObject* PyInit_itertools(void);
extern PyObject* PyInit__functools(void);
extern PyObject* PyInit__collections(void);
extern PyObject* PyInit__weakref(void);
extern PyObject* PyInit__locale(void);
extern PyObject* PyInit__io(void);
extern PyObject* PyInit__md5(void);
extern PyObject* PyInit__sha1(void);
extern PyObject* PyInit__sha256(void);
extern PyObject* PyInit__sha512(void);
extern PyObject* PyInit__blake2(void);
extern PyObject* PyInit__sha3(void);
extern PyObject* PyInit_pyexpat(void);
/* -- ADDMODULE MARKER 1 -- */
extern PyObject* PyMarshal_Init(void);
extern PyObject* PyInit_imp(void);
extern PyObject* PyInit_gc(void);
extern PyObject* PyInit__ast(void);
extern PyObject* _PyWarnings_Init(void);
extern PyObject* PyInit__string(void);
struct _inittab _PyImport_Inittab[] = {
{"_signal", PyInit__signal},
{"_struct", PyInit__struct},
{"atexit", PyInit_atexit},
{"posix", PyInit_posix},
{"errno", PyInit_errno},
{"pwd", PyInit_pwd},
{"_sre", PyInit__sre},
{"_codecs", PyInit__codecs},
{"_weakref", PyInit__weakref},
{"_operator", PyInit__operator},
{"math", PyInit_math},
{"time", PyInit_time},
{"itertools", PyInit_itertools},
{"_functools", PyInit__functools},
{"_collections", PyInit__collections},
{"_locale", PyInit__locale},
{"_io", PyInit__io},
{"zipimport", PyInit_zipimport},
{"_symtable", PyInit__symtable},
{"xxsubtype", PyInit_xxsubtype},
{"_random", PyInit__random},
{"zlib", PyInit_zlib},
{"_md5", PyInit__md5},
{"_sha1", PyInit__sha1},
{"_sha256", PyInit__sha256},
{"_sha512", PyInit__sha512},
{"_blake2", PyInit__blake2},
{"_sha3", PyInit__sha3},
{"pyexpat", PyInit_pyexpat},
/* -- ADDMODULE MARKER 2 -- */
/* This module lives in marshal.c */
{"marshal", PyMarshal_Init},
/* This lives in import.c */
{"imp", PyInit_imp},
/* This lives in Python/Python-ast.c */
{"_ast", PyInit__ast},
/* These entries are here for sys.builtin_module_names */
{"builtins", NULL},
{"sys", NULL},
/* This lives in gcmodule.c */
{"gc", PyInit_gc},
/* This lives in _warnings.c */
{"_warnings", _PyWarnings_Init},
/* This lives in Objects/unicodeobject.c */
{"_string", PyInit__string},
/* Sentinel */
{0, 0}
};
#ifdef __cplusplus
}
#endif

27
src/lib/python3/dup.patch Normal file
View File

@@ -0,0 +1,27 @@
+++ src/lib/python3/Python/pylifecycle.c 2018-05-11 15:20:34.421070206 +0200
@@ -1051,15 +1051,7 @@
int fd2;
if (fd < 0)
return 0;
- _Py_BEGIN_SUPPRESS_IPH
- /* Prefer dup() over fstat(). fstat() can require input/output whereas
- dup() doesn't, there is a low risk of EMFILE/ENFILE at Python
- startup. */
- fd2 = dup(fd);
- if (fd2 >= 0)
- close(fd2);
- _Py_END_SUPPRESS_IPH
- return fd2 >= 0;
+ return fd >= 0;
#endif
}
+++ src/lib/python3/Python/fileutils.c 2018-05-11 15:15:46.841809875 +0200
@@ -1543,6 +1543,7 @@
int
_Py_dup(int fd)
{
+ return fd;
#ifdef MS_WINDOWS
HANDLE handle;
DWORD ftype;

View File

@@ -0,0 +1,8 @@
+++ src/lib/python3/Modules/expat/expat_config.h 2018-05-29 14:26:26.737762285 +0200
@@ -16,4 +16,6 @@
#define XML_DTD 1
#define XML_CONTEXT_BYTES 1024
+#undef PREFIX
+
#endif /* EXPAT_CONFIG_H */

View File

@@ -0,0 +1,20 @@
+++ src/lib/python3/Modules/posixmodule.c
@@ -178,15 +178,15 @@
#define fsync _commit
#else
/* Unix functions that the configure script doesn't check for */
-#define HAVE_EXECV 1
+//#define HAVE_EXECV 1
#define HAVE_FORK 1
#if defined(__USLC__) && defined(__SCO_VERSION__) /* SCO UDK Compiler */
#define HAVE_FORK1 1
#endif
-#define HAVE_GETEGID 1
+//#define HAVE_GETEGID 1
#define HAVE_GETEUID 1
#define HAVE_GETGID 1
-#define HAVE_GETPPID 1
+//#define HAVE_GETPPID 1
#define HAVE_GETUID 1
#define HAVE_KILL 1
#define HAVE_OPENDIR 1