Browse Source

Merge pull request #3419 from xeffyr/fix-paths

Fix hardcoded paths for some packages
android-5
Fredrik Fornwall 6 years ago
committed by GitHub
parent
commit
cc6cab8fa0
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      packages/busybox/build.sh
  2. 12
      packages/busybox/util-linux-setarch.c.patch
  3. 2
      packages/coreutils/build.sh
  4. 92
      packages/coreutils/fix-paths.patch
  5. 21
      packages/coreutils/mktemp.patch
  6. 2
      packages/dnsutils/build.sh
  7. 12
      packages/dnsutils/lib-irs-context.c.patch
  8. 2
      packages/ffmpeg/build.sh
  9. 21
      packages/ffmpeg/libavutil-file_open.c.patch
  10. 1
      packages/file/build.sh
  11. 24
      packages/file/fix-paths.patch
  12. 1
      packages/glib/build.sh
  13. 303
      packages/glib/fix-hardcoded-paths.patch
  14. 2
      packages/gnupg/build.sh
  15. 42
      packages/gnupg/dirmngr-dns.patch
  16. 240
      packages/gnupg/fix-paths.patch
  17. 12
      packages/gnupg/g10-exec.c.patch
  18. 1
      packages/gzip/build.sh
  19. 12
      packages/gzip/zdiff.in.patch
  20. 12
      packages/gzip/zgrep.in.patch
  21. 1
      packages/irssi/build.sh
  22. 42
      packages/irssi/fix-paths.patch
  23. 12
      packages/libarchive/archive_util.c.patch
  24. 2
      packages/libarchive/build.sh
  25. 2
      packages/libbz2/build.sh
  26. 21
      packages/libbz2/fix-paths.patch
  27. 1
      packages/libdb/build.sh
  28. 48
      packages/libdb/fix-tmpdir.patch
  29. 2
      packages/libpulseaudio/build.sh
  30. 145
      packages/libpulseaudio/fix-paths.patch
  31. 29
      packages/libpulseaudio/tmpdir.patch
  32. 1
      packages/libssh/build.sh
  33. 63
      packages/libssh/fix-paths.patch
  34. 12
      packages/libssh/fix-ssh_config-path.patch
  35. 4
      packages/lynx/build.sh
  36. 78
      packages/lynx/fix-paths.patch
  37. 12
      packages/lynx/lynx2.8.9dev.19_WWW_Library_Implementation_HTFormat.c.patch
  38. 12
      packages/lynx/lynx2.8.9dev.19_src_LYUtils.c.patch
  39. 1
      packages/m4/build.sh
  40. 58
      packages/m4/fix-paths.patch
  41. 2
      packages/mathomatic/build.sh
  42. 33
      packages/mathomatic/fix-paths.patch
  43. 12
      packages/mathomatic/fix-tmp_file.patch
  44. 2
      packages/mosh/build.sh
  45. 14
      packages/mosh/mosh-server.cc.patch
  46. 2
      packages/nano/build.sh
  47. 12
      packages/nano/src-files.c.patch
  48. 1
      packages/ncurses/build.sh
  49. 35
      packages/ncurses/fix-paths.patch
  50. 12
      packages/ncurses/tic-fix-tmp-path.patch
  51. 21
      packages/net-tools/arp.c.patch
  52. 2
      packages/net-tools/build.sh
  53. 12
      packages/net-tools/lib-pathnames.h.patch
  54. 14
      packages/net-tools/nameif.c.patch
  55. 12
      packages/net-tools/rarp.c.patch
  56. 12
      packages/net-tools/slattach.c.patch
  57. 2
      packages/newsboat/build.sh
  58. 60
      packages/newsboat/fix-paths.patch
  59. 2
      packages/nmap/build.sh
  60. 90
      packages/nmap/fix-paths.patch
  61. 26
      packages/nmap/ncat-bin-sh-path.patch
  62. 15
      packages/nmap/nmap_dns.cc.patch
  63. 21
      packages/openal-soft/alcConfig.c.patch
  64. 1
      packages/openal-soft/build.sh
  65. 2
      packages/openssh/build.sh
  66. 38
      packages/openssh/session.c.patch
  67. 3
      packages/patch/build.sh
  68. 35
      packages/patch/tmpdir-path.patch
  69. 2
      packages/pinentry/build.sh
  70. 12
      packages/pinentry/pinentry-emacs.c.patch
  71. 1
      packages/radare2/build.sh
  72. 12
      packages/radare2/libr-util-diff.c.patch
  73. 12
      packages/radare2/libr-util-sandbox.c.patch
  74. 1
      packages/rhash/build.sh
  75. 12
      packages/rhash/parse_cmdline.c.patch
  76. 2
      packages/rsync/build.sh
  77. 12
      packages/rsync/rsync.h.patch
  78. 1
      packages/tar/build.sh
  79. 35
      packages/tar/tmpdir-path.patch
  80. 1
      packages/util-linux/build.sh
  81. 423
      packages/util-linux/fix-paths.patch
  82. 2
      packages/wget/build.sh
  83. 46
      packages/wget/tmpdir-path.patch

1
packages/busybox/build.sh

@ -3,6 +3,7 @@ TERMUX_PKG_DESCRIPTION="Tiny versions of many common UNIX utilities into a singl
TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_LICENSE="GPL-2.0"
TERMUX_PKG_ESSENTIAL=yes TERMUX_PKG_ESSENTIAL=yes
TERMUX_PKG_VERSION=1.30.1 TERMUX_PKG_VERSION=1.30.1
TERMUX_PKG_REVISION=1
TERMUX_PKG_SHA256=3d1d04a4dbd34048f4794815a5c48ebb9eb53c5277e09ffffc060323b95dfbdc TERMUX_PKG_SHA256=3d1d04a4dbd34048f4794815a5c48ebb9eb53c5277e09ffffc060323b95dfbdc
TERMUX_PKG_SRCURL=https://busybox.net/downloads/busybox-${TERMUX_PKG_VERSION}.tar.bz2 TERMUX_PKG_SRCURL=https://busybox.net/downloads/busybox-${TERMUX_PKG_VERSION}.tar.bz2
TERMUX_PKG_BUILD_IN_SRC=yes TERMUX_PKG_BUILD_IN_SRC=yes

12
packages/busybox/util-linux-setarch.c.patch

@ -0,0 +1,12 @@
diff -uNr busybox-1.30.1/util-linux/setarch.c busybox-1.30.1.mod/util-linux/setarch.c
--- busybox-1.30.1/util-linux/setarch.c 2018-12-30 17:14:20.000000000 +0200
+++ busybox-1.30.1.mod/util-linux/setarch.c 2019-03-02 14:06:38.150442254 +0200
@@ -98,7 +98,7 @@
argv += optind;
if (!argv[0])
- (--argv)[0] = (char*)"/bin/sh";
+ (--argv)[0] = (char*)"@TERMUX_PREFIX@/bin/sh";
/* Try to execute the program */
BB_EXECVP_or_die(argv);

2
packages/coreutils/build.sh

@ -2,7 +2,7 @@ TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/coreutils/
TERMUX_PKG_DESCRIPTION="Basic file, shell and text manipulation utilities from the GNU project" TERMUX_PKG_DESCRIPTION="Basic file, shell and text manipulation utilities from the GNU project"
TERMUX_PKG_LICENSE="GPL-3.0" TERMUX_PKG_LICENSE="GPL-3.0"
TERMUX_PKG_VERSION=8.30 TERMUX_PKG_VERSION=8.30
TERMUX_PKG_REVISION=1 TERMUX_PKG_REVISION=2
TERMUX_PKG_SHA256=e831b3a86091496cdba720411f9748de81507798f6130adeaef872d206e1b057 TERMUX_PKG_SHA256=e831b3a86091496cdba720411f9748de81507798f6130adeaef872d206e1b057
TERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/coreutils/coreutils-${TERMUX_PKG_VERSION}.tar.xz TERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/coreutils/coreutils-${TERMUX_PKG_VERSION}.tar.xz
# pinky has no usage on Android. # pinky has no usage on Android.

92
packages/coreutils/fix-paths.patch

@ -0,0 +1,92 @@
diff -uNr coreutils-8.30/lib/getusershell.c coreutils-8.30.mod/lib/getusershell.c
--- coreutils-8.30/lib/getusershell.c 2018-05-14 07:20:31.000000000 +0300
+++ coreutils-8.30.mod/lib/getusershell.c 2019-03-01 20:16:36.731319198 +0200
@@ -56,7 +56,7 @@
static char const* const default_shells[] =
{
ADDITIONAL_DEFAULT_SHELLS
- "/bin/sh", "/bin/csh", "/usr/bin/sh", "/usr/bin/csh", NULL
+ "@TERMUX_PREFIX@/bin/sh", "@TERMUX_PREFIX@/bin/bash", "@TERMUX_PREFIX@/bin/ash", "@TERMUX_PREFIX@/bin/csh", NULL
};
/* Index of the next shell in 'default_shells' to return.
diff -uNr coreutils-8.30/lib/tempname.c coreutils-8.30.mod/lib/tempname.c
--- coreutils-8.30/lib/tempname.c 2018-05-14 07:22:38.000000000 +0300
+++ coreutils-8.30.mod/lib/tempname.c 2019-03-01 20:14:04.073892964 +0200
@@ -33,7 +33,7 @@
#include <stdio.h>
#ifndef P_tmpdir
-# define P_tmpdir "/tmp"
+# define P_tmpdir "@TERMUX_PREFIX@/tmp"
#endif
#ifndef TMP_MAX
# define TMP_MAX 238328
@@ -149,8 +149,8 @@
{
if (direxists (P_tmpdir))
dir = P_tmpdir;
- else if (strcmp (P_tmpdir, "/tmp") != 0 && direxists ("/tmp"))
- dir = "/tmp";
+ else if (strcmp (P_tmpdir, "@TERMUX_PREFIX@/tmp") != 0 && direxists ("@TERMUX_PREFIX@/tmp"))
+ dir = "@TERMUX_PREFIX@/tmp";
else
{
__set_errno (ENOENT);
diff -uNr coreutils-8.30/src/mktemp.c coreutils-8.30.mod/src/mktemp.c
--- coreutils-8.30/src/mktemp.c 2018-05-14 07:20:24.000000000 +0300
+++ coreutils-8.30.mod/src/mktemp.c 2019-03-01 20:12:37.923442265 +0200
@@ -270,7 +270,7 @@
else if (dest_dir_arg && *dest_dir_arg)
dest_dir = dest_dir_arg;
else
- dest_dir = "/tmp";
+ dest_dir = "@TERMUX_PREFIX@/tmp";
if (last_component (template) != template)
die (EXIT_FAILURE, 0,
@@ -284,7 +284,7 @@
else
{
char *env = getenv ("TMPDIR");
- dest_dir = (env && *env ? env : "/tmp");
+ dest_dir = (env && *env ? env : "@TERMUX_PREFIX@/tmp");
}
if (IS_ABSOLUTE_FILE_NAME (template))
die (EXIT_FAILURE, 0,
diff -uNr coreutils-8.30/src/sort.c coreutils-8.30.mod/src/sort.c
--- coreutils-8.30/src/sort.c 2018-05-14 07:20:24.000000000 +0300
+++ coreutils-8.30.mod/src/sort.c 2019-03-01 20:13:40.883773368 +0200
@@ -105,7 +105,7 @@
#endif
#ifndef DEFAULT_TMPDIR
-# define DEFAULT_TMPDIR "/tmp"
+# define DEFAULT_TMPDIR "@TERMUX_PREFIX@/tmp"
#endif
/* Maximum number of lines to merge every time a NODE is taken from
diff -uNr coreutils-8.30/src/split.c coreutils-8.30.mod/src/split.c
--- coreutils-8.30/src/split.c 2018-05-14 07:20:24.000000000 +0300
+++ coreutils-8.30.mod/src/split.c 2019-03-01 20:15:52.004434545 +0200
@@ -481,7 +481,7 @@
pid_t child_pid;
char const *shell_prog = getenv ("SHELL");
if (shell_prog == NULL)
- shell_prog = "/bin/sh";
+ shell_prog = "@TERMUX_PREFIX@/bin/sh";
if (setenv ("FILE", name, 1) != 0)
die (EXIT_FAILURE, errno,
_("failed to set FILE environment variable"));
diff -uNr coreutils-8.30/src/tac.c coreutils-8.30.mod/src/tac.c
--- coreutils-8.30/src/tac.c 2018-05-14 07:20:24.000000000 +0300
+++ coreutils-8.30.mod/src/tac.c 2019-03-01 20:13:29.470380749 +0200
@@ -67,7 +67,7 @@
#ifndef DEFAULT_TMPDIR
-# define DEFAULT_TMPDIR "/tmp"
+# define DEFAULT_TMPDIR "@TERMUX_PREFIX@/tmp"
#endif
/* The number of bytes per atomic read. */

21
packages/coreutils/mktemp.patch

