mirror of
https://github.com/logos-messaging/nim-chat-sdk.git
synced 2026-01-02 14:13:07 +00:00
48 lines
1.4 KiB
Nim
48 lines
1.4 KiB
Nim
# Package
|
|
|
|
version = "0.0.1"
|
|
author = "Waku Chat Team"
|
|
description = "Chat features over Waku"
|
|
license = "MIT"
|
|
srcDir = "src"
|
|
|
|
### Dependencies
|
|
requires "nim >= 2.2.4",
|
|
"chronicles",
|
|
"chronos",
|
|
"db_connector",
|
|
"flatty",
|
|
"waku#799793dba7ef78eba41582ed55db01a2d5d7500a",
|
|
"noiseprotocol >= 0.0.2"
|
|
|
|
proc ensureRln(libFile: string = "build/librln.a", version = "v0.7.0") =
|
|
if not fileExists(libFile):
|
|
echo "Building RLN library..."
|
|
let buildDir = getCurrentDir()
|
|
let outFile = libFile
|
|
exec "bash ./scripts/build_rln.sh " & buildDir & " " & version & " " & outFile
|
|
else:
|
|
echo "RLN library already exists: " & libFile
|
|
|
|
task buildSharedLib, "Build shared library for C bindings":
|
|
exec "nim c --mm:refc --app:lib --out:../library/c-bindings/libchatsdk.so chat_sdk/chat_sdk.nim"
|
|
|
|
task buildStaticLib, "Build static library for C bindings":
|
|
exec "nim c --mm:refc --app:staticLib --out:../library/c-bindings/libchatsdk.a chat_sdk/chat_sdk.nim"
|
|
|
|
task migrate, "Run database migrations":
|
|
exec "nim c -r apps/run_migration.nim"
|
|
|
|
task segment, "Run segmentation":
|
|
exec "nim c -r chat_sdk/segmentation.nim"
|
|
|
|
task subscribe, "Run waku subscription service":
|
|
ensureRln()
|
|
exec "nim c --passL:build/librln.a --passL:-lm -r apps/waku_subscriber.nim"
|
|
|
|
task publishing, "Run waku publishing service":
|
|
exec "nim c --passL:build/librln.a --passL:-lm -r apps/waku_publisher.nim"
|
|
|
|
task noise, "Run noise protocol demo":
|
|
exec "nim c -r apps/noise.nim"
|