1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
|
#!/bin/sh
# Copyright 2020-2022 Collabora Ltd.
# Copyright 2021 Christian Rauch.
# SPDX-License-Identifier: MIT
set -eux
if [ -n "${AUTOPKGTEST_ARTIFACTS-}" ]; then
WORKDIR="$AUTOPKGTEST_ARTIFACTS"
else
WORKDIR="$(mktemp -d)"
trap 'cd /; rm -fr "$WORKDIR"' 0 INT QUIT ABRT PIPE TERM
fi
if [ -n "${DEB_HOST_GNU_TYPE:-}" ]; then
CROSS_COMPILE="$DEB_HOST_GNU_TYPE-"
else
CROSS_COMPILE=
fi
srcdir="$(pwd)"
cp obj-*/config.h "$WORKDIR"
cp demo/demo.c "$WORKDIR"
cp src/desktop-settings.h "$WORKDIR"
cp src/desktop-settings.c "$WORKDIR"
cp src/os-compatibility.c "$WORKDIR"
cp src/os-compatibility.h "$WORKDIR"
cp src/utils.h "$WORKDIR"
wayland-scanner client-header /usr/share/wayland-protocols/stable/xdg-shell/xdg-shell.xml "$WORKDIR/xdg-shell-client-protocol.h"
wayland-scanner private-code /usr/share/wayland-protocols/stable/xdg-shell/xdg-shell.xml "$WORKDIR/xdg-shell-protocol.c"
cd "$WORKDIR"
"${CROSS_COMPILE}gcc" \
-D_GNU_SOURCE \
desktop-settings.c \
demo.c \
os-compatibility.c \
xdg-shell-protocol.c \
-o test \
$("${CROSS_COMPILE}pkgconf" \
--cflags \
--libs \
dbus-1 \
libdecor-0 \
wayland-client \
wayland-cursor \
xkbcommon \
)
"$srcdir/debian/tests/run-with-display" wayland \
./test --timed-quit
|