File: libsecret-1-dev

package info (click to toggle)
libsecret 0.21.7-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,556 kB
  • sloc: ansic: 29,587; python: 1,257; xml: 258; sh: 195; javascript: 121; makefile: 16
file content (49 lines) | stat: -rwxr-xr-x 1,243 bytes parent folder | download | duplicates (4)
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
#!/bin/sh
# autopkgtest check: Build and run a program against libsecret, to verify
# that the headers and pkg-config file are installed correctly
# (C) 2012 Canonical Ltd.
# (C) 2018-2019 Simon McVittie
# Authors: Martin Pitt, Simon McVittie

set -eux

WORKDIR="$(mktemp -d)"
export HOME="$WORKDIR"
export XDG_RUNTIME_DIR="$WORKDIR"
trap 'cd /; rm -rf "$WORKDIR"' 0 INT QUIT ABRT PIPE TERM

if [ -n "${DEB_HOST_GNU_TYPE:-}" ]; then
    CROSS_COMPILE="$DEB_HOST_GNU_TYPE-"
else
    CROSS_COMPILE=
fi

cd "$WORKDIR"
cat <<EOF > test.c
#include <libsecret/secret.h>

int main(void)
{
    g_assert_cmpuint(SECRET_TYPE_ITEM, !=, G_TYPE_INVALID);
    return 0;
}
EOF

for package in libsecret-1 libsecret-unstable; do
    case "$package" in
        (libsecret-unstable)
            cflags=-DSECRET_API_SUBJECT_TO_CHANGE
            ;;
        (*)
            cflags=
            ;;
    esac

    # Deliberately word-splitting pkg-config's output and $cflags:
    # shellcheck disable=SC2046
    ${CROSS_COMPILE}gcc $cflags -o "${package}-test" test.c $(${CROSS_COMPILE}pkg-config --cflags --libs "$package")
    echo "build ($package): OK"
    [ -x "${package}-test" ]
    dbus-run-session -- "./${package}-test"
    echo "run ($package): OK"
done