SDL_mixer: ci: fetch yasm for mpg123 (on MSVC)

From 334672d85d09f16b4ecb5e2041a0ad78128c3369 Mon Sep 17 00:00:00 2001
From: Anonymous Maarten <[EMAIL REDACTED]>
Date: Tue, 18 Jul 2023 01:01:53 +0200
Subject: [PATCH] ci: fetch yasm for mpg123 (on MSVC)

---
 .github/fetch_sdl_vc.ps1         | 40 --------------------------------
 .github/workflows/main.yml       | 15 ++++++++----
 build-scripts/test-versioning.sh |  8 -------
 3 files changed, 11 insertions(+), 52 deletions(-)
 delete mode 100644 .github/fetch_sdl_vc.ps1

diff --git a/.github/fetch_sdl_vc.ps1 b/.github/fetch_sdl_vc.ps1
deleted file mode 100644
index 83d4db70..00000000
--- a/.github/fetch_sdl_vc.ps1
+++ /dev/null
@@ -1,40 +0,0 @@
-$ErrorActionPreference = "Stop"
-
-$project_root = "$psScriptRoot\.."
-Write-Output "project_root: $project_root"
-
-$sdl3_version = "3.0.0"
-$sdl3_zip = "SDL3-devel-$($sdl3_version)-VC.zip"
-
-$sdl3_url = "https://github.com/libsdl-org/SDL/releases/download/release-$($sdl3_version)/SDL3-devel-$($sdl3_version)-VC.zip"
-$sdl3_dlpath = "$($Env:TEMP)\$sdl3_zip"
-
-$sdl3_bindir = "$($project_root)"
-$sdl3_extractdir = "$($sdl3_bindir)\SDL3-$($sdl3_version)"
-$sdl3_root_name = "SDL3-devel-VC"
-
-echo "sdl3_bindir:     $sdl3_bindir"
-echo "sdl3_extractdir: $sdl3_extractdir"
-echo "sdl3_root_name:  $sdl3_root_name"
-
-echo "Cleaning previous artifacts"
-if (Test-Path $sdl3_extractdir) {
-    Remove-Item $sdl3_extractdir -Recurse -Force
-}
-if (Test-Path "$($sdl3_bindir)/$sdl3_root_name") {
-    Remove-Item "$($sdl3_bindir)/$sdl3_root_name" -Recurse -Force
-}
-if (Test-Path $sdl3_dlpath) {
-    Remove-Item $sdl3_dlpath -Force
-}
-
-Write-Output "Downloading $sdl3_url"
-Invoke-WebRequest -Uri $sdl3_url -OutFile $sdl3_dlpath
-
-Write-Output "Extracting archive"
-Expand-Archive $sdl3_dlpath -DestinationPath $sdl3_bindir
-
-Write-Output "Setting up SDL3 folder"
-Rename-Item $sdl3_extractdir $sdl3_root_name
-
-Write-Output "Done"
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 0261f8e0..3e4bb791 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -29,7 +29,7 @@ jobs:
       with:
         arch: x64
     - name: Set up MSYS2
-      if: matrix.platform.shell == 'msys2 {0}'
+      if: ${{ matrix.platform.shell == 'msys2 {0}' }}
       uses: msys2/setup-msys2@v2
       with:
         msystem: ${{ matrix.platform.msystem }}
@@ -60,7 +60,7 @@ jobs:
         sdl-test: true
         shell: ${{ matrix.platform.shell }}
     - name: Set up Macos dependencies
-      if: runner.os == 'macOS'
+      if: ${{ runner.os == 'macOS' }}
       run: |
         brew install \
           libtool \
@@ -76,7 +76,7 @@ jobs:
           wavpack \
           ${NULL+}
     - name: Set up Linux dependencies
-      if: runner.os == 'Linux'
+      if: ${{ runner.os == 'Linux' }}
       run: |
         sudo apt-get update
         sudo apt-get -y install \
@@ -98,9 +98,16 @@ jobs:
 
     - name: Check that versioning is consistent
       # We only need to run this once: arbitrarily use the Linux build
-      if: "runner.os == 'Linux'"
+      if: ${{ runner.os == 'Linux' }}
       run: ./build-scripts/test-versioning.sh
 
+    - name: Set up yasm for mpg123
+      if: ${{ matrix.platform.msvc }}
+      shell: pwsh
+      run: |
+        .github/fetch_yasm.ps1
+        echo "${{ github.workspace }}" >> $Env:GITHUB_PATH
+
     - name: Setup (CMake)
       if: ${{ !matrix.platform.msystem && !matrix.platform.msvc }}
       uses: jwlawson/actions-setup-cmake@v1.14
diff --git a/build-scripts/test-versioning.sh b/build-scripts/test-versioning.sh
index 952ed7f6..6468b1db 100755
--- a/build-scripts/test-versioning.sh
+++ b/build-scripts/test-versioning.sh
@@ -138,13 +138,5 @@ else
     not_ok "project.pbxproj DYLIB_CURRENT_VERSION is inconsistent, expected $ref, got $dylib_cur"
 fi
 
-sdl_req=$(sed -ne 's/\$sdl3_version = "\([0-9.]*\)"$/\1/p' .github/fetch_sdl_vc.ps1)
-
-if [ "$ref_sdl_req" = "$sdl_req" ]; then
-    ok ".github/fetch_sdl_vc.ps1 $sdl_req"
-else
-    not_ok ".github/fetch_sdl_vc.ps1 sdl3_version=$sdl_req disagrees with CMakeLists.txt SDL_REQUIRED_VERSION=$ref_sdl_req"
-fi
-
 echo "1..$tests"
 exit "$failed"