|
| 1 | +# Template file for 'concord' |
| 2 | +pkgname=concord |
| 3 | +version=2.5.15 |
| 4 | +revision=1 |
| 5 | +build_style=cargo |
| 6 | +build_helper=qemu |
| 7 | +hostmakedepends="pkg-config cmake clang21 libclang21" |
| 8 | +if [ "$build_option_stream" ]; then |
| 9 | + hostmakedepends+=" nasm" |
| 10 | +fi |
| 11 | + |
| 12 | +makedepends="wayland-devel libzstd-devel" |
| 13 | +if [ "$build_option_voice" ] || [ "$build_option_stream" ]; then |
| 14 | + makedepends+=" alsa-lib-devel pulseaudio-devel" |
| 15 | +fi |
| 16 | +if [ "$build_option_stream" ]; then |
| 17 | + makedepends+=" pipewire-devel libva-devel" |
| 18 | +fi |
| 19 | + |
| 20 | +short_desc="TUI client for Discord" |
| 21 | +maintainer="rayfadh <rayfadh@duck.com>" |
| 22 | +license="GPL-3.0-only" |
| 23 | +homepage="https://github.com/chojs23/concord" |
| 24 | +changelog="https://raw.githubusercontent.com/chojs23/concord/refs/heads/main/CHANGELOG.md" |
| 25 | +distfiles="https://github.com/chojs23/concord/archive/refs/tags/v${version}.tar.gz" |
| 26 | +checksum=d88cfda6bd26d858cafff4aba98bdb9d2291afa9165c7e4be6f3f0bc48993cdc |
| 27 | + |
| 28 | +build_options="voice stream" |
| 29 | +desc_option_voice="Enable voice playback support (requires ALSA)" |
| 30 | +desc_option_stream="Enable stream broadcasting (requires PipeWire and VA-API)" |
| 31 | + |
| 32 | +case "$XBPS_MACHINE" in |
| 33 | + x86_64*|aarch64*) build_options_default="voice stream" ;; |
| 34 | +esac |
| 35 | + |
| 36 | +if [ "$build_option_stream" ]; then |
| 37 | + configure_args="--no-default-features --features stream-broadcast" |
| 38 | +elif [ "$build_option_voice" ]; then |
| 39 | + configure_args="--no-default-features --features voice-playback" |
| 40 | +else |
| 41 | + configure_args="--no-default-features" |
| 42 | +fi |
| 43 | + |
| 44 | +_setup_env() { |
| 45 | + # workaround the cc-rs mixing CFLAGS for host and target. |
| 46 | + # https://github.com/rust-lang/cc-rs/issues/1469 |
| 47 | + export CFLAGS_${RUST_BUILD//-/_}="${CFLAGS_host}" \ |
| 48 | + CXXFLAGS_${RUST_BUILD//-/_}="${CXXFLAGS_host}" \ |
| 49 | + LDFLAGS_${RUST_BUILD//-/_}="${LDFLAGS_host}" \ |
| 50 | + CFLAGS_${RUST_TARGET//-/_}="${CFLAGS}" \ |
| 51 | + CXXFLAGS_${RUST_TARGET//-/_}="${CXXFLAGS}" \ |
| 52 | + LDFLAGS_${RUST_TARGET//-/_}="${LDFLAGS}" \ |
| 53 | + CFLAGS="" CXXFLAGS="" LDFLAGS="" \ |
| 54 | + LIBCLANG_PATH="/usr/lib" |
| 55 | +} |
| 56 | + |
| 57 | +pre_build() { |
| 58 | + _setup_env |
| 59 | +} |
| 60 | + |
| 61 | +pre_install() { |
| 62 | + _setup_env |
| 63 | +} |
0 commit comments