termux-packages/packages/tsocks/tsocks.patch

44 lines
1.3 KiB
Diff
Raw Normal View History

2017-09-22 00:29:36 +02:00
diff --git a/tsocks b/tsocks
index 8380d9c..7d1df7a 100755
--- a/tsocks
+++ b/tsocks
@@ -46,14 +46,14 @@ case "$1" in
on)
if [ -z "$LD_PRELOAD" ]
then
- export LD_PRELOAD="/usr/lib/libtsocks.so"
2021-10-13 12:09:18 +02:00
+ export LD_PRELOAD="@TERMUX_PREFIX@/lib/libtsocks.so"
2017-09-22 00:29:36 +02:00
else
- echo $LD_PRELOAD | grep -q "/usr/lib/libtsocks\.so" || \
- export LD_PRELOAD="/usr/lib/libtsocks.so $LD_PRELOAD"
2021-10-13 12:09:18 +02:00
+ echo $LD_PRELOAD | grep -q "@TERMUX_PREFIX@/lib/libtsocks\.so" || \
+ export LD_PRELOAD="@TERMUX_PREFIX@/lib/libtsocks.so $LD_PRELOAD"
2017-09-22 00:29:36 +02:00
fi
;;
off)
- export LD_PRELOAD=`echo -n $LD_PRELOAD | sed 's/\/usr\/lib\/libtsocks.so \?//'`
2021-10-13 12:09:18 +02:00
+ export LD_PRELOAD=`echo -n $LD_PRELOAD | sed "s:@TERMUX_PREFIX@/lib/libtsocks.so *::"`
2017-09-22 00:29:36 +02:00
if [ -z "$LD_PRELOAD" ]
then
unset LD_PRELOAD
@@ -68,15 +68,15 @@ case "$1" in
*)
if [ -z "$LD_PRELOAD" ]
then
- export LD_PRELOAD="/usr/lib/libtsocks.so"
2021-10-13 12:09:18 +02:00
+ export LD_PRELOAD="@TERMUX_PREFIX@/lib/libtsocks.so"
2017-09-22 00:29:36 +02:00
else
- echo $LD_PRELOAD | grep -q "/usr/lib/libtsocks\.so" || \
- export LD_PRELOAD="/usr/lib/libtsocks.so $LD_PRELOAD"
2021-10-13 12:09:18 +02:00
+ echo $LD_PRELOAD | grep -q "@TERMUX_PREFIX@/lib/libtsocks\.so" || \
+ export LD_PRELOAD="@TERMUX_PREFIX@/lib/libtsocks.so $LD_PRELOAD"
2017-09-22 00:29:36 +02:00
fi
if [ $# = 0 ]
then
- ${SHELL:-/bin/sh}
2021-10-13 12:09:18 +02:00
+ ${SHELL:-@TERMUX_PREFIX@/bin/sh}
2017-09-22 00:29:36 +02:00
fi
if [ $# -gt 0 ]