Skip to content

Commit

Permalink
merge upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
kvnp committed Jul 6, 2024
2 parents 6452d45 + 86f9459 commit 582f5f9
Show file tree
Hide file tree
Showing 152 changed files with 7,272 additions and 1,657 deletions.
266 changes: 253 additions & 13 deletions .github/workflows/build-ffmpeg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,80 @@ jobs:

- name: Combine
run: osu.Framework.NativeLibs/scripts/ffmpeg/combine_dylibs.sh
env:
platform: macOS

- name: Upload
uses: actions/upload-artifact@v4
with:
name: macOS-universal
path: macOS-universal

build-iOS:
name: Build iOS
runs-on: macos-12
strategy:
matrix:
arch: [arm64, simulator-arm64, simulator-x86_64]

steps:
- name: Checkout
uses: actions/checkout@v4

- uses: ilammy/setup-nasm@v1
if: matrix.arch == 'simulator-x86_64'

- name: Setup gas-preprocessor
run: |
git clone --depth=1 https://github.com/FFmpeg/gas-preprocessor
echo "GAS_PREPROCESSOR=$PWD/gas-preprocessor/gas-preprocessor.pl" >> $GITHUB_ENV
- name: Build
run: osu.Framework.NativeLibs/scripts/ffmpeg/build-iOS.sh
env:
arch: ${{ matrix.arch }}

- name: Upload
uses: actions/upload-artifact@v4
with:
name: iOS-${{ matrix.arch }}
path: iOS-${{ matrix.arch }}

combine-iOS:
name: Combine iOS libs
runs-on: macos-12
needs: build-iOS
steps:
- name: Checkout
uses: actions/checkout@v4

- uses: actions/download-artifact@v4
with:
name: iOS-simulator-x86_64
path: iOS-simulator-x86_64
- uses: actions/download-artifact@v4
with:
name: iOS-simulator-arm64
path: iOS-simulator-arm64
- uses: actions/download-artifact@v4
with:
name: iOS-arm64
path: iOS-arm64

- name: Combine dylibs
run: osu.Framework.NativeLibs/scripts/ffmpeg/combine_dylibs.sh
env:
platform: iOS-simulator

- name: Create XCFrameworks
run: osu.Framework.NativeLibs/scripts/ffmpeg/create-xcframeworks.sh

- name: Upload
uses: actions/upload-artifact@v4
with:
name: iOS-xcframework
path: iOS-xcframework

build-win:
name: Build Windows (${{ matrix.arch }})
runs-on: ubuntu-22.04
Expand Down Expand Up @@ -98,6 +165,11 @@ jobs:
- { arch: arm64, container: "arm64v8/ubuntu:20.04" }
- { arch: arm, container: "arm32v7/ubuntu:20.04" }
steps:
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install nasm
- name: Checkout
uses: actions/checkout@v4

Expand All @@ -121,32 +193,200 @@ jobs:
name: linux-${{ matrix.arch }}
path: linux-${{ matrix.arch }}

build-linux-cross:
name: Build Linux
# Use 20.04 to target glibc 2.31 like the other native libs
runs-on: ubuntu-20.04
strategy:
matrix:
include:
- { arch: x86, container: "i386/ubuntu:20.04" }
- { arch: arm64, container: "arm64v8/ubuntu:20.04" }
- { arch: arm, container: "arm32v7/ubuntu:20.04" }
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup QEMU
if: ${{ contains(matrix.arch, 'arm') }}
uses: docker/setup-qemu-action@v2

- name: Build
uses: addnab/docker-run-action@v3
with:
image: ${{ matrix.container }}
options: -v ${{ github.workspace }}:/workspace -w /workspace -e DEBIAN_FRONTEND=noninteractive
run: |
apt-get update -y -qq
apt-get install -y build-essential curl
if [ "$(dpkg --print-architecture)" = "i386" ]; then
apt-get install -y nasm
fi
osu.Framework.NativeLibs/scripts/ffmpeg/build-linux.sh
- name: Upload
uses: actions/upload-artifact@v4
with:
name: linux-${{ matrix.arch }}
path: linux-${{ matrix.arch }}

build-android:
name: Build Android
runs-on: ubuntu-22.04
strategy:
matrix:
arch:
- armeabi-v7a
- arm64-v8a
- x86
- x86_64

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Build
run: osu.Framework.NativeLibs/scripts/ffmpeg/build-android.sh
env:
arch: ${{ matrix.arch }}

