Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/nguynkhn/termux-packages
Browse files Browse the repository at this point in the history
…into bear
  • Loading branch information
nguynkhn committed Oct 17, 2024
2 parents 6b18b9e + 82ee6f8 commit c9e8ef7
Show file tree
Hide file tree
Showing 641 changed files with 6,110 additions and 3,561 deletions.
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ met these conditions:
Software which is either closed-source, contain binary-only components or
is distributed under End User License Agreement is not accepted.

- **Not installable through cpan, gem, npm, or pip**
- **Not installable through cpan, gem, npm, pip or cargo**

These packages should be installed through `cpan`, `gem`, `npm`, `pip` and
These packages should be installed through `cpan`, `gem`, `npm`, `pip`, `cargo` and
so on.

Packaging modules for Perl, Ruby, Node.js, is problematic, especially
Expand Down
4 changes: 4 additions & 0 deletions build-package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ source "$TERMUX_SCRIPTDIR/scripts/build/termux_step_setup_cgct_environment.sh"
# shellcheck source=scripts/build/setup/termux_setup_cargo_c.sh
source "$TERMUX_SCRIPTDIR/scripts/build/setup/termux_setup_cargo_c.sh"

# Utility function for setting up pkg-config wrapper.
# shellcheck source=scripts/build/setup/termux_setup_pkg_config_wrapper.sh
source "$TERMUX_SCRIPTDIR/scripts/build/setup/termux_setup_pkg_config_wrapper.sh"

# Utility function for setting up Crystal toolchain.
# shellcheck source=scripts/build/setup/termux_setup_crystal.sh
source "$TERMUX_SCRIPTDIR/scripts/build/setup/termux_setup_crystal.sh"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,5 @@ TERMUX_PKG_EXTRA_CONFIGURE_ARGS="

termux_step_pre_configure() {
termux_setup_gir

local _WRAPPER_BIN="${TERMUX_PKG_BUILDDIR}/_wrapper/bin"
mkdir -p "${_WRAPPER_BIN}"
if [[ "${TERMUX_ON_DEVICE_BUILD}" == "false" ]]; then
sed "s|^export PKG_CONFIG_LIBDIR=|export PKG_CONFIG_LIBDIR=${TERMUX_PREFIX}/opt/glib/cross/lib/x86_64-linux-gnu/pkgconfig:|" \
"${TERMUX_STANDALONE_TOOLCHAIN}/bin/pkg-config" \
> "${_WRAPPER_BIN}/pkg-config"
chmod +x "${_WRAPPER_BIN}/pkg-config"
export PKG_CONFIG="${_WRAPPER_BIN}/pkg-config"
fi
export PATH="${_WRAPPER_BIN}:${PATH}"
termux_setup_glib_cross_pkg_config_wrapper
}
File renamed without changes.
12 changes: 1 addition & 11 deletions disabled-packages/libhandy-0.0/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,7 @@ TERMUX_PKG_EXTRA_CONFIGURE_ARGS="

termux_step_pre_configure() {
termux_setup_gir

local _WRAPPER_BIN="${TERMUX_PKG_BUILDDIR}/_wrapper/bin"
mkdir -p "${_WRAPPER_BIN}"
if [[ "${TERMUX_ON_DEVICE_BUILD}" == "false" ]]; then
sed "s|^export PKG_CONFIG_LIBDIR=|export PKG_CONFIG_LIBDIR=${TERMUX_PREFIX}/opt/glib/cross/lib/x86_64-linux-gnu/pkgconfig:|" \
"${TERMUX_STANDALONE_TOOLCHAIN}/bin/pkg-config" \
> "${_WRAPPER_BIN}/pkg-config"
chmod +x "${_WRAPPER_BIN}/pkg-config"
export PKG_CONFIG="${_WRAPPER_BIN}/pkg-config"
fi
export PATH="${_WRAPPER_BIN}:${PATH}"
termux_setup_glib_cross_pkg_config_wrapper
}

termux_step_post_massage() {
Expand Down
File renamed without changes.
78 changes: 78 additions & 0 deletions disabled-packages/python3.11/0001-fix-hardcoded-paths.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
--- a/Lib/aifc.py
+++ b/Lib/aifc.py
@@ -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)
--- a/Lib/mailcap.py
+++ b/Lib/mailcap.py
@@ -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


--- 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
"/usr/local/etc/mime.types", # Apache 1.3
+ "@TERMUX_PREFIX@/etc/mime.types", # Termux
]

inited = False
--- a/Lib/posixpath.py
+++ b/Lib/posixpath.py
@@ -32,7 +32,7 @@
extsep = '.'
sep = '/'
pathsep = ':'
-defpath = '/bin:/usr/bin'
+defpath = '@TERMUX_PREFIX@/bin'
altsep = None
devnull = '/dev/null'

--- a/Lib/uuid.py
+++ b/Lib/uuid.py
@@ -361,7 +361,6 @@

