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