- name: Upload
uses: actions/upload-artifact@v4
with:
name: android-${{ matrix.arch }}
path: android-${{ matrix.arch }}

build-linux-cross:
name: Build Linux
# Use 20.04 to target glibc 2.31 like the other native libs
runs-on: ubuntu-20.04
strategy:
matrix:
include:
- { arch: x86, container: "i386/ubuntu:20.04" }
- { arch: arm64, container: "arm64v8/ubuntu:20.04" }
- { arch: arm, container: "arm32v7/ubuntu:20.04" }
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup QEMU
if: ${{ contains(matrix.arch, 'arm') }}
uses: docker/setup-qemu-action@v2

- name: Build
uses: addnab/docker-run-action@v3
with:
image: ${{ matrix.container }}
options: -v ${{ github.workspace }}:/workspace -w /workspace -e DEBIAN_FRONTEND=noninteractive
run: |
apt-get update -y -qq
apt-get install -y build-essential curl
if [ "$(dpkg --print-architecture)" = "i386" ]; then
apt-get install -y nasm
fi
osu.Framework.NativeLibs/scripts/ffmpeg/build-linux.sh
- name: Upload
uses: actions/upload-artifact@v4
with:
name: linux-${{ matrix.arch }}
path: linux-${{ matrix.arch }}

build-android:
name: Build Android
runs-on: ubuntu-22.04
strategy:
matrix:
arch:
- armeabi-v7a
- arm64-v8a
- x86
- x86_64

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Build
run: osu.Framework.NativeLibs/scripts/ffmpeg/build-android.sh
env:
arch: ${{ matrix.arch }}

- name: Upload
uses: actions/upload-artifact@v4
with:
name: linux-x64
path: linux-x64

make-pr:
name: Create pull request
runs-on: ubuntu-22.04
needs:
- combine-macos
- combine-iOS
- build-win
- build-linux
strategy:
matrix:
include:
- { name: macOS-universal, path: osu.Framework.NativeLibs/runtimes/osx/native }
- { name: linux-arm64, path: osu.Framework.NativeLibs/runtimes/linux-arm64/native}
- { name: linux-arm, path: osu.Framework.NativeLibs/runtimes/linux-arm/native}
- { name: linux-x64, path: osu.Framework.NativeLibs/runtimes/linux-x64/native}
- { name: linux-x86, path: osu.Framework.NativeLibs/runtimes/linux-x86/native}
- { name: win-arm64, path: osu.Framework.NativeLibs/runtimes/win-arm64/native}
- { name: win-x64, path: osu.Framework.NativeLibs/runtimes/win-x64/native}
- { name: win-x86, path: osu.Framework.NativeLibs/runtimes/win-x86/native}
- build-linux-cross
- build-android
steps:
- name: Checkout
uses: actions/checkout@v4

- uses: actions/download-artifact@v4
with:
name: ${{ matrix.name }}
path: ${{ matrix.path }}
name: macOS-universal
path: osu.Framework.NativeLibs/runtimes/osx/native
- uses: actions/download-artifact@v4
with:
name: iOS-xcframework
path: osu.Framework.iOS/runtimes/ios/native
- uses: actions/download-artifact@v4
with:
name: linux-arm64
path: osu.Framework.NativeLibs/runtimes/linux-x64/native
- uses: actions/download-artifact@v4
with:
name: linux-arm
path: osu.Framework.NativeLibs/runtimes/linux-x64/native
- uses: actions/download-artifact@v4
with:
name: linux-x64
path: osu.Framework.NativeLibs/runtimes/linux-x64/native
- uses: actions/download-artifact@v4
with:
name: linux-x86
path: osu.Framework.NativeLibs/runtimes/linux-x64/native
- uses: actions/download-artifact@v4
with:
name: win-arm64
path: osu.Framework.NativeLibs/runtimes/win-arm64/native
- uses: actions/download-artifact@v4
with:
name: win-x64
path: osu.Framework.NativeLibs/runtimes/win-x64/native
- uses: actions/download-artifact@v4
with:
name: win-x86
path: osu.Framework.NativeLibs/runtimes/win-x86/native
- uses: actions/download-artifact@v4
with:
name: android-armeabi-v7a
path: osu.Framework.Android/armeabi-v7a
- uses: actions/download-artifact@v4
with:
name: android-arm64-v8a
path: osu.Framework.Android/arm64-v8a
- uses: actions/download-artifact@v4
with:
name: android-x86
path: osu.Framework.Android/x86
- uses: actions/download-artifact@v4
with:
name: android-x86_64
path: osu.Framework.Android/x86_64

