Skip to content

Commit

Permalink
python3.8: rename and sort patches
Browse files Browse the repository at this point in the history
  • Loading branch information
licy183 committed Jan 11, 2024
1 parent 691d82d commit ce435e5
Show file tree
Hide file tree
Showing 11 changed files with 76 additions and 92 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
diff -uNr Python-3.6.2/Lib/aifc.py Python-3.6.2.mod/Lib/aifc.py
--- Python-3.6.2/Lib/aifc.py 2017-07-08 06:33:27.000000000 +0300
+++ Python-3.6.2.mod/Lib/aifc.py 2017-09-15 15:09:08.092797061 +0300
--- a/Lib/aifc.py
+++ b/Lib/aifc.py
@@ -920,7 +920,7 @@
if __name__ == '__main__':
import sys
Expand All @@ -10,9 +9,8 @@ diff -uNr Python-3.6.2/Lib/aifc.py Python-3.6.2.mod/Lib/aifc.py
fn = sys.argv[1]
with open(fn, 'r') as f:
print("Reading", fn)
diff -uNr Python-3.6.2/Lib/mailcap.py Python-3.6.2.mod/Lib/mailcap.py
--- Python-3.6.2/Lib/mailcap.py 2017-07-08 06:33:27.000000000 +0300
+++ Python-3.6.2.mod/Lib/mailcap.py 2017-09-15 15:08:41.312797081 +0300
--- a/Lib/mailcap.py
+++ b/Lib/mailcap.py
@@ -55,7 +55,8 @@
# Don't bother with getpwuid()
home = '.' # Last resort
Expand All @@ -23,9 +21,8 @@ diff -uNr Python-3.6.2/Lib/mailcap.py Python-3.6.2.mod/Lib/mailcap.py
return mailcaps


diff -uNr Python-3.6.2/Lib/mimetypes.py Python-3.6.2.mod/Lib/mimetypes.py
--- Python-3.6.2/Lib/mimetypes.py 2017-07-08 06:33:27.000000000 +0300
+++ Python-3.6.2.mod/Lib/mimetypes.py 2017-09-15 15:08:05.522797106 +0300
--- a/Lib/mimetypes.py
+++ b/Lib/mimetypes.py
@@ -49,6 +49,7 @@
"/usr/local/lib/netscape/mime.types",
"/usr/local/etc/httpd/conf/mime.types", # Apache 1.2
Expand All @@ -34,9 +31,8 @@ diff -uNr Python-3.6.2/Lib/mimetypes.py Python-3.6.2.mod/Lib/mimetypes.py
]

inited = False
diff -uNr Python-3.6.2/Lib/posixpath.py Python-3.6.2.mod/Lib/posixpath.py
--- Python-3.6.2/Lib/posixpath.py 2017-07-08 06:33:27.000000000 +0300
+++ Python-3.6.2.mod/Lib/posixpath.py 2017-09-15 15:07:20.872797138 +0300
--- a/Lib/posixpath.py
+++ b/Lib/posixpath.py
@@ -32,7 +32,7 @@
extsep = '.'
sep = '/'
Expand All @@ -46,9 +42,8 @@ diff -uNr Python-3.6.2/Lib/posixpath.py Python-3.6.2.mod/Lib/posixpath.py
altsep = None
devnull = '/dev/null'

diff -uNr Python-3.6.2/Lib/uuid.py Python-3.6.2.mod/Lib/uuid.py
--- Python-3.6.2/Lib/uuid.py 2017-07-08 06:33:27.000000000 +0300
+++ Python-3.6.2.mod/Lib/uuid.py 2017-09-15 15:06:36.372797170 +0300
--- a/Lib/uuid.py
+++ b/Lib/uuid.py
@@ -306,7 +306,7 @@
import os, shutil, subprocess
executable = shutil.which(command)
Expand All @@ -58,3 +53,27 @@ diff -uNr Python-3.6.2/Lib/uuid.py Python-3.6.2.mod/Lib/uuid.py
executable = shutil.which(command, path=path)
if executable is None:
return None
--- a/Lib/subprocess.py
+++ b/Lib/subprocess.py
@@ -1389,9 +1389,7 @@
args = list(args)

