diff --git a/packages/radare2/build.sh b/packages/radare2/build.sh index 1c7ac9cea..abab1ee29 100644 --- a/packages/radare2/build.sh +++ b/packages/radare2/build.sh @@ -1,9 +1,8 @@ TERMUX_PKG_HOMEPAGE=https://rada.re TERMUX_PKG_DESCRIPTION="Advanced Hexadecimal Editor" TERMUX_PKG_LICENSE="GPL-3.0" -TERMUX_PKG_VERSION=3.6.0 -TERMUX_PKG_REVISION=1 -TERMUX_PKG_SHA256=a763d3812a4cec74fd39d67a2559a4e0073e9e8d1d55481e5feb3f00bbe19b02 +TERMUX_PKG_VERSION=3.9.0 +TERMUX_PKG_SHA256=270cf67d0dee8dab4ed21dfaab57671b479ec82f0fc8d1c988e121c48b51addc TERMUX_PKG_SRCURL=https://github.com/radare/radare2/archive/$TERMUX_PKG_VERSION.tar.gz TERMUX_PKG_DEPENDS="libuv" TERMUX_PKG_BREAKS="radare2-dev" diff --git a/packages/radare2/libr-core-cconfig.c.patch b/packages/radare2/libr-core-cconfig.c.patch index 6e87aab7d..0c7521bb3 100644 --- a/packages/radare2/libr-core-cconfig.c.patch +++ b/packages/radare2/libr-core-cconfig.c.patch @@ -1,14 +1,28 @@ -diff -u -r ../radare2-3.3.0/libr/core/cconfig.c ./libr/core/cconfig.c ---- ../radare2-3.3.0/libr/core/cconfig.c 2019-02-19 12:35:24.000000000 +0000 -+++ ./libr/core/cconfig.c 2019-03-01 23:31:17.730684566 +0000 -@@ -2961,14 +2961,10 @@ +diff -uNr radare2-3.9.0/libr/core/cconfig.c radare2-3.9.0.mod/libr/core/cconfig.c +--- radare2-3.9.0/libr/core/cconfig.c 2019-09-17 16:31:23.000000000 +0300 ++++ radare2-3.9.0.mod/libr/core/cconfig.c 2019-09-18 16:12:01.379864195 +0300 +@@ -2794,7 +2794,7 @@ + char *h = r_sys_getenv (R_SYS_HOME); + if (h) { + if (!strcmp (h, "/")) { +- r_sys_setenv (R_SYS_HOME, "/data/local/tmp"); ++ r_sys_setenv (R_SYS_HOME, "@TERMUX_ANDROID_HOME@"); + } + free (h); + } +@@ -3212,7 +3212,7 @@ free (path); } SETCB ("dir.source", "", &cb_dirsrc, "Path to find source files"); - SETPREF ("dir.types", "/usr/include", "Default path to look for cparse type files"); -+ SETPREF ("dir.types", "@TERMUX_PREFIX@/usr/include", "Default path to look for cparse type files"); - SETCB ("dir.home", r_sys_getenv (R_SYS_HOME), &cb_dirhome, "Path for the home directory"); - SETCB ("dir.tmp", r_sys_getenv (R_SYS_TMP), &cb_dirtmp, "Path of the tmp directory"); ++ SETPREF ("dir.types", "@TERMUX_PREFIX@/include", "Default path to look for cparse type files"); + SETPREF ("dir.libs", "", "Specify path to find libraries to load when bin.libs=true"); + p = r_sys_getenv (R_SYS_HOME); + SETCB ("dir.home", p, &cb_dirhome, "Path for the home directory"); +@@ -3220,11 +3220,7 @@ + p = r_sys_getenv (R_SYS_TMP); + SETCB ("dir.tmp", p, &cb_dirtmp, "Path of the tmp directory"); + free (p); -#if __ANDROID__ - SETPREF ("dir.projects", "/data/data/org.radare.radare2installer/radare2/projects", "Default path for projects"); -#else @@ -17,24 +31,20 @@ diff -u -r ../radare2-3.3.0/libr/core/cconfig.c ./libr/core/cconfig.c SETCB ("dir.zigns", R_JOIN_2_PATHS ("~", R2_HOME_ZIGNS), &cb_dirzigns, "Default path for zignatures (see zo command)"); SETPREF ("stack.reg", "SP", "Which register to use as stack pointer in the visual debug"); SETPREF ("stack.bytes", "true", "Show bytes instead of words in stack"); -@@ -3099,6 +3095,9 @@ - #if __WINDOWS__ - r_config_set (cfg, "http.browser", "start"); +@@ -3362,9 +3358,8 @@ #else -+#ifdef __ANDROID__ -+ r_config_set (cfg, "http.browser", "xdg-open"); -+#else if (r_file_exists ("/usr/bin/openURL")) { // iOS ericautils r_config_set (cfg, "http.browser", "/usr/bin/openURL"); - } else if (r_file_exists ("/system/bin/toolbox")) { -@@ -3111,16 +3110,13 @@ - } else { - r_config_set (cfg, "http.browser", "firefox"); - } -+#endif - r_config_desc (cfg, "http.browser", "Command to open HTTP URLs"); - #endif - SETI ("http.maxsize", 0, "Maximum file size for upload"); +- } else if (r_file_exists ("/system/bin/toolbox")) { +- r_config_set (cfg, "http.browser", +- "LD_LIBRARY_PATH=/system/lib am start -a android.intent.action.VIEW -d"); ++ } else if (r_file_exists ("@TERMUX_PREFIX@/bin/termux-open")) { ++ r_config_set (cfg, "http.browser", "@TERMUX_PREFIX@/bin/termux-open"); + } else if (r_file_exists ("/usr/bin/xdg-open")) { + r_config_set (cfg, "http.browser", "xdg-open"); + } else if (r_file_exists ("/usr/bin/open")) { +@@ -3378,11 +3373,7 @@ + SETPREF ("http.index", "index.html", "Main html file to check in directory"); SETPREF ("http.bind", "localhost", "Server address"); SETPREF ("http.homeroot", R_JOIN_2_PATHS ("~", R2_HOME_WWWROOT), "http home root directory"); -#if __ANDROID__ @@ -45,5 +55,3 @@ diff -u -r ../radare2-3.3.0/libr/core/cconfig.c ./libr/core/cconfig.c SETPREF ("http.port", "9090", "HTTP server port"); SETPREF ("http.maxport", "9999", "Last HTTP server port"); SETPREF ("http.ui", "m", "Default webui (enyo, m, p, t)"); -Only in ./libr/core: cconfig.c.orig -Only in ./libr/core: cconfig.c.rej diff --git a/packages/radare2/sys-ldconfig.sh.patch b/packages/radare2/sys-ldconfig.sh.patch index 32a624ea5..9b4b4f068 100644 --- a/packages/radare2/sys-ldconfig.sh.patch +++ b/packages/radare2/sys-ldconfig.sh.patch @@ -1,21 +1,9 @@ -diff -u -r ../radare2-0.10.5/sys/ldconfig.sh ./sys/ldconfig.sh ---- ../radare2-0.10.5/sys/ldconfig.sh 2016-08-16 19:28:34.000000000 -0400 -+++ ./sys/ldconfig.sh 2016-09-22 21:39:01.237872528 -0400 -@@ -1,15 +1,4 @@ +diff -uNr radare2-3.9.0/sys/ldconfig.sh radare2-3.9.0.mod/sys/ldconfig.sh +--- radare2-3.9.0/sys/ldconfig.sh 2019-09-17 16:31:23.000000000 +0300 ++++ radare2-3.9.0.mod/sys/ldconfig.sh 2019-09-18 16:13:09.246804787 +0300 +@@ -1,4 +1,5 @@ #!/bin/sh --LD=/etc/ld.so.conf.d --if test -w $LD ; then -- if type ldconfig > /dev/null 2>&1 ; then -- mkdir -p $LD -- P=$(awk -F= '/^LIBDIR/{print $2}' config-user.mk) -- D="$(dirname "$P")"/"$(basename "$P")" -- if [ /usr != "$D" ]; then -- echo "$P" > "$LD/radare.conf" -- # do not update symlinks to avoid r2 install issues -- ldconfig -X -- fi -- fi --fi -+# Do not do anything that would break the system -+# if building as root and cross compiling. - exit 0 ++exit 0 + LD=/etc/ld.so.conf.d + if test -w $LD ; then + if type ldconfig > /dev/null 2>&1 ; then