diff --git a/packages/libucontext/Makefile.patch b/packages/libucontext/Makefile.patch new file mode 100644 index 000000000..90bee0fc8 --- /dev/null +++ b/packages/libucontext/Makefile.patch @@ -0,0 +1,15 @@ +--- a/Makefile ++++ b/Makefile +@@ -15,9 +15,9 @@ + endif + + LIBDIR := /lib +-INCLUDEDIR := /usr/include +-PKGCONFIGDIR := /usr/lib/pkgconfig +-CFLAGS := -ggdb3 -O2 -Wall ++INCLUDEDIR := /include ++PKGCONFIGDIR := /lib/pkgconfig ++CFLAGS ?= -ggdb3 -O2 -Wall + CPPFLAGS := -Iinclude -Iarch/${ARCH} -Iarch/common + EXPORT_UNPREFIXED := yes + FREESTANDING := no diff --git a/packages/libucontext/bits.h.patch b/packages/libucontext/bits.h.patch new file mode 100644 index 000000000..34970406c --- /dev/null +++ b/packages/libucontext/bits.h.patch @@ -0,0 +1,53 @@ +--- a/arch/common/include/libucontext/bits.h ++++ b/arch/common/include/libucontext/bits.h +@@ -3,6 +3,50 @@ + + #ifndef FREESTANDING + ++#ifdef __ANDROID__ ++ ++#if defined __i386__ ++# undef REG_GS ++# undef REG_FS ++# undef REG_ES ++# undef REG_DS ++# undef REG_EDI ++# undef REG_ESI ++# undef REG_EBP ++# undef REG_ESP ++# undef REG_EBX ++# undef REG_EDX ++# undef REG_ECX ++# undef REG_EAX ++# undef REG_EIP ++#elif defined __x86_64__ ++# undef REG_R8 ++# undef REG_R9 ++# undef REG_R10 ++# undef REG_R11 ++# undef REG_R12 ++# undef REG_R13 ++# undef REG_R14 ++# undef REG_R15 ++# undef REG_RDI ++# undef REG_RSI ++# undef REG_RBP ++# undef REG_RBX ++# undef REG_RDX ++# undef REG_RAX ++# undef REG_RCX ++# undef REG_RSP ++# undef REG_RIP ++# undef REG_EFL ++# undef REG_CSGSFS ++# undef REG_ERR ++# undef REG_TRAPNO ++# undef REG_OLDMASK ++# undef REG_CR2 ++#endif ++ ++#endif /* __ANDROID__ */ ++ + #include + + typedef greg_t libucontext_greg_t; diff --git a/packages/libucontext/build.sh b/packages/libucontext/build.sh new file mode 100644 index 000000000..65ffc62fe --- /dev/null +++ b/packages/libucontext/build.sh @@ -0,0 +1,17 @@ +TERMUX_PKG_HOMEPAGE=https://github.com/kaniini/libucontext +TERMUX_PKG_DESCRIPTION="A library which provides the ucontext.h C API" +TERMUX_PKG_LICENSE="ISC" +TERMUX_PKG_MAINTAINER="@termux" +TERMUX_PKG_VERSION=1.1 +TERMUX_PKG_SRCURL=https://github.com/kaniini/libucontext/archive/refs/tags/libucontext-${TERMUX_PKG_VERSION}.tar.gz +TERMUX_PKG_SHA256=298201cef024aee29dfb81c3f1ef800047d5c799297651a60e2c53bb76956ea6 +TERMUX_PKG_BUILD_IN_SRC=true +TERMUX_PKG_EXTRA_MAKE_ARGS="DESTDIR=$TERMUX_PREFIX" + +termux_step_pre_configure() { + TERMUX_PKG_EXTRA_MAKE_ARGS+=" ARCH=$TERMUX_ARCH" +} + +termux_step_configure() { + : +}