termux-packages/packages/python/fix-paths.patch

61 lines
2.4 KiB
Diff
Raw Normal View History

2017-09-15 14:13:01 +02:00
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
@@ -920,7 +920,7 @@
if __name__ == '__main__':
import sys
if not sys.argv[1:]:
- sys.argv.append('/usr/demos/data/audio/bach.aiff')
+ sys.argv.append('@TERMUX_PREFIX@/demos/data/audio/bach.aiff')
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
@@ -55,7 +55,8 @@
# Don't bother with getpwuid()
home = '.' # Last resort
mailcaps = [home + '/.mailcap', '/etc/mailcap',
- '/usr/etc/mailcap', '/usr/local/etc/mailcap']
+ '/usr/etc/mailcap', '/usr/local/etc/mailcap',
+ '@TERMUX_PREFIX@/etc/mailcap']
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
@@ -49,6 +49,7 @@
"/usr/local/lib/netscape/mime.types",
"/usr/local/etc/httpd/conf/mime.types", # Apache 1.2
"/usr/local/etc/mime.types", # Apache 1.3
+ "@TERMUX_PREFIX@/etc/mime.types", # Termux
]
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
@@ -32,7 +32,7 @@
extsep = '.'
sep = '/'
pathsep = ':'
2019-07-11 10:28:39 +02:00
-defpath = '/bin:/usr/bin'
2020-07-09 00:29:50 +02:00
+defpath = '@TERMUX_PREFIX@/bin'
2017-09-15 14:13:01 +02:00
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
@@ -306,7 +306,7 @@
import os, shutil, subprocess
executable = shutil.which(command)
if executable is None:
- path = os.pathsep.join(('/sbin', '/usr/sbin'))
2020-07-09 00:29:50 +02:00
+ path = '@TERMUX_PREFIX@/bin'
2017-09-15 14:13:01 +02:00
executable = shutil.which(command, path=path)
if executable is None:
return None