Skip to content

Commit

Permalink
Oh alright, use variables for SDL versioning...
Browse files Browse the repository at this point in the history
  • Loading branch information
flibitijibibo committed Nov 2, 2024
1 parent ea82471 commit 158c5bb
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 13 deletions.
17 changes: 10 additions & 7 deletions build-fnalibs-apple.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/bin/bash

SDL_MINOR_VERSION=1
SDL_PATCH_VERSION=7

set -ex

workflow_id=$(gh -R libsdl-org/SDL run list -b main --json databaseId --jq '.[0].databaseId')
Expand Down Expand Up @@ -31,28 +34,28 @@ mkdir -p fnalibs-apple
cp fnalibs-apple.README fnalibs-apple/README.txt

mkdir -p fnalibs-apple/osx
hdiutil attach SDL-macos-framework/dist/SDL3-3.1.7-macOS.dmg
cp /Volumes/SDL3\ 3.1.7/SDL3.framework/SDL3 fnalibs-apple/osx/libSDL3.0.dylib
hdiutil attach SDL-macos-framework/dist/SDL3-3.$SDL_MINOR_VERSION.$SDL_PATCH_VERSION-macOS.dmg
cp /Volumes/SDL3\ 3.$SDL_MINOR_VERSION.$SDL_PATCH_VERSION/SDL3.framework/SDL3 fnalibs-apple/osx/libSDL3.0.dylib
install_name_tool -id "@rpath/libSDL3.0.dylib" fnalibs-apple/osx/libSDL3.0.dylib
hdiutil detach /Volumes/SDL3\ 3.1.7
hdiutil detach /Volumes/SDL3\ 3.$SDL_MINOR_VERSION.$SDL_PATCH_VERSION
mv FAudio-SDL3-osx/libFAudio.0.dylib fnalibs-apple/osx/
mv FNA3D-SDL3-osx/libFNA3D.0.dylib fnalibs-apple/osx/
mv Theorafile-osx/libtheorafile.dylib fnalibs-apple/osx/
mv macos-latest-binaries/lib/libspirv-cross-c-shared.0.dylib fnalibs-apple/osx/
xattr -c fnalibs-apple/osx/*.dylib

mkdir -p fnalibs-apple/iphoneos
tar xvfz SDL-ios-arm64/dist/SDL3-3.1.7-iOS.tar.gz SDL3-3.1.7-iOS/lib/libSDL3.a
mv SDL3-3.1.7-iOS/lib/libSDL3.a fnalibs-apple/iphoneos/
tar xvfz SDL-ios-arm64/dist/SDL3-3.$SDL_MINOR_VERSION.$SDL_PATCH_VERSION-iOS.tar.gz SDL3-3.$SDL_MINOR_VERSION.$SDL_PATCH_VERSION-iOS/lib/libSDL3.a
mv SDL3-3.$SDL_MINOR_VERSION.$SDL_PATCH_VERSION-iOS/lib/libSDL3.a fnalibs-apple/iphoneos/
mv FAudio-SDL3-iphoneos/libFAudio.a fnalibs-apple/iphoneos/
mv FNA3D-SDL3-iphoneos/libFNA3D.a fnalibs-apple/iphoneos/
mv FNA3D-SDL3-iphoneos/libmojoshader.a fnalibs-apple/iphoneos/
mv Theorafile-iphoneos/libtheorafile.a fnalibs-apple/iphoneos/
# TODO: Which libspirv-cross libraries do we need?

mkdir -p fnalibs-apple/appletvos
tar xvfz SDL-tvos-arm64/dist/SDL3-3.1.7-tvOS.tar.gz SDL3-3.1.7-tvOS/lib/libSDL3.a
mv SDL3-3.1.7-tvOS/lib/libSDL3.a fnalibs-apple/appletvos/
tar xvfz SDL-tvos-arm64/dist/SDL3-3.$SDL_MINOR_VERSION.$SDL_PATCH_VERSION-tvOS.tar.gz SDL3-3.$SDL_MINOR_VERSION.$SDL_PATCH_VERSION-tvOS/lib/libSDL3.a
mv SDL3-3.$SDL_MINOR_VERSION.$SDL_PATCH_VERSION-tvOS/lib/libSDL3.a fnalibs-apple/appletvos/
mv FAudio-SDL3-appletvos/libFAudio.a fnalibs-apple/appletvos/
mv FNA3D-SDL3-appletvos/libFNA3D.a fnalibs-apple/appletvos/
mv FNA3D-SDL3-appletvos/libmojoshader.a fnalibs-apple/appletvos/
Expand Down
15 changes: 9 additions & 6 deletions build-fnalibs.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/bin/bash

SDL_MINOR_VERSION=1
SDL_PATCH_VERSION=7

set -ex

workflow_id=$(gh -R libsdl-org/SDL run list -b main --json databaseId --jq '.[0].databaseId')
Expand All @@ -26,24 +29,24 @@ mkdir -p fnalibs
cp fnalibs.README fnalibs/README.txt

mkdir -p fnalibs/lib64
tar xvfz SDL-slrsniper/dist/SDL3-3.1.7-Linux.tar.gz SDL3-3.1.7-Linux/lib/libSDL3.so.0.1.6
mv SDL3-3.1.7-Linux/lib/libSDL3.so.0.1.6 fnalibs/lib64/libSDL3.so.0
tar xvfz SDL-slrsniper/dist/SDL3-3.$SDL_MINOR_VERSION.$SDL_PATCH_VERSION-Linux.tar.gz SDL3-3.$SDL_MINOR_VERSION.$SDL_PATCH_VERSION-Linux/lib/libSDL3.so.0.$SDL_MINOR_VERSION.$SDL_PATCH_VERSION
mv SDL3-3.$SDL_MINOR_VERSION.$SDL_PATCH_VERSION-Linux/lib/libSDL3.so.0.$SDL_MINOR_VERSION.$SDL_PATCH_VERSION fnalibs/lib64/libSDL3.so.0
chmod +x fnalibs/lib64/libSDL3.so.0
strip -S fnalibs/lib64/libSDL3.so.0
mv FAudio-SDL3-lib64/libFAudio.so.0 fnalibs/lib64/
mv FNA3D-SDL3-lib64/libFNA3D.so.0 fnalibs/lib64/
mv Theorafile-lib64/libtheorafile.so fnalibs/lib64/

mkdir -p fnalibs/x86
unzip SDL-VC-x86/dist/SDL3-3.1.7-Windows-VC.zip SDL3-3.1.7-Windows-VC/bin/SDL3.dll
mv SDL3-3.1.7-Windows-VC/bin/SDL3.dll fnalibs/x86/
unzip SDL-VC-x86/dist/SDL3-3.$SDL_MINOR_VERSION.$SDL_PATCH_VERSION-Windows-VC.zip SDL3-3.$SDL_MINOR_VERSION.$SDL_PATCH_VERSION-Windows-VC/bin/SDL3.dll
mv SDL3-3.$SDL_MINOR_VERSION.$SDL_PATCH_VERSION-Windows-VC/bin/SDL3.dll fnalibs/x86/
mv FAudio-SDL3-x86/FAudio.dll fnalibs/x86/
mv FNA3D-SDL3-x86/FNA3D.dll fnalibs/x86/
mv Theorafile-x86/libtheorafile.dll fnalibs/x86/

mkdir -p fnalibs/x64
unzip SDL-VC-x64/dist/SDL3-3.1.7-Windows-VC.zip SDL3-3.1.7-Windows-VC/bin/SDL3.dll
mv SDL3-3.1.7-Windows-VC/bin/SDL3.dll fnalibs/x64/
unzip SDL-VC-x64/dist/SDL3-3.$SDL_MINOR_VERSION.$SDL_PATCH_VERSION-Windows-VC.zip SDL3-3.$SDL_MINOR_VERSION.$SDL_PATCH_VERSION-Windows-VC/bin/SDL3.dll
mv SDL3-3.$SDL_MINOR_VERSION.$SDL_PATCH_VERSION-Windows-VC/bin/SDL3.dll fnalibs/x64/
mv FAudio-SDL3-x64/FAudio.dll fnalibs/x64/
mv FNA3D-SDL3-x64/FNA3D.dll fnalibs/x64/
mv Theorafile-x64/libtheorafile.dll fnalibs/x64/

0 comments on commit 158c5bb

Please sign in to comment.