File: build

package info (click to toggle)
libwacom 2.16.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,328 kB
  • sloc: ansic: 5,943; python: 2,528; sh: 65; makefile: 21
file content (40 lines) | stat: -rwxr-xr-x 749 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
#!/bin/sh

set -e
exec 2>&1
set -u

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

echo "1..1"

cat > trivial.c <<'EOF'
#include <assert.h>

#include <libwacom/libwacom.h>

int main (void)
{
    WacomDeviceDatabase *db;

    db = libwacom_database_new();
    assert(db != NULL);
    libwacom_database_destroy(db);
    return 0;
}
EOF

# Deliberately word-splitting, that's how pkg-config works:
# shellcheck disable=SC2046
${CROSS_COMPILE}gcc -o trivial trivial.c $(${CROSS_COMPILE}pkg-config --cflags --libs libwacom)
test -x trivial
./trivial
echo "ok 1"

# Static linking not tested here: libwacom depends on libudev which is
# not available as a static library