new package: rappel
Closes https://github.com/termux/termux-packages/issues/5735.
This commit is contained in:
parent
8ecf958b4f
commit
831c6af3dd
|
@ -0,0 +1,32 @@
|
||||||
|
TERMUX_PKG_HOMEPAGE=https://github.com/yrp604/rappel
|
||||||
|
TERMUX_PKG_DESCRIPTION="Rappel is a pretty janky assembly REPL."
|
||||||
|
TERMUX_PKG_LICENSE="custom"
|
||||||
|
TERMUX_PKG_LICENSE_FILE="LICENSE"
|
||||||
|
TERMUX_PKG_VERSION=2020.09.18
|
||||||
|
TERMUX_PKG_SRCURL=https://github.com/yrp604/rappel/archive/dd45bfa000efb89357d5c80a3a77550b96dee499.tar.gz
|
||||||
|
TERMUX_PKG_SHA256=c310855880051a9e0c802b74ba0c8eafddeb5bd2a930728356101e385d04d015
|
||||||
|
TERMUX_PKG_DEPENDS="binutils, libedit"
|
||||||
|
TERMUX_PKG_BUILD_IN_SRC=true
|
||||||
|
|
||||||
|
termux_step_make() {
|
||||||
|
local _ARCH
|
||||||
|
|
||||||
|
if [ "$TERMUX_ARCH" = "i686" ]; then
|
||||||
|
_ARCH="x86"
|
||||||
|
elif [ "$TERMUX_ARCH" = "x86_64" ]; then
|
||||||
|
_ARCH="amd64"
|
||||||
|
elif [ "$TERMUX_ARCH" = "arm" ]; then
|
||||||
|
_ARCH="armv7"
|
||||||
|
elif [ "$TERMUX_ARCH" = "aarch64" ]; then
|
||||||
|
_ARCH="armv8"
|
||||||
|
else
|
||||||
|
_ARCH=$TERMUX_ARCH
|
||||||
|
fi
|
||||||
|
|
||||||
|
make ARCH=$_ARCH CC="$CC $CPPFLAGS $CFLAGS" LDFLAGS="$LDFLAGS" -j $TERMUX_MAKE_PROCESSES
|
||||||
|
}
|
||||||
|
|
||||||
|
termux_step_make_install() {
|
||||||
|
cd bin
|
||||||
|
install -Dm755 -t "$TERMUX_PREFIX/bin" rappel
|
||||||
|
}
|
|
@ -0,0 +1,43 @@
|
||||||
|
diff -uNr rappel-dd45bfa000efb89357d5c80a3a77550b96dee499/ptrace.c rappel-dd45bfa000efb89357d5c80a3a77550b96dee499.mod/ptrace.c
|
||||||
|
--- rappel-dd45bfa000efb89357d5c80a3a77550b96dee499/ptrace.c 2020-09-18 06:37:45.000000000 +0000
|
||||||
|
+++ rappel-dd45bfa000efb89357d5c80a3a77550b96dee499.mod/ptrace.c 2020-11-05 19:35:22.347935876 +0000
|
||||||
|
@@ -7,6 +7,7 @@
|
||||||
|
#include <string.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
|
+#include <sys/stat.h>
|
||||||
|
#include <sys/ptrace.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <sys/wait.h>
|
||||||
|
@@ -103,6 +104,31 @@
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
+static int
|
||||||
|
+fexecve (int fd, char *const argv[], char *const envp[])
|
||||||
|
+{
|
||||||
|
+ if (fd < 0 || argv == NULL || envp == NULL)
|
||||||
|
+ {
|
||||||
|
+ errno = EINVAL;
|
||||||
|
+ return -1;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ char buf[sizeof "/proc/self/fd/" + sizeof (int) * 3];
|
||||||
|
+ snprintf(buf, sizeof (buf), "/proc/self/fd/%d", fd);
|
||||||
|
+
|
||||||
|
+ execve(buf, argv, envp);
|
||||||
|
+
|
||||||
|
+ int save = errno;
|
||||||
|
+
|
||||||
|
+ struct stat st;
|
||||||
|
+ if (stat("/proc/self/fd", &st) != 0 && errno == ENOENT)
|
||||||
|
+ save = ENOSYS;
|
||||||
|
+
|
||||||
|
+ errno = save;
|
||||||
|
+
|
||||||
|
+ return -1;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
void ptrace_child(
|
||||||
|
const int exe_fd)
|
||||||
|
{
|
|
@ -0,0 +1,12 @@
|
||||||
|
diff -uNr rappel-dd45bfa000efb89357d5c80a3a77550b96dee499/arch/armv7/include/arch.h rappel-dd45bfa000efb89357d5c80a3a77550b96dee499.mod/arch/armv7/include/arch.h
|
||||||
|
--- rappel-dd45bfa000efb89357d5c80a3a77550b96dee499/arch/armv7/include/arch.h 2020-09-18 06:37:45.000000000 +0000
|
||||||
|
+++ rappel-dd45bfa000efb89357d5c80a3a77550b96dee499.mod/arch/armv7/include/arch.h 2020-11-05 19:37:33.067086558 +0000
|
||||||
|
@@ -17,7 +17,7 @@
|
||||||
|
|
||||||
|
struct user_fpregs_armv7
|
||||||
|
{
|
||||||
|
- struct fp_reg
|
||||||
|
+ struct a_fp_reg
|
||||||
|
{
|
||||||
|
unsigned int sign1:1;
|
||||||
|
unsigned int unused:15;
|
Loading…
Reference in New Issue