@ -1,21 +0,0 @@
diff -u -r ../coreutils-8.22/src/mktemp.c ./src/mktemp.c
--- ../coreutils-8.22/src/mktemp.c 2013-12-04 15:48:30.000000000 +0100
+++ ./src/mktemp.c 2014-06-03 11:31:58.351787119 +0200
@@ -269,7 +269,7 @@
else if (dest_dir_arg && *dest_dir_arg)
dest_dir = dest_dir_arg;
else
- dest_dir = "/tmp";
+ dest_dir = "@TERMUX_PREFIX@/tmp";
if (last_component (template) != template)
error (EXIT_FAILURE, 0,
@@ -283,7 +283,7 @@
else
{
char *env = getenv ("TMPDIR");
- dest_dir = (env && *env ? env : "/tmp");
+ dest_dir = (env && *env ? env : "@TERMUX_PREFIX@/tmp");
}
if (IS_ABSOLUTE_FILE_NAME (template))
error (EXIT_FAILURE, 0,

2
packages/dnsutils/build.sh

@ -2,7 +2,7 @@ TERMUX_PKG_HOMEPAGE=https://www.isc.org/downloads/bind/
TERMUX_PKG_DESCRIPTION="Clients provided with BIND" TERMUX_PKG_DESCRIPTION="Clients provided with BIND"
TERMUX_PKG_LICENSE="MPL-2.0" TERMUX_PKG_LICENSE="MPL-2.0"
TERMUX_PKG_VERSION=9.13.6 TERMUX_PKG_VERSION=9.13.6
TERMUX_PKG_REVISION=1 TERMUX_PKG_REVISION=2
TERMUX_PKG_SHA256=ae771f209fd807d6cb9db20e16ee96ec4ba44b2052cda8c4487ddacae124870e TERMUX_PKG_SHA256=ae771f209fd807d6cb9db20e16ee96ec4ba44b2052cda8c4487ddacae124870e
TERMUX_PKG_SRCURL="ftp://ftp.isc.org/isc/bind9/${TERMUX_PKG_VERSION}/bind-${TERMUX_PKG_VERSION}.tar.gz" TERMUX_PKG_SRCURL="ftp://ftp.isc.org/isc/bind9/${TERMUX_PKG_VERSION}/bind-${TERMUX_PKG_VERSION}.tar.gz"
TERMUX_PKG_DEPENDS="openssl, readline, resolv-conf" TERMUX_PKG_DEPENDS="openssl, readline, resolv-conf"

12
packages/dnsutils/lib-irs-context.c.patch

@ -0,0 +1,12 @@
diff -uNr bind-9.13.6/lib/irs/context.c bind-9.13.6.mod/lib/irs/context.c
--- bind-9.13.6/lib/irs/context.c 2019-02-07 01:44:09.000000000 +0200
+++ bind-9.13.6.mod/lib/irs/context.c 2019-03-02 02:39:12.188552664 +0200
@@ -42,7 +42,7 @@
#ifndef DNS_CONF
/*% location of dns.conf */
-#define DNS_CONF "/etc/dns.conf"
+#define DNS_CONF "@TERMUX_PREFIX@/etc/dns.conf"
#endif
static bool thread_key_initialized = false;

2
packages/ffmpeg/build.sh

@ -3,7 +3,7 @@ TERMUX_PKG_DESCRIPTION="Tools and libraries to manipulate a wide range of multim
TERMUX_PKG_LICENSE="GPL-3.0" TERMUX_PKG_LICENSE="GPL-3.0"
# NOTE: mpv has to be rebuilt and version bumped after updating ffmpeg. # NOTE: mpv has to be rebuilt and version bumped after updating ffmpeg.
TERMUX_PKG_VERSION=4.1.1 TERMUX_PKG_VERSION=4.1.1
TERMUX_PKG_REVISION=1 TERMUX_PKG_REVISION=2
TERMUX_PKG_SHA256=373749824dfd334d84e55dff406729edfd1606575ee44dd485d97d45ea4d2d86 TERMUX_PKG_SHA256=373749824dfd334d84e55dff406729edfd1606575ee44dd485d97d45ea4d2d86
TERMUX_PKG_SRCURL=https://www.ffmpeg.org/releases/ffmpeg-${TERMUX_PKG_VERSION}.tar.xz TERMUX_PKG_SRCURL=https://www.ffmpeg.org/releases/ffmpeg-${TERMUX_PKG_VERSION}.tar.xz
# libbz2 is used by matroska decoder: # libbz2 is used by matroska decoder:

21
packages/ffmpeg/libavutil-file_open.c.patch

@ -0,0 +1,21 @@
diff -uNr ffmpeg-4.1.1/libavutil/file_open.c ffmpeg-4.1.1.mod/libavutil/file_open.c
--- ffmpeg-4.1.1/libavutil/file_open.c 2019-02-09 22:56:02.000000000 +0200
+++ ffmpeg-4.1.1.mod/libavutil/file_open.c 2019-03-02 01:54:58.775236751 +0200
@@ -119,7 +119,7 @@
#undef free
free(ptr);
#else
- size_t len = strlen(prefix) + 12; /* room for "/tmp/" and "XXXXXX\0" */
+ size_t len = strlen(prefix) + strlen("@TERMUX_PREFIX@/tmp/") + 7; /* room for "@TERMUX_PREFIX@/tmp/" and "XXXXXX\0" */
*filename = av_malloc(len);
#endif
/* -----common section-----*/
@@ -136,7 +136,7 @@
# endif
fd = open(*filename, O_RDWR | O_BINARY | O_CREAT | O_EXCL, 0600);
#else
- snprintf(*filename, len, "/tmp/%sXXXXXX", prefix);
+ snprintf(*filename, len, "@TERMUX_PREFIX@/tmp/%sXXXXXX", prefix);
fd = mkstemp(*filename);
#if defined(_WIN32) || defined (__ANDROID__)
if (fd < 0) {

1
packages/file/build.sh

@ -2,6 +2,7 @@ TERMUX_PKG_HOMEPAGE=https://darwinsys.com/file/
TERMUX_PKG_DESCRIPTION="Command-line tool that tells you in words what kind of data a file contains" TERMUX_PKG_DESCRIPTION="Command-line tool that tells you in words what kind of data a file contains"
TERMUX_PKG_LICENSE="BSD 2-Clause" TERMUX_PKG_LICENSE="BSD 2-Clause"
TERMUX_PKG_VERSION=5.36 TERMUX_PKG_VERSION=5.36
TERMUX_PKG_REVISION=1
TERMUX_PKG_SHA256=fb608290c0fd2405a8f63e5717abf6d03e22e183fb21884413d1edd918184379 TERMUX_PKG_SHA256=fb608290c0fd2405a8f63e5717abf6d03e22e183fb21884413d1edd918184379
TERMUX_PKG_SRCURL=ftp://ftp.astron.com/pub/file/file-${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SRCURL=ftp://ftp.astron.com/pub/file/file-${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="ac_cv_func_mmap_fixed_mapped=yes" TERMUX_PKG_EXTRA_CONFIGURE_ARGS="ac_cv_func_mmap_fixed_mapped=yes"

24
packages/file/fix-paths.patch

@ -0,0 +1,24 @@
diff -uNr file-5.35/src/compress.c file-5.35.mod/src/compress.c
--- file-5.35/src/compress.c 2018-10-15 19:29:16.000000000 +0300
+++ file-5.35.mod/src/compress.c 2019-03-02 01:49:14.754069208 +0200
@@ -410,7 +410,7 @@
ssize_t r;
int tfd;
- (void)strlcpy(buf, "/tmp/file.XXXXXX", sizeof buf);
+ (void)strlcpy(buf, "@TERMUX_PREFIX@/tmp/file.XXXXXX", sizeof buf);
#ifndef HAVE_MKSTEMP
{
char *ptr = mktemp(buf);
diff -uNr file-5.35/src/file.h file-5.35.mod/src/file.h
--- file-5.35/src/file.h 2018-10-15 19:29:16.000000000 +0300
+++ file-5.35.mod/src/file.h 2019-03-02 01:49:41.984157713 +0200
@@ -79,7 +79,7 @@
#define ENABLE_CONDITIONALS
#ifndef MAGIC
-#define MAGIC "/etc/magic"
+#define MAGIC "@TERMUX_PREFIX@/etc/magic"
#endif
#if defined(__EMX__) || defined (WIN32)

1
packages/glib/build.sh

@ -2,6 +2,7 @@ TERMUX_PKG_HOMEPAGE=https://developer.gnome.org/glib/
TERMUX_PKG_DESCRIPTION="Library providing core building blocks for libraries and applications written in C" TERMUX_PKG_DESCRIPTION="Library providing core building blocks for libraries and applications written in C"
TERMUX_PKG_LICENSE="LGPL-2.1" TERMUX_PKG_LICENSE="LGPL-2.1"
TERMUX_PKG_VERSION=2.58.3 TERMUX_PKG_VERSION=2.58.3
TERMUX_PKG_REVISION=1
TERMUX_PKG_SHA256=8f43c31767e88a25da72b52a40f3301fefc49a665b56dc10ee7cc9565cbe7481 TERMUX_PKG_SHA256=8f43c31767e88a25da72b52a40f3301fefc49a665b56dc10ee7cc9565cbe7481
TERMUX_PKG_SRCURL=https://ftp.gnome.org/pub/gnome/sources/glib/${TERMUX_PKG_VERSION:0:4}/glib-${TERMUX_PKG_VERSION}.tar.xz TERMUX_PKG_SRCURL=https://ftp.gnome.org/pub/gnome/sources/glib/${TERMUX_PKG_VERSION:0:4}/glib-${TERMUX_PKG_VERSION}.tar.xz
# libandroid-support to get langinfo.h in include path. # libandroid-support to get langinfo.h in include path.

303
packages/glib/fix-hardcoded-paths.patch

@ -1,7 +1,7 @@
diff -uNr glib-2.56.1/gio/gdbusaddress.c glib-2.56.1.mod/gio/gdbusaddress.c diff -uNr glib-2.58.3/gio/gdbusaddress.c glib-2.58.3.mod/gio/gdbusaddress.c
--- glib-2.56.1/gio/gdbusaddress.c 2018-02-06 17:44:20.000000000 +0200 --- glib-2.58.3/gio/gdbusaddress.c 2019-01-21 15:38:50.000000000 +0200
+++ glib-2.56.1.mod/gio/gdbusaddress.c 2018-06-19 14:33:32.367220998 +0300 +++ glib-2.58.3.mod/gio/gdbusaddress.c 2019-03-02 02:08:55.324976201 +0200
@@ -1624,7 +1624,7 @@ @@ -1628,7 +1628,7 @@
ret = g_strdup (g_getenv ("DBUS_SYSTEM_BUS_ADDRESS")); ret = g_strdup (g_getenv ("DBUS_SYSTEM_BUS_ADDRESS"));
if (ret == NULL) if (ret == NULL)
{ {
@ -10,9 +10,9 @@ diff -uNr glib-2.56.1/gio/gdbusaddress.c glib-2.56.1.mod/gio/gdbusaddress.c
} }
break; break;
diff -uNr glib-2.56.1/gio/gdbusprivate.c glib-2.56.1.mod/gio/gdbusprivate.c diff -uNr glib-2.58.3/gio/gdbusprivate.c glib-2.58.3.mod/gio/gdbusprivate.c
--- glib-2.56.1/gio/gdbusprivate.c 2018-04-07 05:10:22.000000000 +0300 --- glib-2.58.3/gio/gdbusprivate.c 2019-01-21 15:38:50.000000000 +0200
+++ glib-2.56.1.mod/gio/gdbusprivate.c 2018-06-19 14:38:52.253904135 +0300 +++ glib-2.58.3.mod/gio/gdbusprivate.c 2019-03-02 02:08:55.328309547 +0200
@@ -2098,17 +2098,17 @@ @@ -2098,17 +2098,17 @@
/* TODO: use PACKAGE_LOCALSTATEDIR ? */ /* TODO: use PACKAGE_LOCALSTATEDIR ? */
ret = NULL; ret = NULL;
@ -34,9 +34,9 @@ diff -uNr glib-2.56.1/gio/gdbusprivate.c glib-2.56.1.mod/gio/gdbusprivate.c
} }
else else
{ {
diff -uNr glib-2.56.1/gio/gnetworking.h.in glib-2.56.1.mod/gio/gnetworking.h.in diff -uNr glib-2.58.3/gio/gnetworking.h.in glib-2.58.3.mod/gio/gnetworking.h.in
--- glib-2.56.1/gio/gnetworking.h.in 2017-07-14 02:03:38.000000000 +0300 --- glib-2.58.3/gio/gnetworking.h.in 2019-01-21 15:38:50.000000000 +0200
+++ glib-2.56.1.mod/gio/gnetworking.h.in 2018-06-19 14:33:00.180552674 +0300 +++ glib-2.58.3.mod/gio/gnetworking.h.in 2019-03-02 02:08:55.331642893 +0200
@@ -55,7 +55,7 @@ @@ -55,7 +55,7 @@
#endif #endif
@ -46,10 +46,10 @@ diff -uNr glib-2.56.1/gio/gnetworking.h.in glib-2.56.1.mod/gio/gnetworking.h.in
#endif #endif
#ifndef CMSG_LEN #ifndef CMSG_LEN
diff -uNr glib-2.56.1/gio/gunixmounts.c glib-2.56.1.mod/gio/gunixmounts.c diff -uNr glib-2.58.3/gio/gunixmounts.c glib-2.58.3.mod/gio/gunixmounts.c
--- glib-2.56.1/gio/gunixmounts.c 2018-04-07 05:10:22.000000000 +0300 --- glib-2.58.3/gio/gunixmounts.c 2019-01-21 15:38:50.000000000 +0200
+++ glib-2.56.1.mod/gio/gunixmounts.c 2018-06-19 14:42:12.380581105 +0300 +++ glib-2.58.3.mod/gio/gunixmounts.c 2019-03-02 02:08:55.331642893 +0200
@@ -522,7 +522,7 @@ @@ -539,7 +539,7 @@
return _PATH_MOUNTED; return _PATH_MOUNTED;
# endif # endif
#else #else
@ -58,7 +58,7 @@ diff -uNr glib-2.56.1/gio/gunixmounts.c glib-2.56.1.mod/gio/gunixmounts.c
#endif #endif
} }
@@ -648,7 +648,7 @@ @@ -666,7 +666,7 @@
mountinfo_path = _PATH_MOUNTED; mountinfo_path = _PATH_MOUNTED;
# endif # endif
#else #else
@ -67,7 +67,7 @@ diff -uNr glib-2.56.1/gio/gunixmounts.c glib-2.56.1.mod/gio/gunixmounts.c
#endif #endif
return mountinfo_path; return mountinfo_path;
@@ -939,7 +939,7 @@ @@ -960,7 +960,7 @@
#elif defined(VFSTAB) #elif defined(VFSTAB)
return VFSTAB; return VFSTAB;
#else #else
@ -76,7 +76,7 @@ diff -uNr glib-2.56.1/gio/gunixmounts.c glib-2.56.1.mod/gio/gunixmounts.c
#endif #endif
#endif #endif
} }
@@ -2894,7 +2894,7 @@ @@ -2955,7 +2955,7 @@
/* see if device with similar major:minor as /dev/root is mention /* see if device with similar major:minor as /dev/root is mention
* in /etc/mtab (it usually is) * in /etc/mtab (it usually is)
*/ */
@ -85,10 +85,242 @@ diff -uNr glib-2.56.1/gio/gunixmounts.c glib-2.56.1.mod/gio/gunixmounts.c
if (f != NULL) if (f != NULL)
{ {
struct mntent *entp; struct mntent *entp;
diff -uNr glib-2.56.1/gio/xdgmime/xdgmime.c glib-2.56.1.mod/gio/xdgmime/xdgmime.c diff -uNr glib-2.58.3/gio/tests/org.gtk.test.gschema.override.orig glib-2.58.3.mod/gio/tests/org.gtk.test.gschema.override.orig
--- glib-2.56.1/gio/xdgmime/xdgmime.c 2018-03-12 18:23:37.000000000 +0200 --- glib-2.58.3/gio/tests/org.gtk.test.gschema.override.orig 2019-01-21 15:38:50.000000000 +0200
+++ glib-2.56.1.mod/gio/xdgmime/xdgmime.c 2018-06-19 14:43:59.737253299 +0300 +++ glib-2.58.3.mod/gio/tests/org.gtk.test.gschema.override.orig 1970-01-01 03:00:00.000000000 +0300
@@ -253,7 +253,7 @@ @@ -1,2 +0,0 @@
-[org.gtk.test.per-desktop:GNOME-Classic]
-desktop = "GNOME Classic"
diff -uNr glib-2.58.3/gio/tests/org.gtk.test.gschema.xml.orig glib-2.58.3.mod/gio/tests/org.gtk.test.gschema.xml.orig
--- glib-2.58.3/gio/tests/org.gtk.test.gschema.xml.orig 2019-01-21 15:38:50.000000000 +0200
+++ glib-2.58.3.mod/gio/tests/org.gtk.test.gschema.xml.orig 1970-01-01 03:00:00.000000000 +0300
@@ -1,222 +0,0 @@
-<schemalist>
-
- <schema id="org.gtk.test" path="/tests/" gettext-domain="test">
- <key name="greeting" type="s">
- <default l10n="messages">"Hello, earthlings"</default>
- <summary>A greeting</summary>
- <description>
- Greeting of the invading martians
- </description>
- </key>
- <key name="farewell" type="s">
- <default l10n="messages">"So long"</default>
- </key>
-
- <child name='basic-types' schema='org.gtk.test.basic-types'/>
- <child name='complex-types' schema='org.gtk.test.complex-types'/>
- <child name='localized' schema='org.gtk.test.localized'/>
- </schema>
-
- <schema id="org.gtk.test.no-path">
- <key name="test-boolean" type="b">
- <default>true</default>
- </key>
- </schema>
-
- <schema id="org.gtk.test.basic-types" path="/tests/basic-types/">
- <key name="test-boolean" type="b">
- <default>true</default>
- </key>
- <key name="test-byte" type="y">
- <default>25</default>
- </key>
- <key name="test-int16" type="n">
- <default>-1234</default>
- </key>
- <key name="test-uint16" type="q">
- <default>1234</default>
- </key>
- <key name="test-int32" type="i">
- <default>-123456</default>
- </key>
- <key name="test-uint32" type="u">
- <default>123456</default>
- </key>
- <key name="test-int64" type="x">
- <default>-123456789</default>
- </key>
- <key name="test-uint64" type="t">
- <default>123456789</default>
- </key>
- <key name="test-double" type="d">
- <default>123.456</default>
- </key>
- <key name="test-string" type="s">
- <default>"a string, it seems"</default>
- </key>
- <key name="test-objectpath" type="o">
- <default>"/a/object/path"</default>
- </key>
- </schema>
-
- <schema id="org.gtk.test.complex-types" path="/tests/complex-types/">
- <key name="test-tuple" type="(s(ii))">
- <default>("one",(2,3))</default>
- </key>
- <key name="test-array" type="ai">
- <default>[0,1,2,3,4,5]</default>
- </key>
- <key name="test-dict" type="a{sau}">
- <default>
- {
- "AC": [0,0, 0,0,0,0,0,0],
- "IV": [0,0, 0,0,0,0,0,0]
- }
- </default>
- </key>
- </schema>
-
- <schema id="org.gtk.test.localized" path="/tests/localized/" gettext-domain="test">
- <key name="error-message" type="s">
- <default l10n="messages">"Unnamed"</default>
- </key>
- <key name="backspace" type="s">
- <default l10n="messages" context="keyboard label">"BackSpace"</default>
- </key>
- </schema>
-
- <schema id="org.gtk.test.binding" path="/tests/binding/">
- <key name="bool" type="b">
- <default>false</default>
- </key>
- <key name="anti-bool" type="b">
- <default>false</default>
- </key>
- <key name="byte" type="y">
- <default>0</default>
- </key>
- <key name="int16" type="n">
- <default>0</default>
- </key>
- <key name="uint16" type="q">
- <default>0</default>
- </key>
- <key name="int" type="i">
- <default>0</default>
- </key>
- <key name="uint" type="u">
- <default>0</default>
- </key>
- <key name="int64" type="x">
- <default>0</default>
- </key>
- <key name="uint64" type="t">
- <default>0</default>
- </key>
- <key name="double" type="d">
- <default>0</default>
- </key>
- <key name="string" type="s">
- <default>""</default>
- </key>
- <key name="chararray" type="ay">
- <default>[48, 49]</default>
- </key>
- <key name="strv" type="as">
- <default>[]</default>
- </key>
- <key name="enum" enum="org.gtk.test.TestEnum">
- <default>'foo'</default>
- </key>
- <key name="flags" flags="org.gtk.test.TestFlags">
- <default>['mourning', 'laughing']</default>
- </key>
- <key name="range" type='u'>
- <default>33</default>
- <range min="2" max="44"/>
- </key>
- </schema>
-
- <schema id='org.gtk.test.enums' path='/tests/enums/'>
- <key name='test' enum='org.gtk.test.TestEnum'>
- <default>'bar'</default>
- <aliases>
- <alias value='qux' target='quux'/>
- </aliases>
- </key>
- <key name='f-test' flags='org.gtk.test.TestFlags'>
- <default>[]</default>
- <aliases>
- <alias value='speaking' target='talking'/>
- </aliases>
- </key>
- </schema>
-
- <schema id='org.gtk.test.enums.direct' path='/tests/enums/'>
- <key name='f-test' type='as'>
- <default>[]</default>
- </key>
- <key name='test' type='s'>
- <default>'bar'</default>
- </key>
- </schema>
-
- <schema id='org.gtk.test.range' path='/tests/range/'>
- <key name='val' type='i'>
- <default>33</default>
- <range min='2' max='44'/>
- </key>
- </schema>
-
- <schema id='org.gtk.test.range.direct' path='/tests/range/'>
- <key name='val' type='i'>
- <default>33</default>
- </key>
- </schema>
-
- <schema id='org.gtk.test.mapped' path='/tests/mapped/'>
- <key name='val' type='i'>
- <default>0</default>
- </key>
- </schema>
-
- <schema id="org.gtk.test.descriptions" path="/a/">
- <key name='a' type='i'>
- <summary>
- a paragraph.
-
- with some whitespace.
-
- because not everyone has a great editor.
-
-
-
-
- lots of space is as one.
- </summary>
- <default>0</default>
- </key>
- </schema>
-
- <schema id='org.gtk.test.extends.base'>
- <key name='int32' type='i'>
- <default>0</default>
- </key>
- <key name='string' type='s'>
- <default>''</default>
- </key>
- </schema>
- <schema id='org.gtk.test.extends.extended' extends='org.gtk.test.extends.base'>
- <override name="int32">42</override>
- <key name='another-int32' type='i'>
- <default>0</default>
- </key>
- </schema>
-
- <schema id="org.gtk.test.per-desktop" path="/tests/per-desktop/">
- <key name="desktop" type="s">
- <default>"GNOME"</default>
- </key>
- </schema>
-
-</schemalist>
diff -uNr glib-2.58.3/gio/xdgmime/xdgmime.c glib-2.58.3.mod/gio/xdgmime/xdgmime.c
--- glib-2.58.3/gio/xdgmime/xdgmime.c 2019-01-21 15:38:50.000000000 +0200
+++ glib-2.58.3.mod/gio/xdgmime/xdgmime.c 2019-03-02 02:08:55.334976238 +0200
@@ -255,7 +255,7 @@
xdg_data_dirs = getenv ("XDG_DATA_DIRS"); xdg_data_dirs = getenv ("XDG_DATA_DIRS");
if (xdg_data_dirs == NULL) if (xdg_data_dirs == NULL)
@ -97,10 +329,10 @@ diff -uNr glib-2.56.1/gio/xdgmime/xdgmime.c glib-2.56.1.mod/gio/xdgmime/xdgmime.
ptr = xdg_data_dirs; ptr = xdg_data_dirs;
diff -uNr glib-2.56.1/glib/gcharset.c glib-2.56.1.mod/glib/gcharset.c diff -uNr glib-2.58.3/glib/gcharset.c glib-2.58.3.mod/glib/gcharset.c
--- glib-2.56.1/glib/gcharset.c 2018-04-07 05:10:22.000000000 +0300 --- glib-2.58.3/glib/gcharset.c 2019-01-21 15:38:50.000000000 +0200
+++ glib-2.56.1.mod/glib/gcharset.c 2018-06-19 14:33:00.183886007 +0300 +++ glib-2.58.3.mod/glib/gcharset.c 2019-03-02 02:08:55.334976238 +0200
@@ -297,7 +297,7 @@ @@ -298,7 +298,7 @@
if (g_once_init_enter (&alias_table)) if (g_once_init_enter (&alias_table))
{ {
GHashTable *table = g_hash_table_new (g_str_hash, g_str_equal); GHashTable *table = g_hash_table_new (g_str_hash, g_str_equal);
@ -109,10 +341,10 @@ diff -uNr glib-2.56.1/glib/gcharset.c glib-2.56.1.mod/glib/gcharset.c
g_once_init_leave (&alias_table, table); g_once_init_leave (&alias_table, table);
} }
diff -uNr glib-2.56.1/glib/gutils.c glib-2.56.1.mod/glib/gutils.c diff -uNr glib-2.58.3/glib/gutils.c glib-2.58.3.mod/glib/gutils.c
--- glib-2.56.1/glib/gutils.c 2018-01-08 23:34:19.000000000 +0200 --- glib-2.58.3/glib/gutils.c 2019-01-21 15:38:50.000000000 +0200
+++ glib-2.56.1.mod/glib/gutils.c 2018-06-19 14:35:11.100559415 +0300 +++ glib-2.58.3.mod/glib/gutils.c 2019-03-02 02:10:27.148655478 +0200
@@ -378,7 +378,7 @@ @@ -381,7 +381,7 @@
* what to search if PATH is unset. POSIX may, dunno. * what to search if PATH is unset. POSIX may, dunno.
*/ */
@ -121,7 +353,16 @@ diff -uNr glib-2.56.1/glib/gutils.c glib-2.56.1.mod/glib/gutils.c
} }
#else #else
n = GetModuleFileNameW (NULL, wfilename, MAXPATHLEN); n = GetModuleFileNameW (NULL, wfilename, MAXPATHLEN);
@@ -2028,7 +2028,7 @@ @@ -959,7 +959,7 @@
if (tmp == NULL || *tmp == '\0')
{
g_free (tmp);
- tmp = g_strdup ("/tmp");
+ tmp = g_strdup ("@TERMUX_PREFIX@/tmp");
}
#endif /* !G_OS_WIN32 */
@@ -2043,7 +2043,7 @@
#ifndef G_OS_WIN32 #ifndef G_OS_WIN32
if (!data_dirs || !data_dirs[0]) if (!data_dirs || !data_dirs[0])
@ -130,7 +371,7 @@ diff -uNr glib-2.56.1/glib/gutils.c glib-2.56.1.mod/glib/gutils.c
data_dir_vector = g_strsplit (data_dirs, G_SEARCHPATH_SEPARATOR_S, 0); data_dir_vector = g_strsplit (data_dirs, G_SEARCHPATH_SEPARATOR_S, 0);
#else #else
@@ -2104,7 +2104,7 @@ @@ -2119,7 +2119,7 @@
} }
#else #else
if (!conf_dirs || !conf_dirs[0]) if (!conf_dirs || !conf_dirs[0])

2
packages/gnupg/build.sh

@ -2,7 +2,7 @@ TERMUX_PKG_HOMEPAGE=https://www.gnupg.org/
TERMUX_PKG_DESCRIPTION="Implementation of the OpenPGP standard for encrypting and signing data and communication" TERMUX_PKG_DESCRIPTION="Implementation of the OpenPGP standard for encrypting and signing data and communication"
TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_LICENSE="GPL-2.0"
TERMUX_PKG_VERSION=2.2.13 TERMUX_PKG_VERSION=2.2.13
TERMUX_PKG_REVISION=1 TERMUX_PKG_REVISION=2
TERMUX_PKG_SHA256=76c787a955f9e6e0ead47c9be700bfb9d454f955a7b7c7e697aa719bac7b11d8 TERMUX_PKG_SHA256=76c787a955f9e6e0ead47c9be700bfb9d454f955a7b7c7e697aa719bac7b11d8
TERMUX_PKG_SRCURL=https://www.gnupg.org/ftp/gcrypt/gnupg/gnupg-${TERMUX_PKG_VERSION}.tar.bz2 TERMUX_PKG_SRCURL=https://www.gnupg.org/ftp/gcrypt/gnupg/gnupg-${TERMUX_PKG_VERSION}.tar.bz2
TERMUX_PKG_DEPENDS="libassuan,libbz2,libgcrypt,libksba,libsqlite,libnpth,readline,pinentry,libgpg-error" TERMUX_PKG_DEPENDS="libassuan,libbz2,libgcrypt,libksba,libsqlite,libnpth,readline,pinentry,libgpg-error"

42
packages/gnupg/dirmngr-dns.patch

