Files
piik/native/capture/linux/build.sh
T
Matt Van Horn 176e6bd9b4 fix(linux): open KDE remote-desktop sessions without persistence
When a remote-input create fails with that persistence error and has not
already been retried, the error is freed and session creation runs again
with persist mode none and a null restore token. The retry flag allows
only one attempt, so a second rejection still fails the request. The
Linux native check compiles and runs a headless portal regression that
rejects the first remote-desktop create with that error and expects the
second create to use persist mode none and no token, and the README
lists that regression with the other headless checks.

Fixes #549

(cherry picked from commit 1e9fda9f41)
2026-11-20 00:46:17 -05:00

35 lines
1.0 KiB
Bash

#!/bin/sh
set -eu
if [ "$#" -lt 1 ] || [ "$#" -gt 2 ] || { [ "$#" -eq 2 ] && [ "$2" != "--check" ]; }; then
echo "usage: build.sh <output-directory> [--check]" >&2
exit 2
fi
output=$1
source_root=$(dirname "$0")
mkdir -p "$output"
build() {
cc \
-std=c11 -O2 -Wall -Wextra -Werror \
"$source_root/$1" "$source_root/portal.c" "$source_root/input.c" \
$(pkg-config --cflags --libs \
libportal gstreamer-1.0 gstreamer-app-1.0 gstreamer-video-1.0) \
-o "$output/$2"
}
build main.c piik-capture
if [ "${2:-}" = "--check" ]; then
build main.test.c piik-capture-test
"$output/piik-capture-test"
cc -std=c11 -O2 -Wall -Wextra -Werror \
"$source_root/input.test.c" "$source_root/input.c" \
$(pkg-config --cflags --libs libportal) -o "$output/piik-input-test"
"$output/piik-input-test"
cc -std=c11 -O2 -Wall -Wextra -Werror \
"$source_root/portal.test.c" "$source_root/portal.c" "$source_root/input.c" \
$(pkg-config --cflags --libs libportal) -o "$output/piik-portal-test"
"$output/piik-portal-test"
fi