Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions nix/scripts/gateway-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,23 @@ if [ -n "$hasown_src" ]; then
fi
fi

# Work around missing 'long' dependency for @whiskeysockets/baileys in pnpm layout.
# messages-recv.js has a top-level `import Long from 'long'` but baileys does not
# declare 'long' in its package.json, so pnpm strict mode never creates the symlink
# in baileys' virtual node_modules directory.
long_src="$(find "$out/lib/openclaw/node_modules/.pnpm" -path "*/long@4*/node_modules/long" -print | head -n 1)"
if [ -n "$long_src" ]; then
baileys_pkgs="$(find "$out/lib/openclaw/node_modules/.pnpm" -path "*/@whiskeysockets+baileys*/node_modules" -maxdepth 3 -type d -print)"
if [ -n "$baileys_pkgs" ]; then
for pkg in $baileys_pkgs; do
if [ ! -e "$pkg/long" ]; then
mkdir -p "$pkg"
ln -s "$long_src" "$pkg/long"
fi
done
fi
fi

log_step "validate node_modules symlinks" check_no_broken_symlinks "$out/lib/openclaw/node_modules"

bash -e -c '. "$STDENV_SETUP"; makeWrapper "$NODE_BIN" "$out/bin/openclaw" --add-flags "$out/lib/openclaw/dist/index.js" --set-default OPENCLAW_NIX_MODE "1"'