@ -1,42 +0,0 @@
diff -u -r ../gnupg-2.1.22/dirmngr/dns.c ./dirmngr/dns.c
--- ../gnupg-2.1.22/dirmngr/dns.c 2017-07-25 09:37:05.000000000 +0200
+++ ./dirmngr/dns.c 2017-07-29 20:54:37.445647974 +0200
@@ -5424,7 +5424,7 @@
if (!(resconf = dns_resconf_open(&error)))
goto error;
- if ((error = dns_resconf_loadpath(resconf, "/etc/resolv.conf"))) {
+ if ((error = dns_resconf_loadpath(resconf, "@TERMUX_PREFIX@/etc/resolv.conf"))) {
/*
* NOTE: Both the glibc and BIND9 resolvers ignore a missing
* /etc/resolv.conf, defaulting to a nameserver of
@@ -5436,7 +5436,7 @@
goto error;
}
- if ((error = dns_nssconf_loadpath(resconf, "/etc/nsswitch.conf"))) {
+ if ((error = dns_nssconf_loadpath(resconf, "@TERMUX_PREFIX@/etc/nsswitch.conf"))) {
if (error != ENOENT)
goto error;
}
@@ -10407,7 +10407,7 @@
panic("dns_resconf_open: %s", dns_strerror(error));
if (!MAIN.resconf.count)
- MAIN.resconf.path[MAIN.resconf.count++] = "/etc/resolv.conf";
+ MAIN.resconf.path[MAIN.resconf.count++] = "@TERMUX_PREFIX@/etc/resolv.conf";
for (i = 0; i < MAIN.resconf.count; i++) {
path = MAIN.resconf.path[i];
diff -u -r ../gnupg-2.1.22/dirmngr/dns-stuff.c ./dirmngr/dns-stuff.c
--- ../gnupg-2.1.22/dirmngr/dns-stuff.c 2017-05-25 20:24:30.000000000 +0200
+++ ./dirmngr/dns-stuff.c 2017-07-29 20:54:00.414067929 +0200
@@ -114,7 +114,7 @@
#define DEFAULT_TIMEOUT 30
-#define RESOLV_CONF_NAME "/etc/resolv.conf"
+#define RESOLV_CONF_NAME "@TERMUX_PREFIX@/etc/resolv.conf"
/* Two flags to enable verbose and debug mode. */
static int opt_verbose;

240
packages/gnupg/fix-paths.patch

@ -0,0 +1,240 @@
diff -uNr gnupg-2.2.13/dirmngr/certcache.c gnupg-2.2.13.mod/dirmngr/certcache.c
--- gnupg-2.2.13/dirmngr/certcache.c 2018-04-25 13:38:04.000000000 +0300
+++ gnupg-2.2.13.mod/dirmngr/certcache.c 2019-03-02 01:32:08.653821497 +0200
@@ -674,11 +674,8 @@
#ifdef DEFAULT_TRUST_STORE_FILE
{ DEFAULT_TRUST_STORE_FILE }
#else
- { "/etc/ssl/ca-bundle.pem" },
- { "/etc/ssl/certs/ca-certificates.crt" },
- { "/etc/pki/tls/cert.pem" },
- { "/usr/local/share/certs/ca-root-nss.crt" },
- { "/etc/ssl/cert.pem" }
+ { "@TERMUX_PREFIX@/etc/tls/cert.pem" },
+ { "@TERMUX_PREFIX@/etc/ssl/cert.pem" }
#endif /*!DEFAULT_TRUST_STORE_FILE*/
};
int idx;
diff -uNr gnupg-2.2.13/dirmngr/dns.c gnupg-2.2.13.mod/dirmngr/dns.c
--- gnupg-2.2.13/dirmngr/dns.c 2018-12-18 09:26:53.000000000 +0200
+++ gnupg-2.2.13.mod/dirmngr/dns.c 2019-03-02 01:33:24.937449148 +0200
@@ -5112,7 +5112,7 @@
if (!(hosts = dns_hosts_open(&error)))
goto error;
- if ((error = dns_hosts_loadpath(hosts, "/etc/hosts")))
+ if ((error = dns_hosts_loadpath(hosts, "@TERMUX_PREFIX@/etc/hosts")))
goto error;
return hosts;
@@ -5428,7 +5428,7 @@
if (!(resconf = dns_resconf_open(&error)))
goto error;
- if ((error = dns_resconf_loadpath(resconf, "/etc/resolv.conf"))) {
+ if ((error = dns_resconf_loadpath(resconf, "@TERMUX_PREFIX@/etc/resolv.conf"))) {
/*
* NOTE: Both the glibc and BIND9 resolvers ignore a missing
* /etc/resolv.conf, defaulting to a nameserver of
@@ -5440,7 +5440,7 @@
goto error;
}
- if ((error = dns_nssconf_loadpath(resconf, "/etc/nsswitch.conf"))) {
+ if ((error = dns_nssconf_loadpath(resconf, "@TERMUX_PREFIX@/etc/nsswitch.conf"))) {
if (error != ENOENT)
goto error;
}
@@ -10436,7 +10436,7 @@
panic("dns_resconf_open: %s", dns_strerror(error));
if (!MAIN.resconf.count)
- MAIN.resconf.path[MAIN.resconf.count++] = "/etc/resolv.conf";
+ MAIN.resconf.path[MAIN.resconf.count++] = "@TERMUX_PREFIX@/etc/resolv.conf";
for (i = 0; i < MAIN.resconf.count; i++) {
path = MAIN.resconf.path[i];
@@ -10485,11 +10485,11 @@
return *hosts;
if (!MAIN.hosts.count) {
- MAIN.hosts.path[MAIN.hosts.count++] = "/etc/hosts";
+ MAIN.hosts.path[MAIN.hosts.count++] = "@TERMUX_PREFIX@/etc/hosts";
/* Explicitly test dns_hosts_local() */
if (!(*hosts = dns_hosts_local(&error)))
- panic("%s: %s", "/etc/hosts", dns_strerror(error));
+ panic("%s: %s", "@TERMUX_PREFIX@/etc/hosts", dns_strerror(error));
return *hosts;
}
diff -uNr gnupg-2.2.13/dirmngr/dns-stuff.c gnupg-2.2.13.mod/dirmngr/dns-stuff.c
--- gnupg-2.2.13/dirmngr/dns-stuff.c 2018-07-03 12:54:26.000000000 +0300
+++ gnupg-2.2.13.mod/dirmngr/dns-stuff.c 2019-03-02 01:32:38.027267980 +0200
@@ -114,7 +114,7 @@
#define DEFAULT_TIMEOUT 30
-#define RESOLV_CONF_NAME "/etc/resolv.conf"
+#define RESOLV_CONF_NAME "@TERMUX_PREFIX@/etc/resolv.conf"
/* Two flags to enable verbose and debug mode. */
static int opt_verbose;
@@ -602,7 +602,7 @@
derr = dns_hosts_loadpath (ld.hosts, hosts_path);
xfree (hosts_path);
#else
- derr = dns_hosts_loadpath (ld.hosts, "/etc/hosts");
+ derr = dns_hosts_loadpath (ld.hosts, "@TERMUX_PREFIX@/etc/hosts");
#endif
if (derr)
{
diff -uNr gnupg-2.2.13/dirmngr/ks-engine-ldap.c gnupg-2.2.13.mod/dirmngr/ks-engine-ldap.c
--- gnupg-2.2.13/dirmngr/ks-engine-ldap.c 2018-10-25 18:37:53.000000000 +0300
+++ gnupg-2.2.13.mod/dirmngr/ks-engine-ldap.c 2019-03-02 01:32:08.667154882 +0200
@@ -1947,9 +1947,9 @@
if (dump_modlist)
{
- dump = es_fopen("/tmp/modlist.txt", "w");
+ dump = es_fopen("@TERMUX_PREFIX@/tmp/modlist.txt", "w");
if (! dump)
- log_error ("Failed to open /tmp/modlist.txt: %s\n",
+ log_error ("Failed to open @TERMUX_PREFIX@/tmp/modlist.txt: %s\n",
strerror (errno));
if (dump)
diff -uNr gnupg-2.2.13/g10/exec.c gnupg-2.2.13.mod/g10/exec.c
--- gnupg-2.2.13/g10/exec.c 2017-08-28 13:22:54.000000000 +0300
+++ gnupg-2.2.13.mod/g10/exec.c 2019-03-02 01:32:08.667154882 +0200
@@ -180,7 +180,7 @@
tmp="<Wimp$ScrapDir>.GnuPG";
mkdir(tmp,0700); /* Error checks occur later on */
#else
- tmp="/tmp";
+ tmp="@TERMUX_PREFIX@/tmp";
#endif
}
}
@@ -383,7 +383,7 @@
char *shell=getenv("SHELL");
if(shell==NULL)
- shell="/bin/sh";
+ shell="@TERMUX_PREFIX@/bin/sh";
/* I'm the child */
diff -uNr gnupg-2.2.13/g13/be-encfs.c gnupg-2.2.13.mod/g13/be-encfs.c
--- gnupg-2.2.13/g13/be-encfs.c 2017-08-28 13:22:54.000000000 +0300
+++ gnupg-2.2.13.mod/g13/be-encfs.c 2019-03-02 01:32:08.670488228 +0200
@@ -410,7 +410,7 @@
if (err)
goto leave;
- mountpoint = xtrystrdup ("/tmp/.#g13_XXXXXX");
+ mountpoint = xtrystrdup ("@TERMUX_PREFIX@/tmp/.#g13_XXXXXX");
if (!mountpoint)
{
err = gpg_error_from_syserror ();
@@ -420,7 +420,7 @@
{
err = gpg_error_from_syserror ();
log_error (_("can't create directory '%s': %s\n"),
- "/tmp/.#g13_XXXXXX", gpg_strerror (err));
+ "@TERMUX_PREFIX@/tmp/.#g13_XXXXXX", gpg_strerror (err));
goto leave;
}
diff -uNr gnupg-2.2.13/g13/mount.c gnupg-2.2.13.mod/g13/mount.c
--- gnupg-2.2.13/g13/mount.c 2017-08-28 13:22:54.000000000 +0300
+++ gnupg-2.2.13.mod/g13/mount.c 2019-03-02 01:32:08.670488228 +0200
@@ -82,14 +82,14 @@
if (!mountpoint)
{
- mountpoint_buffer = xtrystrdup ("/tmp/g13-XXXXXX");
+ mountpoint_buffer = xtrystrdup ("@TERMUX_PREFIX@/tmp/g13-XXXXXX");
if (!mountpoint_buffer)
return gpg_error_from_syserror ();
if (!gnupg_mkdtemp (mountpoint_buffer))
{
err = gpg_error_from_syserror ();
log_error (_("can't create directory '%s': %s\n"),
- "/tmp/g13-XXXXXX", gpg_strerror (err));
+ "@TERMUX_PREFIX@/tmp/g13-XXXXXX", gpg_strerror (err));
xfree (mountpoint_buffer);
return err;
}
diff -uNr gnupg-2.2.13/scd/scdaemon.c gnupg-2.2.13.mod/scd/scdaemon.c
--- gnupg-2.2.13/scd/scdaemon.c 2018-03-21 20:43:33.000000000 +0200
+++ gnupg-2.2.13.mod/scd/scdaemon.c 2019-03-02 01:32:08.670488228 +0200
@@ -766,10 +766,10 @@
write. */
if (allow_coredump)
{
- if (chdir("/tmp"))
- log_debug ("chdir to '/tmp' failed: %s\n", strerror (errno));
+ if (chdir("@TERMUX_PREFIX@/tmp"))
+ log_debug ("chdir to '@TERMUX_PREFIX@/tmp' failed: %s\n", strerror (errno));
else
- log_debug ("changed working directory to '/tmp'\n");
+ log_debug ("changed working directory to '@TERMUX_PREFIX@/tmp'\n");
}
/* In multi server mode we need to listen on an additional
diff -uNr gnupg-2.2.13/tests/gpgscm/ffi.c gnupg-2.2.13.mod/tests/gpgscm/ffi.c
--- gnupg-2.2.13/tests/gpgscm/ffi.c 2017-08-28 13:22:54.000000000 +0300
+++ gnupg-2.2.13.mod/tests/gpgscm/ffi.c 2019-03-02 01:32:08.673821575 +0200
@@ -355,7 +355,7 @@
FFI_RETURN_STRING (sc, "/temp");
FFI_RETURN_STRING (sc, buffer);
#else
- FFI_RETURN_STRING (sc, "/tmp");
+ FFI_RETURN_STRING (sc, "@TERMUX_PREFIX@/tmp");
#endif
}
diff -uNr gnupg-2.2.13/tools/addgnupghome gnupg-2.2.13.mod/tools/addgnupghome
--- gnupg-2.2.13/tools/addgnupghome 2018-12-11 09:44:33.000000000 +0200
+++ gnupg-2.2.13.mod/tools/addgnupghome 2019-03-02 01:32:08.673821575 +0200
@@ -70,10 +70,10 @@
return
fi
for f in $filelist; do
- if [ -d /etc/skel/.gnupg/$f ]; then
+ if [ -d @TERMUX_PREFIX@/etc/skel/.gnupg/$f ]; then
mkdir $f
else
- cp /etc/skel/.gnupg/$f $f
+ cp @TERMUX_PREFIX@/etc/skel/.gnupg/$f $f
fi
if ! chown $user $f ; then
error "error changing ownership of \`$f'"
@@ -102,11 +102,11 @@
info "please note that only users from /etc/passwd are checked"
fi
-if [ ! -d /etc/skel/.gnupg ]; then
- error "skeleton directory \`/etc/skel/.gnupg' does not exist"
+if [ ! -d @TERMUX_PREFIX@/etc/skel/.gnupg ]; then
+ error "skeleton directory \`@TERMUX_PREFIX@/etc/skel/.gnupg' does not exist"
exit 1
fi
-cd "/etc/skel/.gnupg" || (error "error cd-ing to \`/etc/skel/.gnupg'"; exit 1)
+cd "@TERMUX_PREFIX@/etc/skel/.gnupg" || (error "error cd-ing to \`@TERMUX_PREFIX@/etc/skel/.gnupg'"; exit 1)
filelist=$(find . \( -type f -o -type d \) '!' -name '*~' '!' -name . -print)
diff -uNr gnupg-2.2.13/tools/symcryptrun.c gnupg-2.2.13.mod/tools/symcryptrun.c
--- gnupg-2.2.13/tools/symcryptrun.c 2017-08-28 13:22:54.000000000 +0300
+++ gnupg-2.2.13.mod/tools/symcryptrun.c 2019-03-02 01:32:08.673821575 +0200
@@ -319,7 +319,7 @@
p = getenv ("TMPDIR");
if (!p || !*p)
- p = "/tmp";
+ p = "@TERMUX_PREFIX@/tmp";
if (p[strlen (p) - 1] == '/')
name = xstrconcat (p, "gpg-XXXXXX", NULL);
else

12
packages/gnupg/g10-exec.c.patch

@ -1,12 +0,0 @@
diff -uNr gnupg-2.2.8/g10/exec.c gnupg-2.2.8.mod/g10/exec.c
--- gnupg-2.2.8/g10/exec.c 2017-08-28 13:22:54.000000000 +0300
+++ gnupg-2.2.8.mod/g10/exec.c 2018-06-19 19:08:38.918070875 +0300
@@ -383,7 +383,7 @@
char *shell=getenv("SHELL");
if(shell==NULL)
- shell="/bin/sh";
+ shell="@TERMUX_PREFIX@/bin/sh";
/* I'm the child */

1
packages/gzip/build.sh

@ -2,6 +2,7 @@ TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/gzip/
TERMUX_PKG_DESCRIPTION="Standard GNU file compression utilities" TERMUX_PKG_DESCRIPTION="Standard GNU file compression utilities"
TERMUX_PKG_LICENSE="GPL-3.0" TERMUX_PKG_LICENSE="GPL-3.0"
TERMUX_PKG_VERSION=1.10 TERMUX_PKG_VERSION=1.10
TERMUX_PKG_REVISION=1
TERMUX_PKG_SHA256=8425ccac99872d544d4310305f915f5ea81e04d0f437ef1a230dc9d1c819d7c0 TERMUX_PKG_SHA256=8425ccac99872d544d4310305f915f5ea81e04d0f437ef1a230dc9d1c819d7c0
TERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/gzip/gzip-${TERMUX_PKG_VERSION}.tar.xz TERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/gzip/gzip-${TERMUX_PKG_VERSION}.tar.xz
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="ac_cv_path_GREP=grep" TERMUX_PKG_EXTRA_CONFIGURE_ARGS="ac_cv_path_GREP=grep"

12
packages/gzip/zdiff.in.patch

@ -0,0 +1,12 @@
diff -uNr gzip-1.10/zdiff.in gzip-1.10.mod/zdiff.in
--- gzip-1.10/zdiff.in 2018-03-31 06:55:32.000000000 +0300
+++ gzip-1.10.mod/zdiff.in 2019-03-01 18:41:43.685032331 +0200
@@ -119,7 +119,7 @@
case $TMPDIR in
/ | /*/) ;;
/*) TMPDIR=$TMPDIR/;;
- *) TMPDIR=/tmp/;;
+ *) TMPDIR=@TERMUX_PREFIX@/tmp/;;
esac
if type mktemp >/dev/null 2>&1; then
tmp=`mktemp "${TMPDIR}zdiffXXXXXXXXX"` ||

12
packages/gzip/zgrep.in.patch

@ -0,0 +1,12 @@
diff -uNr gzip-1.10/zgrep.in gzip-1.10.mod/zgrep.in
--- gzip-1.10/zgrep.in 2018-03-31 06:55:32.000000000 +0300
+++ gzip-1.10.mod/zgrep.in 2019-03-01 18:41:31.001645453 +0200
@@ -136,7 +136,7 @@
case $TMPDIR in
/ | /*/) ;;
/*) TMPDIR=$TMPDIR/;;
- *) TMPDIR=/tmp/;;
+ *) TMPDIR=@TERMUX_PREFIX@/tmp/;;
esac
if type mktemp >/dev/null 2>&1; then
pattmp=$(mktemp "${TMPDIR}zgrepXXXXXXXXX") || exit 2

1
packages/irssi/build.sh

@ -3,6 +3,7 @@ TERMUX_PKG_DESCRIPTION="Terminal based IRC client"
TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_LICENSE="GPL-2.0"
TERMUX_PKG_DEPENDS="ncurses, openssl, glib, libandroid-glob" TERMUX_PKG_DEPENDS="ncurses, openssl, glib, libandroid-glob"
TERMUX_PKG_VERSION=1.2.0 TERMUX_PKG_VERSION=1.2.0
TERMUX_PKG_REVISION=1
TERMUX_PKG_SHA256=1643fca1d8b35e5a5d7b715c9c889e1e9cdb7e578e06487901ea959e6ab3ebe5 TERMUX_PKG_SHA256=1643fca1d8b35e5a5d7b715c9c889e1e9cdb7e578e06487901ea959e6ab3ebe5
TERMUX_PKG_SRCURL=https://github.com/irssi/irssi/releases/download/$TERMUX_PKG_VERSION/irssi-$TERMUX_PKG_VERSION.tar.xz TERMUX_PKG_SRCURL=https://github.com/irssi/irssi/releases/download/$TERMUX_PKG_VERSION/irssi-$TERMUX_PKG_VERSION.tar.xz
TERMUX_PKG_BUILD_IN_SRC=yes TERMUX_PKG_BUILD_IN_SRC=yes

42
packages/irssi/fix-paths.patch

@ -0,0 +1,42 @@
diff -uNr irssi-1.2.0/src/fe-common/core/fe-exec.c irssi-1.2.0.mod/src/fe-common/core/fe-exec.c
--- irssi-1.2.0/src/fe-common/core/fe-exec.c 2019-02-11 19:27:58.000000000 +0200
+++ irssi-1.2.0.mod/src/fe-common/core/fe-exec.c 2019-03-01 20:46:39.912473788 +0200
@@ -281,7 +281,7 @@
static void process_exec(PROCESS_REC *rec, const char *cmd)
{
- const char *shell_args[4] = { "/bin/sh", "-c", NULL, NULL };
+ const char *shell_args[4] = { "@TERMUX_PREFIX@/bin/sh", "-c", NULL, NULL };
char **args;
int in[2], out[2];
int n;
@@ -339,7 +339,7 @@
if (rec->shell) {
execvp(shell_args[0], (char **) shell_args);
- fprintf(stderr, "Exec: /bin/sh: %s\n", g_strerror(errno));
+ fprintf(stderr, "Exec: @TERMUX_PREFIX@/bin/sh: %s\n", g_strerror(errno));
} else {
args = g_strsplit(cmd, " ", -1);
execvp(args[0], args);
diff -uNr irssi-1.2.0/src/fe-fuzz/fe-common/core/theme-load.c irssi-1.2.0.mod/src/fe-fuzz/fe-common/core/theme-load.c
--- irssi-1.2.0/src/fe-fuzz/fe-common/core/theme-load.c 2019-02-11 19:27:58.000000000 +0200
+++ irssi-1.2.0.mod/src/fe-fuzz/fe-common/core/theme-load.c 2019-03-01 20:47:09.179339329 +0200
@@ -38,7 +38,7 @@
int LLVMFuzzerInitialize(int *argc, char ***argv) {
core_register_options();
fe_common_core_register_options();
- char *irssi_argv[] = {*argv[0], "--home", "/tmp/irssi", NULL};
+ char *irssi_argv[] = {*argv[0], "--home", "@TERMUX_PREFIX@/tmp/irssi", NULL};
int irssi_argc = sizeof(irssi_argv) / sizeof(char *) - 1;
args_execute(irssi_argc, irssi_argv);
core_preinit((*argv)[0]);
@@ -52,7 +52,7 @@
int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
gchar *copy = g_strndup((const gchar *)data, size);
- FILE *fp = fopen("/tmp/irssi/fuzz.theme", "wb");
+ FILE *fp = fopen("@TERMUX_PREFIX@/tmp/irssi/fuzz.theme", "wb");
if (fp) {
fwrite(copy, strlen(copy), 1, fp);
fclose(fp);

12
packages/libarchive/archive_util.c.patch

@ -0,0 +1,12 @@
diff -uNr libarchive-3.3.3/libarchive/archive_util.c libarchive-3.3.3.mod/libarchive/archive_util.c
--- libarchive-3.3.3/libarchive/archive_util.c 2018-09-02 09:05:18.000000000 +0300
+++ libarchive-3.3.3.mod/libarchive/archive_util.c 2019-03-02 02:14:39.252942170 +0200
@@ -374,7 +374,7 @@
#ifdef _PATH_TMP
tmp = _PATH_TMP;
#else
- tmp = "/tmp";
+ tmp = "@TERMUX_PREFIX@/tmp";
#endif
archive_strcpy(temppath, tmp);
if (temppath->s[temppath->length-1] != '/')

2
packages/libarchive/build.sh

@ -2,7 +2,7 @@ TERMUX_PKG_HOMEPAGE=https://www.libarchive.org/
TERMUX_PKG_DESCRIPTION="Multi-format archive and compression library" TERMUX_PKG_DESCRIPTION="Multi-format archive and compression library"
TERMUX_PKG_LICENSE="BSD 2-Clause" TERMUX_PKG_LICENSE="BSD 2-Clause"
TERMUX_PKG_VERSION=3.3.3 TERMUX_PKG_VERSION=3.3.3
TERMUX_PKG_REVISION=1 TERMUX_PKG_REVISION=2
TERMUX_PKG_SHA256=ba7eb1781c9fbbae178c4c6bad1c6eb08edab9a1496c64833d1715d022b30e2e TERMUX_PKG_SHA256=ba7eb1781c9fbbae178c4c6bad1c6eb08edab9a1496c64833d1715d022b30e2e
TERMUX_PKG_SRCURL=https://www.libarchive.org/downloads/libarchive-${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SRCURL=https://www.libarchive.org/downloads/libarchive-${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_DEPENDS="libbz2, liblzma, libxml2, openssl" TERMUX_PKG_DEPENDS="libbz2, liblzma, libxml2, openssl"

2
packages/libbz2/build.sh

@ -2,7 +2,7 @@ TERMUX_PKG_HOMEPAGE=http://www.bzip.org/
TERMUX_PKG_DESCRIPTION="BZ2 format compression library" TERMUX_PKG_DESCRIPTION="BZ2 format compression library"
TERMUX_PKG_LICENSE="BSD" TERMUX_PKG_LICENSE="BSD"
TERMUX_PKG_VERSION=1.0.6 TERMUX_PKG_VERSION=1.0.6
TERMUX_PKG_REVISION=1 TERMUX_PKG_REVISION=2
TERMUX_PKG_SHA256=4bbea71ae30a0e5a8ddcee8da750bc978a479ba11e04498d082fa65c2f8c1ad5 TERMUX_PKG_SHA256=4bbea71ae30a0e5a8ddcee8da750bc978a479ba11e04498d082fa65c2f8c1ad5
TERMUX_PKG_SRCURL=https://fossies.org/linux/misc/bzip2-${TERMUX_PKG_VERSION}.tar.xz TERMUX_PKG_SRCURL=https://fossies.org/linux/misc/bzip2-${TERMUX_PKG_VERSION}.tar.xz
TERMUX_PKG_EXTRA_MAKE_ARGS="PREFIX=$TERMUX_PREFIX" TERMUX_PKG_EXTRA_MAKE_ARGS="PREFIX=$TERMUX_PREFIX"

21
packages/libbz2/fix-paths.patch

@ -0,0 +1,21 @@
diff -uNr bzip2-1.0.6/bzdiff bzip2-1.0.6.mod/bzdiff
--- bzip2-1.0.6/bzdiff 2007-01-03 04:00:55.000000000 +0200
+++ bzip2-1.0.6.mod/bzdiff 2019-03-01 20:44:12.401418675 +0200
@@ -37,7 +37,7 @@
echo "Usage: $prog [${comp}_options] file [file]"
exit 1
fi
-tmp=`mktemp ${TMPDIR:-/tmp}/bzdiff.XXXXXXXXXX` || {
+tmp=`mktemp ${TMPDIR:-@TERMUX_PREFIX@/tmp}/bzdiff.XXXXXXXXXX` || {
echo 'cannot create a temporary file' >&2
exit 1
}
@@ -56,7 +56,7 @@
bzip2 -cdfq "$2" > $tmp
bzip2 -cdfq "$1" | $comp $OPTIONS - $tmp
STAT="$?"
- /bin/rm -f $tmp;;
+ rm -f $tmp;;
*) bzip2 -cdfq "$1" | $comp $OPTIONS - "$2"
STAT="$?";;

1
packages/libdb/build.sh

@ -3,6 +3,7 @@ TERMUX_PKG_DESCRIPTION="The Berkeley DB embedded database system (library)"
TERMUX_PKG_LICENSE="BSD 3-Clause" TERMUX_PKG_LICENSE="BSD 3-Clause"
TERMUX_PKG_MAINTAINER="Vishal Biswas @vishalbiswas" TERMUX_PKG_MAINTAINER="Vishal Biswas @vishalbiswas"
TERMUX_PKG_VERSION=6.2.32 TERMUX_PKG_VERSION=6.2.32
TERMUX_PKG_REVISION=1
TERMUX_PKG_SRCURL=http://download.oracle.com/berkeley-db/db-${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SRCURL=http://download.oracle.com/berkeley-db/db-${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=a9c5e2b004a5777aa03510cfe5cd766a4a3b777713406b02809c17c8e0e7a8fb TERMUX_PKG_SHA256=a9c5e2b004a5777aa03510cfe5cd766a4a3b777713406b02809c17c8e0e7a8fb
TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" TERMUX_PKG_EXTRA_CONFIGURE_ARGS="

48
packages/libdb/fix-tmpdir.patch

@ -0,0 +1,48 @@
diff -uNr db-6.2.32/lang/sql/generated/sqlite3.c db-6.2.32.mod/lang/sql/generated/sqlite3.c
--- db-6.2.32/lang/sql/generated/sqlite3.c 2017-04-13 17:06:15.000000000 +0300
+++ db-6.2.32.mod/lang/sql/generated/sqlite3.c 2019-03-02 02:06:14.891040820 +0200
@@ -30788,9 +30788,9 @@
0,
0,
0,
- "/var/tmp",
- "/usr/tmp",
- "/tmp",
+ "@TERMUX_PREFIX@/var/tmp",
+ "@TERMUX_PREFIX@/usr/tmp",
+ "@TERMUX_PREFIX@/tmp",
0 /* List terminator */
};
unsigned int i;
diff -uNr db-6.2.32/lang/sql/sqlite/src/os_unix.c db-6.2.32.mod/lang/sql/sqlite/src/os_unix.c
--- db-6.2.32/lang/sql/sqlite/src/os_unix.c 2017-04-13 17:06:17.000000000 +0300
+++ db-6.2.32.mod/lang/sql/sqlite/src/os_unix.c 2019-03-02 02:06:27.711088791 +0200
@@ -5450,9 +5450,9 @@
0,
0,
0,
- "/var/tmp",
- "/usr/tmp",
- "/tmp",
+ "@TERMUX_PREFIX@/var/tmp",
+ "@TERMUX_PREFIX@/usr/tmp",
+ "@TERMUX_PREFIX@/tmp",
0 /* List terminator */
};
unsigned int i;
diff -uNr db-6.2.32/src/os/os_tmpdir.c db-6.2.32.mod/src/os/os_tmpdir.c
--- db-6.2.32/src/os/os_tmpdir.c 2017-04-13 17:06:21.000000000 +0300
+++ db-6.2.32.mod/src/os/os_tmpdir.c 2019-03-02 02:06:03.557665103 +0200
@@ -125,9 +125,9 @@
DB_TEMP_DIRECTORY("C:/temp");
DB_TEMP_DIRECTORY("C:/tmp");
#else
- DB_TEMP_DIRECTORY("/var/tmp");
- DB_TEMP_DIRECTORY("/usr/tmp");
- DB_TEMP_DIRECTORY("/tmp");
+ DB_TEMP_DIRECTORY("@TERMUX_PREFIX@/var/tmp");
+ DB_TEMP_DIRECTORY("@TERMUX_PREFIX@/usr/tmp");
+ DB_TEMP_DIRECTORY("@TERMUX_PREFIX@/tmp");
#if defined(ANDROID) || defined(DB_ANDROID)
DB_TEMP_DIRECTORY("/cache");
#endif