if shell:
- # On Android the default shell is at '/system/bin/sh'.
- unix_shell = ('/system/bin/sh' if
- hasattr(sys, 'getandroidapilevel') else '/bin/sh')
+ unix_shell = ('@TERMUX_PREFIX@/bin/sh')
args = [unix_shell, "-c"] + args
if executable:
args[0] = executable
--- a/Lib/tempfile.py
+++ b/Lib/tempfile.py
@@ -124,7 +124,7 @@
if _os.name == 'nt':
dirlist.extend([ r'c:\temp', r'c:\tmp', r'\temp', r'\tmp' ])
else:
- dirlist.extend([ '/tmp', '/var/tmp', '/usr/tmp' ])
+ dirlist.extend([ '@TERMUX_PREFIX@/tmp' ])

# As a last resort, the current directory.
try:
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
diff -uNr Python-3.9.2/Lib/http/server.py Python-3.9.2.mod/Lib/http/server.py
--- Python-3.9.2/Lib/http/server.py 2021-02-19 14:31:44.000000000 +0200
+++ Python-3.9.2.mod/Lib/http/server.py 2021-03-20 16:08:34.173543081 +0200
--- a/Lib/http/server.py
+++ b/Lib/http/server.py
@@ -1165,10 +1165,6 @@
return
# Child
Expand All @@ -12,9 +11,8 @@ diff -uNr Python-3.9.2/Lib/http/server.py Python-3.9.2.mod/Lib/http/server.py
os.dup2(self.rfile.fileno(), 0)
os.dup2(self.wfile.fileno(), 1)
os.execve(scriptfile, args, env)
diff -uNr Python-3.9.2/Lib/smtpd.py Python-3.9.2.mod/Lib/smtpd.py
--- Python-3.9.2/Lib/smtpd.py 2021-02-19 14:31:44.000000000 +0200
+++ Python-3.9.2.mod/Lib/smtpd.py 2021-03-20 16:11:48.785629393 +0200
--- a/Lib/smtpd.py
+++ b/Lib/smtpd.py
@@ -9,7 +9,8 @@
-n
This program generally tries to setuid `nobody', unless this flag is
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
diff -u -r ../Python-3.6.5/Modules/socketmodule.c ./Modules/socketmodule.c
--- ../Python-3.6.5/Modules/socketmodule.c 2018-03-28 11:19:31.000000000 +0200
+++ ./Modules/socketmodule.c 2018-06-08 03:28:51.003730525 +0200
--- a/Modules/socketmodule.c
+++ b/Modules/socketmodule.c
@@ -5373,17 +5373,74 @@
This only returns the protocol number, since the other info is
already known or not useful (like the list of aliases). */
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
diff -uNr Python-3.8.0/setup.py Python-3.8.0.mod/setup.py
--- Python-3.8.0/setup.py 2019-10-14 16:34:47.000000000 +0300
+++ Python-3.8.0.mod/setup.py 2019-11-17 21:16:46.524157731 +0200
--- a/setup.py
+++ b/setup.py
@@ -824,7 +824,8 @@

# Lance Ellinghaus's syslog module
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
diff -uNr Python-3.9.13/Lib/multiprocessing/heap.py Python-3.9.13.mod/Lib/multiprocessing/heap.py
--- Python-3.9.13/Lib/multiprocessing/heap.py 2022-05-17 19:12:56.000000000 +0800
+++ Python-3.9.13.mod/Lib/multiprocessing/heap.py 2022-07-05 11:30:43.134657200 +0800
--- a/Lib/multiprocessing/heap.py
+++ b/Lib/multiprocessing/heap.py
@@ -70,7 +70,7 @@
"""

Expand All @@ -10,9 +9,8 @@ diff -uNr Python-3.9.13/Lib/multiprocessing/heap.py Python-3.9.13.mod/Lib/multip
else:
_dir_candidates = []

diff -uNr Python-3.9.13/Modules/_multiprocessing/multiprocessing.c Python-3.9.13.mod/Modules/_multiprocessing/multiprocessing.c
--- Python-3.9.13/Modules/_multiprocessing/multiprocessing.c 2022-05-17 19:12:56.000000000 +0800
+++ Python-3.9.13.mod/Modules/_multiprocessing/multiprocessing.c 2022-07-05 11:31:01.456088500 +0800
--- a/Modules/_multiprocessing/multiprocessing.c
+++ b/Modules/_multiprocessing/multiprocessing.c
@@ -128,7 +128,7 @@
{"recv", multiprocessing_recv, METH_VARARGS, ""},
{"send", multiprocessing_send, METH_VARARGS, ""},
Expand All @@ -22,9 +20,8 @@ diff -uNr Python-3.9.13/Modules/_multiprocessing/multiprocessing.c Python-3.9.13
{"sem_unlink", _PyMp_sem_unlink, METH_VARARGS, ""},
#endif
{NULL}
diff -uNr Python-3.9.13/Modules/_multiprocessing/posix-shm-extension.c Python-3.9.13.mod/Modules/_multiprocessing/posix-shm-extension.c
--- Python-3.9.13/Modules/_multiprocessing/posix-shm-extension.c 1970-01-01 08:00:00.000000000 +0800
+++ Python-3.9.13.mod/Modules/_multiprocessing/posix-shm-extension.c 2022-07-05 11:32:24.029768300 +0800
--- a/Modules/_multiprocessing/posix-shm-extension.c
+++ b/Modules/_multiprocessing/posix-shm-extension.c
@@ -0,0 +1,76 @@
+/* This file is a port of posix shared memory for Python3 on Termux Android,
+ based on musl-libc which is licensed under the following standard MIT
Expand Down Expand Up @@ -102,9 +99,8 @@ diff -uNr Python-3.9.13/Modules/_multiprocessing/posix-shm-extension.c Python-3.
+ if (!(name = __shm_mapname(name, buf))) return -1;
+ return unlink(name);
+}
diff -uNr Python-3.9.13/Modules/_multiprocessing/posixshmem.c Python-3.9.13.mod/Modules/_multiprocessing/posixshmem.c
--- Python-3.9.13/Modules/_multiprocessing/posixshmem.c 2022-05-17 19:12:56.000000000 +0800
+++ Python-3.9.13.mod/Modules/_multiprocessing/posixshmem.c 2022-07-05 11:31:30.857914500 +0800
--- a/Modules/_multiprocessing/posixshmem.c
+++ b/Modules/_multiprocessing/posixshmem.c
@@ -11,6 +11,9 @@
#include <sys/mman.h>
#endif
Expand All @@ -115,9 +111,8 @@ diff -uNr Python-3.9.13/Modules/_multiprocessing/posixshmem.c Python-3.9.13.mod/
/*[clinic input]
module _posixshmem
[clinic start generated code]*/
diff -uNr Python-3.9.13/setup.py Python-3.9.13.mod/setup.py
--- Python-3.9.13/setup.py 2022-05-17 19:12:56.000000000 +0800
+++ Python-3.9.13.mod/setup.py 2022-07-05 11:34:12.035464200 +0800
--- a/setup.py
+++ b/setup.py
@@ -1760,7 +1760,8 @@
multiprocessing_srcs.append('_multiprocessing/semaphore.c')
if (sysconfig.get_config_var('HAVE_SHM_OPEN') and
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
We use libandroid-support when building Python, but Python does not
use LDFLAGS when building modules (and not much point in this case).

diff -u -r ../Python-3.4.1/Modules/_cursesmodule.c ./Modules/_cursesmodule.c
--- ../Python-3.4.1/Modules/_cursesmodule.c 2014-05-19 07:19:39.000000000 +0200
+++ ./Modules/_cursesmodule.c 2014-06-04 08:56:50.441097925 +0200
--- a/Modules/_cursesmodule.c
+++ b/Modules/_cursesmodule.c
@@ -121,7 +121,7 @@
#include <term.h>
#endif
Expand Down
11 changes: 11 additions & 0 deletions tur/python3.8/0007-do-not-use-link.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- a/configure
+++ b/configure
@@ -11293,8 +11293,6 @@
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :

-$as_echo "#define HAVE_LINK 1" >>confdefs.h
-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
else
11 changes: 11 additions & 0 deletions tur/python3.8/0008-build-with-fPIC.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- a/configure
+++ b/configure
@@ -9295,7 +9295,7 @@
then CCSHARED="-fPIC";
else CCSHARED="+z";
fi;;
- Linux-android*) ;;
+ Linux-android*) CCSHARED="-fPIC";;
Linux*|GNU*) CCSHARED="-fPIC";;
BSD/OS*/4*) CCSHARED="-fpic";;
FreeBSD*|NetBSD*|OpenBSD*|DragonFly*) CCSHARED="-fPIC";;
14 changes: 0 additions & 14 deletions tur/python3.8/Lib-subprocess.py.patch

This file was deleted.

12 changes: 0 additions & 12 deletions tur/python3.8/Lib-tmpfile.py.patch

This file was deleted.

21 changes: 0 additions & 21 deletions tur/python3.8/configure.patch

This file was deleted.

0 comments on commit ce435e5

Please sign in to comment.