Install rules IDK

I HATE GIT
This commit is contained in:
LDA 2024-08-06 15:01:27 +02:00
commit a92e3daafa
8 changed files with 79 additions and 35 deletions

View file

@ -2,4 +2,6 @@ Some dates for Parsee-related events. They mostly serve as LDA's TODOs with
a strict deadline:
- ~September 2024:
Get Parsee into the _Phantasmagoria of Bug View_ stage (essentially
v0.0.1 for a public testing) once I can afford `yama`.
v0.0.1 for a public testing) once I can afford `yama`, and start
bridging the Matrix room alongside a shiny XMPP MUC, bridged by
yours truly.

View file

@ -10,10 +10,11 @@ VERSION=0.0.0
REPOSITORY=$(shell git remote get-url origin)
# =========================== Compilation Flags ============================
CYTO_INC=/usr/local/include/ # Where Cytoplasm's include path is
CYTO_INC ?=/usr/local/include/ # Where Cytoplasm's include path is
# located.
CYTO_LIB=/usr/local/lib # Where's Cytoplasm's library is
CYTO_LIB ?=/usr/local/lib # Where's Cytoplasm's library is
# located.
PREFIX ?=/usr/local
SOURCE=src
OBJECT=build
@ -53,4 +54,20 @@ $(AYAS)/%.html: $(INCLUDES)/%.h
@mkdir -p $(shell dirname "$@")
tools/out/aya $(AFLAGS) -i $< -o $@
# TODO: a install rule that reads prefix for software packagers?
# Installs everything. Except Ayadocs. Get pranked.
install: binary utils ayadoc install_setup install_parsee install_tools
@echo $(PREFIX)
install_setup:
install -dm755 "$(PREFIX)/bin"
install -dm755 "$(PREFIX)/doc"
install_parsee:
install -Dm755 "$(BINARY)" "$(PREFIX)/bin/$(BINARY)"
TOOLS:=$(shell find 'tools/out' -name '*')
ITOOL:=${subst tools/out/,$(PREFIX)/bin/,$(TOOLS)}
install_tools: $(ITOOL)
$(PREFIX)/bin/%: tools/out/%
install -Dm755 "$<" "$@"

View file

