add(main): new package rirc

Co-authored-by: Tee KOBAYASHI <xtkoba@gmail.com>
This commit is contained in:
T-Dynamos 2022-09-13 00:08:20 +05:30 committed by xtkoba
parent 7e0339ed86
commit 101d682405
4 changed files with 85 additions and 0 deletions

View File

@ -0,0 +1,10 @@
--- a/Makefile
+++ b/Makefile
@@ -9,7 +9,6 @@
PATH_SRC := src
PATH_TEST := test
-include lib/mbedtls.Makefile
CONFIG := config.h

25
packages/rirc/build.sh Normal file
View File

@ -0,0 +1,25 @@
TERMUX_PKG_HOMEPAGE=https://github.com/rcr/rirc
TERMUX_PKG_DESCRIPTION="A terminal IRC client in C"
TERMUX_PKG_LICENSE="MIT"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION=0.1.6
TERMUX_PKG_SRCURL=https://github.com/rcr/rirc/archive/refs/tags/v${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=95ac4fa4538d42509c5ef763afd6b85882f5b8bc0e45dced7b0cb9916961243e
TERMUX_PKG_DEPENDS="ca-certificates, mbedtls"
TERMUX_PKG_BUILD_IN_SRC=true
termux_step_post_get_source() {
# Avoid duplicate definition of `struct user` (defined in <sys/user.h>):
find . -type f -name '*.[ch]' | xargs -n 1 \
sed -i -E 's/(struct user)($|[^_])/\1_\2/g'
}
termux_step_pre_configure() {
CPPFLAGS+=" -DMBEDTLS_ALLOW_PRIVATE_ACCESS"
CFLAGS+=" $CPPFLAGS"
LDFLAGS+=" -lmbedtls -lmbedx509 -lmbedcrypto"
}
termux_step_configure() {
make config.h
}

View File

@ -0,0 +1,19 @@
--- a/src/io.c
+++ b/src/io.c
@@ -160,12 +160,16 @@
static int io_tls_x509_vrfy(struct connection*);
const char *default_ca_certs[] = {
+#ifndef __ANDROID__
"/etc/ssl/ca-bundle.pem",
"/etc/ssl/cert.pem",
"/etc/ssl/certs/ca-certificates.crt",
"/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem",
"/etc/pki/tls/cacert.pem",
"/etc/pki/tls/certs/ca-bundle.crt",
+#else
+ "@TERMUX_PREFIX@/etc/tls/cert.pem",
+#endif
};
struct connection*

View File

@ -0,0 +1,31 @@
--- a/src/components/user.c
+++ b/src/components/user.c
@@ -9,7 +9,7 @@
static inline int user_ncmp(struct user_*, struct user_*, void *arg, size_t);
static inline void user_free(struct user_*);
-AVL_GENERATE(user_list, user, ul, user_cmp, user_ncmp)
+AVL_GENERATE(user_list, user_, ul, user_cmp, user_ncmp)
static inline int
user_cmp(struct user_ *u1, struct user_ *u2, void *arg)
--- a/src/components/user.h
+++ b/src/components/user.h
@@ -14,7 +14,7 @@
struct user_
{
- TREE_NODE(user) ul;
+ TREE_NODE(user_) ul;
const char *nick;
size_t nick_len;
struct mode prfxmodes;
@@ -23,7 +23,7 @@
struct user_list
{
- TREE_HEAD(user);
+ TREE_HEAD(user_);
unsigned count;
};