Package: wireplumber
Version: 0.4.10-1
It would be nicer if the package had autopkgtests testing. The attached
patch is adding a trivial build test on the model of the ones used for
most GNOME libraries, it ensure that a simple case builds and that the
dev isn't missing any depends.
We are using that change in Ubuntu now as having tests is a requirement
to promote packages and we plan to preinstall wireplumber as part of the
switch to pipewire.
The missing depends have been caught by the test failing on our first
upload ;-)
Thanks for considering
diff -Nru wireplumber-0.4.10/debian/changelog wireplumber-0.4.10/debian/changelog
--- wireplumber-0.4.10/debian/changelog 2022-05-11 14:01:51.000000000 +0200
+++ wireplumber-0.4.10/debian/changelog 2022-05-19 15:26:07.000000000 +0200
@@ -1,3 +1,13 @@
+wireplumber (0.4.10-2) UNRELEASED; urgency=medium
+
+ * debian/tests:
+ - add a basic build autopkgtest for the library
+ * debian/control:
+ - libwireplumber-0.4-dev depends on libglib2.0-dev and libglib2.0-dev,
+ those are required by the .pc
+
+ -- Sebastien Bacher <seb...@ubuntu.com> Thu, 19 May 2022 15:26:07 +0200
+
wireplumber (0.4.10-1) unstable; urgency=medium
* Team upload.
diff -Nru wireplumber-0.4.10/debian/control wireplumber-0.4.10/debian/control
--- wireplumber-0.4.10/debian/control 2022-05-11 14:01:51.000000000 +0200
+++ wireplumber-0.4.10/debian/control 2022-05-19 15:26:07.000000000 +0200
@@ -43,6 +43,8 @@
Architecture: linux-any
Multi-Arch: same
Depends: ${misc:Depends},
+ libglib2.0-dev,
+ libpipewire-0.3-dev,
libwireplumber-0.4-0 (= ${binary:Version}),
gir1.2-wp-0.4 (= ${binary:Version}),
Description: Development files for WirePlumber
diff -Nru wireplumber-0.4.10/debian/tests/build wireplumber-0.4.10/debian/tests/build
--- wireplumber-0.4.10/debian/tests/build 1970-01-01 01:00:00.000000000 +0100
+++ wireplumber-0.4.10/debian/tests/build 2022-05-19 15:26:07.000000000 +0200
@@ -0,0 +1,30 @@
+#!/bin/sh
+# autopkgtest check: Build and run a program against libwireplumber, to verify that
+# the headers and pkg-config file are installed correctly
+
+set -e
+
+if [ -n "${DEB_HOST_GNU_TYPE:-}" ]; then
+ CROSS_COMPILE="$DEB_HOST_GNU_TYPE-"
+else
+ CROSS_COMPILE=
+fi
+
+cat <<EOF > libwireplumber_test.c
+#include <wp/wp.h>
+
+int main(void)
+{
+ wp_init (WP_INIT_ALL);
+ return 0;
+}
+EOF
+
+# deliberately word-splitting pkg-config output:
+# shellcheck disable=SC2046
+"${CROSS_COMPILE}gcc" -o libwireplumber_test libwireplumber_test.c \
+$("${CROSS_COMPILE}pkg-config" --cflags --libs wireplumber-0.4)
+echo "build: OK"
+[ -x libwireplumber_test ]
+./libwireplumber_test
+echo "run: OK"
diff -Nru wireplumber-0.4.10/debian/tests/control wireplumber-0.4.10/debian/tests/control
--- wireplumber-0.4.10/debian/tests/control 1970-01-01 01:00:00.000000000 +0100
+++ wireplumber-0.4.10/debian/tests/control 2022-05-19 14:05:24.000000000 +0200
@@ -0,0 +1,3 @@
+Tests: build
+Depends: build-essential, pkg-config, libwireplumber-0.4-dev
+Restrictions: allow-stderr superficial