Files
fluxer-desktop-patched/fluxer_desktop/native/audio-apm/scripts/build-real-apm.sh
T
brenden 682afacd30 Add native self-hosted instance connection to fluxer_desktop
Trimmed monorepo checkout (fluxer_desktop + packages/voice_engine_v2 +
tools/ci) with a "Connect to a Different Server" menu item and popout
that lets the desktop app switch to any self-hosted Fluxer instance,
plus fixes for well-known discovery on single-domain self-hosted
deployments and a false-positive ERR_ABORTED on same-origin client
redirects during the switch. Defaults to chat.fluxr.chat and uses an
isolated userData directory from the official build.
2026-07-01 18:22:43 -04:00

68 lines
1.8 KiB
Bash
Executable File

#!/usr/bin/env bash
# SPDX-License-Identifier: AGPL-3.0-or-later
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
CRATE_DIR="$(cd "${SCRIPT_DIR}/.." && pwd)"
require_pkg_config() {
if ! command -v pkg-config >/dev/null 2>&1; then
echo "error: pkg-config is required but was not found in PATH." >&2
echo " Install via: brew install pkg-config (macOS)" >&2
echo " apt-get install pkg-config (Debian/Ubuntu)" >&2
exit 1
fi
}
assert_webrtc_pkgconfig() {
if ! pkg-config --exists webrtc-audio-processing-2; then
echo "error: pkg-config cannot locate webrtc-audio-processing-2." >&2
echo " See fluxer_desktop/native/audio-apm/README.md for install steps." >&2
exit 1
fi
}
assert_absl_pkgconfig() {
if ! pkg-config --exists absl_base; then
echo "error: pkg-config cannot locate absl_base." >&2
echo " Install via: brew install abseil (macOS)" >&2
echo " apt-get install libabsl-dev (Debian/Ubuntu)" >&2
exit 1
fi
}
inject_absl_include_path() {
local absl_includes
absl_includes="$(pkg-config --cflags-only-I absl_base)"
if [[ -z "${absl_includes}" ]]; then
echo "error: pkg-config returned no include path for absl_base." >&2
exit 1
fi
local prev_cxxflags="${CXXFLAGS-}"
local prev_bindgen="${BINDGEN_EXTRA_CLANG_ARGS-}"
export CXXFLAGS="${absl_includes} ${prev_cxxflags}"
export BINDGEN_EXTRA_CLANG_ARGS="${absl_includes} ${prev_bindgen}"
}
main() {
cd "${CRATE_DIR}"
local cargo_subcmd="build"
if [[ $# -gt 0 && "$1" != -* && "$1" != "--" ]]; then
cargo_subcmd="$1"
shift
fi
require_pkg_config
assert_webrtc_pkgconfig
assert_absl_pkgconfig
inject_absl_include_path
exec cargo "${cargo_subcmd}" --features real-apm "$@"
}
main "$@"