@ -16,14 +16,19 @@ codebase I'm already familiar with.
### "Why not just use Matrix lol"
### "Why not just use XMPP lol"
These two having the same answer should be enough information. Also can I *just* have fun?
~~Also dependency bad.~~
One could also argue that both sides need to migrate(onboard) the other side, so
a bridge may be a good way to start.
## BUILDING
```sh
$ make # This generates a 'parsee' executable.
$
$ cd tools # If you want to build more tools
$ make && cd ..
$ make ayadoc # If you want to build HTML documentation
# make [PREFIX=(install path)] install # To install Parsee.
```
If there are any Cytoplasm-related build failures, you may want to check the Makefile to
change a few variables (you can set `CYTO_INC` and `CYTO_LIB`)
### DEPENDENCIES
Parsee tries to avoid dependencies aside from [Cytoplasm](https://git.telodendria.io/Telodendria/Cytoplasm).
@ -35,6 +40,13 @@ TODO
TODO
## TODOS
- Add [libomemo](https://github.com/gkdr/libomemo) as an optional dependency.
- It depends on more stuff anyways, and I don't want to weigh down the
dependency list of Parsee for that.
- Matrix's libolm is deprecated. They replaced it with a Rust version that
pulls in *way too many* dependencies, and that lacks a C binding. We may
put in the work of either forking off libolm or making a binding to KappaChat.
- Mess with Cytoplasm to make it have support for something like LMDB as an
*optional* dependency. This should increase reliability and speed for anyone.
- Nesting might be an issue we'll need to deal with. libdb and Berkley DB

View file

@ -31,12 +31,6 @@ For future XEPs:
A minor issue with that is pack management. XMPP requires a pack field
which is used along PEP, it seems, and meanwhile Matrix has ''support''
for packs too, tracking them is between "annoyance" and "yeah, no.".
- https://xmpp.org/extensions/xep-0080.html
Doxxing people over two protocols is great! Sadly works over PEP it seems,
so I can't think of a good analogy tbf, also I hate dealing with PEP tbf.
- https://xmpp.org/extensions/xep-0118.html
I feel like polluting Matrix status(which more clients should implement)
sounds like a bad idea. When are we getting _extensible statuses_?
ON STANDBY BECAUSE THESE HAVE BEEN TERRIBLE TO DEAL WITH AND WHO KEEPS WRITING
THESE I WANT TO SEND THEM A NICE, BRIGHT GIFT:
@ -45,13 +39,16 @@ THESE I WANT TO SEND THEM A NICE, BRIGHT GIFT:
Matrix and XMPP both have support for these.
XEP-0084 is a pain in the ass to implement and seems generally just
unreliable, however.
x https://xmpp.org/extensions/xep-0080.html
Can't think of a good analogy to these...
Not XEPs, but ideas that _needs_ to be added:
~ "also it [Bifrost] doesn't respect voice either" -> Send a form on moderated
v "also it [Bifrost] doesn't respect voice either" -> Send a form on moderated
MUCs (which is standard, so its not too bad!). Currently WIP, and barely tested.
~ "GIVE THE PUPPETS APPROPRIATE PLS/ROLES" - Hydro/t4d
- Standalone/Static Parsee, ideally as small as it can be(if not as APE).
- Kappa-like extension system(maybe bridging more than just Matrix-XMPP.)
- https://www.youtube.com/watch?v=InL414iDZmY

View file

@ -49,6 +49,7 @@ CommandParse(char *cmd)
char c = *cur;
char *tmp;
bool type;
char char_type;
switch (state)
{
case STATE_WHITE:
@ -73,23 +74,24 @@ CommandParse(char *cmd)
}
break;
case STATE_VALUE:
type = c == '"';
type = c == '"' || c == '\'';
if (type)
{
char_type = c;
cur++;
}
while (*cur)
{
char c = *cur;
char cb[2] = { c, '\0' };
if ((type && c == '"') || (!type && isblank(c)))
if ((type && c == char_type) || (!type && isblank(c)))
{
break;
}
if (c == '\\' && *(cur + 1) == '"')
if (c == '\\' && *(cur + 1) == char_type)
{
cb[0] = '"';
cb[0] = char_type;
cur++;
}
tmp = val;

View file

@ -27,11 +27,9 @@ SignalHandler(int signal)
{
return;
}
/* Create a loopback stanza, forcing the thread to die */
/* TODO: Better way to break out. */
Log(LOG_INFO, "Killing thread...");
//XMPPKillThread(jabber, "killer");
XMPPFinishCompStream(jabber);
pthread_join(xmpp_thr, NULL);
valid = false;
@ -68,10 +66,10 @@ ParseeInitialiseSignals(HttpServer *s, pthread_t xmpp, XMPPComponent *j)
Log(LOG_DEBUG, "Installed signal handler: %s", #sig); \
}
SIGACTION(SIGINT, &sigAction, NULL);
SIGACTION(SIGTERM, &sigAction, NULL);
SIGACTION(SIGPIPE, &sigAction, NULL);
SIGACTION(SIGUSR1, &sigAction, NULL); /* Make USR1 do a softrestart */
SIGACTION(SIGINT, &sigAction, NULL);
SIGACTION(SIGTERM, &sigAction, NULL);
SIGACTION(SIGPIPE, &sigAction, NULL);
SIGACTION(SIGUSR1, &sigAction, NULL); /* Make USR1 do a softrestart */
#undef SIGACTION
return ret;

View file

@ -30,14 +30,33 @@ extern bool ASRegisterUser(const ParseeConfig *, char *);
/* Pings the homeserver to get attention. */
extern void ASPing(const ParseeConfig *);
/* Joins a room from an ID and a given user we want to masquerade
* as. */
extern char * ASJoin(const ParseeConfig *, char *, char *);
/** Joins a room from an {id} and a given {user} we want to masquerade
* as.
* --------------
* Returns: the decoded room ID that was joined[HEAP] | NULL
* Modifies: the rooms/{user}s inner state */
extern char * ASJoin(const ParseeConfig *config, char *id, char *user);
/* Bans from a room a specific user */
extern void ASBan(const ParseeConfig *, char *, char *);
extern void ASKick(const ParseeConfig *, char *, char *);
extern void ASLeave(const ParseeConfig *, char *, char *);
/** Bans from a room a specific user
* ---------------------
* Returns: NOTHING
* Modifies: the rooms state
* See-Also: ASJoin, ASKick, ASLeave */
extern void ASBan(const ParseeConfig *config, char *room, char *user);
/** Kicks from a room a specific user
* ---------------------
* Returns: NOTHING
* Modifies: the rooms state
* See-Also: ASJoin, ASBan, ASLeave */
extern void ASKick(const ParseeConfig *, char *room, char *user);
/** Makes a specific user leave the room
* ---------------------
* Returns: NOTHING
* Modifies: the rooms state
* See-Also: ASJoin, ASKick, ASBan */
extern void ASLeave(const ParseeConfig *config, char *room, char *user);
/* Invites from a room a specific user */
extern void ASInvite(const ParseeConfig *, char *, char *);

View file

@ -329,7 +329,6 @@ GenerateHTML(Stream *out, AyadocComment *ayadoc, HeaderDeclaration decl)
{
if (StrEquals(attr, "Returns"))
{
/* TODO: Be a little more advanced. */
StreamPrintf(out, "<div class='aya-pret' id='pret-%s'>", decl.name);
StreamPrintf(out, "<h2>Returns</h2>");
GenerateReturns(out, ayadoc, decl, value);
@ -339,7 +338,6 @@ GenerateHTML(Stream *out, AyadocComment *ayadoc, HeaderDeclaration decl)
}
else if (StrEquals(attr, "See-Also"))
{
/* TODO: Be a little more advanced. */
StreamPrintf(out, "<div class='aya-see' id='see-%s'>", decl.name);
StreamPrintf(out, "<h2>See also</h2>");
GenerateSee(out, ayadoc, decl, value);
@ -349,7 +347,6 @@ GenerateHTML(Stream *out, AyadocComment *ayadoc, HeaderDeclaration decl)
}
else if (StrEquals(attr, "Thrasher"))
{
/* TODO: Be a little more advanced. */
StreamPrintf(out, "<p class='aya-free' id='free-%s'>", decl.name);
StreamPrintf(out, "<strong>This function may be destroyed with ");
StreamPrintf(out, "<code><a href='#fdiv-%s'>%s</a></code>", value, value);