| 1 |
#!/bin/sh |
| 2 |
|
| 3 |
set -e |
| 4 |
exec 2>&1 |
| 5 |
set -u |
| 6 |
set -x |
| 7 |
|
| 8 |
if [ -z "${HOME-}" ] || ! [ -w "${HOME}" ]; then |
| 9 |
export HOME="${AUTOPKGTEST_TMP}" |
| 10 |
fi |
| 11 |
|
| 12 |
cd "$AUTOPKGTEST_TMP" |
| 13 |
|
| 14 |
if [ -n "${DEB_HOST_GNU_TYPE:-}" ]; then |
| 15 |
CROSS_COMPILE="$DEB_HOST_GNU_TYPE-" |
| 16 |
else |
| 17 |
CROSS_COMPILE= |
| 18 |
fi |
| 19 |
|
| 20 |
cat > test.c <<'EOF' |
| 21 |
#include <glib.h> |
| 22 |
#include <libportal/portal.h> |
| 23 |
|
| 24 |
int main (int argc, char *argv[]) |
| 25 |
{ |
| 26 |
XdpPortal *portal = NULL; |
| 27 |
|
| 28 |
portal = xdp_portal_new (); |
| 29 |
g_assert_nonnull (portal); |
| 30 |
g_assert_true (XDP_IS_PORTAL (portal)); |
| 31 |
g_object_unref (portal); |
| 32 |
|
| 33 |
return 0; |
| 34 |
} |
| 35 |
EOF |
| 36 |
|
| 37 |
# Deliberately word-splitting, that's how pkg-config works: |
| 38 |
# shellcheck disable=SC2046 |
| 39 |
"${CROSS_COMPILE}gcc" -o test test.c $("${CROSS_COMPILE}pkgconf" --cflags --libs libportal) |
| 40 |
test -x ./test |
| 41 |
dbus-run-session -- ./test |