[termux] testing support for termux v11

This commit is contained in:
synt-xerror
2026-03-14 02:33:13 -03:00
parent 60768a9ed3
commit 490827dc17
4 changed files with 19 additions and 20 deletions

View File

@@ -7,6 +7,7 @@
"node-gyp": "^12.2.0", "node-gyp": "^12.2.0",
"qrcode-terminal": "^0.12.0", "qrcode-terminal": "^0.12.0",
"sharp": "^0.34.5", "sharp": "^0.34.5",
"whatsapp-web.js": "^1.24.0" "whatsapp-web.js": "^1.24.0",
"@img/sharp-wasm": "^0.34.5"
} }
} }

25
setup
View File

@@ -141,31 +141,20 @@ if [[ "$PREFIX" == *"com.termux"* ]]; then
log_info "Ambiente Termux detectado" log_info "Ambiente Termux detectado"
deps=( deps=(
clang chromium
make
pkg-config pkg-config
python3 python3
chromium
libvips
xorgproto
libx11
libxrender
libxcb
) )
install_deps "${deps[@]}" install_deps "${deps[@]}"
export PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig:$PKG_CONFIG_PATH" log_info "Usando sharp via WebAssembly"
export npm_config_platform=linux
node -e "require('sharp')" >/dev/null 2>&1 && log_ok "sharp OK" && return if node -e "require('@img/sharp-wasm')" >/dev/null 2>&1; then
log_ok "sharp-wasm já instalado"
log_info "Reconstruindo módulo sharp" else
run_cmd npm install @img/sharp-wasm
rm -rf node_modules/sharp fi
export android_ndk_path=""
run_cmd npm install sharp
fi fi
# ------------------------ # ------------------------

View File

@@ -1,6 +1,6 @@
import pkg from "whatsapp-web.js"; import pkg from "whatsapp-web.js";
const { MessageMedia } = pkg; const { MessageMedia } = pkg;
import sharp from "sharp"; import sharp from "../utils/sharp-loader.js";
import fs from "fs"; import fs from "fs";
import { botMsg } from "../utils/botMsg.js"; import { botMsg } from "../utils/botMsg.js";
import { client } from "../client/whatsappClient.js" import { client } from "../client/whatsappClient.js"

View File

@@ -0,0 +1,9 @@
let sharp;
try {
sharp = (await import("sharp")).default;
} catch {
sharp = (await import("@img/sharp-wasm")).default;
}
export default sharp;