diff --git a/flake.nix b/flake.nix index 85d7b5f..8fcb584 100644 --- a/flake.nix +++ b/flake.nix @@ -218,8 +218,13 @@ WRAPPER LDC_DIR=$PWD cd ../.. # binding.gyp resolves include/lib from env (LDC_INCLUDE = source - # dir with rtc/rtc.hpp, LDC_LIB = cmake build dir with the .so). + # dir with rtc/rtc.hpp, LDC_LIB = cmake build dir with the .so, + # NAPI_INCLUDE = node-addon-api include root). + NAPI_INCLUDE=$(find ../../node_modules/.pnpm -maxdepth 3 \ + -type d -path "*node_modules/node-addon-api" | head -1) + echo "NAPI_INCLUDE=$NAPI_INCLUDE" LDC_INCLUDE=${libdatachannel-src} LDC_LIB=$LDC_DIR \ + NAPI_INCLUDE=$NAPI_INCLUDE \ npx node-gyp rebuild 2>&1 || true ls -la build/Release/datachannel_min.node 2>/dev/null \ && echo "libdatachannel-min binding OK: $(stat -c%s build/Release/datachannel_min.node) bytes" \ diff --git a/services/discord-gateway/native/libdatachannel-min/binding.gyp b/services/discord-gateway/native/libdatachannel-min/binding.gyp index cfa3257..49506bc 100644 --- a/services/discord-gateway/native/libdatachannel-min/binding.gyp +++ b/services/discord-gateway/native/libdatachannel-min/binding.gyp @@ -4,7 +4,7 @@ "target_name": "libdatachannel_min", "sources": ["binding.cpp"], "include_dirs": [ - " { try { return require('node-addon-api').include; } catch { return '/nonexistent'; } })())\")", "