if ab_match_arch loongson3; then
	# Fix: Error: Your current platform "linux" and architecture "mips64el" combination is not yet supported by the native Rollup build. Please use the WASM build "@rollup/wasm-node" instead.
	abinfo "Replacing rollup with @rollup/wasm-node for web/frpc and web/frps..."
	cd "$SRCDIR"/web
	npm pkg set resolutions.rollup="npm:@rollup/wasm-node"
fi

# web/frp{c,s}/README.md suggests using yarn to install dependencies and make to build.
# There's a bug with npm overrides and workspaces so yarn is used instead here.
abinfo "Installing dependencies for frp dashboards..."
cd "$SRCDIR"/web
yarn install

abinfo "Building frp dashboards..."
yarn workspaces run build

abinfo "Building frp..."
cd "$SRCDIR"
make build

abinfo "Installing binaries..."
install -Dvm755 "$SRCDIR"/bin/frpc "$PKGDIR"/usr/bin/frpc
install -Dvm755 "$SRCDIR"/bin/frps "$PKGDIR"/usr/bin/frps
