mirror of
https://github.com/logos-messaging/logos-chat.git
synced 2026-02-27 20:33:07 +00:00
fix: building liblogoschat
- build liblogoschat and required liblibchat - update libchat and nim-ffi to latest
This commit is contained in:
parent
d15bcb0729
commit
e694d17718
9
Makefile
9
Makefile
@ -130,6 +130,15 @@ liblogoschat: | build-waku-librln build-waku-nat build-libchat logos_chat.nims
|
||||
$(ENV_SCRIPT) nim liblogoschat $(NIM_PARAMS) --path:src logos_chat.nims && \
|
||||
echo -e "\n\x1B[92mLibrary built successfully:\x1B[39m" && \
|
||||
echo " $(shell pwd)/$(LIBLOGOSCHAT)"
|
||||
ifeq ($(shell uname -s),Darwin)
|
||||
@cp vendor/libchat/target/release/liblibchat.dylib build/
|
||||
@# Fix install names so the dylibs are relocatable (no absolute paths)
|
||||
@install_name_tool -id @rpath/liblibchat.dylib build/liblibchat.dylib
|
||||
@echo " $(shell pwd)/build/liblibchat.dylib"
|
||||
else ifeq ($(shell uname -s),Linux)
|
||||
@cp vendor/libchat/target/release/liblibchat.so build/
|
||||
@echo " $(shell pwd)/build/liblibchat.so"
|
||||
endif
|
||||
|
||||
endif
|
||||
|
||||
|
||||
@ -77,5 +77,17 @@ task pingpong, "Build the Pingpong example":
|
||||
buildBinary name, "examples/", "-d:chronicles_log_level='INFO' -d:chronicles_disabled_topics='waku node' "
|
||||
|
||||
task liblogoschat, "Build the Logos-Chat shared library (C bindings)":
|
||||
# Dynamically link liblibchat (Rust) on both platforms.
|
||||
# Clients must distribute liblibchat.so/.dylib alongside liblogoschat.so/.dylib.
|
||||
# Cannot static link because of duplicate symbols: both liblibchat.a and librln embed Rust's std
|
||||
var linkFlags = ""
|
||||
when defined(linux):
|
||||
staticLinkFlags = " -d:CONVERSATIONS_LIB:liblibchat.so" &
|
||||
" --passL:-Wl,-rpath,'$$ORIGIN'"
|
||||
elif defined(macosx):
|
||||
linkFlags = " -d:CONVERSATIONS_LIB:@rpath/liblibchat.dylib" &
|
||||
" --passL:-Wl,-rpath,@loader_path"
|
||||
|
||||
buildLibrary "logoschat", "library/",
|
||||
"-d:chronicles_log_level='INFO' -d:chronicles_enabled=on --path:src --path:vendor/nim-ffi"
|
||||
"-d:chronicles_log_level='INFO' -d:chronicles_enabled=on --path:src --path:vendor/nim-ffi" &
|
||||
linkFlags
|
||||
|
||||
@ -81,7 +81,7 @@ proc newClient*(ds: WakuClient, ident: Identity): ChatClient {.raises: [IOError,
|
||||
|
||||
var q = QueueRef(queue: newAsyncQueue[ChatPayload](10))
|
||||
var c = ChatClient(
|
||||
libchatCtx: newConversationsContext(),
|
||||
libchatCtx: newConversationsContext(ident.getName()),
|
||||
ds: ds,
|
||||
id: ident.getName(),
|
||||
inboundQueue: q,
|
||||
|
||||
2
vendor/libchat
vendored
2
vendor/libchat
vendored
@ -1 +1 @@
|
||||
Subproject commit a9ca4ffb7de90ea4cd269350c189c19fb78a2589
|
||||
Subproject commit 960bb195a13657a09fa2df66262b3b2ced738f30
|
||||
2
vendor/nim-ffi
vendored
2
vendor/nim-ffi
vendored
@ -1 +1 @@
|
||||
Subproject commit c2c03f1f0f300ec3aab8b733fe97575f452f6133
|
||||
Subproject commit bb8a3e7e221c36effd528605a6eb8ecd0f8b22dd
|
||||
Loading…
x
Reference in New Issue
Block a user