Move native builds to wholphin-extensions (#1172)

## Description
This PR moves the native components (ffmpeg decoder, av1 decoder, &
`libmpv`) to https://github.com/damontecres/wholphin-extensions. They
can be retrieved as gradle dependencies now.

This allows for contributors to more easily include these extensions
when building Wholphin locally.

There are no user facing changes in this PR.

Note: the kotlin code for interfacing with `libmpv`, ie `MPVLib` &
`MpvPlayer`, is still in this repo for now.

### Related issues
Related to #828

### Testing
Emulator

## Screenshots
N/A

## AI or LLM usage
None
This commit is contained in:
Ray 2026-03-31 18:10:40 -04:00 committed by GitHub
parent ca43baa531
commit 4ea21be430
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
42 changed files with 48 additions and 1806 deletions

View file

@ -1,82 +0,0 @@
name: "Native build"
description: "Performs native builds"
inputs:
cache:
description: "Whether to use the cache or not"
required: true
runs:
using: "composite"
steps:
- name: Load ffmpeg module cache
id: cache_ffmpeg_module
if: ${{ inputs.cache }}
uses: actions/cache/restore@v5
with:
path: |
app/libs
key: ${{ runner.os }}-ffmpeg-${{ hashFiles('**/libs.versions.toml', '**/scripts/ffmpeg/build_ffmpeg_decoder.sh') }}
- name: Load libmpv module cache
id: cache_libmpv_module
if: ${{ inputs.cache }}
uses: actions/cache/restore@v5
with:
path: |
app/src/main/libs
key: ${{ runner.os }}-libmpv-${{ hashFiles('**/scripts/mpv/*.sh', '**/scripts/mpv/include/*', '**/scripts/mpv/scripts/*', 'app/src/main/jni/*') }}
- name: Install dependencies
if: steps.cache_ffmpeg_module.outputs.cache-hit != 'true' || steps.cache_libmpv_module.outputs.cache-hit != 'true'
shell: bash
run: |
python -m pip install --upgrade pip
pip install jsonschema jinja2
sudo apt update
sudo apt install -y build-essential autoconf pkg-config libtool ninja-build unzip wget meson nasm
# ffmpeg
- name: Build ffmpeg decoder
id: ffmpeg-decoder
if: steps.cache_ffmpeg_module.outputs.cache-hit != 'true'
shell: bash
run: |
cd scripts/ffmpeg
./build_ffmpeg_decoder.sh "${{ env.ANDROID_SDK_ROOT }}/ndk/${{ env.NDK_VERSION }}"
- name: Save ffmpeg module cache
id: cache_ffmpeg_module_save
uses: actions/cache/save@v5
with:
path: |
app/libs
key: ${{ steps.cache_ffmpeg_module.outputs.cache-primary-key }}
# libmpv
- name: Get libmpv dependencies
if: steps.cache_libmpv_module.outputs.cache-hit != 'true'
shell: bash
run: |
cd scripts/mpv
./get_dependencies.sh
- name: Build libmpv dependencies
if: steps.cache_libmpv_module.outputs.cache-hit != 'true'
shell: bash
run: |
cd scripts/mpv
./buildall.sh --clean --arch arm64 mpv
./buildall.sh mpv
cd ../..
env PREFIX32="$(realpath scripts/mpv/prefix/armv7l)" PREFIX64="$(realpath scripts/mpv/prefix/arm64)" ndk-build -C app/src/main -j
- name: Setup jniLibs
shell: bash
run: |
cd app/src/main
mkdir -p jniLibs
cp -r libs/* jniLibs
#ln -s libs jniLibs
- name: Save libmpv module cache
id: cache_libmpv_module_save
uses: actions/cache/save@v5
with:
path: |
app/src/main/libs
key: ${{ steps.cache_libmpv_module.outputs.cache-primary-key }}

View file

@ -30,10 +30,6 @@ jobs:
fetch-depth: 0 # Need the tags to build
- name: Setup
uses: ./.github/actions/setup
- name: Native build
uses: ./.github/actions/native-build
with:
cache: true
- name: Get version names
run: |
@ -55,8 +51,11 @@ jobs:
KEY_PASSWORD: "${{ secrets.KEY_PASSWORD }}"
KEY_STORE_PASSWORD: "${{ secrets.KEY_STORE_PASSWORD }}"
SIGNING_KEY: "${{ secrets.SIGNING_KEY }}"
ORG_GRADLE_PROJECT_WholphinExtensionsUsername: "${{ secrets.EXTENSIONS_USERNAME }}"
ORG_GRADLE_PROJECT_WholphinExtensionsPassword: "${{ secrets.EXTENSIONS_PASSWORD }}"
run: |
./gradlew clean assembleRelease assembleDebug --no-daemon
- name: Verify signatures
run: |
echo "Verify APK signatures"

View file

@ -36,10 +36,6 @@ jobs:
fetch-depth: 0 # Need the tags to build
- name: Setup
uses: ./.github/actions/setup
- name: Native build
uses: ./.github/actions/native-build
with:
cache: true
- name: Build app
id: buildapp
run: |

View file

@ -26,10 +26,6 @@ jobs:
fetch-depth: 0 # Need the tags to build
- name: Setup
uses: ./.github/actions/setup
- name: Native build
uses: ./.github/actions/native-build
with:
cache: false
- name: Build app
id: buildapp
env:
@ -37,6 +33,8 @@ jobs:
KEY_PASSWORD: "${{ secrets.KEY_PASSWORD }}"
KEY_STORE_PASSWORD: "${{ secrets.KEY_STORE_PASSWORD }}"
SIGNING_KEY: "${{ secrets.SIGNING_KEY }}"
ORG_GRADLE_PROJECT_WholphinExtensionsUsername: "${{ secrets.EXTENSIONS_USERNAME }}"
ORG_GRADLE_PROJECT_WholphinExtensionsPassword: "${{ secrets.EXTENSIONS_PASSWORD }}"
run: |
./gradlew clean assembleRelease --no-daemon
@ -47,6 +45,8 @@ jobs:
KEY_PASSWORD: "${{ secrets.KEY_PASSWORD }}"
KEY_STORE_PASSWORD: "${{ secrets.KEY_STORE_PASSWORD }}"
SIGNING_KEY: "${{ secrets.SIGNING_KEY }}"
ORG_GRADLE_PROJECT_WholphinExtensionsUsername: "${{ secrets.EXTENSIONS_USERNAME }}"
ORG_GRADLE_PROJECT_WholphinExtensionsPassword: "${{ secrets.EXTENSIONS_PASSWORD }}"
run: |
git apply app/src/patches/play_store.patch
./gradlew bundleRelease --no-daemon