From 91a66a7077deb833c96875b21ee4235d906fa361 Mon Sep 17 00:00:00 2001
From: Delyan Angelov <delian66@gmail.com>
Date: Tue, 14 Jan 2025 12:46:57 +0200
Subject: [PATCH] ci: fix macos ci, use the 2.30.0 version as the default
 master branch

---
 .github/workflows/ci.yml | 38 ++++++++++++++------------------------
 1 file changed, 14 insertions(+), 24 deletions(-)

diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 6370ceb9..3fec6f9e 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -19,7 +19,7 @@ jobs:
       - name: Install dependencies
         run: |
           sudo apt-get update
-          sudo apt-get install --quiet -y libsdl2-ttf-dev
+          sudo apt-get install --quiet -y libsdl2-dev libsdl2-ttf-dev
           sudo apt-get install --quiet -y libsdl2-mixer-dev libsdl2-image-dev
           curl -L https://www.libsdl.org/release/SDL2-${SDL2_VERSION}.tar.gz -o SDL2.tar.gz
           tar -zxvf SDL2.tar.gz
@@ -39,7 +39,7 @@ jobs:
           check-latest: true
 
       - name: Checkout SDL
-        uses: actions/checkout@v2
+        uses: actions/checkout@v4
         with:
           path: sdl
 
@@ -78,38 +78,29 @@ jobs:
           test "${SDL2_VERSION}" = "$VER" || exit 1
 
   macos:
-    runs-on: macos-12
+    runs-on: macos-13
     timeout-minutes: 60
     env:
-      SDL2_VERSION: 2.0.12
+      SDL2_VERSION: 2.30.11
+      CFLAGS: -fpermissive -std=c99
     steps:
       - name: Checkout V
-        uses: actions/checkout@v2
+        uses: actions/checkout@v4
         with:
           repository: vlang/v
 
       - name: Build local v
-        run: make -j4 && ./v symlink
+        run: make && ./v symlink
 
       - name: Install dependencies
         run: |
           brew install sdl2_ttf sdl2_mixer sdl2_image
-          curl -L https://www.libsdl.org/release/SDL2-${SDL2_VERSION}.tar.gz -o SDL2.tar.gz
-          tar -zxvf SDL2.tar.gz
-
-      - name: Build SDL
-        run: |
-          cd SDL2-${SDL2_VERSION}
-          mkdir build
-          cd build
-          ../configure --prefix /tmp/sdl2-${SDL2_VERSION}
-          make
-          make install
 
       - name: Checkout SDL
-        uses: actions/checkout@v2
+        uses: actions/checkout@v4
         with:
           path: sdl
+          ref: 2.30.0
 
       - name: Link local SDL folder in ~/.vmodules/sdl
         run: |
@@ -125,7 +116,7 @@ jobs:
 
       - name: Build sdl shared
         run: |
-          export CFLAGS="$(/tmp/sdl2-${SDL2_VERSION}/bin/sdl2-config --cflags --libs)"
+          export CFLAGS="$(sdl2-config --cflags --libs)"
           v -shared -g sdl
 
       - name: Run tests
@@ -134,13 +125,13 @@ jobs:
       - name: Build sdl examples
         run: |
           v shader sdl/examples/sdl_opengl_and_sokol
-          export CFLAGS="$(/tmp/sdl2-${SDL2_VERSION}/bin/sdl2-config --cflags --libs)"
+          export CFLAGS="$(sdl2-config --cflags --libs)"
           v run sdl/examples/versions
           v should-compile-all sdl/examples/
 
       - name: Test SDL version
         run: |
-          export CFLAGS="$(/tmp/sdl2-${SDL2_VERSION}/bin/sdl2-config --cflags --libs)"
+          export CFLAGS="$(sdl2-config --cflags --libs)"
           VER="$(v run sdl/examples/version)"
           echo "${SDL2_VERSION} == $VER ?"
           test "${SDL2_VERSION}" = "$VER" || exit 1
@@ -158,7 +149,7 @@ jobs:
           check-latest: true
 
       - name: Checkout SDL
-        uses: actions/checkout@v2
+        uses: actions/checkout@v4
         with:
           path: sdl
 
@@ -187,14 +178,13 @@ jobs:
       VFLAGS: -cc tcc -no-retry-compilation
       SDL2_VERSION: 2.0.12
     steps:
-
       - name: Install V
         uses: vlang/setup-v@v1
         with:
           check-latest: true
 
       - name: Checkout SDL
-        uses: actions/checkout@v2
+        uses: actions/checkout@v4
         with:
           path: sdl