fix liblogosdelivery librln dependency for module and bundle

This commit is contained in:
NagyZoltanPeter
2026-04-15 11:50:31 +02:00
parent 61ed69928e
commit b601d0e445
3 changed files with 31 additions and 2 deletions
Generated
+5 -1
View File
@@ -2759,7 +2759,11 @@
"inputs": {
"logos-delivery": "logos-delivery",
"logos-module-builder": "logos-module-builder",
"nix-bundle-lgx": "nix-bundle-lgx_4"
"nix-bundle-lgx": "nix-bundle-lgx_4",
"zerokit": [
"logos-delivery",
"zerokit"
]
}
},
"rust-overlay": {
+20 -1
View File
@@ -5,6 +5,8 @@
logos-module-builder.url = "github:logos-co/logos-module-builder";
nix-bundle-lgx.url = "github:logos-co/nix-bundle-lgx";
logos-delivery.url = "git+https://github.com/logos-messaging/logos-delivery?submodules=1";
# Pin to the same zerokit logos-delivery uses so librln.dylib versions match
zerokit.follows = "logos-delivery/zerokit";
};
outputs = inputs@{ logos-module-builder, ... }:
@@ -17,9 +19,26 @@
input = inputs.logos-delivery;
packages.default = "liblogosdelivery";
};
# Bundle librln.dylib alongside liblogosdelivery.dylib so the transitive
# dep resolves at runtime (and during logos-cpp-generator dlopen).
rln = {
input = inputs.zerokit;
packages.default = "rln";
};
};
# Bundle runtime libraries alongside the plugin.
postInstall = ''
# liblogosdelivery.dylib has a sandbox-baked absolute path for librln.dylib
# (Cargo bakes the build-time path as the install name). Rewrite it to
# @rpath/librln.dylib so the dynamic linker finds it via @loader_path.
if [ -f "$out/lib/liblogosdelivery.dylib" ]; then
OLD_RLN=$(otool -L "$out/lib/liblogosdelivery.dylib" | awk '/librln/{print $1}')
if [ -n "$OLD_RLN" ]; then
echo "Fixing librln rpath in liblogosdelivery.dylib: $OLD_RLN -> @rpath/librln.dylib"
install_name_tool -change "$OLD_RLN" "@rpath/librln.dylib" \
"$out/lib/liblogosdelivery.dylib"
fi
fi
# Use pkg-config to locate the exact libpq from the build environment
LIBPQ_LIBDIR=$(pkg-config --variable=libdir libpq 2>/dev/null || true)
if [ -n "$LIBPQ_LIBDIR" ] && [ -d "$LIBPQ_LIBDIR" ]; then
+6
View File
@@ -11,6 +11,9 @@
"liblogosdelivery.so",
"liblogosdelivery.dylib",
"liblogosdelivery.dll",
"librln.so",
"librln.dylib",
"librln.dll",
"libpq.so",
"libpq.so.5",
"libpq.dylib",
@@ -26,6 +29,9 @@
{
"name": "logosdelivery",
"build_command": "true"
},
{
"name": "rln"
}
],
"cmake": {