From 8222bfe56d4dabe8d92fc4b25ea1b0163b16f3e1 Mon Sep 17 00:00:00 2001 From: 3gg <3gg@shellblade.net> Date: Sat, 4 May 2024 16:51:29 -0700 Subject: Initial commit. --- .../SDL-2.30.2/.github/PULL_REQUEST_TEMPLATE.md | 7 + .../SDL-2.30.2/.github/cmake/CMakeLists.txt | 16 ++ .../SDL-2.30.2/.github/workflows/android.yml | 81 +++++++ .../SDL-2.30.2/.github/workflows/cpactions.yml | 51 +++++ .../SDL-2.30.2/.github/workflows/emscripten.yml | 45 ++++ src/contrib/SDL-2.30.2/.github/workflows/ios.yml | 20 ++ src/contrib/SDL-2.30.2/.github/workflows/main.yml | 240 +++++++++++++++++++++ src/contrib/SDL-2.30.2/.github/workflows/msvc.yml | 80 +++++++ src/contrib/SDL-2.30.2/.github/workflows/n3ds.yml | 55 +++++ src/contrib/SDL-2.30.2/.github/workflows/ps2.yaml | 73 +++++++ src/contrib/SDL-2.30.2/.github/workflows/psp.yaml | 50 +++++ .../SDL-2.30.2/.github/workflows/riscos.yml | 68 ++++++ src/contrib/SDL-2.30.2/.github/workflows/vita.yaml | 95 ++++++++ .../SDL-2.30.2/.github/workflows/watcom.yml | 35 +++ 14 files changed, 916 insertions(+) create mode 100644 src/contrib/SDL-2.30.2/.github/PULL_REQUEST_TEMPLATE.md create mode 100644 src/contrib/SDL-2.30.2/.github/cmake/CMakeLists.txt create mode 100644 src/contrib/SDL-2.30.2/.github/workflows/android.yml create mode 100644 src/contrib/SDL-2.30.2/.github/workflows/cpactions.yml create mode 100644 src/contrib/SDL-2.30.2/.github/workflows/emscripten.yml create mode 100644 src/contrib/SDL-2.30.2/.github/workflows/ios.yml create mode 100644 src/contrib/SDL-2.30.2/.github/workflows/main.yml create mode 100644 src/contrib/SDL-2.30.2/.github/workflows/msvc.yml create mode 100644 src/contrib/SDL-2.30.2/.github/workflows/n3ds.yml create mode 100644 src/contrib/SDL-2.30.2/.github/workflows/ps2.yaml create mode 100644 src/contrib/SDL-2.30.2/.github/workflows/psp.yaml create mode 100644 src/contrib/SDL-2.30.2/.github/workflows/riscos.yml create mode 100644 src/contrib/SDL-2.30.2/.github/workflows/vita.yaml create mode 100644 src/contrib/SDL-2.30.2/.github/workflows/watcom.yml (limited to 'src/contrib/SDL-2.30.2/.github') diff --git a/src/contrib/SDL-2.30.2/.github/PULL_REQUEST_TEMPLATE.md b/src/contrib/SDL-2.30.2/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..533be85 --- /dev/null +++ b/src/contrib/SDL-2.30.2/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,7 @@ + + +## Description + + +## Existing Issue(s) + diff --git a/src/contrib/SDL-2.30.2/.github/cmake/CMakeLists.txt b/src/contrib/SDL-2.30.2/.github/cmake/CMakeLists.txt new file mode 100644 index 0000000..4875701 --- /dev/null +++ b/src/contrib/SDL-2.30.2/.github/cmake/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.0...3.5) +project(ci_utils C CXX) + +set(txt "CC=${CMAKE_C_COMPILER} +CXX=${CMAKE_CXX_COMPILER} +CFLAGS=${CMAKE_C_FLAGS} +CXXFLAGS=${CMAKE_CXX_FLAGS} +LDFLAGS=${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_C_STANDARD_LIBRARIES} +") + +message("${txt}") + +set(VAR_PATH "/tmp/env.txt" CACHE PATH "Where to write environment file") +message(STATUS "Writing CC/CXX/CFLAGS/CXXFLAGS/LDFLAGS environment to ${VAR_PATH}") + +file(WRITE "${VAR_PATH}" "${txt}") diff --git a/src/contrib/SDL-2.30.2/.github/workflows/android.yml b/src/contrib/SDL-2.30.2/.github/workflows/android.yml new file mode 100644 index 0000000..a2d2b0b --- /dev/null +++ b/src/contrib/SDL-2.30.2/.github/workflows/android.yml @@ -0,0 +1,81 @@ +name: Build (Android) + +on: [push, pull_request] + +jobs: + android: + name: ${{ matrix.platform.name }} + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + platform: + - { name: Android.mk } + - { name: CMake, cmake: 1, android_abi: "arm64-v8a", android_platform: 23, arch: "aarch64" } + + steps: + - uses: actions/checkout@v4 + - uses: nttld/setup-ndk@v1 + id: setup_ndk + with: + ndk-version: r21e + - name: Build (Android.mk) + if: ${{ matrix.platform.name == 'Android.mk' }} + run: | + ./build-scripts/androidbuildlibs.sh + - name: Setup (CMake) + if: ${{ matrix.platform.name == 'CMake' }} + run: | + sudo apt-get update + sudo apt-get install ninja-build pkg-config + - name: Configure (CMake) + if: ${{ matrix.platform.name == 'CMake' }} + run: | + cmake -B build \ + -DCMAKE_TOOLCHAIN_FILE=${{ steps.setup_ndk.outputs.ndk-path }}/build/cmake/android.toolchain.cmake \ + -DSDL_WERROR=ON \ + -DANDROID_PLATFORM=${{ matrix.platform.android_platform }} \ + -DANDROID_ABI=${{ matrix.platform.android_abi }} \ + -DSDL_STATIC_PIC=ON \ + -DSDL_VENDOR_INFO="Github Workflow" \ + -DCMAKE_INSTALL_PREFIX=prefix \ + -DCMAKE_BUILD_TYPE=Release \ + -GNinja + - name: Build (CMake) + if: ${{ matrix.platform.name == 'CMake' }} + run: | + cmake --build build --config Release --parallel --verbose + - name: Install (CMake) + if: ${{ matrix.platform.name == 'CMake' }} + run: | + cmake --install build --config Release + echo "SDL2_DIR=$(pwd)/prefix" >> $GITHUB_ENV + ( cd prefix; find ) | LC_ALL=C sort -u + - name: Verify CMake configuration files + if: ${{ matrix.platform.name == 'CMake' }} + run: | + cmake -S cmake/test -B cmake_config_build -G Ninja \ + -DCMAKE_TOOLCHAIN_FILE=${{ steps.setup_ndk.outputs.ndk-path }}/build/cmake/android.toolchain.cmake \ + -DANDROID_PLATFORM=${{ matrix.platform.android_platform }} \ + -DANDROID_ABI=${{ matrix.platform.android_abi }} \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_PREFIX_PATH=${{ env.SDL2_DIR }} + cmake --build cmake_config_build --verbose + - name: Verify sdl2-config + if: ${{ matrix.platform.name == 'CMake' }} + run: | + export CC="${{ steps.setup_ndk.outputs.ndk-path }}/toolchains/llvm/prebuilt/linux-x86_64/bin/clang --target=${{ matrix.platform.arch }}-none-linux-androideabi${{ matrix.platform.android_platform }}" + export PATH=${{ env.SDL2_DIR }}/bin:$PATH + cmake/test/test_sdlconfig.sh + - name: Verify sdl2.pc + if: ${{ matrix.platform.name == 'CMake' }} + run: | + export CC="${{ steps.setup_ndk.outputs.ndk-path }}/toolchains/llvm/prebuilt/linux-x86_64/bin/clang --target=${{ matrix.platform.arch }}-none-linux-androideabi${{ matrix.platform.android_platform }}" + export PKG_CONFIG_PATH=${{ env.SDL2_DIR }}/lib/pkgconfig + cmake/test/test_pkgconfig.sh + - name: Verify Android.mk + if: ${{ matrix.platform.name == 'CMake' }} + run: | + export NDK_MODULE_PATH=${{ env.SDL2_DIR }}/share/ndk-modules + ndk-build -C ${{ github.workspace }}/cmake/test APP_PLATFORM=android-${{ matrix.platform.android_platform }} APP_ABI=${{ matrix.platform.android_abi }} NDK_OUT=$PWD NDK_LIBS_OUT=$PWD V=1 diff --git a/src/contrib/SDL-2.30.2/.github/workflows/cpactions.yml b/src/contrib/SDL-2.30.2/.github/workflows/cpactions.yml new file mode 100644 index 0000000..a2e676f --- /dev/null +++ b/src/contrib/SDL-2.30.2/.github/workflows/cpactions.yml @@ -0,0 +1,51 @@ +name: Build (C/P Actions) + +on: [push, pull_request] + +jobs: + freebsd: + runs-on: ubuntu-latest + name: FreeBSD + timeout-minutes: 30 + steps: + - uses: actions/checkout@v4 + - name: Build + uses: cross-platform-actions/action@v0.23.0 + with: + operating_system: freebsd + version: '13.2' + shell: bash + run: | + sudo pkg update + sudo pkg install -y \ + gmake \ + pkgconf \ + libXcursor \ + libXext \ + libXinerama \ + libXi \ + libXfixes \ + libXrandr \ + libXScrnSaver \ + libXxf86vm \ + wayland \ + wayland-protocols \ + libxkbcommon \ + mesa-libs \ + libglvnd \ + evdev-proto \ + libinotify \ + alsa-lib \ + jackit \ + pipewire \ + pulseaudio \ + sndio \ + dbus \ + zh-fcitx \ + ibus \ + libudev-devd + mkdir build_autotools + export CPPFLAGS="-I/usr/local/include" + export LDFLAGS="-L/usr/local/lib" + (cd build_autotools && ../configure --disable-static) + gmake -C build_autotools -j`sysctl -n hw.ncpu` V=1 diff --git a/src/contrib/SDL-2.30.2/.github/workflows/emscripten.yml b/src/contrib/SDL-2.30.2/.github/workflows/emscripten.yml new file mode 100644 index 0000000..ee7974e --- /dev/null +++ b/src/contrib/SDL-2.30.2/.github/workflows/emscripten.yml @@ -0,0 +1,45 @@ +name: Build (Emscripten) + +on: [push, pull_request] + +jobs: + emscripten: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: mymindstorm/setup-emsdk@v14 + with: + version: 3.1.35 + - name: Install ninja + run: | + sudo apt-get -y update + sudo apt-get install -y ninja-build + - name: Configure CMake + run: | + emcmake cmake -S . -B build \ + -DSDL_WERROR=ON \ + -DSDL_TESTS=ON \ + -DSDL_INSTALL_TESTS=ON \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=prefix \ + -GNinja + - name: Build + run: cmake --build build/ --verbose + - name: Run build-time tests + run: | + set -eu + export SDL_TESTS_QUICK=1 + # FIXME: enable Emscripten build time tests + # ctest -VV --test-dir build/ + - name: Install + run: | + echo "SDL2_DIR=$(pwd)/prefix" >> $GITHUB_ENV + cmake --install build/ + - name: Verify CMake configuration files + run: | + emcmake cmake -S cmake/test -B cmake_config_build \ + -DCMAKE_BUILD_TYPE=Release \ + -DSDL_VENDOR_INFO="Github Workflow" \ + -DTEST_SHARED=FALSE \ + -DCMAKE_PREFIX_PATH=${{ env.SDL2_DIR }} + cmake --build cmake_config_build --verbose diff --git a/src/contrib/SDL-2.30.2/.github/workflows/ios.yml b/src/contrib/SDL-2.30.2/.github/workflows/ios.yml new file mode 100644 index 0000000..1eb5735 --- /dev/null +++ b/src/contrib/SDL-2.30.2/.github/workflows/ios.yml @@ -0,0 +1,20 @@ +name: Build (iOS/tvOS) + +on: [push, pull_request] + +jobs: + Build: + name: ${{ matrix.platform.name }} + runs-on: macos-latest + + strategy: + fail-fast: false + matrix: + platform: + - { name: iOS, target: Static Library-iOS, sdk: iphoneos } + - { name: tvOS, target: Static Library-tvOS, sdk: appletvos } + + steps: + - uses: actions/checkout@v4 + - name: Build + run: xcodebuild -project Xcode/SDL/SDL.xcodeproj -target '${{ matrix.platform.target }}' -configuration Release -sdk ${{ matrix.platform.sdk }} clean build \ No newline at end of file diff --git a/src/contrib/SDL-2.30.2/.github/workflows/main.yml b/src/contrib/SDL-2.30.2/.github/workflows/main.yml new file mode 100644 index 0000000..223d404 --- /dev/null +++ b/src/contrib/SDL-2.30.2/.github/workflows/main.yml @@ -0,0 +1,240 @@ +name: Build + +on: [push, pull_request] + +jobs: + Build: + name: ${{ matrix.platform.name }} + runs-on: ${{ matrix.platform.os }} + + defaults: + run: + shell: ${{ matrix.platform.shell }} + + strategy: + fail-fast: false + matrix: + platform: + - { name: Windows (mingw32), os: windows-latest, shell: 'msys2 {0}', msystem: mingw32, msys-env: mingw-w64-i686 } + - { name: Windows (mingw64), os: windows-latest, shell: 'msys2 {0}', msystem: mingw64, msys-env: mingw-w64-x86_64 } + - { name: Windows (clang32), os: windows-latest, shell: 'msys2 {0}', msystem: clang32, msys-env: mingw-w64-clang-i686 } + - { name: Windows (clang64), os: windows-latest, shell: 'msys2 {0}', msystem: clang64, msys-env: mingw-w64-clang-x86_64 } + - { name: Windows (ucrt64), os: windows-latest, shell: 'msys2 {0}', msystem: ucrt64, msys-env: mingw-w64-ucrt-x86_64 } + - { name: Ubuntu 20.04 (CMake), os: ubuntu-20.04, shell: sh } + - { name: Ubuntu 20.04 (autotools), os: ubuntu-20.04, shell: sh, autotools: true } + - { name: Intel oneAPI (Ubuntu 20.04), os: ubuntu-20.04, shell: bash, artifact: 'SDL-ubuntu20.04-oneapi', intel: true, + source_cmd: 'source /opt/intel/oneapi/setvars.sh; export CC=icx; export CXX=icx;'} + - { name: Intel Compiler (Ubuntu 20.04), os: ubuntu-20.04, shell: bash, artifact: 'SDL-ubuntu20.04-icc', intel: true, cmake: '-DSDL_CLANG_TIDY=OFF', + source_cmd: 'source /opt/intel/oneapi/setvars.sh; export CC=icc; export CXX=icpc; export CFLAGS=-diag-disable=10441; export CXXFLAGS=-diag-disable=10441; '} + + - { name: Ubuntu 22.04 (CMake), os: ubuntu-22.04, shell: sh } + - { name: Ubuntu 22.04 (autotools), os: ubuntu-22.04, shell: sh, autotools: true } + - { name: MacOS (CMake), os: macos-latest, shell: sh, cmake: '-DCMAKE_OSX_ARCHITECTURES="x86_64;arm64"' } + - { name: MacOS (autotools), os: macos-latest, shell: sh, autotools: true } + + steps: + - name: Set up MSYS2 + if: matrix.platform.shell == 'msys2 {0}' + uses: msys2/setup-msys2@v2 + with: + msystem: ${{ matrix.platform.msystem }} + install: >- + ${{ matrix.platform.msys-env }}-cc + ${{ matrix.platform.msys-env }}-cmake + ${{ matrix.platform.msys-env }}-ninja + ${{ matrix.platform.msys-env }}-pkg-config + + - name: Setup Linux dependencies + if: runner.os == 'Linux' + run: | + sudo apt-get update + sudo apt-get install build-essential git make autoconf automake libtool \ + pkg-config cmake ninja-build gnome-desktop-testing libasound2-dev libpulse-dev \ + libaudio-dev libjack-dev libsndio-dev libsamplerate0-dev libx11-dev libxext-dev \ + libxrandr-dev libxcursor-dev libxfixes-dev libxi-dev libxss-dev libwayland-dev \ + libxkbcommon-dev libdrm-dev libgbm-dev libgl1-mesa-dev libgles2-mesa-dev \ + libegl1-mesa-dev libdbus-1-dev libibus-1.0-dev libudev-dev fcitx-libs-dev + + - name: Setup extra Ubuntu 22.04 dependencies + if: matrix.platform.os == 'ubuntu-22.04' + run: | + sudo apt-get install libpipewire-0.3-dev libdecor-0-dev + + - name: Setup Macos dependencies + if: runner.os == 'macOS' + run: | + brew install \ + ninja \ + pkg-config + + - name: Setup Intel oneAPI + if: matrix.platform.intel + run: | + # Download the key to system keyring + wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB \ + | gpg --dearmor | sudo tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null + + # Add signed entry to apt sources and configure the APT client to use Intel repository: + echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list + + # Update package list + sudo apt-get update -y + + # Install oneAPI + sudo apt-get install -y intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic + + - uses: actions/checkout@v4 + - name: Check that versioning is consistent + # We only need to run this once: arbitrarily use the Linux/CMake build + if: "runner.os == 'Linux' && ! matrix.platform.autotools" + run: ./build-scripts/test-versioning.sh + - name: Configure (CMake) + if: "! matrix.platform.autotools" + run: | + ${{ matrix.platform.source_cmd }} + cmake -S . -B build -G Ninja \ + -DSDL_TESTS=ON \ + -DSDL_WERROR=ON \ + -DSDL_INSTALL_TESTS=ON \ + -DSDL_VENDOR_INFO="Github Workflow" \ + -DCMAKE_INSTALL_PREFIX=cmake_prefix \ + -DCMAKE_BUILD_TYPE=Release \ + ${{ matrix.platform.cmake }} + - name: Build (CMake) + if: "! matrix.platform.autotools" + run: | + ${{ matrix.platform.source_cmd }} + cmake --build build/ --config Release --verbose --parallel + - name: Run build-time tests (CMake) + if: "! matrix.platform.autotools" + run: | + ${{ matrix.platform.source_cmd }} + set -eu + export SDL_TESTS_QUICK=1 + ctest -VV --test-dir build/ -j2 + if test "${{ runner.os }}" = "Linux"; then + # This should show us the SDL_REVISION + strings build/libSDL2-2.0.so.0 | grep SDL- + fi + - name: Install (CMake) + if: "! matrix.platform.autotools" + run: | + set -eu + cmake --install build/ --config Release + echo "SDL2_DIR=$(pwd)/cmake_prefix" >> $GITHUB_ENV + ( cd cmake_prefix; find ) | LC_ALL=C sort -u + - name: Configure (Autotools) + if: matrix.platform.autotools + run: | + ${{ matrix.platform.source_cmd }} + set -eu + rm -fr build-autotools + mkdir build-autotools + ./autogen.sh + ( + cd build-autotools + ${{ github.workspace }}/configure \ + --enable-vendor-info="Github Workflow" \ + --enable-werror \ + --prefix=${{ github.workspace }}/autotools_prefix \ + ) + if test "${{ runner.os }}" != "macOS" ; then + curdir="$(pwd)" + multiarch="$(dpkg-architecture -qDEB_HOST_MULTIARCH)" + ( + mkdir -p build-autotools/test + cd build-autotools/test + ${{ github.workspace }}/test/configure \ + --enable-werror \ + --x-includes=/usr/include \ + --x-libraries="/usr/lib/${multiarch}" \ + --prefix=${{ github.workspace }}/autotools_prefix \ + SDL_CFLAGS="-I${curdir}/include" \ + SDL_LIBS="-L${curdir}/build-autotools/build/.libs -lSDL2" \ + ac_cv_lib_SDL2_ttf_TTF_Init=no \ + ${NULL+} + ) + fi + - name: Build (Autotools) + if: matrix.platform.autotools + run: | + ${{ matrix.platform.source_cmd }} + set -eu + parallel="$(getconf _NPROCESSORS_ONLN)" + make -j"${parallel}" -C build-autotools V=1 + if test "${{ runner.os }}" != "macOS" ; then + make -j"${parallel}" -C build-autotools/test V=1 + fi + - name: Run build-time tests (Autotools) + if: ${{ matrix.platform.autotools && (runner.os != 'macOS') }} + run: | + ${{ matrix.platform.source_cmd }} + set -eu + curdir="$(pwd)" + parallel="$(getconf _NPROCESSORS_ONLN)" + export SDL_TESTS_QUICK=1 + make -j"${parallel}" -C build-autotools/test check LD_LIBRARY_PATH="${curdir}/build-autotools/build/.libs" + if test "${{ runner.os }}" = "Linux"; then + # This should show us the SDL_REVISION + strings "${curdir}/build-autotools/build/.libs/libSDL2-2.0.so.0" | grep SDL- + fi + - name: Install (Autotools) + if: matrix.platform.autotools + run: | + ${{ matrix.platform.source_cmd }} + set -eu + curdir="$(pwd)" + parallel="$(getconf _NPROCESSORS_ONLN)" + make -j"${parallel}" -C build-autotools install V=1 + if test "${{ runner.os }}" != "macOS" ; then + make -j"${parallel}" -C build-autotools/test install V=1 + fi + ( cd autotools_prefix; find . ) | LC_ALL=C sort -u + echo "SDL2_DIR=$(pwd)/autotools_prefix" >> $GITHUB_ENV + - name: Verify CMake configuration files + run: | + ${{ matrix.platform.source_cmd }} + cmake -S cmake/test -B cmake_config_build -G Ninja \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_PREFIX_PATH=${{ env.SDL2_DIR }} + cmake --build cmake_config_build --verbose + - name: Verify sdl2-config + run: | + ${{ matrix.platform.source_cmd }} + export PATH=${{ env.SDL2_DIR }}/bin:$PATH + cmake/test/test_sdlconfig.sh + - name: Verify sdl2.pc + run: | + ${{ matrix.platform.source_cmd }} + export PKG_CONFIG_PATH=${{ env.SDL2_DIR }}/lib/pkgconfig + cmake/test/test_pkgconfig.sh + - name: Distcheck (Autotools) + if: matrix.platform.autotools + run: | + set -eu + parallel="$(getconf _NPROCESSORS_ONLN)" + make -j"${parallel}" -C build-autotools 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 build-autotools/SDL2-*.tar.gz + ( cd distcheck/SDL2-* && ./configure ) + make -j"${parallel}" -C distcheck/SDL2-* + - name: Run installed-tests (Autotools) + if: "runner.os == 'Linux' && matrix.platform.autotools" + run: | + ${{ matrix.platform.source_cmd }} + set -eu + parallel="$(getconf _NPROCESSORS_ONLN)" + sudo make -j"${parallel}" -C build-autotools install + sudo make -j"${parallel}" -C build-autotools/test install + export SDL_TESTS_QUICK=1 + # We need to set LD_LIBRARY_PATH because it isn't in the default + # linker search path. We don't need to set XDG_DATA_DIRS for + # ginsttest-runner, because /usr/local/share *is* in the default + # search path for that. + env --chdir=/ \ + LD_LIBRARY_PATH=/usr/local/lib \ + SDL_AUDIODRIVER=dummy \ + SDL_VIDEODRIVER=dummy \ + ginsttest-runner --tap SDL2 diff --git a/src/contrib/SDL-2.30.2/.github/workflows/msvc.yml b/src/contrib/SDL-2.30.2/.github/workflows/msvc.yml new file mode 100644 index 0000000..241cc55 --- /dev/null +++ b/src/contrib/SDL-2.30.2/.github/workflows/msvc.yml @@ -0,0 +1,80 @@ +name: Build (MSVC) + +on: [push, pull_request] + +jobs: + Build: + name: ${{ matrix.platform.name }} + runs-on: windows-latest + + strategy: + fail-fast: false + matrix: + platform: + - { name: Windows (x64), flags: -A x64, project: VisualC/SDL.sln, projectflags: '/p:Platform=x64' } + - { name: Windows (x86), flags: -A Win32, project: VisualC/SDL.sln, projectflags: '/p:Platform=Win32' } + - { name: Windows static VCRT (x64), flags: -A x64 -DSDL_FORCE_STATIC_VCRT=ON } + - { name: Windows static VCRT (x86), flags: -A Win32 -DSDL_FORCE_STATIC_VCRT=ON } + - { name: Windows (clang-cl x64), flags: -T ClangCL -A x64 } + - { name: Windows (clang-cl x86), flags: -T ClangCL -A Win32 } + - { name: Windows (ARM), flags: -A ARM } + - { name: Windows (ARM64), flags: -A ARM64 } + - { name: UWP (x64), flags: -A x64 -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION="10.0" -DSDL_TESTS=OFF, nowerror: true, + project: VisualC-WinRT/SDL-UWP.sln, projectflags: '/p:Platform=x64 /p:WindowsTargetPlatformVersion=10.0.17763.0' } + + steps: + - uses: actions/checkout@v4 + - name: Create CMake project using SDL as a subproject + shell: python + run: | + import os + import textwrap + srcdir = r"${{ github.workspace }}".replace("\\", "/") + builddir = f"{ srcdir }/build" + os.makedirs(builddir) + with open(f"{ builddir }/CMakeLists.txt", "w") as f: + f.write(textwrap.dedent(f"""\ + # Always build .PDB symbol file + set(CMAKE_POLICY_DEFAULT_CMP0141 "NEW" CACHE STRING "MSVC debug information format flags are selected by an abstraction") + set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "ProgramDatabase" CACHE STRING "MSVC debug information format") + set(CMAKE_EXE_LINKER_FLAGS "-DEBUG" CACHE STRING "Linker flags for executables") + set(CMAKE_SHARED_LINKER_FLAGS "-DEBUG" CACHE STRING "Linker flag for shared libraries") + cmake_minimum_required(VERSION 3.0...3.25) + project(sdl_user) + enable_testing() + add_subdirectory("{ srcdir }" SDL) + """)) + - name: Configure (CMake) + run: cmake -S build -B build ` + -DSDL_WERROR=${{ !matrix.platform.nowerror }} ` + -DSDL_TESTS=ON ` + -DSDL_INSTALL_TESTS=ON ` + -DSDL_VENDOR_INFO="Github Workflow" ` + -DSDL2_DISABLE_INSTALL=OFF ` + ${{ matrix.platform.flags }} ` + -DCMAKE_INSTALL_PREFIX=prefix + - name: Build (CMake) + run: cmake --build build/ --config Release --parallel + - name: Run build-time tests + if: "! contains(matrix.platform.name, 'ARM')" + run: | + $env:SDL_TESTS_QUICK=1 + ctest -VV --test-dir build/ -C Release -j2 + - name: Install (CMake) + run: | + echo "SDL2_DIR=$Env:GITHUB_WORKSPACE/prefix" >> $Env:GITHUB_ENV + cmake --install build/ + - name: Verify CMake configuration files + if: ${{ !contains(matrix.platform.name, 'UWP') }} # FIXME: cmake/test/CMakeLists.txt should support UWP + run: | + cmake -S cmake/test -B cmake_config_build ` + -DCMAKE_PREFIX_PATH=${{ env.SDL2_DIR }} ` + ${{ matrix.platform.flags }} + cmake --build cmake_config_build --config Release + + - name: Add msbuild to PATH + if: ${{ matrix.platform.project != '' }} + uses: microsoft/setup-msbuild@v2 + - name: Build msbuild + if: ${{ matrix.platform.project != '' }} + run: msbuild ${{ matrix.platform.project }} /m /p:BuildInParallel=true /p:Configuration=Release ${{ matrix.platform.projectflags }} diff --git a/src/contrib/SDL-2.30.2/.github/workflows/n3ds.yml b/src/contrib/SDL-2.30.2/.github/workflows/n3ds.yml new file mode 100644 index 0000000..c7a135a --- /dev/null +++ b/src/contrib/SDL-2.30.2/.github/workflows/n3ds.yml @@ -0,0 +1,55 @@ +name: Build (Nintendo 3DS) + +on: [push, pull_request] + +jobs: + n3ds: + runs-on: ubuntu-latest + container: + image: devkitpro/devkitarm:latest + steps: + - uses: actions/checkout@v4 + - name: Install build requirements + run: | + apt update + apt install ninja-build + - name: Configure CMake + run: | + cmake -S . -B build -G Ninja \ + -DCMAKE_TOOLCHAIN_FILE=${DEVKITPRO}/cmake/3DS.cmake \ + -DSDL_WERROR=ON \ + -DSDL_TESTS=ON \ + -DSDL_INSTALL_TESTS=ON \ + -DSDL_VENDOR_INFO="Github Workflow" \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=prefix + - name: Build + run: cmake --build build --verbose + - name: Install CMake + run: | + echo "SDL2_DIR=$(pwd)/prefix" >> $GITHUB_ENV + cmake --install build/ + ( cd prefix; find ) | LC_ALL=C sort -u + - name: Verify CMake configuration files + run: | + cmake -S cmake/test -B cmake_config_build -G Ninja \ + -DCMAKE_TOOLCHAIN_FILE=${DEVKITPRO}/cmake/3DS.cmake \ + -DTEST_SHARED=FALSE \ + -DCMAKE_PREFIX_PATH=${{ env.SDL2_DIR }} \ + -DCMAKE_BUILD_TYPE=Release + cmake --build cmake_config_build --verbose + - name: Extract CC/CXX/CFLAGS/CXXFLAGS from CMake toolchain + run: | + cmake -S .github/cmake -B /tmp/cmake_extract \ + -DCMAKE_TOOLCHAIN_FILE=${DEVKITPRO}/cmake/3DS.cmake \ + -DCMAKE_BUILD_TYPE=Release \ + -DVAR_PATH=/tmp/n3ds_env.txt + cat /tmp/n3ds_env.txt >> $GITHUB_ENV + - name: Verify sdl2-config + run: | + export PATH=${{ env.SDL2_DIR }}/bin:$PATH + cmake/test/test_sdlconfig.sh + - name: Verify sdl2.pc + run: | + export PKG_CONFIG_PATH=${{ env.SDL2_DIR }}/lib/pkgconfig + cmake/test/test_pkgconfig.sh diff --git a/src/contrib/SDL-2.30.2/.github/workflows/ps2.yaml b/src/contrib/SDL-2.30.2/.github/workflows/ps2.yaml new file mode 100644 index 0000000..2fb97f2 --- /dev/null +++ b/src/contrib/SDL-2.30.2/.github/workflows/ps2.yaml @@ -0,0 +1,73 @@ +name: Build (Sony Playstation 2) + +on: [push, pull_request] + +jobs: + ps2: + runs-on: ubuntu-latest + container: ps2dev/ps2dev:latest + steps: + - uses: actions/checkout@v4 + - name: Setup dependencies + run: | + apk update + apk add cmake gmp mpc1 mpfr4 ninja pkgconf make git + + # To be removed once ps2_drivers is part of PS2DEV + - name: Install ps2_drivers lib + run: | + git clone https://github.com/fjtrujy/ps2_drivers.git + cd ps2_drivers + make -j $(getconf _NPROCESSORS_ONLN) clean + make -j $(getconf _NPROCESSORS_ONLN) + make -j $(getconf _NPROCESSORS_ONLN) install + + - name: Configure (CMake) + run: | + cmake -S . -B build -G Ninja \ + -DCMAKE_TOOLCHAIN_FILE=$PS2DEV/ps2sdk/ps2dev.cmake \ + -DSDL_WERROR=ON \ + -DSDL_TESTS=ON \ + -DCMAKE_INSTALL_PREFIX=cmake_prefix \ + -DCMAKE_BUILD_TYPE=Release + - name: Build + run: cmake --build build --config Release --verbose --parallel + - name: Install (CMake) + run: | + set -eu + cmake --install build/ --config Release + echo "SDL2_DIR=$(pwd)/cmake_prefix" >> $GITHUB_ENV + ( cd cmake_prefix; find ) | LC_ALL=C sort -u + + - name: Verify CMake configuration files + run: | + cmake -S cmake/test -B cmake_config_build -G Ninja \ + -DCMAKE_TOOLCHAIN_FILE=$PS2DEV/ps2sdk/ps2dev.cmake \ + -DTEST_SHARED=FALSE \ + -DCMAKE_PREFIX_PATH=${{ env.SDL2_DIR }} \ + -DCMAKE_BUILD_TYPE=Release + cmake --build cmake_config_build --verbose + - name: Verify sdl2-config + run: | + export CC=mips64r5900el-ps2-elf-gcc + export LDFLAGS="-L$PS2DEV/ps2sdk/ee/lib -L$PS2DEV/gsKit/lib -L$PS2DEV/ps2sdk/ports/lib" + export PATH=${{ env.SDL2_DIR }}/bin:$PATH + cmake/test/test_sdlconfig.sh + - name: Verify sdl2.pc + run: | + export CC=mips64r5900el-ps2-elf-gcc + export LDFLAGS="-L$PS2DEV/ps2sdk/ee/lib -L$PS2DEV/gsKit/lib -L$PS2DEV/ps2sdk/ports/lib" + export PKG_CONFIG_PATH=${{ env.SDL2_DIR }}/lib/pkgconfig + cmake/test/test_pkgconfig.sh + + - name: Get short SHA + id: slug + run: echo "::set-output name=sha8::$(echo ${GITHUB_SHA} | cut -c1-8)" + + - name: Upload artifacts + if: ${{ success() }} + uses: actions/upload-artifact@v3 + with: + name: tests-${{ steps.slug.outputs.sha8 }} + path: | + build/test diff --git a/src/contrib/SDL-2.30.2/.github/workflows/psp.yaml b/src/contrib/SDL-2.30.2/.github/workflows/psp.yaml new file mode 100644 index 0000000..83e5dc3 --- /dev/null +++ b/src/contrib/SDL-2.30.2/.github/workflows/psp.yaml @@ -0,0 +1,50 @@ +name: Build (Sony Playstation Portable) + +on: [push, pull_request] + +jobs: + psp: + runs-on: ubuntu-latest + container: pspdev/pspdev:latest + steps: + - uses: actions/checkout@v4 + - name: Setup dependencies + run: | + apk update + apk add cmake gmp mpc1 mpfr4 make pkgconf + - name: Configure CMake + run: | + cmake -S . -B build \ + -DCMAKE_TOOLCHAIN_FILE=$PSPDEV/psp/share/pspdev.cmake \ + -DSDL_WERROR=ON \ + -DSDL_TESTS=ON \ + -DSDL_INSTALL_TESTS=ON \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=prefix + - name: Build + run: cmake --build build --config Release + - name: Install + run: | + echo "SDL2_DIR=$(pwd)/prefix" >> $GITHUB_ENV + cmake --install build --config Release + ( cd prefix; find ) | LC_ALL=C sort -u + - name: Verify CMake configuration files + run: | + cmake -S cmake/test -B cmake_config_build \ + -DCMAKE_TOOLCHAIN_FILE=$PSPDEV/psp/share/pspdev.cmake \ + -DCMAKE_PREFIX_PATH=${{ env.SDL2_DIR }} \ + -DTEST_SHARED=FALSE \ + -DCMAKE_BUILD_TYPE=Release + cmake --build cmake_config_build --verbose + - name: Verify sdl2-config + run: | + export CC=psp-gcc + export LDFLAGS="-L$PSPDEV/lib -L$PSPDEV/psp/lib -L$PSPDEV/psp/sdk/lib" + export PATH=${{ env.SDL2_DIR }}/bin:$PATH + cmake/test/test_sdlconfig.sh + - name: Verify sdl2.pc + run: | + export CC=psp-gcc + export LDFLAGS="-L$PSPDEV/lib -L$PSPDEV/psp/lib -L$PSPDEV/psp/sdk/lib" + export PKG_CONFIG_PATH=${{ env.SDL2_DIR }}/lib/pkgconfig + cmake/test/test_pkgconfig.sh diff --git a/src/contrib/SDL-2.30.2/.github/workflows/riscos.yml b/src/contrib/SDL-2.30.2/.github/workflows/riscos.yml new file mode 100644 index 0000000..9f4c140 --- /dev/null +++ b/src/contrib/SDL-2.30.2/.github/workflows/riscos.yml @@ -0,0 +1,68 @@ +name: Build (RISC OS) + +on: [push, pull_request] + +jobs: + Build: + name: ${{ matrix.platform.name }} + runs-on: ubuntu-latest + container: riscosdotinfo/riscos-gccsdk-4.7:latest + + strategy: + fail-fast: false + matrix: + platform: + - { name: autotools, test_args: '-DTEST_SHARED=FALSE' } # FIXME: autotools should build and install shared libraries + - { name: CMake } + + steps: + - name: Setup dependencies + run: apt-get update && apt-get install -y cmake ninja-build + - uses: actions/checkout@v4 + - name: Configure (autotools) + if: ${{ contains(matrix.platform.name, 'autotools') }} + run: | + mkdir build_autotools + cd build_autotools + ../configure \ + --host=arm-unknown-riscos \ + --disable-gcc-atomics \ + --prefix=${{ github.workspace }}/prefix_autotools + - name: Build (autotools) + if: ${{ contains(matrix.platform.name, 'autotools') }} + run: make -C build_autotools -j`nproc` V=1 + - name: Install (autotools) + if: ${{ contains(matrix.platform.name, 'autotools') }} + run: | + echo "SDL2_DIR=${{ github.workspace }}/prefix_autotools" >> $GITHUB_ENV + make -C build_autotools install + ( cd ${{ github.workspace }}/prefix_autotools; find ) | LC_ALL=C sort -u + - name: Configure (CMake) + if: ${{ contains(matrix.platform.name, 'CMake') }} + run: | + cmake -S . -B build -G Ninja \ + -DCMAKE_TOOLCHAIN_FILE=/home/riscos/env/toolchain-riscos.cmake \ + -DRISCOS=ON \ + -DSDL_GCC_ATOMICS=OFF \ + -DSDL_TESTS=ON \ + -DSDL_INSTALL_TESTS=ON \ + -DSDL_VENDOR_INFO="Github Workflow" \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/prefix_cmake + - name: Build (CMake) + if: ${{ contains(matrix.platform.name, 'CMake') }} + run: cmake --build build --verbose + - name: Install (CMake) + if: ${{ contains(matrix.platform.name, 'CMake') }} + run: | + echo "SDL2_DIR=${{ github.workspace }}/prefix_cmake" >> $GITHUB_ENV + cmake --install build/ + ( cd ${{ github.workspace }}/prefix_cmake; find ) | LC_ALL=C sort -u + - name: Verify CMake configuration files + run: | + cmake -S cmake/test -B cmake_config_build -G Ninja \ + -DCMAKE_TOOLCHAIN_FILE=/home/riscos/env/toolchain-riscos.cmake \ + -DCMAKE_PREFIX_PATH=${{ env.SDL2_DIR }} \ + -DCMAKE_BUILD_TYPE=Release \ + ${{ matrix.platform.test_args }} + cmake --build cmake_config_build --verbose diff --git a/src/contrib/SDL-2.30.2/.github/workflows/vita.yaml b/src/contrib/SDL-2.30.2/.github/workflows/vita.yaml new file mode 100644 index 0000000..8089408 --- /dev/null +++ b/src/contrib/SDL-2.30.2/.github/workflows/vita.yaml @@ -0,0 +1,95 @@ +name: Build (Sony Playstation Vita) + +on: [push, pull_request] + +defaults: + run: + shell: sh + +jobs: + vita: + name: ${{ matrix.platform.name }} + runs-on: ubuntu-latest + container: + image: vitasdk/vitasdk:latest + strategy: + fail-fast: false + matrix: + platform: + - { name: GLES (pib), os: windows-latest, pib: true } + - { name: GLES (PVR_PSP2 + gl4es4vita), os: windows-latest, pvr: true } + steps: + - uses: actions/checkout@v4 + - name: Install build requirements + run: | + apk update + apk add cmake ninja pkgconf bash + + - name: Configure PVR_PSP2 (GLES) + if: ${{ !!matrix.platform.pvr }} + run: | + pvr_psp2_version=3.9 + + # Configure PVR_PSP2 headers + wget https://github.com/GrapheneCt/PVR_PSP2/archive/refs/tags/v$pvr_psp2_version.zip -P/tmp + unzip /tmp/v$pvr_psp2_version.zip -d/tmp + cp -r /tmp/PVR_PSP2-$pvr_psp2_version/include/* ${VITASDK}/arm-vita-eabi/include + rm /tmp/v$pvr_psp2_version.zip + + # Configure PVR_PSP2 stub libraries + wget https://github.com/GrapheneCt/PVR_PSP2/releases/download/v$pvr_psp2_version/vitasdk_stubs.zip -P/tmp + unzip /tmp/vitasdk_stubs.zip -d/tmp/pvr_psp2_stubs + find /tmp/pvr_psp2_stubs -type f -name "*.a" -exec cp {} ${VITASDK}/arm-vita-eabi/lib \; + rm /tmp/vitasdk_stubs.zip + rm -rf /tmp/pvr_psp2_stubs + + - name: Configure gl4es4vita (OpenGL) + if: ${{ !!matrix.platform.pvr }} + run: | + gl4es4vita_version=1.1.4 + + # Configure gl4es4vita headers + wget https://github.com/SonicMastr/gl4es4vita/releases/download/v$gl4es4vita_version-vita/include.zip -P/tmp + unzip -o /tmp/include.zip -d${VITASDK}/arm-vita-eabi/include + rm /tmp/include.zip + + # Configure gl4es4vita stub libraries + wget https://github.com/SonicMastr/gl4es4vita/releases/download/v$gl4es4vita_version-vita/vitasdk_stubs.zip -P/tmp + unzip /tmp/vitasdk_stubs.zip -d${VITASDK}/arm-vita-eabi/lib + + - name: Configure CMake + run: | + cmake -S . -B build -G Ninja \ + -DCMAKE_TOOLCHAIN_FILE=${VITASDK}/share/vita.toolchain.cmake \ + -DVIDEO_VITA_PIB=${{ !!matrix.platform.pib }} \ + -DVIDEO_VITA_PVR=${{ !!matrix.platform.pvr }} \ + -DSDL_WERROR=ON \ + -DSDL_TESTS=ON \ + -DSDL_INSTALL_TESTS=ON \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=prefix + - name: Build + run: cmake --build build --verbose + - name: Install CMake + run: | + echo "SDL2_DIR=$(pwd)/prefix" >> $GITHUB_ENV + cmake --install build/ + ( cd prefix; find ) | LC_ALL=C sort -u + - name: Verify CMake configuration files + run: | + cmake -S cmake/test -B cmake_config_build -G Ninja \ + -DCMAKE_TOOLCHAIN_FILE=${VITASDK}/share/vita.toolchain.cmake \ + -DTEST_SHARED=FALSE \ + -DCMAKE_PREFIX_PATH=${{ env.SDL2_DIR }} \ + -DCMAKE_BUILD_TYPE=Release + cmake --build cmake_config_build --verbose + - name: Verify sdl2-config + run: | + export CC=arm-vita-eabi-gcc + export PATH=${{ env.SDL2_DIR }}/bin:$PATH + cmake/test/test_sdlconfig.sh + - name: Verify sdl2.pc + run: | + export CC=arm-vita-eabi-gcc + export PKG_CONFIG_PATH=${{ env.SDL2_DIR }}/lib/pkgconfig + cmake/test/test_pkgconfig.sh diff --git a/src/contrib/SDL-2.30.2/.github/workflows/watcom.yml b/src/contrib/SDL-2.30.2/.github/workflows/watcom.yml new file mode 100644 index 0000000..a79cc96 --- /dev/null +++ b/src/contrib/SDL-2.30.2/.github/workflows/watcom.yml @@ -0,0 +1,35 @@ +name: Build (OpenWatcom) + +on: [push, pull_request] + +jobs: + os2: + name: ${{ matrix.platform.name }} + runs-on: windows-latest + + strategy: + matrix: + platform: + - { name: Windows, makefile: Makefile.w32 } + - { name: OS/2, makefile: Makefile.os2 } + + steps: + - uses: actions/checkout@v4 + - uses: open-watcom/setup-watcom@v0 + - name: Build SDL2 + run: | + wmake -f ${{ matrix.platform.makefile }} ENABLE_WERROR=1 + - name: Build tests + run: | + cd test && wmake -f ${{ matrix.platform.makefile }} ENABLE_WERROR=1 + cd .. + - name: Run tests + if: "matrix.platform.makefile == 'Makefile.w32'" + run: | + cd test && wmake -f ${{ matrix.platform.makefile }} check-quick + cd .. + - name: distclean + run: | + wmake -f ${{ matrix.platform.makefile }} distclean + cd test && wmake -f ${{ matrix.platform.makefile }} distclean + cd .. -- cgit v1.2.3