2
packages/libpulseaudio/build.sh

@ -2,7 +2,7 @@ TERMUX_PKG_HOMEPAGE=https://www.freedesktop.org/wiki/Software/PulseAudio
TERMUX_PKG_DESCRIPTION="A featureful, general-purpose sound server - shared libraries" TERMUX_PKG_DESCRIPTION="A featureful, general-purpose sound server - shared libraries"
TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_LICENSE="GPL-2.0"
TERMUX_PKG_VERSION=12.2 TERMUX_PKG_VERSION=12.2
TERMUX_PKG_REVISION=11 TERMUX_PKG_REVISION=12
TERMUX_PKG_SHA256=809668ffc296043779c984f53461c2b3987a45b7a25eb2f0a1d11d9f23ba4055 TERMUX_PKG_SHA256=809668ffc296043779c984f53461c2b3987a45b7a25eb2f0a1d11d9f23ba4055
TERMUX_PKG_SRCURL=https://www.freedesktop.org/software/pulseaudio/releases/pulseaudio-${TERMUX_PKG_VERSION}.tar.xz TERMUX_PKG_SRCURL=https://www.freedesktop.org/software/pulseaudio/releases/pulseaudio-${TERMUX_PKG_VERSION}.tar.xz
TERMUX_PKG_DEPENDS="libltdl, libsndfile, libandroid-glob, libsoxr, speexdsp" TERMUX_PKG_DEPENDS="libltdl, libsndfile, libandroid-glob, libsoxr, speexdsp"

145
packages/libpulseaudio/fix-paths.patch

