Nim implementation of the e2e reliability protocol.
- Nix package manager
git clone https://github.com/logos-messaging/nim-sds.git
cd nim-sds
# Build the shared library
nix build '.#libsds'
# Run tests
nix develop --command nimble testnix build --print-out-paths '.#libsds'nix build --print-out-paths '.#libsds-android-arm64'
nix build --print-out-paths '.#libsds-android-amd64'
nix build --print-out-paths '.#libsds-android-x86'
nix build --print-out-paths '.#libsds-android-arm'nix build --print-out-paths '.#libsds-ios'Development shell
Enter the dev shell:
nix developBuild using nimble tasks:
# Dynamic library (auto-detects OS)
nimble libsdsDynamicMac # macOS
nimble libsdsDynamicLinux # Linux
nimble libsdsDynamicWindows # Windows
# Static library
nimble libsdsStaticMac # macOS
nimble libsdsStaticLinux # Linux
nimble libsdsStaticWindows # WindowsRun tests:
nimble testThe built library is output to build/.
Android (without Nix)
Download the latest Android NDK:
cd ~
wget https://dl.google.com/android/repository/android-ndk-r27c-linux.zip
unzip android-ndk-r27c-linux.zipAdd to ~/.bashrc:
export ANDROID_NDK_ROOT=$HOME/android-ndk-r27c
export PATH=$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/bin:$PATHThen build:
ARCH=arm64 nimble libsdsAndroid| Architecture | Command |
|---|---|
| arm64 | ARCH=arm64 nimble libsdsAndroid |
| amd64 | ARCH=amd64 nimble libsdsAndroid |
| x86 | ARCH=x86 nimble libsdsAndroid |
The library is output to build/libsds.so.
Dependency management
Dependencies are managed by Nimble and pinned via nimble.lock.
To set up dependencies locally:
nimble setup -lTo update dependencies:
nimble lockAfter updating nimble.lock, the Nix outputHash in nix/deps.nix must be recalculated
by running nix build and updating the hash from the error output.
Licensed under either of Apache License, Version 2.0 or MIT license at your option.