Package: speexdsp Version: 1.2.1-1 Tags: patch User: ubuntu-de...@lists.ubuntu.com Usertags: origin-ubuntu noble ubuntu-patch
I'm working on getting speexdsp promoted for Ubuntu (Depends of roc-toolkit which is a new depends of pipewire), one of the requirements is to have tests. Upstream doesn't provide a testsuite but having an small 'build test' autopkg would be better than noticing, I'm adding a patch that adds one. It at least ensure that the corresponding header and .pc are installed and that the dev binary isn't missing a depends
Cheers, Sébastien
diff -Nru speexdsp-1.2.1/debian/changelog speexdsp-1.2.1/debian/changelog --- speexdsp-1.2.1/debian/changelog 2022-09-17 19:48:41.000000000 +0200 +++ speexdsp-1.2.1/debian/changelog 2023-12-21 15:43:07.000000000 +0100 @@ -1,3 +1,10 @@ +speexdsp (1.2.1-2) UNRELEASED; urgency=medium + + * Add a simple build autopkgtest for the library, it does ensure at least + that the needed files are installed and the dev depends correct. + + -- Sebastien Bacher <seb...@ubuntu.com> Thu, 21 Dec 2023 15:43:07 +0100 + speexdsp (1.2.1-1) unstable; urgency=medium * New upstream release. (Closes: #1014555) diff -Nru speexdsp-1.2.1/debian/control speexdsp-1.2.1/debian/control --- speexdsp-1.2.1/debian/control 2022-04-02 03:48:08.000000000 +0200 +++ speexdsp-1.2.1/debian/control 2023-12-21 15:43:07.000000000 +0100 @@ -1,7 +1,8 @@ Source: speexdsp Priority: optional Section: sound -Maintainer: Debian Multimedia Maintainers <debian-multime...@lists.debian.org> +Maintainer: Ubuntu Developers <ubuntu-devel-disc...@lists.ubuntu.com> +XSBC-Original-Maintainer: Debian Multimedia Maintainers <debian-multime...@lists.debian.org> Uploaders: Boyuan Yang <by...@debian.org>, Build-Depends: diff -Nru speexdsp-1.2.1/debian/tests/build speexdsp-1.2.1/debian/tests/build --- speexdsp-1.2.1/debian/tests/build 1970-01-01 01:00:00.000000000 +0100 +++ speexdsp-1.2.1/debian/tests/build 2023-12-21 15:43:07.000000000 +0100 @@ -0,0 +1,32 @@ +#!/bin/sh +# autopkgtest check: Build and run a program against libspeexdsp, +# 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 > libspeexdsp_test.c +#include <stddef.h> +#include <speex/speex_resampler.h> + +int main(void) +{ + SpeexResamplerState *st = speex_resampler_init(1, 48000, 48000, 4, NULL); + + return 0; +} +EOF + +# deliberately word-splitting pkg-config output: +# shellcheck disable=SC2046 +"${CROSS_COMPILE}gcc" -o libspeexdsp_test libspeexdsp_test.c \ +$("${CROSS_COMPILE}pkg-config" --cflags --libs speexdsp) +echo "build: OK" +[ -x libspeexdsp_test ] +./libspeexdsp_test +echo "run: OK" diff -Nru speexdsp-1.2.1/debian/tests/control speexdsp-1.2.1/debian/tests/control --- speexdsp-1.2.1/debian/tests/control 1970-01-01 01:00:00.000000000 +0100 +++ speexdsp-1.2.1/debian/tests/control 2023-12-21 15:43:07.000000000 +0100 @@ -0,0 +1,3 @@ +Tests: build +Depends: build-essential, pkg-config, libspeexdsp-dev +Restrictions: allow-stderr superficial