SDL_mixer: workflows: Run `make dist`

From 5fd1ce9b08769c45dbc4b478848a284952fb07fa Mon Sep 17 00:00:00 2001
From: Simon McVittie <[EMAIL REDACTED]>
Date: Thu, 5 May 2022 17:03:03 +0100
Subject: [PATCH] workflows: Run `make dist`

This confirms that we can build an official source tarball distribution.
It also partially implements the equivalent of Automake's
`make distcheck`, checking that we can build from the resulting tarball.

Signed-off-by: Simon McVittie <smcv@collabora.com>
---
 .github/workflows/linux.yml | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml
index 7f4430ce..ec0bf3a4 100644
--- a/.github/workflows/linux.yml
+++ b/.github/workflows/linux.yml
@@ -74,3 +74,15 @@ jobs:
 
       - name: Build make
         run: make -j2
+
+      - name: Distcheck
+        run: |
+          set -eu
+          parallel="$(getconf _NPROCESSORS_ONLN)"
+          make -j"${parallel}" dist V=1
+          # Similar to Automake `make distcheck`: check that the tarball
+          # release is sufficient to do a new build
+          mkdir distcheck
+          tar -C distcheck -zxf SDL2_mixer-*.tar.gz
+          ( cd distcheck/SDL2_mixer-* && ./configure )
+          make -C distcheck/SDL2_mixer-*