- uses: peter-evans/create-pull-request@v6
with:
Expand Down
16 changes: 12 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -308,12 +308,15 @@ fabric.properties
# Reference: https://github.com/JetBrains/resharper-rider-samples/blob/master/.gitignore

# User specific
**/.idea/**/workspace.xml
**/.idea/**/tasks.xml
**/.idea/shelf/*
**/.idea/dictionaries
**/.idea/httpRequests/
**/.idea/**/usage.statistics.xml
**/.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf
.idea/*/.idea/projectSettingsUpdater.xml
.idea/*/.idea/encodings.xml

# Sensitive or high-churn files
**/.idea/**/dataSources/
Expand All @@ -339,3 +342,8 @@ inspectcode

.idea/.idea.osu-framework.Desktop/.idea/misc.xml
.idea/.idea.osu-framework.Android/.idea/deploymentTargetDropDown.xml

# NativeLibs build folders and tarballs
osu.Framework.NativeLibs/scripts/ffmpeg/*/
osu.Framework.NativeLibs/scripts/ffmpeg/*.tar.gz

This file was deleted.

4 changes: 0 additions & 4 deletions .idea/.idea.osu-framework.Desktop/.idea/encodings.xml

This file was deleted.

This file was deleted.

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/.idea.osu-framework/.idea/projectSettingsUpdater.xml

This file was deleted.

1 change: 0 additions & 1 deletion CodeAnalysis/BannedSymbols.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ M:System.Object.Equals(System.Object,System.Object)~System.Boolean;Don't use obj
M:System.Object.Equals(System.Object)~System.Boolean;Don't use object.Equals. Use IEquatable<T> or EqualityComparer<T>.Default instead.
M:System.ValueType.Equals(System.Object)~System.Boolean;Don't use object.Equals(Fallbacks to ValueType). Use IEquatable<T> or EqualityComparer<T>.Default instead.
T:System.IComparable;Don't use non-generic IComparable. Use generic version instead.
M:System.Enum.HasFlag(System.Enum);Use osu.Framework.Extensions.EnumExtensions.HasFlagFast<T>() instead.
F:System.UriKind.RelativeOrAbsolute;Incompatible results when run on mono (see https://www.mono-project.com/docs/faq/known-issues/urikind-relativeorabsolute/). Use Validation.TryParseUri(string, out Uri?) instead.
M:System.Threading.Tasks.Task.Wait();Don't use Task.Wait. Use Task.WaitSafely() to ensure we avoid deadlocks.
M:System.Guid.#ctor;Probably meaning to use Guid.NewGuid() instead. If actually wanting empty, use Guid.Empty.
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ This framework is intended to take steps beyond what you would normally expect f

## Requirements

- A desktop platform with the [.NET 6.0 SDK](https://dotnet.microsoft.com/download).
- A desktop platform with the [.NET 8.0 SDK](https://dotnet.microsoft.com/download).
- When running on linux, please have a system-wide ffmpeg installation available to support video decoding.
- When running on Windows 7 or 8.1, *[additional prerequisites](https://docs.microsoft.com/en-us/dotnet/core/install/windows?tabs=net60&pivots=os-windows#dependencies)** may be required to correctly run .NET 6 applications if your operating system is not up-to-date with the latest service packs.
- When running on Windows 7 or 8.1, *[additional prerequisites](https://docs.microsoft.com/en-us/dotnet/core/install/windows?tabs=net60&pivots=os-windows#dependencies)** may be required to correctly run .NET 8 applications if your operating system is not up-to-date with the latest service packs.
- When working with the codebase, we recommend using an IDE with intellisense and syntax highlighting, such as [Visual Studio 2019+](https://visualstudio.microsoft.com/vs/), [Jetbrains Rider](https://www.jetbrains.com/rider/), or [Visual Studio Code](https://code.visualstudio.com/) with the [EditorConfig](https://marketplace.visualstudio.com/items?itemName=EditorConfig.EditorConfig) and [C#](https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.csharp) plugin installed.

### Building
Expand Down
Loading

0 comments on commit 582f5f9

Please sign in to comment.