@ -0,0 +1,145 @@
diff -uNr pulseaudio-12.2/src/Makefile.am pulseaudio-12.2.mod/src/Makefile.am
--- pulseaudio-12.2/src/Makefile.am 2018-07-16 17:40:33.000000000 +0300
+++ pulseaudio-12.2.mod/src/Makefile.am 2019-03-02 02:22:51.618146972 +0200
@@ -1903,7 +1903,7 @@
module_augment_properties_la_LDFLAGS = $(MODULE_LDFLAGS)
module_augment_properties_la_LIBADD = $(MODULE_LIBADD)
#module_augment_properties_la_CFLAGS = $(AM_CFLAGS) -DDESKTOPFILEDIR=\"$(datadir)/applications\"
-module_augment_properties_la_CFLAGS = $(AM_CFLAGS) -DDESKTOPFILEDIR=\"/usr/share/applications\" -DPA_MODULE_NAME=module_augment_properties
+module_augment_properties_la_CFLAGS = $(AM_CFLAGS) -DDESKTOPFILEDIR=\"@TERMUX_PREFIX@/share/applications\" -DPA_MODULE_NAME=module_augment_properties
# Cork certain streams while others are active (e.g. cork music when phone streams appear)
module_role_cork_la_SOURCES = modules/module-role-cork.c \
diff -uNr pulseaudio-12.2/src/Makefile.in pulseaudio-12.2.mod/src/Makefile.in
--- pulseaudio-12.2/src/Makefile.in 2018-07-16 17:57:09.000000000 +0300
+++ pulseaudio-12.2.mod/src/Makefile.in 2019-03-02 02:22:31.711404512 +0200
@@ -4708,7 +4708,7 @@
module_augment_properties_la_LDFLAGS = $(MODULE_LDFLAGS)
module_augment_properties_la_LIBADD = $(MODULE_LIBADD)
#module_augment_properties_la_CFLAGS = $(AM_CFLAGS) -DDESKTOPFILEDIR=\"$(datadir)/applications\"
-module_augment_properties_la_CFLAGS = $(AM_CFLAGS) -DDESKTOPFILEDIR=\"/usr/share/applications\" -DPA_MODULE_NAME=module_augment_properties
+module_augment_properties_la_CFLAGS = $(AM_CFLAGS) -DDESKTOPFILEDIR=\"@TERMUX_PREFIX@/share/applications\" -DPA_MODULE_NAME=module_augment_properties
# Cork certain streams while others are active (e.g. cork music when phone streams appear)
module_role_cork_la_SOURCES = modules/module-role-cork.c \
diff -uNr pulseaudio-12.2/src/modules/echo-cancel/module-echo-cancel.c pulseaudio-12.2.mod/src/modules/echo-cancel/module-echo-cancel.c
--- pulseaudio-12.2/src/modules/echo-cancel/module-echo-cancel.c 2018-07-16 17:40:33.000000000 +0300
+++ pulseaudio-12.2.mod/src/modules/echo-cancel/module-echo-cancel.c 2019-03-02 02:25:58.655526061 +0200
@@ -2047,18 +2047,18 @@
}
if (u->save_aec) {
- pa_log("Creating AEC files in /tmp");
- u->captured_file = fopen("/tmp/aec_rec.sw", "wb");
+ pa_log("Creating AEC files in @TERMUX_PREFIX@/tmp");
+ u->captured_file = fopen("@TERMUX_PREFIX@/tmp/aec_rec.sw", "wb");
if (u->captured_file == NULL)
perror ("fopen failed");
- u->played_file = fopen("/tmp/aec_play.sw", "wb");
+ u->played_file = fopen("@TERMUX_PREFIX@/tmp/aec_play.sw", "wb");
if (u->played_file == NULL)
perror ("fopen failed");
- u->canceled_file = fopen("/tmp/aec_out.sw", "wb");
+ u->canceled_file = fopen("@TERMUX_PREFIX@/tmp/aec_out.sw", "wb");
if (u->canceled_file == NULL)
perror ("fopen failed");
if (u->ec->params.drift_compensation) {
- u->drift_file = fopen("/tmp/aec_drift.txt", "w");
+ u->drift_file = fopen("@TERMUX_PREFIX@/tmp/aec_drift.txt", "w");
if (u->drift_file == NULL)
perror ("fopen failed");
}
diff -uNr pulseaudio-12.2/src/modules/module-pipe-source.c pulseaudio-12.2.mod/src/modules/module-pipe-source.c
--- pulseaudio-12.2/src/modules/module-pipe-source.c 2018-07-14 18:53:48.000000000 +0300
+++ pulseaudio-12.2.mod/src/modules/module-pipe-source.c 2019-03-02 02:25:16.902033631 +0200
@@ -59,7 +59,7 @@
"channels=<number of channels> "
"channel_map=<channel map>");
-#define DEFAULT_FILE_NAME "/tmp/music.input"
+#define DEFAULT_FILE_NAME "@TERMUX_PREFIX@/tmp/music.input"
#define DEFAULT_SOURCE_NAME "fifo_input"
struct userdata {
diff -uNr pulseaudio-12.2/src/modules/module-protocol-stub.c pulseaudio-12.2.mod/src/modules/module-protocol-stub.c
--- pulseaudio-12.2/src/modules/module-protocol-stub.c 2018-07-13 22:06:15.000000000 +0300
+++ pulseaudio-12.2.mod/src/modules/module-protocol-stub.c 2019-03-02 02:24:55.008616887 +0200
@@ -301,9 +301,9 @@
# if defined(USE_PROTOCOL_ESOUND)
# if defined(USE_PER_USER_ESOUND_SOCKET)
- u->socket_path = pa_sprintf_malloc("/tmp/.esd-%lu/socket", (unsigned long) getuid());
+ u->socket_path = pa_sprintf_malloc("@TERMUX_PREFIX@/tmp/.esd-%lu/socket", (unsigned long) getuid());
# else
- u->socket_path = pa_xstrdup("/tmp/.esd/socket");
+ u->socket_path = pa_xstrdup("@TERMUX_PREFIX@/tmp/.esd/socket");
# endif
/* This socket doesn't reside in our own runtime dir but in
diff -uNr pulseaudio-12.2/src/pulsecore/core-util.c pulseaudio-12.2.mod/src/pulsecore/core-util.c
--- pulseaudio-12.2/src/pulsecore/core-util.c 2018-07-16 17:40:33.000000000 +0300
+++ pulseaudio-12.2.mod/src/pulsecore/core-util.c 2019-03-02 02:21:18.667793155 +0200
@@ -1834,7 +1834,7 @@
* users, too. Since we need POSIX locking and UNIX sockets in
* this directory, we try XDG_RUNTIME_DIR first, and if that isn't
* set create a directory in $HOME and link it to a random subdir
- * in /tmp, if it was not explicitly configured. */
+ * in @TERMUX_PREFIX@/tmp, if it was not explicitly configured. */
m = pa_in_system_mode() ? 0755U : 0700U;
@@ -1907,7 +1907,7 @@
#ifdef HAVE_SYMLINK
/* Hmm, so the runtime directory didn't exist yet, so let's
- * create one in /tmp and symlink that to it */
+ * create one in @TERMUX_PREFIX@/tmp and symlink that to it */
if (make_random_dir_and_link(0700, k) < 0) {
@@ -3120,8 +3120,8 @@
if ((f = pa_fopen_cloexec(PA_MACHINE_ID, "r")) ||
(f = pa_fopen_cloexec(PA_MACHINE_ID_FALLBACK, "r")) ||
#if !defined(OS_IS_WIN32)
- (f = pa_fopen_cloexec("/etc/machine-id", "r")) ||
- (f = pa_fopen_cloexec("/var/lib/dbus/machine-id", "r"))
+ (f = pa_fopen_cloexec("@TERMUX_PREFIX@/etc/machine-id", "r")) ||
+ (f = pa_fopen_cloexec("@TERMUX_PREFIX@/var/lib/dbus/machine-id", "r"))
#else
false
#endif
@@ -3468,7 +3468,7 @@
pa_is_path_absolute(t))
return t;
- return "/tmp";
+ return "@TERMUX_PREFIX@/tmp";
}
int pa_open_cloexec(const char *fn, int flags, mode_t mode) {
diff -uNr pulseaudio-12.2/src/pulsecore/esound.h pulseaudio-12.2.mod/src/pulsecore/esound.h
--- pulseaudio-12.2/src/pulsecore/esound.h 2018-07-13 22:06:12.000000000 +0300
+++ pulseaudio-12.2.mod/src/pulsecore/esound.h 2019-03-02 02:24:34.161870804 +0200
@@ -23,8 +23,8 @@
/* Most of the following is blatantly stolen from esound. */
/* path and name of the default EsounD domain socket */
-#define ESD_UNIX_SOCKET_DIR "/tmp/.esd"
-#define ESD_UNIX_SOCKET_NAME "/tmp/.esd/socket"
+#define ESD_UNIX_SOCKET_DIR "@TERMUX_PREFIX@/tmp/.esd"
+#define ESD_UNIX_SOCKET_NAME "@TERMUX_PREFIX@/tmp/.esd/socket"
/* length of the audio buffer size */
#define ESD_BUF_SIZE (4 * 1024)
diff -uNr pulseaudio-12.2/src/pulsecore/shm.c pulseaudio-12.2.mod/src/pulsecore/shm.c
--- pulseaudio-12.2/src/pulsecore/shm.c 2018-07-13 22:06:12.000000000 +0300
+++ pulseaudio-12.2.mod/src/pulsecore/shm.c 2019-03-02 02:28:09.806025965 +0200
@@ -67,7 +67,7 @@
/* On Linux we know that the shared memory blocks are files in
* /dev/shm. We can use that information to list all blocks and
* cleanup unused ones */
-#define SHM_PATH "/dev/shm/"
+#define SHM_PATH "@TERMUX_PREFIX@/tmp/"
#define SHM_ID_LEN 10
#elif defined(__sun)
#define SHM_PATH "/tmp"

29
packages/libpulseaudio/tmpdir.patch

@ -1,29 +0,0 @@
--- src/src/pulsecore/core-util.c.orig 2017-01-13 03:02:18.000000000 +0000
+++ src/src/pulsecore/core-util.c 2017-03-06 22:31:51.321911880 +0000
@@ -1812,7 +1812,7 @@
* users, too. Since we need POSIX locking and UNIX sockets in
* this directory, we try XDG_RUNTIME_DIR first, and if that isn't
* set create a directory in $HOME and link it to a random subdir
- * in /tmp, if it was not explicitly configured. */
+ * in @TERMUX_PREFIX@/tmp, if it was not explicitly configured. */
m = pa_in_system_mode() ? 0755U : 0700U;
@@ -1885,7 +1885,7 @@
#ifdef HAVE_SYMLINK
/* Hmm, so the runtime directory didn't exist yet, so let's
- * create one in /tmp and symlink that to it */
+ * create one in @TERMUX_PREFIX@/tmp and symlink that to it */
if (make_random_dir_and_link(0700, k) < 0) {
@@ -3429,7 +3429,7 @@
pa_is_path_absolute(t))
return t;
- return "/tmp";
+ return "@TERMUX_PREFIX@/tmp";
}
int pa_open_cloexec(const char *fn, int flags, mode_t mode) {

1
packages/libssh/build.sh

@ -2,6 +2,7 @@ TERMUX_PKG_HOMEPAGE=https://www.libssh.org/
TERMUX_PKG_DESCRIPTION="Tiny C SSH library" TERMUX_PKG_DESCRIPTION="Tiny C SSH library"
TERMUX_PKG_LICENSE="LGPL-2.0" TERMUX_PKG_LICENSE="LGPL-2.0"
TERMUX_PKG_VERSION=0.8.7 TERMUX_PKG_VERSION=0.8.7
TERMUX_PKG_REVISION=1
TERMUX_PKG_SHA256=43304ca22f0ba0b654e14b574a39816bc70212fdea5858a6637cc26cade3d592 TERMUX_PKG_SHA256=43304ca22f0ba0b654e14b574a39816bc70212fdea5858a6637cc26cade3d592
TERMUX_PKG_SRCURL=https://www.libssh.org/files/${TERMUX_PKG_VERSION:0:3}/libssh-$TERMUX_PKG_VERSION.tar.xz TERMUX_PKG_SRCURL=https://www.libssh.org/files/${TERMUX_PKG_VERSION:0:3}/libssh-$TERMUX_PKG_VERSION.tar.xz
TERMUX_PKG_DEPENDS="openssl" TERMUX_PKG_DEPENDS="openssl"

63
packages/libssh/fix-paths.patch

@ -0,0 +1,63 @@
diff -uNr libssh-0.8.6/examples/ssh_server_fork.c libssh-0.8.6.mod/examples/ssh_server_fork.c
--- libssh-0.8.6/examples/ssh_server_fork.c 2018-12-24 09:35:54.000000000 +0200
+++ libssh-0.8.6.mod/examples/ssh_server_fork.c 2019-03-02 13:54:01.710902660 +0200
@@ -308,7 +308,7 @@
if (login_tty(cdata->pty_slave) != 0) {
exit(1);
}
- execl("/bin/sh", "sh", mode, command, NULL);
+ execl("@TERMUX_PREFIX@/bin/sh", "sh", mode, command, NULL);
exit(0);
default:
close(cdata->pty_slave);
@@ -347,7 +347,7 @@
close(out[1]);
close(err[1]);
/* exec the requested command. */
- execl("/bin/sh", "sh", "-c", command, NULL);
+ execl("@TERMUX_PREFIX@/bin/sh", "sh", "-c", command, NULL);
exit(0);
}
diff -uNr libssh-0.8.6/src/options.c libssh-0.8.6.mod/src/options.c
--- libssh-0.8.6/src/options.c 2018-12-24 09:35:55.000000000 +0200
+++ libssh-0.8.6.mod/src/options.c 2019-03-02 13:55:07.926515301 +0200
@@ -622,7 +622,7 @@
SAFE_FREE(session->opts.global_knownhosts);
if (v == NULL) {
session->opts.global_knownhosts =
- strdup("/etc/ssh/ssh_known_hosts");
+ strdup("@TERMUX_PREFIX@/etc/ssh/ssh_known_hosts");
if (session->opts.global_knownhosts == NULL) {
ssh_set_error_oom(session);
return -1;
@@ -1327,7 +1327,7 @@
goto out;
}
if (filename == NULL) {
- r = ssh_config_parse_file(session, "/etc/ssh/ssh_config");
+ r = ssh_config_parse_file(session, "@TERMUX_PREFIX@/etc/ssh/ssh_config");
}
out:
@@ -1366,7 +1366,7 @@
session->opts.knownhosts = tmp;
if (session->opts.global_knownhosts == NULL) {
- tmp = strdup("/etc/ssh/ssh_known_hosts");
+ tmp = strdup("@TERMUX_PREFIX@/etc/ssh/ssh_known_hosts");
} else {
tmp = ssh_path_expand_escape(session, session->opts.global_knownhosts);
}
diff -uNr libssh-0.8.6/src/socket.c libssh-0.8.6.mod/src/socket.c
--- libssh-0.8.6/src/socket.c 2018-12-10 15:05:43.000000000 +0200
+++ libssh-0.8.6.mod/src/socket.c 2019-03-02 13:54:24.269341523 +0200
@@ -805,7 +805,7 @@
* @param out output file descriptor
*/
void ssh_execute_command(const char *command, socket_t in, socket_t out){
- const char *args[]={"/bin/sh","-c",command,NULL};
+ const char *args[]={"@TERMUX_PREFIX@/bin/sh","-c",command,NULL};
/* redirect in and out to stdin, stdout and stderr */
dup2(in, 0);
dup2(out,1);

12
packages/libssh/fix-ssh_config-path.patch

@ -1,12 +0,0 @@
diff -uNr libssh-0.7.5/src/options.c libssh-0.7.5.mod/src/options.c
--- libssh-0.7.5/src/options.c 2017-04-13 17:33:04.000000000 +0300
+++ libssh-0.7.5.mod/src/options.c 2017-09-12 11:16:10.212992453 +0300
@@ -1232,7 +1232,7 @@
goto out;
}
if (filename == NULL) {
- r = ssh_config_parse_file(session, "/etc/ssh/ssh_config");
+ r = ssh_config_parse_file(session, "@TERMUX_PREFIX@/etc/ssh/ssh_config");
}
out:

4
packages/lynx/build.sh

@ -2,11 +2,11 @@ TERMUX_PKG_HOMEPAGE=http://lynx.browser.org/
TERMUX_PKG_DESCRIPTION="The text web browser" TERMUX_PKG_DESCRIPTION="The text web browser"
TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_LICENSE="GPL-2.0"
TERMUX_PKG_VERSION=2.8.9rel.1 TERMUX_PKG_VERSION=2.8.9rel.1
TERMUX_PKG_REVISION=1 TERMUX_PKG_REVISION=2
TERMUX_PKG_SHA256=387f193d7792f9cfada14c60b0e5c0bff18f227d9257a39483e14fa1aaf79595 TERMUX_PKG_SHA256=387f193d7792f9cfada14c60b0e5c0bff18f227d9257a39483e14fa1aaf79595
TERMUX_PKG_SRCURL=http://invisible-mirror.net/archives/lynx/tarballs/lynx${TERMUX_PKG_VERSION}.tar.bz2 TERMUX_PKG_SRCURL=http://invisible-mirror.net/archives/lynx/tarballs/lynx${TERMUX_PKG_VERSION}.tar.bz2
TERMUX_PKG_DEPENDS="ncurses, openssl, libbz2, libidn" TERMUX_PKG_DEPENDS="ncurses, openssl, libbz2, libidn"
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--with-screen=ncursesw --enable-widec --enable-scrollbar --enable-nested-tables --enable-htmlized-cfg --with-ssl --with-zlib --with-bzlib --enable-cjk --enable-japanese-utf8 --enable-progressbar --enable-prettysrc --enable-forms-options --enable-8bit-toupper --enable-ascii-ctypes --disable-font-switch" TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--with-screen=ncursesw --enable-widec --enable-scrollbar --enable-nested-tables --enable-htmlized-cfg --with-ssl --with-zlib --with-bzlib --enable-cjk --enable-japanese-utf8 --enable-progressbar --enable-prettysrc --enable-forms-options --enable-8bit-toupper --enable-ascii-ctypes --disable-font-switch --with-mime-libdir=$TERMUX_PREFIX/etc"
## set default paths for tools that may be used in runtime by 'lynx' binary ## set default paths for tools that may be used in runtime by 'lynx' binary
TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" ac_cv_path_BZIP2=${TERMUX_PREFIX}/bin/bzip2" TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" ac_cv_path_BZIP2=${TERMUX_PREFIX}/bin/bzip2"

78
packages/lynx/fix-paths.patch

@ -0,0 +1,78 @@
diff -uNr lynx2.8.9rel.1/src/LYNews.c lynx2.8.9rel.1.mod/src/LYNews.c
--- lynx2.8.9rel.1/src/LYNews.c 2018-03-18 20:51:02.000000000 +0200
+++ lynx2.8.9rel.1.mod/src/LYNews.c 2019-03-01 22:04:51.671752655 +0200
@@ -261,7 +261,7 @@
StrAllocCat(cp, org);
}
#ifdef UNIX
- else if ((fp = fopen("/etc/organization", TXT_R)) != NULL) {
+ else if ((fp = fopen("@TERMUX_PREFIX@/etc/organization", TXT_R)) != NULL) {
char *buffer = 0;
if (LYSafeGets(&buffer, fp) != NULL) {
diff -uNr lynx2.8.9rel.1/src/LYUtils.c lynx2.8.9rel.1.mod/src/LYUtils.c
--- lynx2.8.9rel.1/src/LYUtils.c 2018-05-16 00:20:52.000000000 +0300
+++ lynx2.8.9rel.1.mod/src/LYUtils.c 2019-03-01 22:05:42.915339501 +0200
@@ -165,7 +165,7 @@
#if defined(__FreeBSD__) || defined(__bsdi__)
#define UTMP_FILE _PATH_UTMP
#else
-#define UTMP_FILE "/etc/utmp"
+#define UTMP_FILE "@TERMUX_PREFIX@/etc/utmp"
#endif /* __FreeBSD__ || __bsdi__ */
#endif /* !UTMP_FILE */
@@ -5185,7 +5185,7 @@
/*
* Use /tmp; it should be writable.
*/
- StrAllocCopy(HomeDir, "/tmp");
+ StrAllocCopy(HomeDir, "@TERMUX_PREFIX@/tmp");
}
#endif
#endif /* VMS */
diff -uNr lynx2.8.9rel.1/WWW/Library/Implementation/HTFile.c lynx2.8.9rel.1.mod/WWW/Library/Implementation/HTFile.c
--- lynx2.8.9rel.1/WWW/Library/Implementation/HTFile.c 2018-05-12 02:20:35.000000000 +0300
+++ lynx2.8.9rel.1.mod/WWW/Library/Implementation/HTFile.c 2019-03-01 22:04:51.675086005 +0200
@@ -145,7 +145,7 @@
static const char *HTCacheRoot = "/WWW$SCRATCH"; /* Where to cache things */
#else
-static const char *HTCacheRoot = "/tmp/W3_Cache_"; /* Where to cache things */
+static const char *HTCacheRoot = "@TERMUX_PREFIX@/tmp/W3_Cache_"; /* Where to cache things */
#endif /* VMS */
static char s_no_suffix[] = "*";
@@ -743,7 +743,7 @@
home = LYGetEnv("HOME");
#endif
if (home == NULL)
- home = "/tmp";
+ home = "@TERMUX_PREFIX@/tmp";
#endif /* VMS */
HTSprintf0(&result, "%s/WWW/%s/%s%s", home, acc_method, host, path);
} else {
diff -uNr lynx2.8.9rel.1/WWW/Library/Implementation/HTFormat.c lynx2.8.9rel.1.mod/WWW/Library/Implementation/HTFormat.c
--- lynx2.8.9rel.1/WWW/Library/Implementation/HTFormat.c 2018-05-12 01:18:24.000000000 +0300
+++ lynx2.8.9rel.1.mod/WWW/Library/Implementation/HTFormat.c 2019-03-01 22:04:51.678419355 +0200
@@ -27,7 +27,7 @@
#ifdef NeXT
#define PRESENT_POSTSCRIPT "open %s; /bin/rm -f %s\n"
#else
-#define PRESENT_POSTSCRIPT "(ghostview %s ; /bin/rm -f %s)&\n"
+#define PRESENT_POSTSCRIPT "(ghostview %s ; rm -f %s)&\n"
/* Full pathname would be better! */
#endif /* NeXT */
#endif /* UNIX */
diff -uNr lynx2.8.9rel.1/WWW/Library/Implementation/HTNews.c lynx2.8.9rel.1.mod/WWW/Library/Implementation/HTNews.c
--- lynx2.8.9rel.1/WWW/Library/Implementation/HTNews.c 2018-02-26 02:28:40.000000000 +0200
+++ lynx2.8.9rel.1.mod/WWW/Library/Implementation/HTNews.c 2019-03-01 22:04:51.681752704 +0200
@@ -36,7 +36,7 @@
#endif /* DEFAULT_NEWS_HOST */
#ifndef NEWS_SERVER_FILE
-#define NEWS_SERVER_FILE "/usr/local/lib/rn/server"
+#define NEWS_SERVER_FILE "@TERMUX_PREFIX@/lib/rn/server"
#endif /* NEWS_SERVER_FILE */
#ifndef NEWS_AUTH_FILE

12
packages/lynx/lynx2.8.9dev.19_WWW_Library_Implementation_HTFormat.c.patch

@ -1,12 +0,0 @@
diff -uNr lynx2.8.9dev.19/WWW/Library/Implementation/HTFormat.c lynx2.8.9dev.19.mod/WWW/Library/Implementation/HTFormat.c
--- lynx2.8.9dev.19/WWW/Library/Implementation/HTFormat.c 2018-05-12 01:18:24.000000000 +0300
+++ lynx2.8.9dev.19.mod/WWW/Library/Implementation/HTFormat.c 2018-06-19 19:42:26.744841948 +0300
@@ -27,7 +27,7 @@
#ifdef NeXT
#define PRESENT_POSTSCRIPT "open %s; /bin/rm -f %s\n"
#else
-#define PRESENT_POSTSCRIPT "(ghostview %s ; /bin/rm -f %s)&\n"
+#define PRESENT_POSTSCRIPT "(ghostview %s ; rm -f %s)&\n"
/* Full pathname would be better! */
#endif /* NeXT */
#endif /* UNIX */

12
packages/lynx/lynx2.8.9dev.19_src_LYUtils.c.patch

@ -1,12 +0,0 @@
diff -uNr lynx2.8.9dev.19/src/LYUtils.c lynx2.8.9dev.19.mod/src/LYUtils.c
--- lynx2.8.9dev.19/src/LYUtils.c 2018-05-16 00:20:52.000000000 +0300
+++ lynx2.8.9dev.19.mod/src/LYUtils.c 2018-06-19 19:40:07.058168089 +0300
@@ -5185,7 +5185,7 @@
/*
* Use /tmp; it should be writable.
*/
- StrAllocCopy(HomeDir, "/tmp");
+ StrAllocCopy(HomeDir, "@TERMUX_PREFIX@/tmp");
}
#endif
#endif /* VMS */

1
packages/m4/build.sh

@ -2,5 +2,6 @@ TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/m4/m4.html
TERMUX_PKG_DESCRIPTION="Traditional Unix macro processor" TERMUX_PKG_DESCRIPTION="Traditional Unix macro processor"
TERMUX_PKG_LICENSE="GPL-3.0" TERMUX_PKG_LICENSE="GPL-3.0"
TERMUX_PKG_VERSION=1.4.18 TERMUX_PKG_VERSION=1.4.18
TERMUX_PKG_REVISION=1
TERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/m4/m4-${TERMUX_PKG_VERSION}.tar.xz TERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/m4/m4-${TERMUX_PKG_VERSION}.tar.xz
TERMUX_PKG_SHA256=f2c1e86ca0a404ff281631bdc8377638992744b175afb806e25871a24a934e07 TERMUX_PKG_SHA256=f2c1e86ca0a404ff281631bdc8377638992744b175afb806e25871a24a934e07

58
packages/m4/fix-paths.patch

@ -0,0 +1,58 @@
diff -uNr m4-1.4.18/lib/spawni.c m4-1.4.18.mod/lib/spawni.c
--- m4-1.4.18/lib/spawni.c 2016-12-31 15:54:42.000000000 +0200
+++ m4-1.4.18.mod/lib/spawni.c 2019-03-01 20:54:18.601984363 +0200
@@ -32,7 +32,7 @@
#if _LIBC || HAVE_PATHS_H
# include <paths.h>
#else
-# define _PATH_BSHELL "/bin/sh"
+# define _PATH_BSHELL "@TERMUX_PREFIX@/bin/sh"
#endif
#include <signal.h>
diff -uNr m4-1.4.18/lib/tempname.c m4-1.4.18.mod/lib/tempname.c
--- m4-1.4.18/lib/tempname.c 2016-12-31 15:54:42.000000000 +0200
+++ m4-1.4.18.mod/lib/tempname.c 2019-03-01 20:52:48.978132063 +0200
@@ -32,7 +32,7 @@
#include <stdio.h>
#ifndef P_tmpdir
-# define P_tmpdir "/tmp"
+# define P_tmpdir "@TERMUX_PREFIX@/tmp"
#endif
#ifndef TMP_MAX
# define TMP_MAX 238328
@@ -148,8 +148,8 @@
{
if (direxists (P_tmpdir))
dir = P_tmpdir;
- else if (strcmp (P_tmpdir, "/tmp") != 0 && direxists ("/tmp"))
- dir = "/tmp";
+ else if (strcmp (P_tmpdir, "@TERMUX_PREFIX@/tmp") != 0 && direxists ("@TERMUX_PREFIX@/tmp"))
+ dir = "@TERMUX_PREFIX@/tmp";
else
{
__set_errno (ENOENT);
diff -uNr m4-1.4.18/lib/tmpdir.c m4-1.4.18.mod/lib/tmpdir.c
--- m4-1.4.18/lib/tmpdir.c 2016-12-31 15:54:42.000000000 +0200
+++ m4-1.4.18.mod/lib/tmpdir.c 2019-03-01 20:53:16.521626327 +0200
@@ -36,7 +36,7 @@
# ifdef _P_tmpdir /* native Windows */
# define P_tmpdir _P_tmpdir
# else
-# define P_tmpdir "/tmp"
+# define P_tmpdir "@TERMUX_PREFIX@/tmp"
# endif
#endif
@@ -130,8 +130,8 @@
#endif
if (direxists (P_tmpdir))
dir = P_tmpdir;
- else if (strcmp (P_tmpdir, "/tmp") != 0 && direxists ("/tmp"))
- dir = "/tmp";
+ else if (strcmp (P_tmpdir, "@TERMUX_PREFIX@/tmp") != 0 && direxists ("@TERMUX_PREFIX@/tmp"))
+ dir = "@TERMUX_PREFIX@/tmp";
else
{
__set_errno (ENOENT);

2
packages/mathomatic/build.sh

@ -2,7 +2,7 @@ TERMUX_PKG_HOMEPAGE=https://en.wikipedia.org/wiki/Mathomatic
TERMUX_PKG_DESCRIPTION="Simple CAS and symbolic calculator" TERMUX_PKG_DESCRIPTION="Simple CAS and symbolic calculator"
TERMUX_PKG_LICENSE="LGPL-2.0" TERMUX_PKG_LICENSE="LGPL-2.0"
TERMUX_PKG_VERSION=16.0.5 TERMUX_PKG_VERSION=16.0.5
TERMUX_PKG_REVISION=4 TERMUX_PKG_REVISION=5
TERMUX_PKG_SRCURL="https://fossies.org/linux/misc/old/mathomatic-${TERMUX_PKG_VERSION}.tar.xz" TERMUX_PKG_SRCURL="https://fossies.org/linux/misc/old/mathomatic-${TERMUX_PKG_VERSION}.tar.xz"
TERMUX_PKG_SHA256=7f525bdb2e13006549dd8f17906c26f926f5ac51174f02f074107c612491e05c TERMUX_PKG_SHA256=7f525bdb2e13006549dd8f17906c26f926f5ac51174f02f074107c612491e05c
TERMUX_PKG_BUILD_IN_SRC=yes TERMUX_PKG_BUILD_IN_SRC=yes

33
packages/mathomatic/fix-paths.patch

@ -0,0 +1,33 @@
diff -uNr mathomatic-16.0.5/am.h mathomatic-16.0.5.mod/am.h
--- mathomatic-16.0.5/am.h 2012-08-19 17:42:52.000000000 +0300
+++ mathomatic-16.0.5.mod/am.h 2019-03-01 20:49:40.456989348 +0200
@@ -57,7 +57,7 @@
#define TEXT_ROWS STANDARD_SCREEN_ROWS /* number of lines per page in the symbolic math library */
#define TEXT_COLUMNS STANDARD_SCREEN_COLUMNS /* default number of columns per page in the symbolic math library */
-#define TMP_FILE "/tmp/mathomatic.XXXXXX" /* temporary file template for mkstemp(3) */
+#define TMP_FILE "@TERMUX_PREFIX@/tmp/mathomatic.XXXXXX" /* temporary file template for mkstemp(3) */
#define PROMPT_STR "-> " /* user interface main prompt strings, preceded by the current equation number */
#define HTML_PROMPT_STR "&minus;&gt; " /* main prompt in HTML output mode, should be same number of columns as above */
diff -uNr mathomatic-16.0.5/help.c mathomatic-16.0.5.mod/help.c
--- mathomatic-16.0.5/help.c 2012-10-01 13:43:46.000000000 +0300
+++ mathomatic-16.0.5.mod/help.c 2019-03-01 20:50:09.883839729 +0200
@@ -612,7 +612,7 @@
#else
cp1 = getenv("SHELL");
if (cp1 == NULL) {
- cp1 = "/bin/sh";
+ cp1 = "@TERMUX_PREFIX@/bin/sh";
}
#endif
#if 0
@@ -1157,7 +1157,7 @@
}
if (cp[0] == '!') {
SP("A command preceded by an exclamation point (such as \"!ls\") is taken to");
- SP("be a shell command and is passed unchanged to the shell (/bin/sh) when");
+ SP("be a shell command and is passed unchanged to the shell (@TERMUX_PREFIX@/bin/sh) when");
SP("Mathomatic is not in secure mode. \"!\" by itself invokes the default shell,");
EP("which is specified in the SHELL environment variable.\n");

12
packages/mathomatic/fix-tmp_file.patch

@ -1,12 +0,0 @@
diff -uNr mathomatic-16.0.5/am.h mathomatic-16.0.5.mod/am.h
--- mathomatic-16.0.5/am.h 2012-08-19 17:42:52.000000000 +0300
+++ mathomatic-16.0.5.mod/am.h 2017-09-14 14:36:31.112860259 +0300
@@ -57,7 +57,7 @@
#define TEXT_ROWS STANDARD_SCREEN_ROWS /* number of lines per page in the symbolic math library */
#define TEXT_COLUMNS STANDARD_SCREEN_COLUMNS /* default number of columns per page in the symbolic math library */
-#define TMP_FILE "/tmp/mathomatic.XXXXXX" /* temporary file template for mkstemp(3) */
+#define TMP_FILE "@TERMUX_PREFIX@/tmp/mathomatic.XXXXXX" /* temporary file template for mkstemp(3) */
#define PROMPT_STR "-> " /* user interface main prompt strings, preceded by the current equation number */
#define HTML_PROMPT_STR "&minus;&gt; " /* main prompt in HTML output mode, should be same number of columns as above */

2
packages/mosh/build.sh

@ -2,7 +2,7 @@ TERMUX_PKG_HOMEPAGE=https://mosh.org
TERMUX_PKG_DESCRIPTION="Mobile shell that supports roaming and intelligent local echo" TERMUX_PKG_DESCRIPTION="Mobile shell that supports roaming and intelligent local echo"
TERMUX_PKG_LICENSE="GPL-3.0" TERMUX_PKG_LICENSE="GPL-3.0"
TERMUX_PKG_VERSION=1.3.2 TERMUX_PKG_VERSION=1.3.2
TERMUX_PKG_REVISION=9 TERMUX_PKG_REVISION=10
TERMUX_PKG_SHA256=da600573dfa827d88ce114e0fed30210689381bbdcff543c931e4d6a2e851216 TERMUX_PKG_SHA256=da600573dfa827d88ce114e0fed30210689381bbdcff543c931e4d6a2e851216
TERMUX_PKG_SRCURL=https://github.com/mobile-shell/mosh/releases/download/mosh-${TERMUX_PKG_VERSION}/mosh-${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SRCURL=https://github.com/mobile-shell/mosh/releases/download/mosh-${TERMUX_PKG_VERSION}/mosh-${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_DEPENDS="libandroid-support, libprotobuf, ncurses, openssl, openssh, libutil" TERMUX_PKG_DEPENDS="libandroid-support, libprotobuf, ncurses, openssl, openssh, libutil"

14
packages/mosh/mosh-server.cc.patch

@ -0,0 +1,14 @@
diff -uNr mosh-1.3.2/src/frontend/mosh-server.cc mosh-1.3.2.mod/src/frontend/mosh-server.cc
--- mosh-1.3.2/src/frontend/mosh-server.cc 2017-07-23 00:14:53.000000000 +0300
+++ mosh-1.3.2.mod/src/frontend/mosh-server.cc 2019-03-01 22:37:18.009498882 +0200
@@ -562,8 +562,8 @@
// this always happens.
// XXX Hackish knowledge of Ubuntu PAM configuration.
// But this seems less awful than build-time detection with autoconf.
- if (!print_motd("/run/motd.dynamic")) {
- print_motd("/var/run/motd.dynamic");
+ if (!print_motd("@TERMUX_PREFIX@/run/motd.dynamic")) {
+ print_motd("@TERMUX_PREFIX@/var/run/motd.dynamic");
}
// Always print traditional /etc/motd.
print_motd("/etc/motd");

2
packages/nano/build.sh

@ -2,7 +2,7 @@ TERMUX_PKG_HOMEPAGE=https://www.nano-editor.org/
TERMUX_PKG_DESCRIPTION="Small, free and friendly text editor" TERMUX_PKG_DESCRIPTION="Small, free and friendly text editor"
TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_LICENSE="GPL-2.0"
TERMUX_PKG_VERSION=3.2 TERMUX_PKG_VERSION=3.2
TERMUX_PKG_REVISION=2 TERMUX_PKG_REVISION=3
TERMUX_PKG_SHA256=d12773af3589994b2e4982c5792b07c6240da5b86c5aef2103ab13b401fe6349 TERMUX_PKG_SHA256=d12773af3589994b2e4982c5792b07c6240da5b86c5aef2103ab13b401fe6349
TERMUX_PKG_SRCURL=https://nano-editor.org/dist/latest/nano-$TERMUX_PKG_VERSION.tar.xz TERMUX_PKG_SRCURL=https://nano-editor.org/dist/latest/nano-$TERMUX_PKG_VERSION.tar.xz
TERMUX_PKG_DEPENDS="libandroid-support, libandroid-glob, ncurses" TERMUX_PKG_DEPENDS="libandroid-support, libandroid-glob, ncurses"

12
packages/nano/src-files.c.patch

@ -0,0 +1,12 @@
diff -uNr nano-3.2/src/files.c nano-3.2.mod/src/files.c
--- nano-3.2/src/files.c 2018-11-05 21:04:46.000000000 +0200
+++ nano-3.2.mod/src/files.c 2019-03-01 22:09:30.233108029 +0200
@@ -1439,7 +1439,7 @@
/* if P_tmpdir is NULL, use /tmp. */
if (full_tempdir == NULL)
- full_tempdir = mallocstrcpy(NULL, "/tmp/");
+ full_tempdir = mallocstrcpy(NULL, "@TERMUX_PREFIX@/tmp/");
full_tempdir = charealloc(full_tempdir, strlen(full_tempdir) + 12);
strcat(full_tempdir, "nano.XXXXXX");

1
packages/ncurses/build.sh

@ -3,6 +3,7 @@ TERMUX_PKG_DESCRIPTION="Library for text-based user interfaces in a terminal-ind
TERMUX_PKG_LICENSE="MIT" TERMUX_PKG_LICENSE="MIT"
TERMUX_PKG_VERSION=(6.1.20181117 TERMUX_PKG_VERSION=(6.1.20181117
9.22) 9.22)
TERMUX_PKG_REVISION=1
TERMUX_PKG_SHA256=(b5568d53d31787cda727f949b68bcb60c667dba5deff72bd7ade40dbe45e4b16 TERMUX_PKG_SHA256=(b5568d53d31787cda727f949b68bcb60c667dba5deff72bd7ade40dbe45e4b16
e94628e9bcfa0adb1115d83649f898d6edb4baced44f5d5b769c2eeb8b95addd) e94628e9bcfa0adb1115d83649f898d6edb4baced44f5d5b769c2eeb8b95addd)
TERMUX_PKG_SRCURL=(https://dl.bintray.com/termux/upstream/ncurses-${TERMUX_PKG_VERSION:0:3}-${TERMUX_PKG_VERSION:4}.tgz TERMUX_PKG_SRCURL=(https://dl.bintray.com/termux/upstream/ncurses-${TERMUX_PKG_VERSION:0:3}-${TERMUX_PKG_VERSION:4}.tgz

35
packages/ncurses/fix-paths.patch

@ -0,0 +1,35 @@
diff -uNr ncurses-6.1-20181117/progs/tic.c ncurses-6.1-20181117.mod/progs/tic.c
--- ncurses-6.1-20181117/progs/tic.c 2018-03-18 02:05:10.000000000 +0200
+++ ncurses-6.1-20181117.mod/progs/tic.c 2019-03-01 20:40:56.193173489 +0200
@@ -386,7 +386,7 @@
{
FILE *result = 0;
- _nc_STRCPY(filename, "/tmp/XXXXXX", PATH_MAX);
+ _nc_STRCPY(filename, "@TERMUX_PREFIX@/tmp/XXXXXX", PATH_MAX);
#if HAVE_MKSTEMP
{
int oldmask = (int) umask(077);
@@ -900,7 +900,7 @@
} else {
if (infodump == TRUE) {
/* captoinfo's no-argument case */
- source_file = "/etc/termcap";
+ source_file = "@TERMUX_PREFIX@/etc/termcap";
if ((termcap = getenv("TERMCAP")) != 0
&& (namelst = make_namelist(getenv("TERM"))) != 0) {
if (access(termcap, F_OK) == 0) {
diff -uNr ncurses-6.1-20181117/progs/tset.c ncurses-6.1-20181117.mod/progs/tset.c
--- ncurses-6.1-20181117/progs/tset.c 2017-10-08 03:01:29.000000000 +0300
+++ ncurses-6.1-20181117.mod/progs/tset.c 2019-03-01 20:40:15.049476720 +0200
@@ -566,8 +566,8 @@
goto map;
}
#else
- if ((fp = fopen("/etc/ttytype", "r")) != 0
- || (fp = fopen("/etc/ttys", "r")) != 0) {
+ if ((fp = fopen("@TERMUX_PREFIX@/etc/ttytype", "r")) != 0
+ || (fp = fopen("@TERMUX_PREFIX@/etc/ttys", "r")) != 0) {
char buffer[BUFSIZ];
char *s, *t, *d;

12
packages/ncurses/tic-fix-tmp-path.patch

@ -1,12 +0,0 @@
diff -uNr ncurses-6.0-20170909/progs/tic.c ncurses-6.0-20170909.mod/progs/tic.c
--- ncurses-6.0-20170909/progs/tic.c 2017-08-26 23:56:55.000000000 +0300
+++ ncurses-6.0-20170909.mod/progs/tic.c 2017-09-14 15:45:21.992857305 +0300
@@ -386,7 +386,7 @@
{
FILE *result = 0;
- _nc_STRCPY(filename, "/tmp/XXXXXX", PATH_MAX);
+ _nc_STRCPY(filename, "@TERMUX_PREFIX@/tmp/XXXXXX", PATH_MAX);
#if HAVE_MKSTEMP
{
int oldmask = (int) umask(077);

21
packages/net-tools/arp.c.patch

@ -0,0 +1,21 @@
diff -uNr net-tools/arp.c net-tools.mod/arp.c
--- net-tools/arp.c 2017-02-21 20:24:32.000000000 +0200
+++ net-tools.mod/arp.c 2019-03-01 19:05:20.555355036 +0200
@@ -644,7 +644,7 @@
fprintf(stderr, _(" -i, --device specify network interface (e.g. eth0)\n"));
fprintf(stderr, _(" -D, --use-device read <hwaddr> from given device\n"));
fprintf(stderr, _(" -A, -p, --protocol specify protocol family\n"));
- fprintf(stderr, _(" -f, --file read new entries from file or from /etc/ethers\n\n"));
+ fprintf(stderr, _(" -f, --file read new entries from file or from $PREFIX/etc/ethers\n\n"));
fprintf(stderr, _(" <HW>=Use '-H <hw>' to specify hardware address type. Default: %s\n"), DFLT_HW);
fprintf(stderr, _(" List of possible hardware types (which support ARP):\n"));
@@ -791,7 +791,7 @@
break;
case 2: /* process an EtherFile */
- what = arp_file(argv[optind] ? argv[optind] : "/etc/ethers");
+ what = arp_file(argv[optind] ? argv[optind] : "@TERMUX_PREFIX@/etc/ethers");
break;
case 3: /* delete an ARP entry from the cache */

2
packages/net-tools/build.sh

@ -2,7 +2,7 @@ TERMUX_PKG_HOMEPAGE=http://net-tools.sourceforge.net/
TERMUX_PKG_DESCRIPTION="Configuration tools for Linux networking" TERMUX_PKG_DESCRIPTION="Configuration tools for Linux networking"
TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_LICENSE="GPL-2.0"
TERMUX_PKG_VERSION=1.60.2017.02.21 TERMUX_PKG_VERSION=1.60.2017.02.21
TERMUX_PKG_REVISION=1 TERMUX_PKG_REVISION=2
local commit=479bb4a7e11a4084e2935c0a576388f92469225b local commit=479bb4a7e11a4084e2935c0a576388f92469225b
TERMUX_PKG_SHA256=7e9f8e8dcbabed0c8eeb976100496567abae7ac9d92c72cebd1a9d965473e943 TERMUX_PKG_SHA256=7e9f8e8dcbabed0c8eeb976100496567abae7ac9d92c72cebd1a9d965473e943
# We use a mirror to avoid using # We use a mirror to avoid using

12
packages/net-tools/lib-pathnames.h.patch

@ -0,0 +1,12 @@
diff -uNr net-tools/lib/pathnames.h net-tools.mod/lib/pathnames.h
--- net-tools/lib/pathnames.h 2017-02-21 20:24:32.000000000 +0200
+++ net-tools.mod/lib/pathnames.h 2019-03-01 19:05:45.935478227 +0200
@@ -47,7 +47,7 @@
#define _PATH_PROCNET_IFINET6 "/proc/net/if_inet6"
#define _PATH_PROCNET_DEV "/proc/net/dev"
#define _PATH_PROCNET_RARP "/proc/net/rarp"
-#define _PATH_ETHERS "/etc/ethers"
+#define _PATH_ETHERS "@TERMUX_PREFIX@/etc/ethers"
#define _PATH_PROCNET_ROSE "/proc/net/rose"
#define _PATH_PROCNET_ROSE_NEIGH "/proc/net/rose_neigh"
#define _PATH_PROCNET_ROSE_NODES "/proc/net/rose_nodes"

14
packages/net-tools/nameif.c.patch

@ -1,5 +1,6 @@
--- ./nameif.c 2017-02-21 23:54:32.000000000 +0530 diff -uNr net-tools/nameif.c net-tools.mod/nameif.c
+++ ../nameif.c 2017-04-09 14:47:40.889765378 +0530 --- net-tools/nameif.c 2017-02-21 20:24:32.000000000 +0200
+++ net-tools.mod/nameif.c 2019-03-01 19:02:26.447822359 +0200
@@ -10,7 +10,7 @@ @@ -10,7 +10,7 @@
#endif #endif
#include <stdio.h> #include <stdio.h>
@ -9,3 +10,12 @@
#include <errno.h> #include <errno.h>
#include <stdlib.h> #include <stdlib.h>
#include <ctype.h> #include <ctype.h>
@@ -25,7 +25,7 @@
#include "net-support.h"
#include "util.h"
-const char default_conf[] = "/etc/mactab";
+const char default_conf[] = "@TERMUX_PREFIX@/etc/mactab";
const char *fname = default_conf;
int use_syslog;
int ctl_sk = -1;

12
packages/net-tools/rarp.c.patch

@ -0,0 +1,12 @@
diff -uNr net-tools/rarp.c net-tools.mod/rarp.c
--- net-tools/rarp.c 2017-02-21 20:24:32.000000000 +0200
+++ net-tools.mod/rarp.c 2019-03-01 19:06:09.028923071 +0200
@@ -178,7 +178,7 @@
fprintf(stderr, _("Usage: rarp -a list entries in cache.\n"));
fprintf(stderr, _(" rarp -d <hostname> delete entry from cache.\n"));
fprintf(stderr, _(" rarp [<HW>] -s <hostname> <hwaddr> add entry to cache.\n"));
- fprintf(stderr, _(" rarp -f add entries from /etc/ethers.\n"));
+ fprintf(stderr, _(" rarp -f add entries from $PREFIX/etc/ethers.\n"));
fprintf(stderr, _(" rarp -V display program version.\n\n"));
fprintf(stderr, _(" <HW>=Use '-H <hw>' to specify hardware address type. Default: %s\n"), DFLT_HW);

12
packages/net-tools/slattach.c.patch

@ -0,0 +1,12 @@
diff -uNr net-tools/slattach.c net-tools.mod/slattach.c
--- net-tools/slattach.c 2017-02-21 20:24:32.000000000 +0200
+++ net-tools.mod/slattach.c 2019-03-01 21:54:06.558251056 +0200
@@ -55,7 +55,7 @@
#include "util.h"
#ifndef _PATH_LOCKD
-#define _PATH_LOCKD "/var/lock" /* lock files */
+#define _PATH_LOCKD "@TERMUX_PREFIX@/var/lock" /* lock files */
#endif
#ifndef _UID_UUCP
#define _UID_UUCP "uucp" /* owns locks */

2
packages/newsboat/build.sh

@ -3,7 +3,7 @@ TERMUX_PKG_DESCRIPTION="RSS/Atom feed reader for the text console"
TERMUX_PKG_LICENSE="MIT" TERMUX_PKG_LICENSE="MIT"
TERMUX_PKG_API_LEVEL=24 TERMUX_PKG_API_LEVEL=24
TERMUX_PKG_VERSION=2.14.1 TERMUX_PKG_VERSION=2.14.1
TERMUX_PKG_REVISION=1 TERMUX_PKG_REVISION=2
TERMUX_PKG_SHA256=4bd0d3b1901a3fc7e0ef73b800587c28181a57b175c36b547dbd84636330df66 TERMUX_PKG_SHA256=4bd0d3b1901a3fc7e0ef73b800587c28181a57b175c36b547dbd84636330df66
TERMUX_PKG_SRCURL=https://newsboat.org/releases/${TERMUX_PKG_VERSION}/newsboat-${TERMUX_PKG_VERSION}.tar.xz TERMUX_PKG_SRCURL=https://newsboat.org/releases/${TERMUX_PKG_VERSION}/newsboat-${TERMUX_PKG_VERSION}.tar.xz
TERMUX_PKG_DEPENDS="libandroid-support, libandroid-glob, json-c, libsqlite, libcurl, libxml2, stfl, ncurses, openssl" TERMUX_PKG_DEPENDS="libandroid-support, libandroid-glob, json-c, libsqlite, libcurl, libxml2, stfl, ncurses, openssl"

60
packages/newsboat/fix-paths.patch

@ -0,0 +1,60 @@
diff -uNr newsboat-2.14.1/src/controller.cpp newsboat-2.14.1.mod/src/controller.cpp
--- newsboat-2.14.1/src/controller.cpp 2019-02-10 18:07:09.000000000 +0200
+++ newsboat-2.14.1.mod/src/controller.cpp 2019-03-01 21:52:00.350784451 +0200
@@ -768,7 +768,7 @@
} else {
snprintf(filename,
sizeof(filename),
- "/tmp/newsboat-article.XXXXXX");
+ "@TERMUX_PREFIX@/tmp/newsboat-article.XXXXXX");
}
int fd = mkstemp(filename);
if (fd != -1) {
diff -uNr newsboat-2.14.1/src/formaction.cpp newsboat-2.14.1.mod/src/formaction.cpp
--- newsboat-2.14.1/src/formaction.cpp 2019-02-10 18:07:09.000000000 +0200
+++ newsboat-2.14.1.mod/src/formaction.cpp 2019-03-01 21:51:38.197304516 +0200
@@ -540,7 +540,7 @@
return "";
} else {
char* my_argv[4];
- my_argv[0] = const_cast<char*>("/bin/sh");
+ my_argv[0] = const_cast<char*>("@TERMUX_PREFIX@/bin/sh");
my_argv[1] = const_cast<char*>("-c");
my_argv[2] = const_cast<char*>(cmdline.c_str());
my_argv[3] = nullptr;
diff -uNr newsboat-2.14.1/src/itemrenderer.cpp newsboat-2.14.1.mod/src/itemrenderer.cpp
--- newsboat-2.14.1/src/itemrenderer.cpp 2019-02-10 18:07:09.000000000 +0200
+++ newsboat-2.14.1.mod/src/itemrenderer.cpp 2019-03-01 21:51:38.200637872 +0200
@@ -92,7 +92,7 @@
rnd.render(source, lines, thelinks, url);
} else {
char* argv[4];
- argv[0] = const_cast<char*>("/bin/sh");
+ argv[0] = const_cast<char*>("@TERMUX_PREFIX@/bin/sh");
argv[1] = const_cast<char*>("-c");
argv[2] = const_cast<char*>(renderer.c_str());
argv[3] = nullptr;
diff -uNr newsboat-2.14.1/src/pbcontroller.cpp newsboat-2.14.1.mod/src/pbcontroller.cpp
--- newsboat-2.14.1/src/pbcontroller.cpp 2019-02-10 18:07:09.000000000 +0200
+++ newsboat-2.14.1.mod/src/pbcontroller.cpp 2019-03-01 21:51:38.200637872 +0200
@@ -281,7 +281,7 @@
cfgparser.register_handler("reset-unread-on-update", &null_cah);
try {
- cfgparser.parse("/etc/newsboat/config");
+ cfgparser.parse("@TERMUX_PREFIX@/etc/newsboat/config");
cfgparser.parse(config_file);
} catch (const ConfigException& ex) {
std::cout << ex.what() << std::endl;
diff -uNr newsboat-2.14.1/src/rssparser.cpp newsboat-2.14.1.mod/src/rssparser.cpp
--- newsboat-2.14.1/src/rssparser.cpp 2019-02-10 18:07:09.000000000 +0200
+++ newsboat-2.14.1.mod/src/rssparser.cpp 2019-03-01 21:51:38.203971227 +0200
@@ -291,7 +291,7 @@
{
std::string buf = utils::retrieve_url(uri, cfgcont);
- char* argv[4] = {const_cast<char*>("/bin/sh"),
+ char* argv[4] = {const_cast<char*>("@TERMUX_PREFIX@/bin/sh"),
const_cast<char*>("-c"),
const_cast<char*>(filter.c_str()),
nullptr};

2
packages/nmap/build.sh

@ -2,7 +2,7 @@ TERMUX_PKG_HOMEPAGE=https://nmap.org/
TERMUX_PKG_DESCRIPTION="Utility for network discovery and security auditing" TERMUX_PKG_DESCRIPTION="Utility for network discovery and security auditing"
TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_LICENSE="GPL-2.0"
TERMUX_PKG_VERSION=7.70 TERMUX_PKG_VERSION=7.70
TERMUX_PKG_REVISION=3 TERMUX_PKG_REVISION=4
TERMUX_PKG_SHA256=847b068955f792f4cc247593aca6dc3dc4aae12976169873247488de147a6e18 TERMUX_PKG_SHA256=847b068955f792f4cc247593aca6dc3dc4aae12976169873247488de147a6e18
TERMUX_PKG_SRCURL=https://nmap.org/dist/nmap-${TERMUX_PKG_VERSION}.tar.bz2 TERMUX_PKG_SRCURL=https://nmap.org/dist/nmap-${TERMUX_PKG_VERSION}.tar.bz2
# Depend on netcat so that it gets installed automatically when installing # Depend on netcat so that it gets installed automatically when installing

90
packages/nmap/fix-paths.patch

@ -0,0 +1,90 @@
diff -uNr nmap-7.70/ncat/ncat_connect.c nmap-7.70.mod/ncat/ncat_connect.c
--- nmap-7.70/ncat/ncat_connect.c 2018-01-28 23:18:17.000000000 +0200
+++ nmap-7.70.mod/ncat/ncat_connect.c 2019-03-02 01:35:44.977992954 +0200
@@ -1005,7 +1005,7 @@
char *tmpdir = getenv("TMPDIR");
size_t size=0, offset=0;
strbuf_sprintf(&tmp_name, &size, &offset, "%s/ncat.XXXXXX",
- tmpdir ? tmpdir : "/tmp");
+ tmpdir ? tmpdir : "@TERMUX_PREFIX@/tmp");
if (mkstemp(tmp_name) == -1) {
bye("Failed to create name for temporary DGRAM source Unix domain socket (mkstemp).");
}
diff -uNr nmap-7.70/ncat/ncat_main.c nmap-7.70.mod/ncat/ncat_main.c
--- nmap-7.70/ncat/ncat_main.c 2018-03-05 03:53:34.000000000 +0200
+++ nmap-7.70.mod/ncat/ncat_main.c 2019-03-02 01:35:44.977992954 +0200
@@ -999,8 +999,8 @@
#ifndef WIN32
/* See if the shell is executable before we get deep into this */
- if (o.execmode == EXEC_SHELL && access("/bin/sh", X_OK) == -1)
- bye("/bin/sh is not executable, so `-c' won't work.");
+ if (o.execmode == EXEC_SHELL && access("@TERMUX_PREFIX@/bin/sh", X_OK) == -1)
+ bye("@TERMUX_PREFIX@/bin/sh is not executable, so `-c' won't work.");
#endif
if (targetaddrs->addr.storage.ss_family != AF_UNSPEC) {
diff -uNr nmap-7.70/ncat/ncat_posix.c nmap-7.70.mod/ncat/ncat_posix.c
--- nmap-7.70/ncat/ncat_posix.c 2018-01-28 23:18:17.000000000 +0200
+++ nmap-7.70.mod/ncat/ncat_posix.c 2019-03-02 01:35:44.981326300 +0200
@@ -239,7 +239,7 @@
char **cmdargs;
case EXEC_SHELL:
- execl("/bin/sh", "sh", "-c", cmdexec, (void *) NULL);
+ execl("@TERMUX_PREFIX@/bin/sh", "sh", "-c", cmdexec, (void *) NULL);
break;
#ifdef HAVE_LUA
case EXEC_LUA:
diff -uNr nmap-7.70/nmap_dns.cc nmap-7.70.mod/nmap_dns.cc
--- nmap-7.70/nmap_dns.cc 2018-01-28 23:18:17.000000000 +0200
+++ nmap-7.70.mod/nmap_dns.cc 2019-03-02 01:35:44.981326300 +0200
@@ -1016,9 +1016,9 @@
char fmt[32];
char ipaddr[INET6_ADDRSTRLEN+1];
- fp = fopen("/etc/resolv.conf", "r");
+ fp = fopen("@TERMUX_PREFIX@/etc/resolv.conf", "r");
if (fp == NULL) {
- if (firstrun) error("mass_dns: warning: Unable to open /etc/resolv.conf. Try using --system-dns or specify valid servers with --dns-servers");
+ if (firstrun) error("mass_dns: warning: Unable to open $PREFIX/etc/resolv.conf. Try using --system-dns or specify valid servers with --dns-servers");
return;
}
@@ -1099,7 +1099,7 @@
parse_etchosts(tpbuf);
#else
- parse_etchosts("/etc/hosts");
+ parse_etchosts("@TERMUX_PREFIX@/etc/hosts");
#endif // WIN32
}
diff -uNr nmap-7.70/protocols.cc nmap-7.70.mod/protocols.cc
--- nmap-7.70/protocols.cc 2018-01-28 23:18:17.000000000 +0200
+++ nmap-7.70.mod/protocols.cc 2019-03-02 01:37:23.878379187 +0200
@@ -156,8 +156,8 @@
int res;
if (nmap_fetchfile(filename, sizeof(filename), "nmap-protocols") != 1) {
- error("Unable to find nmap-protocols! Resorting to /etc/protocols");
- strcpy(filename, "/etc/protocols");
+ error("Unable to find nmap-protocols! Resorting to @TERMUX_PREFIX@/etc/protocols");
+ strcpy(filename, "@TERMUX_PREFIX@/etc/protocols");
}
fp = fopen(filename, "r");
diff -uNr nmap-7.70/services.cc nmap-7.70.mod/services.cc
--- nmap-7.70/services.cc 2018-01-28 23:18:17.000000000 +0200
+++ nmap-7.70.mod/services.cc 2019-03-02 01:36:46.291565552 +0200
@@ -202,8 +202,8 @@
if (nmap_fetchfile(filename, sizeof(filename), "nmap-services") != 1) {
#ifndef WIN32
- error("Unable to find nmap-services! Resorting to /etc/services");
- strcpy(filename, "/etc/services");
+ error("Unable to find nmap-services! Resorting to @TERMUX_PREFIX@/etc/services");
+ strcpy(filename, "@TERMUX_PREFIX@/etc/services");
#else
int len, wnt = GetVersion() < 0x80000000;
error("Unable to find nmap-services! Resorting to /etc/services");

26
packages/nmap/ncat-bin-sh-path.patch

@ -1,26 +0,0 @@
diff -u -r ../nmap-7.40/ncat/ncat_main.c ./ncat/ncat_main.c
--- ../nmap-7.40/ncat/ncat_main.c 2016-12-14 01:12:23.000000000 +0100
+++ ./ncat/ncat_main.c 2017-02-17 11:46:27.468844181 +0100
@@ -965,8 +965,8 @@
#ifndef WIN32
/* See if the shell is executable before we get deep into this */
- if (o.execmode == EXEC_SHELL && access("/bin/sh", X_OK) == -1)
- bye("/bin/sh is not executable, so `-c' won't work.");
+ if (o.execmode == EXEC_SHELL && access("@TERMUX_PREFIX@/bin/sh", X_OK) == -1)
+ bye("@TERMUX_PREFIX@/bin/sh is not executable, so `-c' won't work.");
#endif
if (targetss.storage.ss_family != AF_UNSPEC) {
diff -u -r ../nmap-7.40/ncat/ncat_posix.c ./ncat/ncat_posix.c
--- ../nmap-7.40/ncat/ncat_posix.c 2016-12-14 01:12:23.000000000 +0100
+++ ./ncat/ncat_posix.c 2017-02-17 11:47:09.716313620 +0100
@@ -239,7 +239,7 @@
char **cmdargs;
case EXEC_SHELL:
- execl("/bin/sh", "sh", "-c", cmdexec, (void *) NULL);
+ execl("@TERMUX_PREFIX@/bin/sh", "sh", "-c", cmdexec, (void *) NULL);
break;
#ifdef HAVE_LUA
case EXEC_LUA:

15
packages/nmap/nmap_dns.cc.patch

@ -1,15 +0,0 @@
diff -u -r ../nmap-7.01/nmap_dns.cc ./nmap_dns.cc
--- ../nmap-7.01/nmap_dns.cc 2015-10-07 13:49:24.000000000 -0400
+++ ./nmap_dns.cc 2015-12-15 18:49:27.994641597 -0500
@@ -959,9 +959,9 @@
char fmt[32];
char ipaddr[INET6_ADDRSTRLEN+1];
- fp = fopen("/etc/resolv.conf", "r");
+ fp = fopen("@TERMUX_PREFIX@/etc/resolv.conf", "r");
if (fp == NULL) {
- if (firstrun) error("mass_dns: warning: Unable to open /etc/resolv.conf. Try using --system-dns or specify valid servers with --dns-servers");
+ if (firstrun) error("mass_dns: warning: Unable to open $PREFIX/etc/resolv.conf. Try using --system-dns or specify valid servers with --dns-servers");
return;
}

21
packages/openal-soft/alcConfig.c.patch

@ -0,0 +1,21 @@
diff -uNr openal-soft-1.18.2/Alc/alcConfig.c openal-soft-1.18.2.mod/Alc/alcConfig.c
--- openal-soft-1.18.2/Alc/alcConfig.c 2017-09-24 16:41:50.000000000 +0300
+++ openal-soft-1.18.2.mod/Alc/alcConfig.c 2019-03-02 02:17:37.066950410 +0200
@@ -424,7 +424,7 @@
al_string ppath;
FILE *f;
- str = "/etc/openal/alsoft.conf";
+ str = "@TERMUX_PREFIX@/etc/openal/alsoft.conf";
TRACE("Loading config %s...\n", str);
f = al_fopen(str, "r");
@@ -435,7 +435,7 @@
}
if(!(str=getenv("XDG_CONFIG_DIRS")) || str[0] == 0)
- str = "/etc/xdg";
+ str = "@TERMUX_PREFIX@/etc/xdg";
strncpy(buffer, str, sizeof(buffer)-1);
buffer[sizeof(buffer)-1] = 0;
/* Go through the list in reverse, since "the order of base directories

1
packages/openal-soft/build.sh

@ -2,6 +2,7 @@ TERMUX_PKG_HOMEPAGE=http://openal-soft.org/
TERMUX_PKG_DESCRIPTION="Software implementation of the OpenAL API" TERMUX_PKG_DESCRIPTION="Software implementation of the OpenAL API"
TERMUX_PKG_LICENSE="LGPL-2.0" TERMUX_PKG_LICENSE="LGPL-2.0"
TERMUX_PKG_VERSION=1.18.2 TERMUX_PKG_VERSION=1.18.2
TERMUX_PKG_REVISION=1
TERMUX_PKG_SHA256=9f8ac1e27fba15a59758a13f0c7f6540a0605b6c3a691def9d420570506d7e82 TERMUX_PKG_SHA256=9f8ac1e27fba15a59758a13f0c7f6540a0605b6c3a691def9d420570506d7e82
TERMUX_PKG_SRCURL=http://openal-soft.org/openal-releases/openal-soft-$TERMUX_PKG_VERSION.tar.bz2 TERMUX_PKG_SRCURL=http://openal-soft.org/openal-releases/openal-soft-$TERMUX_PKG_VERSION.tar.bz2
TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" TERMUX_PKG_EXTRA_CONFIGURE_ARGS="

2
packages/openssh/build.sh

@ -2,7 +2,7 @@ TERMUX_PKG_HOMEPAGE=https://www.openssh.com/
TERMUX_PKG_DESCRIPTION="Secure shell for logging into a remote machine" TERMUX_PKG_DESCRIPTION="Secure shell for logging into a remote machine"
TERMUX_PKG_LICENSE="BSD" TERMUX_PKG_LICENSE="BSD"
TERMUX_PKG_VERSION=7.9p1 TERMUX_PKG_VERSION=7.9p1
TERMUX_PKG_REVISION=4 TERMUX_PKG_REVISION=5
TERMUX_PKG_SHA256=6b4b3ba2253d84ed3771c8050728d597c91cfce898713beb7b64a305b6f11aad TERMUX_PKG_SHA256=6b4b3ba2253d84ed3771c8050728d597c91cfce898713beb7b64a305b6f11aad
TERMUX_PKG_SRCURL=https://fastly.cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SRCURL=https://fastly.cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_DEPENDS="libandroid-support, ldns, openssl, libedit, libutil, termux-auth, krb5" TERMUX_PKG_DEPENDS="libandroid-support, ldns, openssl, libedit, libutil, termux-auth, krb5"

38
packages/openssh/session.c.patch

@ -1,17 +1,25 @@
diff --git a/session.c.orig b/session.c diff -uNr openssh-7.9p1/session.c openssh-7.9p1.mod/session.c
index 58826db..890e452 100644 --- openssh-7.9p1/session.c 2018-10-17 03:01:20.000000000 +0300
--- a/session.c.orig +++ openssh-7.9p1.mod/session.c 2019-03-01 23:13:36.360949253 +0200
+++ b/session.c @@ -200,7 +200,7 @@
@@ -199,7 +199,7 @@ auth_input_request_forwarding(struct ssh *ssh, struct passwd * pw)
temporarily_use_uid(pw); temporarily_use_uid(pw);
/* Allocate a buffer for the socket name, and format the name. */ /* Allocate a buffer for the socket name, and format the name. */
- auth_sock_dir = xstrdup("/tmp/ssh-XXXXXXXXXX"); - auth_sock_dir = xstrdup("/tmp/ssh-XXXXXXXXXX");
+ auth_sock_dir = xstrdup("@TERMUX_PREFIX@/tmp/ssh-XXXXXXXXXX"); + auth_sock_dir = xstrdup("@TERMUX_PREFIX@/tmp/ssh-XXXXXXXXXX");
/* Create private directory for socket */ /* Create private directory for socket */
if (mkdtemp(auth_sock_dir) == NULL) { if (mkdtemp(auth_sock_dir) == NULL) {
@@ -802,7 +802,7 @@ do_motd(void) @@ -268,7 +268,7 @@
return;
temporarily_use_uid(pw);
- auth_info_file = xstrdup("/tmp/sshauth.XXXXXXXXXXXXXXX");
+ auth_info_file = xstrdup("@TERMUX_PREFIX@/tmp/sshauth.XXXXXXXXXXXXXXX");
if ((fd = mkstemp(auth_info_file)) == -1) {
error("%s: mkstemp: %s", __func__, strerror(errno));
goto out;
@@ -833,7 +833,7 @@
f = fopen(login_getcapstr(lc, "welcome", "/etc/motd", f = fopen(login_getcapstr(lc, "welcome", "/etc/motd",
"/etc/motd"), "r"); "/etc/motd"), "r");
#else #else
@ -20,21 +28,21 @@ index 58826db..890e452 100644
#endif #endif
if (f) { if (f) {
while (fgets(buf, sizeof(buf), f)) while (fgets(buf, sizeof(buf), f))
@@ -1044,8 +1044,10 @@ do_setup_env(struct ssh *ssh, Session *s, const char *shell) @@ -1082,8 +1082,10 @@
# endif /* HAVE_CYGWIN */ # endif /* HAVE_CYGWIN */
#endif /* HAVE_LOGIN_CAP */ #endif /* HAVE_LOGIN_CAP */
+#ifdef _PATH_MAILDIR +#ifdef _PATH_MAILDIR
snprintf(buf, sizeof buf, "%.200s/%.50s", _PATH_MAILDIR, pw->pw_name); snprintf(buf, sizeof buf, "%.200s/%.50s", _PATH_MAILDIR, pw->pw_name);
child_set_env(&env, &envsize, "MAIL", buf); child_set_env(&env, &envsize, "MAIL", buf);
+#endif +#endif
/* Normal systems set SHELL by default. */ /* Normal systems set SHELL by default. */
child_set_env(&env, &envsize, "SHELL", shell); child_set_env(&env, &envsize, "SHELL", shell);
@@ -1053,6 +1055,15 @@ do_setup_env(struct ssh *ssh, Session *s, const char *shell) @@ -1127,6 +1129,15 @@
if (getenv("TZ")) auth_sock_name);
child_set_env(&env, &envsize, "TZ", getenv("TZ"));
+#ifdef __ANDROID__ +#ifdef __ANDROID__
+ char const* envs_to_keep[] = {"LD_LIBRARY_PATH", "PATH", "ANDROID_ROOT", "ANDROID_DATA", "EXTERNAL_STORAGE", "LANG", "PREFIX", "TMPDIR"}; + char const* envs_to_keep[] = {"LD_LIBRARY_PATH", "PATH", "ANDROID_ROOT", "ANDROID_DATA", "EXTERNAL_STORAGE", "LANG", "PREFIX", "TMPDIR"};
+ for (i = 0; i < (sizeof(envs_to_keep) / sizeof(envs_to_keep[0])); i++) { + for (i = 0; i < (sizeof(envs_to_keep) / sizeof(envs_to_keep[0])); i++) {

3
packages/patch/build.sh

@ -2,6 +2,7 @@ TERMUX_PKG_HOMEPAGE=https://savannah.gnu.org/projects/patch/
TERMUX_PKG_DESCRIPTION="GNU patch which applies diff files to create patched files" TERMUX_PKG_DESCRIPTION="GNU patch which applies diff files to create patched files"
TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_LICENSE="GPL-2.0"
TERMUX_PKG_VERSION=2.7.6 TERMUX_PKG_VERSION=2.7.6
TERMUX_PKG_REVISION=1 TERMUX_PKG_REVISION=2
TERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/patch/patch-${TERMUX_PKG_VERSION}.tar.xz TERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/patch/patch-${TERMUX_PKG_VERSION}.tar.xz
TERMUX_PKG_SHA256=ac610bda97abe0d9f6b7c963255a11dcb196c25e337c61f94e4778d632f1d8fd TERMUX_PKG_SHA256=ac610bda97abe0d9f6b7c963255a11dcb196c25e337c61f94e4778d632f1d8fd
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="ac_cv_path_ED=$TERMUX_PREFIX/bin/ed"

35
packages/patch/tmpdir-path.patch

@ -0,0 +1,35 @@
diff -uNr patch-2.7.6/lib/tempname.c patch-2.7.6.mod/lib/tempname.c
--- patch-2.7.6/lib/tempname.c 2018-02-03 14:41:53.000000000 +0200
+++ patch-2.7.6.mod/lib/tempname.c 2019-03-01 18:34:47.353225515 +0200
@@ -32,7 +32,7 @@
#include <stdio.h>
#ifndef P_tmpdir
-# define P_tmpdir "/tmp"
+# define P_tmpdir "@TERMUX_PREFIX@/tmp"
#endif
#ifndef TMP_MAX
# define TMP_MAX 238328
@@ -147,8 +147,8 @@
{
if (direxists (P_tmpdir))
dir = P_tmpdir;
- else if (strcmp (P_tmpdir, "/tmp") != 0 && direxists ("/tmp"))
- dir = "/tmp";
+ else if (strcmp (P_tmpdir, "@TERMUX_PREFIX@/tmp") != 0 && direxists ("@TERMUX_PREFIX@/tmp"))
+ dir = "@TERMUX_PREFIX@/tmp";
else
{
__set_errno (ENOENT);
diff -uNr patch-2.7.6/src/util.c patch-2.7.6.mod/src/util.c
--- patch-2.7.6/src/util.c 2018-02-03 14:41:49.000000000 +0200
+++ patch-2.7.6.mod/src/util.c 2019-03-01 18:35:00.313283739 +0200
@@ -1601,7 +1601,7 @@
}
#ifndef TMPDIR
-#define TMPDIR "/tmp"
+#define TMPDIR "@TERMUX_PREFIX@/tmp"
#endif
struct try_safe_open_args

2
packages/pinentry/build.sh

@ -2,7 +2,7 @@ TERMUX_PKG_HOMEPAGE=https://www.gnupg.org/related_software/pinentry/index.html
TERMUX_PKG_DESCRIPTION="Dialog allowing secure password entry" TERMUX_PKG_DESCRIPTION="Dialog allowing secure password entry"
TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_LICENSE="GPL-2.0"
TERMUX_PKG_VERSION=1.1.0 TERMUX_PKG_VERSION=1.1.0
TERMUX_PKG_REVISION=1 TERMUX_PKG_REVISION=2
TERMUX_PKG_SHA256=68076686fa724a290ea49cdf0d1c0c1500907d1b759a3bcbfbec0293e8f56570 TERMUX_PKG_SHA256=68076686fa724a290ea49cdf0d1c0c1500907d1b759a3bcbfbec0293e8f56570
TERMUX_PKG_SRCURL=https://www.gnupg.org/ftp/gcrypt/pinentry/pinentry-${TERMUX_PKG_VERSION}.tar.bz2 TERMUX_PKG_SRCURL=https://www.gnupg.org/ftp/gcrypt/pinentry/pinentry-${TERMUX_PKG_VERSION}.tar.bz2
TERMUX_PKG_DEPENDS="libandroid-support, libassuan, ncurses" TERMUX_PKG_DEPENDS="libandroid-support, libassuan, ncurses"

12
packages/pinentry/pinentry-emacs.c.patch

@ -0,0 +1,12 @@
diff -uNr pinentry-1.1.0/pinentry/pinentry-emacs.c pinentry-1.1.0.mod/pinentry/pinentry-emacs.c
--- pinentry-1.1.0/pinentry/pinentry-emacs.c 2017-12-03 18:13:05.000000000 +0200
+++ pinentry-1.1.0.mod/pinentry/pinentry-emacs.c 2019-03-01 18:38:36.250899637 +0200
@@ -134,7 +134,7 @@
}
else
#endif
- tmpdir = "/tmp";
+ tmpdir = "@TERMUX_PREFIX@/tmp";
}
socket_name_storage = malloc (strlen (tmpdir)

1
packages/radare2/build.sh

@ -2,6 +2,7 @@ TERMUX_PKG_HOMEPAGE=https://rada.re
TERMUX_PKG_DESCRIPTION="Advanced Hexadecimal Editor" TERMUX_PKG_DESCRIPTION="Advanced Hexadecimal Editor"
TERMUX_PKG_LICENSE="GPL-3.0" TERMUX_PKG_LICENSE="GPL-3.0"
TERMUX_PKG_VERSION=3.3.0 TERMUX_PKG_VERSION=3.3.0
TERMUX_PKG_REVISION=1
TERMUX_PKG_SHA256=3c092bdf8676d7d49537926258c50557bca98d7d669babfed6113ff82c403bcb TERMUX_PKG_SHA256=3c092bdf8676d7d49537926258c50557bca98d7d669babfed6113ff82c403bcb
TERMUX_PKG_SRCURL=https://github.com/radare/radare2/archive/$TERMUX_PKG_VERSION.tar.gz TERMUX_PKG_SRCURL=https://github.com/radare/radare2/archive/$TERMUX_PKG_VERSION.tar.gz
TERMUX_PKG_DEPENDS="libuv" TERMUX_PKG_DEPENDS="libuv"

12
packages/radare2/libr-util-diff.c.patch

@ -0,0 +1,12 @@
diff -uNr radare2-3.2.1/libr/util/diff.c radare2-3.2.1.mod/libr/util/diff.c
--- radare2-3.2.1/libr/util/diff.c 2019-01-08 18:14:43.000000000 +0200
+++ radare2-3.2.1.mod/libr/util/diff.c 2019-03-02 03:17:18.566391827 +0200
@@ -145,7 +145,7 @@
char* err = NULL;
char* out = NULL;
int out_len;
- (void)r_sys_cmd_str_full ("/usr/bin/diff -u .a .b", NULL, &out, &out_len, &err);
+ (void)r_sys_cmd_str_full ("@TERMUX_PREFIX@/bin/diff -u .a .b", NULL, &out, &out_len, &err);
r_file_rm (".a");
r_file_rm (".b");
free (err);

12
packages/radare2/libr-util-sandbox.c.patch

@ -0,0 +1,12 @@
diff -uNr radare2-3.2.1/libr/util/sandbox.c radare2-3.2.1.mod/libr/util/sandbox.c
--- radare2-3.2.1/libr/util/sandbox.c 2019-01-08 18:14:43.000000000 +0200
+++ radare2-3.2.1.mod/libr/util/sandbox.c 2019-03-02 02:42:52.796061199 +0200
@@ -154,7 +154,7 @@
return system (x);
#endif
}
- return execl ("/bin/sh", "sh", "-c", x, (const char*)NULL);
+ return execl ("@TERMUX_PREFIX@/bin/sh", "sh", "-c", x, (const char*)NULL);
#else
#include <spawn.h>
if (n && !strchr (x, '|')) {

1
packages/rhash/build.sh

@ -2,6 +2,7 @@ TERMUX_PKG_HOMEPAGE=https://github.com/rhash/RHash
TERMUX_PKG_DESCRIPTION="Console utility for calculation and verification of magnet links and a wide range of hash sums" TERMUX_PKG_DESCRIPTION="Console utility for calculation and verification of magnet links and a wide range of hash sums"
TERMUX_PKG_LICENSE="MIT" TERMUX_PKG_LICENSE="MIT"
TERMUX_PKG_VERSION=1.3.8 TERMUX_PKG_VERSION=1.3.8
TERMUX_PKG_REVISION=1
TERMUX_PKG_SHA256=be536a56acfefc87dbc8b1db30fc639020e41edf05518185ea98630e3df7c04c TERMUX_PKG_SHA256=be536a56acfefc87dbc8b1db30fc639020e41edf05518185ea98630e3df7c04c
TERMUX_PKG_SRCURL=https://github.com/rhash/RHash/archive/v$TERMUX_PKG_VERSION.tar.gz TERMUX_PKG_SRCURL=https://github.com/rhash/RHash/archive/v$TERMUX_PKG_VERSION.tar.gz
TERMUX_PKG_DEPENDS="openssl" TERMUX_PKG_DEPENDS="openssl"

12
packages/rhash/parse_cmdline.c.patch

@ -0,0 +1,12 @@
diff -uNr RHash-1.3.8/parse_cmdline.c RHash-1.3.8.mod/parse_cmdline.c
--- RHash-1.3.8/parse_cmdline.c 2019-02-04 06:05:28.000000000 +0200
+++ RHash-1.3.8.mod/parse_cmdline.c 2019-03-01 20:33:22.425704712 +0200
@@ -547,7 +547,7 @@
static const char* find_conf_file(void)
{
#ifndef SYSCONFDIR
-# define SYSCONFDIR "/etc"
+# define SYSCONFDIR "@TERMUX_PREFIX@/etc"
#endif
#define CONFIG_FILENAME "rhashrc"

2
packages/rsync/build.sh

@ -2,7 +2,7 @@ TERMUX_PKG_HOMEPAGE=https://rsync.samba.org/
TERMUX_PKG_DESCRIPTION="Utility that provides fast incremental file transfer" TERMUX_PKG_DESCRIPTION="Utility that provides fast incremental file transfer"
TERMUX_PKG_LICENSE="GPL-3.0" TERMUX_PKG_LICENSE="GPL-3.0"
TERMUX_PKG_VERSION=3.1.3 TERMUX_PKG_VERSION=3.1.3
TERMUX_PKG_REVISION=1 TERMUX_PKG_REVISION=2
TERMUX_PKG_SHA256=55cc554efec5fdaad70de921cd5a5eeb6c29a95524c715f3bbf849235b0800c0 TERMUX_PKG_SHA256=55cc554efec5fdaad70de921cd5a5eeb6c29a95524c715f3bbf849235b0800c0
TERMUX_PKG_SRCURL=https://rsync.samba.org/ftp/rsync/src/rsync-${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SRCURL=https://rsync.samba.org/ftp/rsync/src/rsync-${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--with-rsyncd-conf=$TERMUX_PREFIX/etc/rsyncd.conf --with-included-zlib=no --disable-debug" TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--with-rsyncd-conf=$TERMUX_PREFIX/etc/rsyncd.conf --with-included-zlib=no --disable-debug"

12
packages/rsync/rsync.h.patch

@ -0,0 +1,12 @@
diff -uNr rsync-3.1.3/rsync.h rsync-3.1.3.mod/rsync.h
--- rsync-3.1.3/rsync.h 2018-01-15 20:58:31.000000000 +0200
+++ rsync-3.1.3.mod/rsync.h 2019-03-01 22:40:29.926940976 +0200
@@ -29,7 +29,7 @@
/* RSYNCD_SYSCONF is now set in config.h */
#define RSYNCD_USERCONF "rsyncd.conf"
-#define DEFAULT_LOCK_FILE "/var/run/rsyncd.lock"
+#define DEFAULT_LOCK_FILE "@TERMUX_PREFIX@/var/run/rsyncd.lock"
#define URL_PREFIX "rsync://"
#define SYMLINK_PREFIX "/rsyncd-munged/" /* This MUST have a trailing slash! */

1
packages/tar/build.sh

@ -2,6 +2,7 @@ TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/tar/
TERMUX_PKG_DESCRIPTION="GNU tar for manipulating tar archives" TERMUX_PKG_DESCRIPTION="GNU tar for manipulating tar archives"
TERMUX_PKG_LICENSE="GPL-3.0" TERMUX_PKG_LICENSE="GPL-3.0"
TERMUX_PKG_VERSION=1.32 TERMUX_PKG_VERSION=1.32
TERMUX_PKG_REVISION=1
TERMUX_PKG_SHA256=d0d3ae07f103323be809bc3eac0dcc386d52c5262499fe05511ac4788af1fdd8 TERMUX_PKG_SHA256=d0d3ae07f103323be809bc3eac0dcc386d52c5262499fe05511ac4788af1fdd8
TERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/tar/tar-${TERMUX_PKG_VERSION}.tar.xz TERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/tar/tar-${TERMUX_PKG_VERSION}.tar.xz
# Allow xz compression (busybox only provides xz decompression): # Allow xz compression (busybox only provides xz decompression):

35
packages/tar/tmpdir-path.patch

@ -0,0 +1,35 @@
diff -uNr tar-1.31/gnu/tempname.c tar-1.31.mod/gnu/tempname.c
--- tar-1.31/gnu/tempname.c 2019-01-02 20:16:01.000000000 +0200
+++ tar-1.31.mod/gnu/tempname.c 2019-03-01 18:31:05.035530338 +0200
@@ -32,7 +32,7 @@
#include <stdio.h>
#ifndef P_tmpdir
-# define P_tmpdir "/tmp"
+# define P_tmpdir "@TERMUX_PREFIX@/tmp"
#endif
#ifndef TMP_MAX
# define TMP_MAX 238328
@@ -147,8 +147,8 @@
{
if (direxists (P_tmpdir))
dir = P_tmpdir;
- else if (strcmp (P_tmpdir, "/tmp") != 0 && direxists ("/tmp"))
- dir = "/tmp";
+ else if (strcmp (P_tmpdir, "@TERMUX_PREFIX@/tmp") != 0 && direxists ("@TERMUX_PREFIX@/tmp"))
+ dir = "@TERMUX_PREFIX@/tmp";
else
{
__set_errno (ENOENT);
diff -uNr tar-1.31/src/xheader.c tar-1.31.mod/src/xheader.c
--- tar-1.31/src/xheader.c 2019-01-02 20:07:48.000000000 +0200
+++ tar-1.31.mod/src/xheader.c 2019-03-01 18:31:18.538927987 +0200
@@ -387,7 +387,7 @@
size_t len;
const char *tmp = getenv ("TMPDIR");
if (!tmp)
- tmp = "/tmp";
+ tmp = "@TERMUX_PREFIX@/tmp";
len = strlen (tmp) + sizeof (GLOBAL_HEADER_TEMPLATE); /* Includes nul */
globexthdr_name = xmalloc (len);
strcpy(globexthdr_name, tmp);

1
packages/util-linux/build.sh

@ -2,6 +2,7 @@ TERMUX_PKG_HOMEPAGE=https://en.wikipedia.org/wiki/Util-linux
TERMUX_PKG_DESCRIPTION="Miscellaneous system utilities" TERMUX_PKG_DESCRIPTION="Miscellaneous system utilities"
TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_LICENSE="GPL-2.0"
TERMUX_PKG_VERSION=2.33.1 TERMUX_PKG_VERSION=2.33.1
TERMUX_PKG_REVISION=1
TERMUX_PKG_SHA256=c14bd9f3b6e1792b90db87696e87ec643f9d63efa0a424f092a5a6b2f2dbef21 TERMUX_PKG_SHA256=c14bd9f3b6e1792b90db87696e87ec643f9d63efa0a424f092a5a6b2f2dbef21
TERMUX_PKG_SRCURL=https://www.kernel.org/pub/linux/utils/util-linux/v${TERMUX_PKG_VERSION:0:4}/util-linux-${TERMUX_PKG_VERSION}.tar.xz TERMUX_PKG_SRCURL=https://www.kernel.org/pub/linux/utils/util-linux/v${TERMUX_PKG_VERSION:0:4}/util-linux-${TERMUX_PKG_VERSION}.tar.xz
TERMUX_PKG_DEPENDS="ncurses, libutil, libcrypt" TERMUX_PKG_DEPENDS="ncurses, libutil, libcrypt"

423
packages/util-linux/fix-paths.patch

@ -0,0 +1,423 @@
diff -uNr util-linux-2.33.1/include/pathnames.h util-linux-2.33.1.mod/include/pathnames.h
--- util-linux-2.33.1/include/pathnames.h 2019-01-08 15:58:25.324719638 +0200
+++ util-linux-2.33.1.mod/include/pathnames.h 2019-03-02 01:26:11.465802555 +0200
@@ -20,68 +20,58 @@
/* DEFPATHs from <paths.h> don't include /usr/local */
#undef _PATH_DEFPATH
-
-#ifdef USE_USRDIR_PATHS_ONLY
-# define _PATH_DEFPATH "/usr/local/bin:/usr/bin"
-#else
-# define _PATH_DEFPATH "/usr/local/bin:/bin:/usr/bin"
-#endif
+#define _PATH_DEFPATH "@TERMUX_PREFIX@/bin:@TERMUX_PREFIX@/bin/applets"
#undef _PATH_DEFPATH_ROOT
-
-#ifdef USE_USRDIR_PATHS_ONLY
-# define _PATH_DEFPATH_ROOT "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin"
-#else
-# define _PATH_DEFPATH_ROOT "/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin"
-#endif
+#define _PATH_DEFPATH_ROOT "@TERMUX_PREFIX@/bin:@TERMUX_PREFIX@/bin/applets"
#define _PATH_HUSHLOGIN ".hushlogin"
-#define _PATH_HUSHLOGINS "/etc/hushlogins"
+#define _PATH_HUSHLOGINS "@TERMUX_PREFIX@/etc/hushlogins"
-#define _PATH_NOLOGIN_TXT "/etc/nologin.txt"
+#define _PATH_NOLOGIN_TXT "@TERMUX_PREFIX@/etc/nologin.txt"
#ifndef _PATH_MAILDIR
-# define _PATH_MAILDIR "/var/spool/mail"
+# define _PATH_MAILDIR "@TERMUX_PREFIX@/var/spool/mail"
#endif
-#define _PATH_MOTDFILE "/usr/share/misc/motd:/run/motd:/etc/motd"
+#define _PATH_MOTDFILE "@TERMUX_PREFIX@/share/misc/motd:@TERMUX_PREFIX@/var/run/motd:@TERMUX_PREFIX@/etc/motd"
#ifndef _PATH_NOLOGIN
-# define _PATH_NOLOGIN "/etc/nologin"
+# define _PATH_NOLOGIN "@TERMUX_PREFIX@/etc/nologin"
#endif
-#define _PATH_VAR_NOLOGIN "/var/run/nologin"
+#define _PATH_VAR_NOLOGIN "@TERMUX_PREFIX@/var/run/nologin"
#ifndef _PATH_LOGIN
-# define _PATH_LOGIN "/bin/login"
+# define _PATH_LOGIN "@TERMUX_PREFIX@/bin/login"
#endif
-#define _PATH_SHUTDOWN "/sbin/shutdown"
+#define _PATH_SHUTDOWN "@TERMUX_PREFIX@/bin/shutdown"
#define _PATH_TERMCOLORS_DIRNAME "terminal-colors.d"
-#define _PATH_TERMCOLORS_DIR "/etc/" _PATH_TERMCOLORS_DIRNAME
+#define _PATH_TERMCOLORS_DIR "@TERMUX_PREFIX@/etc/" _PATH_TERMCOLORS_DIRNAME
/* login paths */
-#define _PATH_PASSWD "/etc/passwd"
-#define _PATH_GSHADOW "/etc/gshadow"
-#define _PATH_GROUP "/etc/group"
-#define _PATH_SHADOW_PASSWD "/etc/shadow"
-#define _PATH_SHELLS "/etc/shells"
+#define _PATH_PASSWD "@TERMUX_PREFIX@/etc/passwd"
+#define _PATH_GSHADOW "@TERMUX_PREFIX@/etc/gshadow"
+#define _PATH_GROUP "@TERMUX_PREFIX@/etc/group"
+#define _PATH_SHADOW_PASSWD "@TERMUX_PREFIX@/etc/shadow"
+#define _PATH_SHELLS "@TERMUX_PREFIX@/etc/shells"
#ifndef _PATH_BTMP
-# define _PATH_BTMP "/var/log/btmp"
+# define _PATH_BTMP "@TERMUX_PREFIX@/var/log/btmp"
#endif
-#define _PATH_ISSUE "/etc/issue"
+#define _PATH_ISSUE "@TERMUX_PREFIX@/etc/issue"
#define _PATH_ISSUEDIR _PATH_ISSUE ".d"
-#define _PATH_OS_RELEASE_ETC "/etc/os-release"
-#define _PATH_OS_RELEASE_USR "/usr/lib/os-release"
+#define _PATH_OS_RELEASE_ETC "@TERMUX_PREFIX@/etc/os-release"
+#define _PATH_OS_RELEASE_USR "@TERMUX_PREFIX@/lib/os-release"
#define _PATH_NUMLOCK_ON _PATH_RUNSTATEDIR "/numlock-on"
-#define _PATH_LOGINDEFS "/etc/login.defs"
+#define _PATH_LOGINDEFS "@TERMUX_PREFIX@/etc/login.defs"
/* misc paths */
-#define _PATH_WORDS "/usr/share/dict/words"
-#define _PATH_WORDS_ALT "/usr/share/dict/web2"
+#define _PATH_WORDS "@TERMUX_PREFIX@/share/dict/words"
+#define _PATH_WORDS_ALT "@TERMUX_PREFIX@/share/dict/web2"
/* mount paths */
-#define _PATH_FILESYSTEMS "/etc/filesystems"
+#define _PATH_FILESYSTEMS "@TERMUX_PREFIX@/etc/filesystems"
#define _PATH_PROC_SWAPS "/proc/swaps"
#define _PATH_PROC_FILESYSTEMS "/proc/filesystems"
#define _PATH_PROC_MOUNTS "/proc/mounts"
@@ -112,7 +102,7 @@
# ifdef MOUNTED /* deprecated */
# define _PATH_MOUNTED MOUNTED
# else
-# define _PATH_MOUNTED "/etc/mtab"
+# define _PATH_MOUNTED "@TERMUX_PREFIX@/etc/mtab"
# endif
#endif
@@ -120,7 +110,7 @@
# ifdef MNTTAB /* deprecated */
# define _PATH_MNTTAB MNTTAB
# else
-# define _PATH_MNTTAB "/etc/fstab"
+# define _PATH_MNTTAB "@TERMUX_PREFIX@/etc/fstab"
# endif
#endif
@@ -147,11 +137,7 @@
#define _PATH_DEV_BYPARTUUID "/dev/disk/by-partuuid"
/* hwclock paths */
-#ifdef CONFIG_ADJTIME_PATH
-# define _PATH_ADJTIME CONFIG_ADJTIME_PATH
-#else
-# define _PATH_ADJTIME "/etc/adjtime"
-#endif
+#define _PATH_ADJTIME "@TERMUX_PREFIX@/etc/adjtime"
#ifdef __ia64__
# define _PATH_RTC_DEV "/dev/efirtc"
diff -uNr util-linux-2.33.1/lib/exec_shell.c util-linux-2.33.1.mod/lib/exec_shell.c
--- util-linux-2.33.1/lib/exec_shell.c 2018-09-20 15:38:55.851404915 +0300
+++ util-linux-2.33.1.mod/lib/exec_shell.c 2019-03-02 01:26:11.469135901 +0200
@@ -28,7 +28,7 @@
#include "exec_shell.h"
-#define DEFAULT_SHELL "/bin/sh"
+#define DEFAULT_SHELL "@TERMUX_PREFIX@/bin/sh"
void __attribute__((__noreturn__)) exec_shell(void)
{
diff -uNr util-linux-2.33.1/libblkid/src/blkidP.h util-linux-2.33.1.mod/libblkid/src/blkidP.h
--- util-linux-2.33.1/libblkid/src/blkidP.h 2018-09-20 15:38:55.853404903 +0300
+++ util-linux-2.33.1.mod/libblkid/src/blkidP.h 2019-03-02 01:26:11.469135901 +0200
@@ -288,7 +288,7 @@
#define BLKID_BIC_FL_CHANGED 0x0004 /* Cache has changed from disk */
/* config file */
-#define BLKID_CONFIG_FILE "/etc/blkid.conf"
+#define BLKID_CONFIG_FILE "@TERMUX_PREFIX@/etc/blkid.conf"
/* cache file on systemds with /run */
#define BLKID_RUNTIME_TOPDIR "/run"
@@ -296,7 +296,7 @@
#define BLKID_CACHE_FILE BLKID_RUNTIME_DIR "/blkid.tab"
/* old systems */
-#define BLKID_CACHE_FILE_OLD "/etc/blkid.tab"
+#define BLKID_CACHE_FILE_OLD "@TERMUX_PREFIX@/etc/blkid.tab"
#define BLKID_PROBE_OK 0
#define BLKID_PROBE_NONE 1
diff -uNr util-linux-2.33.1/libblkid/src/topology/dm.c util-linux-2.33.1.mod/libblkid/src/topology/dm.c
--- util-linux-2.33.1/libblkid/src/topology/dm.c 2018-09-20 15:38:55.856404884 +0300
+++ util-linux-2.33.1.mod/libblkid/src/topology/dm.c 2019-03-02 01:27:49.282834302 +0200
@@ -30,9 +30,8 @@
const struct blkid_idmag *mag __attribute__((__unused__)))
{
const char *paths[] = {
- "/usr/local/sbin/dmsetup",
- "/usr/sbin/dmsetup",
- "/sbin/dmsetup"
+ "@TERMUX_PREFIX@/bin/dmsetup",
+ "@TERMUX_PREFIX@/sbin/dmsetup"
};
int dmpipe[] = { -1, -1 }, stripes, stripesize;
const char *cmd = NULL;
diff -uNr util-linux-2.33.1/libblkid/src/topology/lvm.c util-linux-2.33.1.mod/libblkid/src/topology/lvm.c
--- util-linux-2.33.1/libblkid/src/topology/lvm.c 2017-09-18 12:48:03.563891490 +0300
+++ util-linux-2.33.1.mod/libblkid/src/topology/lvm.c 2019-03-02 01:28:56.036419326 +0200
@@ -36,9 +36,8 @@
const struct blkid_idmag *mag __attribute__((__unused__)))
{
const char *paths[] = {
- "/usr/local/sbin/lvdisplay",
- "/usr/sbin/lvdisplay",
- "/sbin/lvdisplay"
+ "@TERMUX_PREFIX@/bin/lvdisplay",
+ "@TERMUX_PREFIX@/sbin/lvdisplay"
};
int lvpipe[] = { -1, -1 }, stripes = 0, stripesize = 0;
FILE *stream = NULL;
diff -uNr util-linux-2.33.1/libuuid/src/uuidd.h util-linux-2.33.1.mod/libuuid/src/uuidd.h
--- util-linux-2.33.1/libuuid/src/uuidd.h 2018-06-04 10:57:02.806445781 +0300
+++ util-linux-2.33.1.mod/libuuid/src/uuidd.h 2019-03-02 01:28:28.309647886 +0200
@@ -38,7 +38,7 @@
#define UUIDD_DIR _PATH_RUNSTATEDIR "/uuidd"
#define UUIDD_SOCKET_PATH UUIDD_DIR "/request"
#define UUIDD_PIDFILE_PATH UUIDD_DIR "/uuidd.pid"
-#define UUIDD_PATH "/usr/sbin/uuidd"
+#define UUIDD_PATH "@TERMUX_PREFIX@/bin/uuidd"
#define UUIDD_OP_GETPID 0
#define UUIDD_OP_GET_MAXOP 1
diff -uNr util-linux-2.33.1/libuuid/src/uuidP.h util-linux-2.33.1.mod/libuuid/src/uuidP.h
--- util-linux-2.33.1/libuuid/src/uuidP.h 2018-09-20 15:38:55.870404799 +0300
+++ util-linux-2.33.1.mod/libuuid/src/uuidP.h 2019-03-02 01:29:29.103211342 +0200
@@ -37,7 +37,7 @@
#include "uuid.h"
-#define LIBUUID_CLOCK_FILE "/var/lib/libuuid/clock.txt"
+#define LIBUUID_CLOCK_FILE "@TERMUX_PREFIX@/var/lib/libuuid/clock.txt"
/*
* Offset between 15-Oct-1582 and 1-Jan-70
diff -uNr util-linux-2.33.1/login-utils/login.c util-linux-2.33.1.mod/login-utils/login.c
--- util-linux-2.33.1/login-utils/login.c 2018-12-07 13:31:45.441532191 +0200
+++ util-linux-2.33.1.mod/login-utils/login.c 2019-03-02 01:26:11.469135901 +0200
@@ -1358,7 +1358,7 @@
strcpy(buff, "exec ");
strcat(buff, pwd->pw_shell);
- childArgv[childArgc++] = "/bin/sh";
+ childArgv[childArgc++] = "@TERMUX_PREFIX@/bin/sh";
childArgv[childArgc++] = "-sh";
childArgv[childArgc++] = "-c";
childArgv[childArgc++] = buff;
@@ -1377,7 +1377,7 @@
execvp(childArgv[0], childArgv + 1);
- if (!strcmp(childArgv[0], "/bin/sh"))
+ if (!strcmp(childArgv[0], "@TERMUX_PREFIX@/bin/sh"))
warn(_("couldn't exec shell script"));
else
warn(_("no shell"));
diff -uNr util-linux-2.33.1/login-utils/su-common.c util-linux-2.33.1.mod/login-utils/su-common.c
--- util-linux-2.33.1/login-utils/su-common.c 2018-12-07 13:31:45.441532191 +0200
+++ util-linux-2.33.1.mod/login-utils/su-common.c 2019-03-02 01:26:11.472469247 +0200
@@ -96,7 +96,7 @@
#define is_pam_failure(_rc) ((_rc) != PAM_SUCCESS)
/* The shell to run if none is given in the user's passwd entry. */
-#define DEFAULT_SHELL "/bin/sh"
+#define DEFAULT_SHELL "@TERMUX_PREFIX@/bin/sh"
/* The user to become if none is specified. */
#define DEFAULT_USER "root"
diff -uNr util-linux-2.33.1/login-utils/sulogin.c util-linux-2.33.1.mod/login-utils/sulogin.c
--- util-linux-2.33.1/login-utils/sulogin.c 2018-09-20 15:38:55.873404781 +0300
+++ util-linux-2.33.1.mod/login-utils/sulogin.c 2019-03-02 01:26:11.475802592 +0200
@@ -742,7 +742,7 @@
if (pwd->pw_shell[0])
su_shell = pwd->pw_shell;
else
- su_shell = "/bin/sh";
+ su_shell = "@TERMUX_PREFIX@/bin/sh";
}
if ((p = strrchr(su_shell, '/')) == NULL)
p = su_shell;
@@ -791,9 +791,9 @@
execl(su_shell, shell, NULL);
warn(_("failed to execute %s"), su_shell);
- xsetenv("SHELL", "/bin/sh", 1);
- execl("/bin/sh", profile ? "-sh" : "sh", NULL);
- warn(_("failed to execute %s"), "/bin/sh");
+ xsetenv("SHELL", "@TERMUX_PREFIX@/bin/sh", 1);
+ execl("@TERMUX_PREFIX@/bin/sh", profile ? "-sh" : "sh", NULL);
+ warn(_("failed to execute %s"), "@TERMUX_PREFIX@/bin/sh");
}
static void usage(void)
diff -uNr util-linux-2.33.1/misc-utils/whereis.c util-linux-2.33.1.mod/misc-utils/whereis.c
--- util-linux-2.33.1/misc-utils/whereis.c 2018-06-04 10:57:02.811445742 +0300
+++ util-linux-2.33.1.mod/misc-utils/whereis.c 2019-03-02 01:26:11.475802592 +0200
@@ -97,82 +97,23 @@
};
static const char *bindirs[] = {
- "/usr/bin",
- "/usr/sbin",
-#if defined(MULTIARCHTRIPLET)
- "/lib/" MULTIARCHTRIPLET,
- "/usr/lib/" MULTIARCHTRIPLET,
- "/usr/local/lib/" MULTIARCHTRIPLET,
-#endif
- "/usr/lib",
- "/usr/lib64",
- "/bin",
+ "@TERMUX_PREFIX@/bin",
+ "@TERMUX_PREFIX@/bin/applets",
+ "@TERMUX_PREFIX@/libexec",
"/sbin",
- "/etc",
- "/usr/etc",
- "/lib",
- "/lib64",
- "/usr/games",
- "/usr/games/bin",
- "/usr/games/lib",
- "/usr/emacs/etc",
- "/usr/lib/emacs/*/etc",
- "/usr/TeX/bin",
- "/usr/tex/bin",
- "/usr/interviews/bin/LINUX",
-
- "/usr/X11R6/bin",
- "/usr/X386/bin",
- "/usr/bin/X11",
- "/usr/X11/bin",
- "/usr/X11R5/bin",
-
- "/usr/local/bin",
- "/usr/local/sbin",
- "/usr/local/etc",
- "/usr/local/lib",
- "/usr/local/games",
- "/usr/local/games/bin",
- "/usr/local/emacs/etc",
- "/usr/local/TeX/bin",
- "/usr/local/tex/bin",
- "/usr/local/bin/X11",
-
- "/usr/contrib",
- "/usr/hosts",
- "/usr/include",
-
- "/usr/g++-include",
-
- "/usr/ucb",
- "/usr/old",
- "/usr/new",
- "/usr/local",
- "/usr/libexec",
- "/usr/share",
-
- "/opt/*/bin",
+ "/system/bin",
+ "/system/xbin",
NULL
};
static const char *mandirs[] = {
- "/usr/man/*",
- "/usr/share/man/*",
- "/usr/X386/man/*",
- "/usr/X11/man/*",
- "/usr/TeX/man/*",
- "/usr/interviews/man/mann",
- "/usr/share/info",
+ "@TERMUX_PREFIX@/share/man/*",
+ "@TERMUX_PREFIX@/share/info",
NULL
};
static const char *srcdirs[] = {
- "/usr/src/*",
- "/usr/src/lib/libc/*",
- "/usr/src/lib/libc/net/*",
- "/usr/src/ucb/pascal",
- "/usr/src/ucb/pascal/utilities",
- "/usr/src/undoc",
+ "@TERMUX_PREFIX@/src",
NULL
};
diff -uNr util-linux-2.33.1/sys-utils/setarch.c util-linux-2.33.1.mod/sys-utils/setarch.c
--- util-linux-2.33.1/sys-utils/setarch.c 2019-01-04 12:19:16.258737400 +0200
+++ util-linux-2.33.1.mod/sys-utils/setarch.c 2019-03-02 01:26:44.309257925 +0200
@@ -315,7 +315,7 @@
/* Don't use ifdef sparc here, we get "Unrecognized architecture"
* error message later if necessary */
if (strcmp(arch, "sparc32bash") == 0) {
- shell = "/bin/bash";
+ shell = "@TERMUX_PREFIX@/bin/bash";
shell_arg = "";
goto set_arch;
}
@@ -425,7 +425,7 @@
verify_arch_domain(target, arch);
if (!argc) {
- shell = "/bin/sh";
+ shell = "@TERMUX_PREFIX@/bin/sh";
shell_arg = "-sh";
}
if (verbose) {
diff -uNr util-linux-2.33.1/sys-utils/setpriv.c util-linux-2.33.1.mod/sys-utils/setpriv.c
--- util-linux-2.33.1/sys-utils/setpriv.c 2019-01-04 12:47:44.026147542 +0200
+++ util-linux-2.33.1.mod/sys-utils/setpriv.c 2019-03-02 01:26:11.479135938 +0200
@@ -58,7 +58,7 @@
#define SETPRIV_EXIT_PRIVERR 127 /* how we exit when we fail to set privs */
/* The shell to set SHELL env.variable if none is given in the user's passwd entry. */
-#define DEFAULT_SHELL "/bin/sh"
+#define DEFAULT_SHELL "@TERMUX_PREFIX@/bin/sh"
static gid_t get_group(const char *s, const char *err);
diff -uNr util-linux-2.33.1/text-utils/more.c util-linux-2.33.1.mod/text-utils/more.c
--- util-linux-2.33.1/text-utils/more.c 2018-09-20 15:38:55.990404066 +0300
+++ util-linux-2.33.1.mod/text-utils/more.c 2019-03-02 01:26:11.479135938 +0200
@@ -1877,7 +1877,7 @@
}
if ((ctl->shell = getenv("SHELL")) == NULL)
- ctl->shell = "/bin/sh";
+ ctl->shell = "@TERMUX_PREFIX@/bin/sh";
}
ctl->no_tty_in = tcgetattr(STDIN_FILENO, &ctl->output_tty);
tcgetattr(STDERR_FILENO, &ctl->output_tty);
diff -uNr util-linux-2.33.1/text-utils/pg.c util-linux-2.33.1.mod/text-utils/pg.c
--- util-linux-2.33.1/text-utils/pg.c 2018-06-04 10:57:02.900445049 +0300
+++ util-linux-2.33.1.mod/text-utils/pg.c 2019-03-02 01:26:11.482469284 +0200
@@ -1365,7 +1365,7 @@
{
const char *sh = getenv("SHELL");
if (!sh)
- sh = "/bin/sh";
+ sh = "@TERMUX_PREFIX@/bin/sh";
if (!nobuf)
fclose(fbuf);
fclose(find);

2
packages/wget/build.sh

@ -2,7 +2,7 @@ TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/wget/
TERMUX_PKG_DESCRIPTION="Commandline tool for retrieving files using HTTP, HTTPS and FTP" TERMUX_PKG_DESCRIPTION="Commandline tool for retrieving files using HTTP, HTTPS and FTP"
TERMUX_PKG_LICENSE="GPL-3.0" TERMUX_PKG_LICENSE="GPL-3.0"
TERMUX_PKG_VERSION=1.20.1 TERMUX_PKG_VERSION=1.20.1
TERMUX_PKG_REVISION=1 TERMUX_PKG_REVISION=2
TERMUX_PKG_SHA256=0f63e84dd23dc53ab3ab6f483c3afff8301e54c165783f772101cdd9b1c64928 TERMUX_PKG_SHA256=0f63e84dd23dc53ab3ab6f483c3afff8301e54c165783f772101cdd9b1c64928
TERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/wget/wget-${TERMUX_PKG_VERSION}.tar.lz TERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/wget/wget-${TERMUX_PKG_VERSION}.tar.lz
TERMUX_PKG_DEPENDS="pcre2, openssl, libuuid, libandroid-support, libunistring" TERMUX_PKG_DEPENDS="pcre2, openssl, libuuid, libandroid-support, libunistring"

46
packages/wget/tmpdir-path.patch

@ -0,0 +1,46 @@
diff -uNr wget-1.20.1/lib/tempname.c wget-1.20.1.mod/lib/tempname.c
--- wget-1.20.1/lib/tempname.c 2018-12-26 22:08:19.000000000 +0200
+++ wget-1.20.1.mod/lib/tempname.c 2019-03-01 18:28:01.751293299 +0200
@@ -32,7 +32,7 @@
#include <stdio.h>
#ifndef P_tmpdir
-# define P_tmpdir "/tmp"
+# define P_tmpdir "@TERMUX_PREFIX@/tmp"
#endif
#ifndef TMP_MAX
# define TMP_MAX 238328
@@ -147,8 +147,8 @@
{
if (direxists (P_tmpdir))
dir = P_tmpdir;
- else if (strcmp (P_tmpdir, "/tmp") != 0 && direxists ("/tmp"))
- dir = "/tmp";
+ else if (strcmp (P_tmpdir, "@TERMUX_PREFIX@/tmp") != 0 && direxists ("@TERMUX_PREFIX@/tmp"))
+ dir = "@TERMUX_PREFIX@/tmp";
else
{
__set_errno (ENOENT);
diff -uNr wget-1.20.1/lib/tmpdir.c wget-1.20.1.mod/lib/tmpdir.c
--- wget-1.20.1/lib/tmpdir.c 2018-12-26 22:08:19.000000000 +0200
+++ wget-1.20.1.mod/lib/tmpdir.c 2019-03-01 18:27:22.434424043 +0200
@@ -36,7 +36,7 @@
# ifdef _P_tmpdir /* native Windows */
# define P_tmpdir _P_tmpdir
# else
-# define P_tmpdir "/tmp"
+# define P_tmpdir "@TERMUX_PREFIX@/tmp"
# endif
#endif
@@ -130,8 +130,8 @@
#endif
if (direxists (P_tmpdir))
dir = P_tmpdir;
- else if (strcmp (P_tmpdir, "/tmp") != 0 && direxists ("/tmp"))
- dir = "/tmp";
+ else if (strcmp (P_tmpdir, "@TERMUX_PREFIX@/tmp") != 0 && direxists ("@TERMUX_PREFIX@/tmp"))
+ dir = "@TERMUX_PREFIX@/tmp";
else
{
__set_errno (ENOENT);
Loading…
Cancel
Save