try:
path_dirs = os.environ.get('PATH', os.defpath).split(os.pathsep)
- path_dirs.extend(['/sbin', '/usr/sbin'])
executable = shutil.which(command, path=os.pathsep.join(path_dirs))
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:
34 changes: 34 additions & 0 deletions disabled-packages/python3.11/0002-no-setuid-servers.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
--- a/Lib/http/server.py
+++ b/Lib/http/server.py
@@ -1165,10 +1165,6 @@
return
# Child
try:
- try:
- os.setuid(nobody)
- except OSError:
- pass
os.dup2(self.rfile.fileno(), 0)
os.dup2(self.wfile.fileno(), 1)
os.execve(scriptfile, args, env)
--- a/Lib/smtpd.py
+++ b/Lib/smtpd.py
@@ -9,7 +9,8 @@
-n
This program generally tries to setuid `nobody', unless this flag is
set. The setuid call will fail if this program is not run as root (in
- which case, use this flag).
+ which case, use this flag). Ignored in Termux as no setuid done on this
+ platform.

--version
-V
@@ -863,7 +864,7 @@


class Options:
- setuid = True
+ setuid = False
classname = 'PureProxy'
size_limit = None
enable_SMTPUTF8 = False
31 changes: 31 additions & 0 deletions disabled-packages/python3.11/0003-ctypes-util-use-llvm-tools.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
https://github.com/termux/termux-packages/issues/8478

--- a/Lib/ctypes/util.py
+++ b/Lib/ctypes/util.py
@@ -172,7 +172,7 @@
# assuming GNU binutils / ELF
if not f:
return None
- objdump = shutil.which('objdump')
+ objdump = shutil.which('llvm-objdump')
if not objdump:
# objdump is not available, give up
return None
@@ -209,7 +209,7 @@
expr = os.fsencode(expr)

try:
- proc = subprocess.Popen(('/sbin/ldconfig', '-r'),
+ proc = subprocess.Popen(('@TERMUX_PREFIX@/bin/ldconfig', '-r'),
stdout=subprocess.PIPE,
stderr=subprocess.DEVNULL)
except OSError: # E.g. command not found
@@ -300,7 +300,7 @@
def _findLib_ld(name):
# See issue #9998 for why this is needed
expr = r'[^\(\)\s]*lib%s\.[^\(\)\s]*' % re.escape(name)
- cmd = ['ld', '-t']
+ cmd = ['ld.lld', '-t']
libpath = os.environ.get('LD_LIBRARY_PATH')
if libpath:
for d in libpath.split(':'):
77 changes: 77 additions & 0 deletions disabled-packages/python3.11/0004-impl-getprotobyname.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
--- 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). */

+#ifdef __ANDROID__
+struct protocol_name_and_number {
+ char* name;
+ int number;
+};
+#endif
+
/*ARGSUSED*/
static PyObject *
socket_getprotobyname(PyObject *self, PyObject *args)
{
+#ifdef __ANDROID__
+ /* http://git.musl-libc.org/cgit/musl/tree/src/network/proto.c */
+ static const struct protocol_name_and_number protocols[] = {
+ {"ip", 0},
+ {"icmp", 1},
+ {"igmp", 2},
+ {"ggp", 3},
+ {"ipencap", 4},
+ {"st", 5},
+ {"tcp", 6},
+ {"egp", 8},
+ {"pup", 12},
+ {"udp", 17},
+ {"hmp", 20},
+ {"xns-idp", 22},
+ {"iso-tp4", 29},
+ {"xtp", 36},
+ {"ddp", 37},
+ {"idpr-cmtp", 38},
+ {"ipv6", 41},
+ {"ipv6-route", 43},
+ {"ipv6-frag", 44},
+ {"idrp", 45},
+ {"rsvp", 46},
+ {"gre", 47},
+ {"esp", 50},
+ {"ah", 51},
+ {"skip", 57},
+ {"ipv6-icmp", 58},
+ {"ipv6-nonxt", 59},
+ {"ipv6-opts", 60},
+ {"rspf", 73},
+ {"vmtp", 81},
+ {"ospf", 89},
+ {"ipip", 94},
+ {"encap", 98},
+ {"pim", 103},
+ {"raw", 255}
+ };
+ int i;
+#endif
const char *name;
struct protoent *sp;
if (!PyArg_ParseTuple(args, "s:getprotobyname", &name))
return NULL;
+#ifdef __ANDROID__
+ for (i = 0; i < sizeof(protocols) / sizeof(protocols[0]); i++) {
+ if (strcmp(protocols[i].name, name) == 0) {
+ return PyLong_FromLong((long) protocols[i].number);
+ }
+ }
+ sp = NULL;
+#else
Py_BEGIN_ALLOW_THREADS
sp = getprotobyname(name);
Py_END_ALLOW_THREADS
+#endif
if (sp == NULL) {
PyErr_SetString(PyExc_OSError, "protocol not found");
return NULL;
Loading

0 comments on commit c9e8ef7

Please sign in to comment.