Skip to content

Commit c2fc17b

Browse files
authored
Merge pull request #6575 from JamiKettunen/arm64-linux-bass-ffmpeg
Add linux-arm64 BASS & FFmpeg natives
2 parents 90c048d + b196eee commit c2fc17b

File tree

11 files changed

+56
-4
lines changed

11 files changed

+56
-4
lines changed

.github/workflows/build-ffmpeg.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,13 +185,33 @@ jobs:
185185

186186
- name: Build
187187
run: osu.Framework.NativeLibs/scripts/ffmpeg/build-linux.sh
188+
env:
189+
arch: x64
188190

189191
- name: Upload
190192
uses: actions/upload-artifact@v4
191193
with:
192194
name: linux-x64
193195
path: linux-x64
194196

197+
build-linux-arm64:
198+
name: Build Linux (arm64)
199+
runs-on: ubuntu-22.04-arm
200+
steps:
201+
- name: Checkout
202+
uses: actions/checkout@v4
203+
204+
- name: Build
205+
run: osu.Framework.NativeLibs/scripts/ffmpeg/build-linux.sh
206+
env:
207+
arch: arm64
208+
209+
- name: Upload
210+
uses: actions/upload-artifact@v4
211+
with:
212+
name: linux-arm64
213+
path: linux-arm64
214+
195215
build-android:
196216
name: Build Android
197217
runs-on: ubuntu-22.04
@@ -244,6 +264,10 @@ jobs:
244264
with:
245265
name: linux-x64
246266
path: osu.Framework.NativeLibs/runtimes/linux-x64/native
267+
- uses: actions/download-artifact@v4
268+
with:
269+
name: linux-arm64
270+
path: osu.Framework.NativeLibs/runtimes/linux-arm64/native
247271
- uses: actions/download-artifact@v4
248272
with:
249273
name: win-arm64
Binary file not shown.
Binary file not shown.
Binary file not shown.
246 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

osu.Framework.NativeLibs/scripts/ffmpeg/build-linux.sh

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,43 @@ SCRIPT_PATH=$(pwd)
66
popd > /dev/null
77
source "$SCRIPT_PATH/common.sh"
88

9+
if [ -z "${arch-}" ]; then
10+
PS3='Build for which arch? '
11+
select arch in "x64" "arm64"; do
12+
if [ -z "$arch" ]; then
13+
echo "invalid option"
14+
else
15+
break
16+
fi
17+
done
18+
fi
19+
20+
case $arch in
21+
x64)
22+
FFMPEG_FLAGS+=(
23+
--arch=x86_64
24+
)
25+
;;
26+
27+
arm64)
28+
FFMPEG_FLAGS+=(
29+
--arch=aarch64
30+
)
31+
;;
32+
esac
33+
934
FFMPEG_FLAGS+=(
1035
--target-os=linux
1136
)
1237

1338
pushd . > /dev/null
14-
prep_ffmpeg linux-x64
39+
prep_ffmpeg "linux-$arch"
1540
build_ffmpeg
1641
popd > /dev/null
1742

1843
# gcc creates multiple symlinks per .so file for versioning.
1944
# We delete the symlinks and rename the real files to include the major library version
20-
rm linux-x64/*.so
21-
for f in linux-x64/*.so.*.*.*; do
45+
rm linux-$arch/*.so
46+
for f in linux-$arch/*.so.*.*.*; do
2247
mv -vf "$f" "${f%.*.*}"
2348
done

osu.Framework.NativeLibs/update-bass.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ curl -Lso bass24-arm64.zip https://www.un4seen.com/files/bass24-arm64.zip
99
unzip -qjo bass24-arm64.zip arm64/bass.dll -d runtimes/win-arm64/native/
1010

1111
curl -Lso bass-linux.zip https://www.un4seen.com/stuff/bass-linux.zip
12+
unzip -qjo bass-linux.zip aarch64/libbass.so -d runtimes/linux-arm64/native/
1213
unzip -qjo bass-linux.zip x86/libbass.so -d runtimes/linux-x86/native/
1314
unzip -qjo bass-linux.zip x86_64/libbass.so -d runtimes/linux-x64/native/
1415

@@ -32,6 +33,7 @@ curl -Lso bass_fx-arm64.zip https://www.un4seen.com/stuff/bass_fx-arm64.zip
3233
unzip -qjo bass_fx-arm64.zip bass_fx.dll -d runtimes/win-arm64/native/
3334

3435
curl -Lso bass_fx-linux.zip https://www.un4seen.com/stuff/bass_fx-linux.zip
36+
unzip -qjo bass_fx-linux.zip aarch64/libbass_fx.so -d runtimes/linux-arm64/native/
3537
unzip -qjo bass_fx-linux.zip x86/libbass_fx.so -d runtimes/linux-x86/native/
3638
unzip -qjo bass_fx-linux.zip x86_64/libbass_fx.so -d runtimes/linux-x64/native/
3739

@@ -55,6 +57,7 @@ unzip -qjo bassmix24.zip bassmix.dll -d runtimes/win-x86/native/
5557
unzip -qjo bass24-arm64.zip arm64/bassmix.dll -d runtimes/win-arm64/native/
5658

5759
curl -Lso bassmix24-linux.zip https://www.un4seen.com/stuff/bassmix-linux.zip
60+
unzip -qjo bassmix24-linux.zip aarch64/libbassmix.so -d runtimes/linux-arm64/native/
5861
unzip -qjo bassmix24-linux.zip x86/libbassmix.so -d runtimes/linux-x86/native/
5962
unzip -qjo bassmix24-linux.zip x86_64/libbassmix.so -d runtimes/linux-x64/native/
6063

0 commit comments

Comments
 (0)