build(nix): fix binding link path — LDC_LIB is full .so path
binding.gyp appended '/libdatachannel.so.0.24.0' to LDC_LIB; nixpkgs output layout is <out>/lib/libdatachannel.so.0.24.1. Make LDC_LIB the complete library path (env or default) and drop the append.
This commit is contained in:
@@ -206,7 +206,7 @@ WRAPPER
|
|||||||
NAPI_INCLUDE=$(find ../../node_modules/.pnpm -maxdepth 3 \
|
NAPI_INCLUDE=$(find ../../node_modules/.pnpm -maxdepth 3 \
|
||||||
-type d -path "*node_modules/node-addon-api" | head -1)
|
-type d -path "*node_modules/node-addon-api" | head -1)
|
||||||
echo "NAPI_INCLUDE=$NAPI_INCLUDE"
|
echo "NAPI_INCLUDE=$NAPI_INCLUDE"
|
||||||
LDC_INCLUDE=${libdatachannel.dev} LDC_LIB=${libdatachannel.lib} \
|
LDC_INCLUDE=${libdatachannel.dev} LDC_LIB=${libdatachannel.out}/lib/libdatachannel.so.0.24.1 \
|
||||||
NAPI_INCLUDE=$NAPI_INCLUDE \
|
NAPI_INCLUDE=$NAPI_INCLUDE \
|
||||||
npx node-gyp rebuild 2>&1 || true
|
npx node-gyp rebuild 2>&1 || true
|
||||||
ls -la build/Release/datachannel_min.node 2>/dev/null \
|
ls -la build/Release/datachannel_min.node 2>/dev/null \
|
||||||
@@ -271,7 +271,7 @@ WRAPPER
|
|||||||
#!${pkgs.runtimeShell}
|
#!${pkgs.runtimeShell}
|
||||||
cd $out/lib/gmw-discord-gateway
|
cd $out/lib/gmw-discord-gateway
|
||||||
export PATH=${pkgs.ffmpeg-headless}/bin:${pkgs.yt-dlp}/bin:\$PATH
|
export PATH=${pkgs.ffmpeg-headless}/bin:${pkgs.yt-dlp}/bin:\$PATH
|
||||||
export LD_LIBRARY_PATH=${libdatachannel.lib}/lib:\$LD_LIBRARY_PATH
|
export LD_LIBRARY_PATH=${libdatachannel.out}/lib:\$LD_LIBRARY_PATH
|
||||||
exec ${nodejs}/bin/node dist/index.js
|
exec ${nodejs}/bin/node dist/index.js
|
||||||
WRAPPER
|
WRAPPER
|
||||||
chmod +x $out/bin/gmw-discord-gateway
|
chmod +x $out/bin/gmw-discord-gateway
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
"<!(node -e \"const s=process.env.LDC_INCLUDE||'/nix/store/39a85gpfjqy3h3k8jwrwh7m9yc3inqw7-source';console.log(s+'/include')\")"
|
"<!(node -e \"const s=process.env.LDC_INCLUDE||'/nix/store/39a85gpfjqy3h3k8jwrwh7m9yc3inqw7-source';console.log(s+'/include')\")"
|
||||||
],
|
],
|
||||||
"libraries": [
|
"libraries": [
|
||||||
"<!(node -e \"const s=process.env.LDC_LIB||'/tmp/ldc-build';console.log(s+'/libdatachannel.so.0.24.0')\")"
|
"<!(node -e \"console.log(process.env.LDC_LIB || '/tmp/ldc-build/libdatachannel.so.0.24.0')\")"
|
||||||
],
|
],
|
||||||
"cflags": ["-std=c++17", "-fexceptions"],
|
"cflags": ["-std=c++17", "-fexceptions"],
|
||||||
"cflags_cc": ["-std=c++17", "-fexceptions"],
|
"cflags_cc": ["-std=c++17", "-fexceptions"],
|
||||||
|
|||||||
Reference in New Issue
Block a user