Compare commits

...

89 Commits

Author SHA1 Message Date
Mary Guillemard
d50837c46b
Update version to 2.30.0
Forgot to increment it before release oh well...
2024-02-06 23:39:55 +01:00
github-actions[bot]
caa502a393
Update linux-arm64 SDL binaries (#158)
Co-authored-by: marysaka <marysaka@users.noreply.github.com>
2024-02-06 23:19:34 +01:00
github-actions[bot]
71ec99d676
Update osx-arm64 SDL binaries (#157)
Co-authored-by: marysaka <marysaka@users.noreply.github.com>
2024-02-06 23:19:27 +01:00
github-actions[bot]
7389c35176
Update osx-x64 SDL binaries (#156)
Co-authored-by: marysaka <marysaka@users.noreply.github.com>
2024-02-06 23:19:20 +01:00
github-actions[bot]
14e19b5164
Update win-x64 SDL binaries (#155)
Co-authored-by: marysaka <marysaka@users.noreply.github.com>
2024-02-06 23:18:47 +01:00
github-actions[bot]
038059ecc9
Update win-arm64 SDL binaries (#154)
Co-authored-by: marysaka <marysaka@users.noreply.github.com>
2024-02-06 23:18:41 +01:00
github-actions[bot]
b42777f4d3
Update iOS SDL binaries (#153)
Co-authored-by: marysaka <marysaka@users.noreply.github.com>
2024-02-06 23:18:35 +01:00
github-actions[bot]
82c0c38477
Update linux-x64 SDL binaries (#152)
Co-authored-by: marysaka <marysaka@users.noreply.github.com>
2024-02-06 23:18:29 +01:00
Mary Guillemard
c66a752bf5 Add linux-arm64 in csproj
Signed-off-by: Mary Guillemard <mary@mary.zone>
2024-02-06 22:48:29 +01:00
Mary Guillemard
2402c1a0db Enable linux-arm64 in CI
Signed-off-by: Mary Guillemard <mary@mary.zone>
2024-02-06 20:52:14 +01:00
Mary Guillemard
275e67ad11 Move build operation to a bash script
This greatly simplify the action and prepare for building for other archs.

Signed-off-by: Mary Guillemard <mary@mary.zone>
2024-02-06 20:10:42 +01:00
Mary Guillemard
70a111cbb6 Respect workflow argument for iOS
Signed-off-by: Mary Guillemard <mary@mary.zone>
2024-02-06 19:41:53 +01:00
TSRBerry
8f286bb048
Update version to 2.28.3 2023-10-20 16:16:33 +02:00
TSR Berry
e96d39d94b
Merge remote-tracking branches 'origin/update-ios-binaries', 'origin/update-linux-x64-binaries', 'origin/update-win-x64-binaries', 'origin/update-win-arm64-binaries', 'origin/update-osx-arm64-binaries' and 'origin/update-osx-x64-binaries' 2023-09-23 20:01:28 +02:00
TSR Berry
a389f319ce
Add note about commit sha to workflow input 2023-09-23 19:59:24 +02:00
TSRBerry
ce6acac60e Update osx-x64 SDL binaries 2023-09-23 17:57:58 +00:00
TSRBerry
3547f466d7 Update osx-arm64 SDL binaries 2023-09-23 17:57:49 +00:00
TSRBerry
4251b252ed Update iOS SDL binaries 2023-09-23 17:57:22 +00:00
TSRBerry
7f231ea460 Update win-arm64 SDL binaries 2023-09-23 17:56:41 +00:00
TSRBerry
802dd6f15a Update win-x64 SDL binaries 2023-09-23 17:56:35 +00:00
TSRBerry
68ab08e264 Update linux-x64 SDL binaries 2023-09-23 17:55:34 +00:00
TSR Berry
df777874bc
Update actions 2023-09-23 19:46:13 +02:00
TSR Berry
232018f03e
Add dependabot.yml 2023-09-23 19:45:52 +02:00
github-actions[bot]
95f9c5c73a
Update osx-x64 SDL binaries (#145)
Co-authored-by: marysaka <marysaka@users.noreply.github.com>
2023-07-14 10:19:39 +02:00
github-actions[bot]
077f5e5171
Update win-x64 SDL binaries (#144)
Co-authored-by: marysaka <marysaka@users.noreply.github.com>
2023-07-14 10:19:31 +02:00
github-actions[bot]
6fa4edcdc4
Update osx-arm64 SDL binaries (#143)
Co-authored-by: marysaka <marysaka@users.noreply.github.com>
2023-07-14 10:19:23 +02:00
github-actions[bot]
aa545e727a
Update win-arm64 SDL binaries (#142)
Co-authored-by: marysaka <marysaka@users.noreply.github.com>
2023-07-14 10:19:14 +02:00
github-actions[bot]
f4681ebf95
Update linux-x64 SDL binaries (#141)
Co-authored-by: marysaka <marysaka@users.noreply.github.com>
2023-07-14 10:18:25 +02:00
github-actions[bot]
161373c455
Update iOS SDL binaries (#140)
Co-authored-by: marysaka <marysaka@users.noreply.github.com>
2023-07-14 10:18:16 +02:00
Mary
4e470dba41 Update metadata to 2.28.1 2023-07-14 09:31:36 +02:00
TSR Berry
9af6bb8fe8
Update metadata to 2.28.0 2023-07-05 15:50:46 +02:00
TSRBerry
172acaa08d
Update win-x64 SDL binaries 2023-07-05 15:50:46 +02:00
TSRBerry
7ca43ee88c
Update win-arm64 SDL binaries 2023-07-05 15:50:46 +02:00
TSRBerry
497d929939
Update osx-x64 SDL binaries 2023-07-05 15:50:46 +02:00
TSRBerry
54cb2e08c7
Update osx-arm64 SDL binaries 2023-07-05 15:50:46 +02:00
TSRBerry
ce3bfab43c
Update linux-x64 SDL binaries 2023-07-05 15:50:46 +02:00
TSRBerry
6bd29ff214
Update iOS SDL binaries 2023-07-05 15:50:45 +02:00
Mary
b6e8330d71
Introduce needed changes for Ryujinx's fork 2023-07-05 15:50:34 +02:00
Dean Herbert
b4c039993e Merge remote-tracking branch 'upstream/update-win-x86-binaries' 2023-05-21 12:50:01 +09:00
Dean Herbert
832a10c772 Merge remote-tracking branch 'upstream/update-win-x64-binaries' 2023-05-21 12:50:00 +09:00
Dean Herbert
740c7a8f87 Merge remote-tracking branch 'upstream/update-win-arm64-binaries' 2023-05-21 12:49:59 +09:00
Dean Herbert
4d2270aa86 Merge remote-tracking branch 'upstream/update-osx-x64-binaries' 2023-05-21 12:49:58 +09:00
Dean Herbert
d046b2f2c1 Merge remote-tracking branch 'upstream/update-osx-arm64-binaries' 2023-05-21 12:49:57 +09:00
Dean Herbert
d0361d0e73 Merge remote-tracking branch 'upstream/update-linux-x86-binaries' 2023-05-21 12:49:55 +09:00
Dean Herbert
5dc54d80a0 Merge remote-tracking branch 'upstream/update-linux-x64-binaries' 2023-05-21 12:49:54 +09:00
peppy
2428ad15be Update osx-arm64 SDL binaries 2023-05-21 03:44:23 +00:00
peppy
45535693a6 Update linux-x86 SDL binaries 2023-05-21 03:42:36 +00:00
peppy
bccb6a3136 Update osx-x64 SDL binaries 2023-05-21 03:42:27 +00:00
peppy
fc8ed7005b Update win-x86 SDL binaries 2023-05-21 03:41:50 +00:00
peppy
2ec5b46232 Update win-x64 SDL binaries 2023-05-21 03:41:41 +00:00
peppy
eb9f81ac25 Update win-arm64 SDL binaries 2023-05-21 03:41:13 +00:00
peppy
2b1c66c7eb Update iOS SDL binaries 2023-05-21 03:40:33 +00:00
peppy
16ec96817c Update linux-x64 SDL binaries 2023-05-21 03:40:27 +00:00
Dean Herbert
9b92aed4b4 Merge remote-tracking branch 'upstream/update-win-x86-binaries' 2023-03-08 18:44:04 +09:00
Dean Herbert
a730d16076 Merge remote-tracking branch 'upstream/update-win-x64-binaries' 2023-03-08 18:44:03 +09:00
Dean Herbert
f0bef1b9c3 Merge remote-tracking branch 'upstream/update-win-arm64-binaries' 2023-03-08 18:44:03 +09:00
Dean Herbert
556cd552dd Merge remote-tracking branch 'upstream/update-osx-x64-binaries' 2023-03-08 18:44:00 +09:00
Dean Herbert
d2e0088381 Merge remote-tracking branch 'upstream/update-osx-arm64-binaries' 2023-03-08 18:43:59 +09:00
Dean Herbert
aa80fe5791 Merge remote-tracking branch 'upstream/update-linux-x86-binaries' 2023-03-08 18:43:56 +09:00
Dean Herbert
4969c7f3fe Merge remote-tracking branch 'upstream/update-linux-x64-binaries' 2023-03-08 18:43:55 +09:00
peppy
658f11e526 Update win-x86 SDL binaries 2023-03-08 09:24:32 +00:00
peppy
ecbe28799d Update osx-x64 SDL binaries 2023-03-08 09:23:22 +00:00
peppy
da916a88d5 Update osx-arm64 SDL binaries 2023-03-08 09:23:15 +00:00
peppy
09f36bcf76 Update win-x64 SDL binaries 2023-03-08 09:23:09 +00:00
peppy
07df446ec8 Update win-arm64 SDL binaries 2023-03-08 09:22:55 +00:00
peppy
3d22cd7cb9 Update linux-x86 SDL binaries 2023-03-08 09:22:54 +00:00
peppy
00c73365df Update linux-x64 SDL binaries 2023-03-08 09:21:38 +00:00
peppy
a30ddefbaf Update iOS SDL binaries 2023-03-08 09:21:10 +00:00
Dean Herbert
32913b2335
Merge pull request #152 from frenzibyte/ios-build
Add iOS platform support
2023-03-08 18:18:18 +09:00
Dean Herbert
903eebdec4
Remove one unnecessary mkdir invocation 2023-03-08 18:13:40 +09:00
Salman Ahmed
2519332ce6 Bump AppVeyor image 2023-03-08 11:59:01 +03:00
Salman Ahmed
e07402105e Bump projects to .NET 6 and add DllImport resolver for iOS 2023-03-08 11:51:55 +03:00
Salman Ahmed
98a238fe07 Include native iOS libraries in package 2023-03-08 11:51:03 +03:00
Salman Ahmed
f6cf0b57d1 Add iOS build action 2023-03-08 10:58:00 +03:00
Dean Herbert
7e10ed6133 Merge remote-tracking branch 'upstream/update-win-x86-binaries' 2022-12-12 02:36:36 +09:00
Dean Herbert
3ec97c0015 Merge remote-tracking branch 'upstream/update-win-x64-binaries' 2022-12-12 02:36:35 +09:00
Dean Herbert
d00aabdc2f Merge remote-tracking branch 'upstream/update-win-arm64-binaries' 2022-12-12 02:36:34 +09:00
Dean Herbert
429dca2440 Merge remote-tracking branch 'upstream/update-osx-x64-binaries' 2022-12-12 02:36:34 +09:00
Dean Herbert
0b373076f6 Merge remote-tracking branch 'upstream/update-osx-arm64-binaries' 2022-12-12 02:36:33 +09:00
Dean Herbert
0f4a522842 Merge remote-tracking branch 'upstream/update-linux-x86-binaries' 2022-12-12 02:36:32 +09:00
peppy
b11bffacf6 Update osx-x64 SDL binaries 2022-12-11 17:33:40 +00:00
peppy
fdae20ed32 Update osx-arm64 SDL binaries 2022-12-11 17:31:15 +00:00
peppy
9dd06c9aa7 Update linux-x64 SDL binaries 2022-12-11 17:31:06 +00:00
peppy
3de7aae105 Update win-x86 SDL binaries 2022-12-11 17:29:51 +00:00
peppy
aa6c6691d1 Update linux-x86 SDL binaries 2022-12-11 17:29:48 +00:00
peppy
356c96c4b4 Update win-x64 SDL binaries 2022-12-11 17:29:46 +00:00
peppy
d5c82b3874 Update win-arm64 SDL binaries 2022-12-11 17:29:27 +00:00
Dean Herbert
0fc27053cd Switch to checkout@v3 2022-12-12 02:26:22 +09:00
Dean Herbert
7b7046588d Lock to SDL2 branch for now 2022-12-12 02:08:25 +09:00
21 changed files with 314 additions and 97 deletions

9
.github/dependabot.yml vendored Normal file
View File

@ -0,0 +1,9 @@
version: 2
updates:
- directory: /
package-ecosystem: github-actions
reviewers:
- marysaka
- TSRBerry
schedule:
interval: daily

View File

@ -1,7 +1,10 @@
name: build-native
on:
workflow_dispatch:
inputs: {}
inputs:
rev:
description: 'Ryujinx/SDL commit to build (this has to be a full commit sha, otherwise it will not work)'
required: true
# schedule:
# - cron: '0 0 * * *'
env:
@ -15,94 +18,33 @@ jobs:
fail-fast: false
matrix:
platform:
- { name: win-x64, os: windows-latest, flags: -A x64 }
- { name: win-x86, os: windows-latest, flags: -A Win32 }
- { name: win-arm64, os: windows-latest, flags: -A ARM64 }
- { name: linux-x64, os: ubuntu-20.04, flags: -GNinja, target_apt_arch: ":amd64" }
- { name: linux-x86, os: ubuntu-20.04, flags: -GNinja, cmake_configure_env: CFLAGS=-m32 CXXFLAGS=-m32, target_apt_arch: ":i386" }
- { name: osx-x64, os: macos-latest, flags: -DCMAKE_OSX_ARCHITECTURES="x86_64" -DCMAKE_OSX_DEPLOYMENT_TARGET="10.14" }
# NOTE: macOS 11.0 is the first released supported by Apple Silicon.
- { name: osx-arm64, os: macos-latest, flags: -DCMAKE_OSX_ARCHITECTURES="arm64" -DCMAKE_OSX_DEPLOYMENT_TARGET="11.0" }
- { name: win-x64, os: windows-latest, arch: x64 }
# - { name: win-x86, os: windows-latest, arch: Win32 }
- { name: win-arm64, os: windows-latest, arch: ARM64 }
- { name: linux-x64, os: ubuntu-20.04, arch: amd64 }
# - { name: linux-x86, os: ubuntu-20.04, arch: i386 }
- { name: linux-arm64, os: ubuntu-20.04, arch: arm64 }
- { name: osx-x64, os: macos-latest, arch: x86_64 }
- { name: osx-arm64, os: macos-latest, arch: arm64 }
steps:
- name: Setup Linux dependencies
- name: Setup qemu static
uses: docker/setup-qemu-action@v3
if: runner.os == 'Linux'
run: |
if [[ ${{ matrix.platform.target_apt_arch }} == :i386 ]]; then
sudo dpkg --add-architecture i386
fi
sudo apt-get update -y -qq
if [[ ${{ matrix.platform.target_apt_arch }} == :i386 ]]; then
# Workaround GitHub's ubuntu-20.04 image issue <https://github.com/actions/virtual-environments/issues/4589>
sudo apt-get install -y --allow-downgrades libpcre2-8-0=10.34-7
fi
sudo apt-get install -y \
gcc-multilib \
g++-multilib \
cmake \
ninja-build \
wayland-scanner++ \
wayland-protocols \
pkg-config${{ matrix.platform.target_apt_arch }} \
libasound2-dev${{ matrix.platform.target_apt_arch }} \
libdbus-1-dev${{ matrix.platform.target_apt_arch }} \
libegl1-mesa-dev${{ matrix.platform.target_apt_arch }} \
libgl1-mesa-dev${{ matrix.platform.target_apt_arch }} \
libgles2-mesa-dev${{ matrix.platform.target_apt_arch }} \
libglu1-mesa-dev${{ matrix.platform.target_apt_arch }} \
libibus-1.0-dev${{ matrix.platform.target_apt_arch }} \
libpulse-dev${{ matrix.platform.target_apt_arch }} \
libsdl2-2.0-0${{ matrix.platform.target_apt_arch }} \
libsndio-dev${{ matrix.platform.target_apt_arch }} \
libudev-dev${{ matrix.platform.target_apt_arch }} \
libwayland-dev${{ matrix.platform.target_apt_arch }} \
libx11-dev${{ matrix.platform.target_apt_arch }} \
libxcursor-dev${{ matrix.platform.target_apt_arch }} \
libxext-dev${{ matrix.platform.target_apt_arch }} \
libxi-dev${{ matrix.platform.target_apt_arch }} \
libxinerama-dev${{ matrix.platform.target_apt_arch }} \
libxkbcommon-dev${{ matrix.platform.target_apt_arch }} \
libxrandr-dev${{ matrix.platform.target_apt_arch }} \
libxss-dev${{ matrix.platform.target_apt_arch }} \
libxt-dev${{ matrix.platform.target_apt_arch }} \
libxv-dev${{ matrix.platform.target_apt_arch }} \
libxxf86vm-dev${{ matrix.platform.target_apt_arch }} \
libdrm-dev${{ matrix.platform.target_apt_arch }} \
libgbm-dev${{ matrix.platform.target_apt_arch }} \
libpulse-dev${{ matrix.platform.target_apt_arch }}
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
repository: libsdl-org/SDL
- uses: actions/checkout@v2
repository: Ryujinx/SDL
ref: ${{ github.event.inputs.rev }}
- uses: actions/checkout@v4
with:
path: 'SDL2-CS'
- name: Configure CMake
run: ${{ matrix.platform.cmake_configure_env }} cmake -B build ${{ matrix.platform.flags }} -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DSDL_SHARED_ENABLED_BY_DEFAULT=ON -DSDL_STATIC_ENABLED_BY_DEFAULT=ON
- name: Build
run: cmake --build build/ --config Release
- name: Install (Windows)
run: cmake --install build/ --prefix install_output --config Release
if: runner.os == 'Windows'
- name: Install
run: sudo cmake --install build/ --prefix install_output --config Release
if: runner.os != 'Windows'
- name: Prepare release directory (Windows)
run: mkdir -Force SDL2-CS/native/${{ matrix.platform.name }}
if: runner.os == 'Windows'
- name: Prepare release directory
run: mkdir -p SDL2-CS/native/${{ matrix.platform.name }}
if: runner.os != 'Windows'
- name: Prepare release (Windows)
run: cp install_output/bin/SDL2.dll SDL2-CS/native/${{ matrix.platform.name }}/SDL2.dll
if: runner.os == 'Windows'
- name: Prepare release (Linux)
run: cp install_output/lib/libSDL2-2.0.so.0 SDL2-CS/native/${{ matrix.platform.name }}/libSDL2.so
if: runner.os == 'Linux'
- name: Prepare release (OSX)
run: cp install_output/lib/libSDL2-2.0.dylib SDL2-CS/native/${{ matrix.platform.name }}/libSDL2.dylib
if: runner.os == 'macOS'
- name: Build and prepare release
run: SDL2-CS/ci/run.sh $PWD $PWD/SDL2-CS/native/${{ matrix.platform.name }} ${{ matrix.platform.arch }}
shell: bash
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.platform.name }}-binaries
path: install_output
- name: Create pull request
uses: peter-evans/create-pull-request@v4
with:
@ -113,3 +55,38 @@ jobs:
path: 'SDL2-CS'
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
build-ios:
name: ios
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
with:
repository: Ryujinx/SDL
ref: ${{ github.event.inputs.rev }}
- uses: actions/checkout@v4
with:
path: 'SDL2-CS'
- name: Build (iOS)
run: xcodebuild -project Xcode/SDL/SDL.xcodeproj -scheme xcFramework-iOS -configuration Release
- name: Prepare release directory (iOS)
run: mkdir -p SDL2-CS/native/ios
- name: Prepare release (iOS)
run: |
mkdir -p SDL2-CS/native/ios/SDL2.xcframework/ios-arm64/SDL2.framework;
mkdir -p SDL2-CS/native/ios/SDL2.xcframework/ios-arm64_x86_64-simulator/SDL2.framework;
cp Xcode/SDL/Products/SDL2.xcframework/Info.plist SDL2-CS/native/ios/SDL2.xcframework/Info.plist;
cp Xcode/SDL/Products/SDL2.xcframework/ios-arm64/SDL2.framework/SDL2 SDL2-CS/native/ios/SDL2.xcframework/ios-arm64/SDL2.framework/SDL2;
cp Xcode/SDL/Products/SDL2.xcframework/ios-arm64/SDL2.framework/Info.plist SDL2-CS/native/ios/SDL2.xcframework/ios-arm64/SDL2.framework/Info.plist;
cp Xcode/SDL/Products/SDL2.xcframework/ios-arm64_x86_64-simulator/SDL2.framework/SDL2 SDL2-CS/native/ios/SDL2.xcframework/ios-arm64_x86_64-simulator/SDL2.framework/SDL2;
cp Xcode/SDL/Products/SDL2.xcframework/ios-arm64_x86_64-simulator/SDL2.framework/Info.plist SDL2-CS/native/ios/SDL2.xcframework/ios-arm64_x86_64-simulator/SDL2.framework/Info.plist;
- name: Create pull request
uses: peter-evans/create-pull-request@v4
with:
commit-message: Update iOS SDL binaries
title: Update iOS SDL binaries
body: This PR has been auto-genereated to update the iOS SDL binaries
branch: update-ios-binaries
path: 'SDL2-CS'
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'

34
.github/workflows/ci.yml vendored Normal file
View File

@ -0,0 +1,34 @@
name: Build
on:
workflow_dispatch:
inputs: {}
#push:
# branches: [ master ]
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
- uses: nuget/setup-nuget@v1
with:
nuget-api-key: ${{ secrets.NUGET_API_KEY }}
nuget-version: '6.x'
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Test
run: dotnet test --no-build --verbosity normal
- name: Pack & Publish
run: |
dotnet pack --version-suffix "build${{ github.run_number }}" -c Release .\SDL2-CS.csproj -o .
$file_to_publish = Get-ChildItem -Path $dir -Filter *.nupkg | Select -First 1
echo $file_to_publish
nuget push $file_to_publish -Source https://api.nuget.org/v3/index.json

View File

@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<OutputType>Library</OutputType>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<AssemblyTitle>SDL2#</AssemblyTitle>
@ -8,13 +8,14 @@
<Description>libSDL2 bindings for C#</Description>
<RootNamespace>SDL2</RootNamespace>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<VersionPrefix>2.30.0</VersionPrefix>
</PropertyGroup>
<PropertyGroup Label="NuGet">
<Authors>ppy Pty Ltd &amp; flibitijibibo</Authors>
<Authors>marysaka &amp; ppy Pty Ltd &amp; flibitijibibo</Authors>
<Title>SDL2#</Title>
<PackageId>ppy.SDL2-CS</PackageId>
<PackageProjectUrl>https://github.com/ppy/SDL2-CS</PackageProjectUrl>
<RepositoryUrl>https://github.com/ppy/SDL2-CS</RepositoryUrl>
<PackageId>Ryujinx.SDL2-CS</PackageId>
<PackageProjectUrl>https://github.com/Ryujinx/SDL2-CS</PackageProjectUrl>
<RepositoryUrl>https://github.com/Ryujinx/SDL2-CS</RepositoryUrl>
</PropertyGroup>
<ItemGroup>
<Content Include="$(MSBuildThisFileDirectory)native\win-x64\SDL2.dll">
@ -27,11 +28,6 @@
<PackagePath>runtimes/win-arm64/native</PackagePath>
<Pack>true</Pack>
</Content>
<Content Include="$(MSBuildThisFileDirectory)native\win-x86\SDL2.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<PackagePath>runtimes/win-x86/native</PackagePath>
<Pack>true</Pack>
</Content>
<Content Include="$(MSBuildThisFileDirectory)native\osx-x64\libSDL2.dylib">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<PackagePath>runtimes/osx-x64/native</PackagePath>
@ -47,9 +43,14 @@
<PackagePath>runtimes/linux-x64/native</PackagePath>
<Pack>true</Pack>
</Content>
<Content Include="$(MSBuildThisFileDirectory)native\linux-x86\libSDL2.so">
<Content Include="$(MSBuildThisFileDirectory)native\linux-arm64\libSDL2.so">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<PackagePath>runtimes/linux-x86/native</PackagePath>
<PackagePath>runtimes/linux-arm64/native</PackagePath>
<Pack>true</Pack>
</Content>
<Content Include="$(MSBuildThisFileDirectory)native\ios\**\*">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<PackagePath>runtimes/ios/native</PackagePath>
<Pack>true</Pack>
</Content>
</ItemGroup>

View File

@ -1,4 +1,4 @@
image: Visual Studio 2017
image: Visual Studio 2022
build_script:
- cmd: dotnet restore
- cmd: dotnet pack SDL2-CS.csproj -c:Release --include-symbols /p:Version=%APPVEYOR_BUILD_VERSION%

109
ci/compile.sh Executable file
View File

@ -0,0 +1,109 @@
#!/bin/bash
set -e
if [ "$#" -le 1 ]; then
echo "usage: <sdl_dir> <output_path> [build_arch]"
exit 1
fi
uname_system="$(uname -s)"
case "${uname_system}" in
Linux*) system_name=linux;;
Darwin*) system_name=macos;;
CYGWIN*) system_name=win;;
MINGW*) system_name=win;;
*) system_name="Unknown OS: ${uname_system}"
esac
export DEBIAN_FRONTEND=noninteractive
sdl_dir=$1
output_path=$2
build_arch=$3
mkdir -p $output_path
if [ -z "$3" ]; then
if [ $system_name == "linux" ]; then
build_arch=$(dpkg --print-architecture)
else
echo "ERROR - build_arch parameter needed on macOS and Windows"
exit 1
fi
fi
if command -v sudo &> /dev/null
then
SUDO=sudo
fi
if [[ $system_name == "linux" ]]; then
if [[ $build_arch == "i386" ]]; then
sudo dpkg --add-architecture i386
export CFLAGS=-m32
export CXXFLAGS=-m32
fi
$SUDO apt-get update -y
$SUDO apt-get install -y \
build-essential \
cmake \
ninja-build \
wayland-scanner++ \
wayland-protocols \
pkg-config:$build_arch \
libasound2-dev:$build_arch \
libdbus-1-dev:$build_arch \
libegl1-mesa-dev:$build_arch \
libgl1-mesa-dev:$build_arch \
libgles2-mesa-dev:$build_arch \
libglu1-mesa-dev:$build_arch \
libibus-1.0-dev:$build_arch \
libpulse-dev:$build_arch \
libsdl2-2.0-0:$build_arch \
libsndio-dev:$build_arch \
libudev-dev:$build_arch \
libwayland-dev:$build_arch \
libx11-dev:$build_arch \
libxcursor-dev:$build_arch \
libxext-dev:$build_arch \
libxi-dev:$build_arch \
libxinerama-dev:$build_arch \
libxkbcommon-dev:$build_arch \
libxrandr-dev:$build_arch \
libxss-dev:$build_arch \
libxt-dev:$build_arch \
libxv-dev:$build_arch \
libxxf86vm-dev:$build_arch \
libdrm-dev:$build_arch \
libgbm-dev:$build_arch \
libpulse-dev:$build_arch \
libhidapi-dev:$build_arch \
libwayland-client++0:$build_arch \
libwayland-cursor++0:$build_arch
extra_cmake_flags="-GNinja"
elif [[ $system_name == "macos" ]]; then
extra_cmake_flags="-DCMAKE_OSX_ARCHITECTURES=\"$build_arch\" -DCMAKE_OSX_DEPLOYMENT_TARGET=\"11.0\""
elif [[ $system_name == "win" ]]; then
extra_cmake_flags="-A $build_arch"
fi
pushd $sdl_dir
cmake -B build -DCMAKE_BUILD_TYPE=Release -DSDL_SHARED_ENABLED_BY_DEFAULT=ON -DSDL_STATIC_ENABLED_BY_DEFAULT=ON $extra_cmake_flags
cmake --build build/ --config Release
$SUDO cmake --install build/ --prefix install_output --config Release
mkdir -p $output_path
if [[ $system_name == "linux" ]]; then
cp install_output/lib/libSDL2-2.0.so.0 $output_path/libSDL2.so
elif [[ $system_name == "macos" ]]; then
cp install_output/lib/libSDL2-2.0.dylib $output_path/libSDL2.dylib
elif [[ $system_name == "win" ]]; then
cp install_output/bin/SDL2.dll $output_path/SDL2.dll
fi
popd

41
ci/run.sh Executable file
View File

@ -0,0 +1,41 @@
#!/bin/bash
set -e
if [ "$#" -le 2 ]; then
echo "usage: <sdl_dir> <output_path> <build_arch>"
exit 1
fi
uname_system="$(uname -s)"
case "${uname_system}" in
Linux*) system_name=linux;;
Darwin*) system_name=macos;;
CYGWIN*) system_name=win;;
MINGW*) system_name=win;;
*) system_name="Unknown OS: ${uname_system}"
esac
sdl_dir=$1
output_path=$2
build_arch=$3
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
mkdir -p $output_path
if [ $system_name == "linux" ] && [ $build_arch == "arm64" ]; then
if command -v podman &> /dev/null; then
DOCKER=podman
elif command -v docker &> /dev/null; then
DOCKER=docker
else
echo "ERROR - Missing docker/podman env, cannot crossbuild"
exit 1
fi
$DOCKER run --rm -v $SCRIPT_DIR:/scripts -v $output_path:/output -v $sdl_dir:/source -t arm64v8/ubuntu:focal bash /scripts/compile.sh /source /output $build_arch
else
$SCRIPT_DIR/compile.sh "$sdl_dir" "$output_path" "$build_arch"
fi

View File

@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>AvailableLibraries</key>
<array>
<dict>
<key>LibraryIdentifier</key>
<string>ios-arm64</string>
<key>LibraryPath</key>
<string>SDL2.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
</dict>
<dict>
<key>LibraryIdentifier</key>
<string>ios-arm64_x86_64-simulator</string>
<key>LibraryPath</key>
<string>SDL2.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
</array>
<key>CFBundlePackageType</key>
<string>XFWK</string>
<key>XCFrameworkFormatVersion</key>
<string>1.0</string>
</dict>
</plist>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -37,6 +37,12 @@ namespace SDL2
{
public static class SDL
{
static SDL()
{
if (OperatingSystem.IsIOS())
NativeLibrary.SetDllImportResolver(typeof(SDL).Assembly, (_, assembly, path) => NativeLibrary.Load("@rpath/SDL2.framework/SDL2", assembly, path));
}
#region SDL2# Variables
private const string nativeLibName = "SDL2";