From 69b04f3be77e25e10f1e11b15d862d0cbe707c4d Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Tue, 6 Oct 2020 01:01:42 -0700 Subject: python: Update to 3.9.0 --- pkg/python/.gitignore | 2 +- pkg/python/gen.lua | 20 +++++++++++------ pkg/python/modules.lua | 4 +++- .../patch/0001-Fix-build-with-libressl.patch | 25 ++++++++++++++++++++++ pkg/python/pyconfig.h | 9 ++++---- pkg/python/pylibs.txt | 14 +++++++++--- pkg/python/sha256 | 2 +- pkg/python/url | 2 +- pkg/python/ver | 2 +- 9 files changed, 61 insertions(+), 19 deletions(-) create mode 100644 pkg/python/patch/0001-Fix-build-with-libressl.patch (limited to 'pkg/python') diff --git a/pkg/python/.gitignore b/pkg/python/.gitignore index 728162e9..abf98e78 100644 --- a/pkg/python/.gitignore +++ b/pkg/python/.gitignore @@ -1,3 +1,3 @@ -/Python-3.8.6.tar.xz +/Python-3.9.0.tar.xz /modules.ninja /src diff --git a/pkg/python/gen.lua b/pkg/python/gen.lua index 152b4fee..6c63129f 100644 --- a/pkg/python/gen.lua +++ b/pkg/python/gen.lua @@ -56,7 +56,7 @@ rule('makesetup', 'lua $dir/makesetup.lua $dir/modules.lua <$in >$out') build('makesetup', '$outdir/config.c', {'$srcdir/Modules/config.c.in', '|', '$dir/makesetup.lua', '$dir/modules.lua'}) cc('Modules/getbuildinfo.c', nil, { - cflags=[[$cflags -D 'DATE="Oct 14 2019"' -D 'TIME="15:34:47"']] + cflags=[[$cflags -D 'DATE="Oct 4 2020"' -D 'TIME="19:31:29"']] }) cc('Modules/getpath.c', nil, { cflags={ @@ -64,7 +64,7 @@ cc('Modules/getpath.c', nil, { [[-D 'PYTHONPATH=":plat-linux"']], [[-D 'PREFIX="/"']], [[-D 'EXEC_PREFIX="/"']], - [[-D 'VERSION="3.8"']], + [[-D 'VERSION="3.9"']], [[-D 'VPATH=""']], }, }) @@ -82,6 +82,9 @@ end cc('Python/getplatform.c', nil, { cflags=string.format([[$cflags -D 'PLATFORM="%s"']], platform), }) +cc('Python/initconfig.c', nil, { + cflags=[[$cflags -D 'PLATLIBDIR="lib"']], +}) cc('Python/sysmodule.c', nil, { cflags=string.format([[$cflags -D 'ABIFLAGS="%s"']], abiflags), }) @@ -109,6 +112,7 @@ lib('libpython.a', {expand{'Modules/', srcs}, paths[[ descrobject.c enumobject.c exceptions.c + genericaliasobject.c genobject.c fileobject.c floatobject.c @@ -144,6 +148,7 @@ lib('libpython.a', {expand{'Modules/', srcs}, paths[[ node.c parser.c token.c + pegen/(pegen.c parse.c parse_string.c peg_api.c) myreadline.c parsetok.c tokenizer.c ) Python/( @@ -168,9 +173,10 @@ lib('libpython.a', {expand{'Modules/', srcs}, paths[[ getversion.c graminit.c hamt.c + hashtable.c import.c importdl.c - initconfig.c + initconfig.c.o marshal.c modsupport.c mysnprintf.c @@ -215,10 +221,10 @@ man{'$outdir/python3.1'} sym('share/man/man1/python.1.gz', 'python3.1.gz') for f in iterlines('pylibs.txt') do - file('lib/python3.8/'..f, '644', '$srcdir/Lib/'..f) + file('lib/python3.9/'..f, '644', '$srcdir/Lib/'..f) end -file('lib/python3.8/_sysconfigdata_'..abiflags..'_'..platform..'_.py', '644', '$dir/lib/_sysconfigdata.py') -file('lib/python3.8/Makefile', '644', '$dir/lib/Makefile') -dir('lib/python3.8/lib-dynload', '755') +file('lib/python3.9/_sysconfigdata_'..abiflags..'_'..platform..'_.py', '644', '$dir/lib/_sysconfigdata.py') +file('lib/python3.9/Makefile', '644', '$dir/lib/Makefile') +dir('lib/python3.9/lib-dynload', '755') fetch 'curl' diff --git a/pkg/python/modules.lua b/pkg/python/modules.lua index 93b978ba..3bb65721 100644 --- a/pkg/python/modules.lua +++ b/pkg/python/modules.lua @@ -27,7 +27,8 @@ return { '_io/stringio.c', }, faulthandler={'faulthandler.c'}, - _tracemalloc={'_tracemalloc.c', 'hashtable.c'}, + _tracemalloc={'_tracemalloc.c'}, + _peg_parser={'_peg_parser.c'}, --_symtable={'symtablemodule.c'}, --xxsubtype={'xxsubtype.c'}, @@ -38,6 +39,7 @@ return { cmath={'cmathmodule.c', '_math.c'}, -- time defined above _datetime={'_datetimemodule.c'}, + _zoneinfo={'_zoneinfo.c'}, _random={'_randommodule.c'}, _bisect={'_bisectmodule.c'}, _heapq={'_heapqmodule.c'}, diff --git a/pkg/python/patch/0001-Fix-build-with-libressl.patch b/pkg/python/patch/0001-Fix-build-with-libressl.patch new file mode 100644 index 00000000..2a7a5803 --- /dev/null +++ b/pkg/python/patch/0001-Fix-build-with-libressl.patch @@ -0,0 +1,25 @@ +From c10df94443a1193da36af080993d64942b272be4 Mon Sep 17 00:00:00 2001 +From: Michael Forney +Date: Tue, 6 Oct 2020 00:58:09 -0700 +Subject: [PATCH] Fix build with libressl + +--- + Modules/_hashopenssl.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Modules/_hashopenssl.c b/Modules/_hashopenssl.c +index adc8653773..c40a3ff705 100644 +--- a/Modules/_hashopenssl.c ++++ b/Modules/_hashopenssl.c +@@ -32,7 +32,7 @@ + # error "OPENSSL_THREADS is not defined, Python requires thread-safe OpenSSL" + #endif + +-#if (OPENSSL_VERSION_NUMBER < 0x10100000L) || defined(LIBRESSL_VERSION_NUMBER) ++#if (OPENSSL_VERSION_NUMBER < 0x10100000L) || (defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x2070000fL) + /* OpenSSL < 1.1.0 */ + #define EVP_MD_CTX_new EVP_MD_CTX_create + #define EVP_MD_CTX_free EVP_MD_CTX_destroy +-- +2.28.0 + diff --git a/pkg/python/pyconfig.h b/pkg/python/pyconfig.h index 8ba5406e..1afe089b 100644 --- a/pkg/python/pyconfig.h +++ b/pkg/python/pyconfig.h @@ -1,6 +1,7 @@ #ifndef Py_PYCONFIG_H #define Py_PYCONFIG_H /* #undef AC_APPLE_UNIVERSAL_BUILD */ +/* #undef AIX_BUILDDATE */ /* #undef AIX_GENUINE_CPLUSPLUS */ /* #undef ALT_SOABI */ /* #undef ANDROID_API_LEVEL */ @@ -11,7 +12,6 @@ /* #undef FLOAT_WORDS_BIGENDIAN */ /* #undef FLOCK_NEEDS_LIBBSD */ /* #undef GETPGRP_HAVE_ARG */ -/* #undef GETTIMEOFDAY_NO_TZ */ #define HAVE_ACCEPT4 1 #define HAVE_ACOSH 1 #define HAVE_ADDRINFO 1 @@ -162,7 +162,6 @@ #define HAVE_GETSID 1 #define HAVE_GETSPENT 1 #define HAVE_GETSPNAM 1 -#define HAVE_GETTIMEOFDAY 1 /* #undef HAVE_GETWD */ /* #undef HAVE_GLIBC_MEMMOVE_BUG */ #define HAVE_GRP_H 1 @@ -198,14 +197,17 @@ #define HAVE_LINKAT 1 #define HAVE_LINUX_CAN_BCM_H 1 #define HAVE_LINUX_CAN_H 1 +#define HAVE_LINUX_CAN_J1939_H 1 #define HAVE_LINUX_CAN_RAW_FD_FRAMES 1 #define HAVE_LINUX_CAN_RAW_H 1 +#define HAVE_LINUX_CAN_RAW_JOIN_FILTERS 1 #define HAVE_LINUX_MEMFD_H 1 #define HAVE_LINUX_NETLINK_H 1 #define HAVE_LINUX_QRTR_H 1 #define HAVE_LINUX_RANDOM_H 1 #define HAVE_LINUX_TIPC_H 1 #define HAVE_LINUX_VM_SOCKETS_H 1 +#define HAVE_LINUX_WAIT_H 1 #define HAVE_LOCKF 1 #define HAVE_LOG1P 1 #define HAVE_LOG2 1 @@ -257,7 +259,6 @@ #define HAVE_PTHREAD_KILL 1 #define HAVE_PTHREAD_SIGMASK 1 #define HAVE_PTY_H 1 -#define HAVE_PUTENV 1 #define HAVE_PWRITE 1 #define HAVE_PWRITEV 1 /* #undef HAVE_PWRITEV2 */ @@ -409,7 +410,6 @@ #define HAVE_UNAME 1 #define HAVE_UNISTD_H 1 #define HAVE_UNLINKAT 1 -#define HAVE_UNSETENV 1 /* #undef HAVE_USABLE_WCHAR_T */ /* #undef HAVE_UTIL_H */ #define HAVE_UTIMENSAT 1 @@ -447,6 +447,7 @@ #define PTHREAD_KEY_T_IS_COMPATIBLE_WITH_INT 1 #define PTHREAD_SYSTEM_SCHED_SUPPORTED 1 /* #undef PYLONG_BITS_IN_DIGIT */ +#define PY_BUILTIN_HASHLIB_HASHES "sha3,blake2" #define PY_COERCE_C_LOCALE 1 #define PY_FORMAT_SIZE_T "z" #define PY_SSL_DEFAULT_CIPHERS 1 diff --git a/pkg/python/pylibs.txt b/pkg/python/pylibs.txt index 8d30f84b..c401b239 100644 --- a/pkg/python/pylibs.txt +++ b/pkg/python/pylibs.txt @@ -1,11 +1,12 @@ # 2,