From 124f3322846d8875572d2ffebb782ffa3b39f7b2 Mon Sep 17 00:00:00 2001 From: NagyZoltanPeter <113987313+NagyZoltanPeter@users.noreply.github.com> Date: Fri, 13 Feb 2026 12:36:06 +0100 Subject: [PATCH] Adjust nix build to new naming --- Makefile | 2 +- flake.nix | 4 +-- liblogosdelivery/BUILD.md | 44 ++++++++++++++--------------- liblogosdelivery/README.md | 10 +++---- liblogosdelivery/examples/README.md | 14 ++++----- liblogosdelivery/nim.cfg | 2 +- nix/default.nix | 2 +- 7 files changed, 39 insertions(+), 39 deletions(-) diff --git a/Makefile b/Makefile index 433827216..1967e3a99 100644 --- a/Makefile +++ b/Makefile @@ -433,7 +433,7 @@ docker-liteprotocoltester-push: ################ ## C Bindings ## ################ -.PHONY: cbindings cwaku_example libwaku liblmapi liblogosdelivery liblogosdelivery_example +.PHONY: cbindings cwaku_example libwaku liblogosdelivery liblogosdelivery_example STATIC ?= 0 LIBWAKU_BUILD_COMMAND ?= libwakuDynamic diff --git a/flake.nix b/flake.nix index 0263615c0..ee24c8f13 100644 --- a/flake.nix +++ b/flake.nix @@ -71,10 +71,10 @@ zerokitRln = zerokit.packages.${system}.rln; }; - liblmapi = pkgs.callPackage ./nix/default.nix { + liblogosdelivery = pkgs.callPackage ./nix/default.nix { inherit stableSystems; src = self; - targets = ["liblmapi"]; + targets = ["liblogosdelivery"]; zerokitRln = zerokit.packages.${system}.rln; }; diff --git a/liblogosdelivery/BUILD.md b/liblogosdelivery/BUILD.md index a85ac3b07..c038f011d 100644 --- a/liblogosdelivery/BUILD.md +++ b/liblogosdelivery/BUILD.md @@ -1,4 +1,4 @@ -# Building liblmapi and Examples +# Building liblogosdelivery and Examples ## Prerequisites @@ -12,22 +12,22 @@ ### Dynamic Library ```bash -make liblmapi +make liblogosdelivery ``` -This creates `build/liblmapi.dylib` (macOS) or `build/liblmapi.so` (Linux). +This creates `build/liblogosdelivery.dylib` (macOS) or `build/liblogosdelivery.so` (Linux). ### Static Library ```bash -nim liblmapiStatic +nim liblogosdelivery STATIC=1 ``` -This creates `build/liblmapi.a`. +This creates `build/liblogosdelivery.a`. ## Building Examples -### liblmapi Example +### liblogosdelivery Example Compile the C example that demonstrates all library features: @@ -37,16 +37,16 @@ make liblogosdelivery_example # Or manually on macOS: gcc -o build/liblogosdelivery_example \ - liblmapi/examples/liblogosdelivery_example.c \ - -I./liblmapi \ + liblogosdelivery/examples/liblogosdelivery_example.c \ + -I./liblogosdelivery \ -L./build \ -llmapi \ -Wl,-rpath,./build # Or manually on Linux: gcc -o build/liblogosdelivery_example \ - liblmapi/examples/liblogosdelivery_example.c \ - -I./liblmapi \ + liblogosdelivery/examples/liblogosdelivery_example.c \ + -I./liblogosdelivery \ -L./build \ -llmapi \ -Wl,-rpath='$ORIGIN' @@ -73,15 +73,15 @@ After building, you'll have: ``` build/ -├── liblmapi.dylib # Dynamic library (34MB) -├── liblmapi.dylib.dSYM/ # Debug symbols +├── liblogosdelivery.dylib # Dynamic library (34MB) +├── liblogosdelivery.dylib.dSYM/ # Debug symbols └── liblogosdelivery_example # Compiled example (34KB) ``` ## Library Headers The main header file is: -- `liblmapi/liblmapi.h` - C API declarations +- `liblogosdelivery/liblogosdelivery.h` - C API declarations ## Troubleshooting @@ -115,10 +115,10 @@ This updates all git submodules which are required for building. To link statically instead of dynamically: ```bash -gcc -o build/simple_example \ - liblmapi/examples/simple_example.c \ - -I./liblmapi \ - build/liblmapi.a \ +gcc -o build/logosdelivery_example \ + liblogosdelivery/examples/logosdelivery_example.c \ + -I./liblogosdelivery \ + build/liblogosdelivery.a \ -lm -lpthread ``` @@ -129,7 +129,7 @@ Note: Static library is much larger (~129MB) but creates a standalone executable For cross-compilation, you need to: 1. Build the Nim library for the target platform 2. Use the appropriate cross-compiler -3. Link against the target platform's liblmapi +3. Link against the target platform's liblogosdelivery Example for Linux from macOS: ```bash @@ -143,14 +143,14 @@ Example for Linux from macOS: ```cmake find_library(LMAPI_LIBRARY NAMES lmapi PATHS ${PROJECT_SOURCE_DIR}/build) -include_directories(${PROJECT_SOURCE_DIR}/liblmapi) +include_directories(${PROJECT_SOURCE_DIR}/liblogosdelivery) target_link_libraries(your_target ${LMAPI_LIBRARY}) ``` ### Makefile ```makefile -CFLAGS += -I/path/to/liblmapi +CFLAGS += -I/path/to/liblogosdelivery LDFLAGS += -L/path/to/build -llmapi -Wl,-rpath,/path/to/build your_program: your_program.c @@ -160,5 +160,5 @@ your_program: your_program.c ## API Documentation See: -- [liblmapi.h](liblmapi/liblmapi.h) - API function declarations -- [MESSAGE_EVENTS.md](liblmapi/MESSAGE_EVENTS.md) - Message event handling guide +- [liblogosdelivery.h](liblogosdelivery/liblogosdelivery.h) - API function declarations +- [MESSAGE_EVENTS.md](liblogosdelivery/MESSAGE_EVENTS.md) - Message event handling guide diff --git a/liblogosdelivery/README.md b/liblogosdelivery/README.md index 7ae52a257..f9909dd3d 100644 --- a/liblogosdelivery/README.md +++ b/liblogosdelivery/README.md @@ -159,9 +159,9 @@ The library follows the same build system as the main Logos Messaging project. ### Build the library ```bash -make liblmapiStatic # Build static library +make liblogosdeliveryStatic # Build static library # or -make liblmapiDynamic # Build dynamic library +make liblogosdeliveryDynamic # Build dynamic library ``` ## Return Codes @@ -194,7 +194,7 @@ typedef void (*FFICallBack)( ## Example Usage ```c -#include "liblmapi.h" +#include "liblogosdelivery.h" #include void callback(int ret, const char *msg, size_t len, void *userData) { @@ -243,8 +243,8 @@ int main() { The library is structured as follows: -- `liblmapi.h`: C header file with function declarations -- `liblmapi.nim`: Main library entry point +- `liblogosdelivery.h`: C header file with function declarations +- `liblogosdelivery.nim`: Main library entry point - `declare_lib.nim`: Library declaration and initialization - `lmapi/node_api.nim`: Node lifecycle API implementation - `lmapi/messaging_api.nim`: Subscribe/send API implementation diff --git a/liblogosdelivery/examples/README.md b/liblogosdelivery/examples/README.md index cabc5bcc6..02a71c5de 100644 --- a/liblogosdelivery/examples/README.md +++ b/liblogosdelivery/examples/README.md @@ -1,4 +1,4 @@ -# Examples for liblmapi +# Examples for liblogosdelivery This directory contains example programs demonstrating the usage of the Logos Messaging API (LMAPI) library. @@ -6,15 +6,15 @@ This directory contains example programs demonstrating the usage of the Logos Me ### Prerequisites -1. Build the liblmapi library first: +1. Build the liblogosdelivery library first: ```bash cd /path/to/logos-messaging-nim - make liblmapi + make liblogosdelivery ``` -2. The library will be available in `build/liblmapi.so` (or `.dylib` on macOS, `.dll` on Windows) +2. The library will be available in `build/liblogosdelivery.so` (or `.dylib` on macOS, `.dll` on Windows) -### Compile the liblmapi Example +### Compile the liblogosdelivery Example #### On Linux/macOS: ```bash @@ -22,7 +22,7 @@ This directory contains example programs demonstrating the usage of the Logos Me gcc -o liblogosdelivery_example liblogosdelivery_example.c -I.. -L../../build -llmapi -Wl,-rpath,../../build # Static library (if built with STATIC=1) -gcc -o liblogosdelivery_example liblogosdelivery_example.c -I.. ../../build/liblmapi.a -lpthread -lm -ldl +gcc -o liblogosdelivery_example liblogosdelivery_example.c -I.. ../../build/liblogosdelivery.a -lpthread -lm -ldl ``` #### On macOS: @@ -37,7 +37,7 @@ gcc -o liblogosdelivery_example.exe liblogosdelivery_example.c -I.. -L../../buil ## Running the Examples -### liblmapi Example +### liblogosdelivery Example ```bash ./liblogosdelivery_example diff --git a/liblogosdelivery/nim.cfg b/liblogosdelivery/nim.cfg index b98c1b381..3fd5adb32 100644 --- a/liblogosdelivery/nim.cfg +++ b/liblogosdelivery/nim.cfg @@ -1,4 +1,4 @@ -# Nim configuration for liblmapi +# Nim configuration for liblogosdelivery # Ensure correct compiler configuration --gc: diff --git a/nix/default.nix b/nix/default.nix index d5c529ec9..36c2c9248 100644 --- a/nix/default.nix +++ b/nix/default.nix @@ -99,7 +99,7 @@ in stdenv.mkDerivation { # Copy header files cp library/libwaku.h $out/include/ 2>/dev/null || true - cp liblmapi/liblmapi.h $out/include/ 2>/dev/null || true + cp liblogosdelivery/liblogosdelivery.h $out/include/ 2>/dev/null || true ''; meta = with pkgs.lib; {