Package list libsdl2-mixer / a276d8c debian / tests / libsdl2-mixer-dev
a276d8c

Tree @a276d8c (Download .tar.gz)

libsdl2-mixer-dev @a276d8craw · history · blame

#!/bin/sh
# Copyright 2019 Collabora Ltd.
# SPDX-License-Identifier: Zlib
# (see "zlib/libpng" in debian/copyright)

set -eux

if [ -n "${AUTOPKGTEST_ARTIFACTS-}" ]; then
	WORKDIR="$AUTOPKGTEST_ARTIFACTS"
else
	WORKDIR="$(mktemp -d)"
	trap 'cd /; rm -fr "$WORKDIR"' 0 INT QUIT ABRT PIPE TERM
fi

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

export SDL_AUDIODRIVER=dummy

cp playmus.c "$WORKDIR"
cp playwave.c "$WORKDIR"

cd "$WORKDIR"

# Deliberately word-splitting pkg-config's output:
# shellcheck disable=SC2046
"${CROSS_COMPILE}gcc" -oplaymus playmus.c $("${CROSS_COMPILE}pkg-config" --cflags --libs SDL2_mixer)
# shellcheck disable=SC2046
"${CROSS_COMPILE}gcc" -oplaywave playwave.c $("${CROSS_COMPILE}pkg-config" --cflags --libs SDL2_mixer)

set -- xvfb-run -a

# This audio file is shipped in the alsa-utils package
"$@" ./playmus /usr/share/sounds/alsa/Front_Center.wav
"$@" ./playwave /usr/share/sounds/alsa/Front_Center.wav