Switch to downloading prebuilt release artifacts instead of a submodule

This commit is contained in:
Cameron Gutman
2026-05-03 20:55:07 -05:00
parent f222aa7985
commit 453435f916
12 changed files with 111 additions and 98 deletions
+4
View File
@@ -34,6 +34,10 @@ jobs:
submodules: 'recursive'
fetch-depth: 1
- name: Download dependencies (Windows)
if: runner.os == 'Windows'
run: powershell ./setup-deps.ps1
- name: Install create-dmg (macOS)
if: runner.os == 'macOS'
run: |
+1
View File
@@ -4,5 +4,6 @@
**/.vs/
.vscode/
build/
libs/
config.tests/*/.qmake.stash
config.tests/*/Makefile
-4
View File
@@ -10,7 +10,3 @@
[submodule "h264bitstream/h264bitstream"]
path = h264bitstream/h264bitstream
url = https://github.com/aizvorski/h264bitstream.git
[submodule "libs"]
path = libs
url = https://github.com/cgutman/moonlight-qt-prebuilts.git
shallow = true
+4 -1
View File
@@ -91,7 +91,10 @@ for different architectures, which handle building deps and extra linking for yo
* You can install Qt via Homebrew on macOS, but you will need to use `brew install qt --with-debug` to be able to create debug builds of Moonlight.
* You may also use your Linux distro's package manager for the Qt SDK as long as the packages are Qt 5.12 or later.
* This step is not required for building on Steam Link, because the Steam Link SDK includes Qt 5.14.
2. Run `git submodule update --init --recursive` from within `moonlight-qt/`
2. Download submodules and dependencies
* Run `git submodule update --init --recursive` from within `moonlight-qt/`.
* On Windows and macOS, you must also run `setup-deps.ps1` (Windows) or `setup-deps.py` (macOS).
* Perform these steps each time you pull new changes from the Git repository.
3. Open the project in Qt Creator or build from qmake on the command line.
* To build a binary for use on non-development machines, use the scripts in the `scripts` folder.
* For Windows builds, use `scripts\build-arch.bat` and `scripts\generate-bundle.bat`. Execute these scripts from the root of the repository within a Qt command prompt. Ensure 7-Zip binary directory is on your `%PATH%`.
+8
View File
@@ -36,6 +36,10 @@ DEFINES += QT_DEPRECATED_WARNINGS
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
win32 {
!exists($$PWD/../libs/windows) {
error("Missing dependencies. Please run 'powershell .\setup-deps.ps1' to fetch prebuilt libraries.")
}
contains(QT_ARCH, x86_64) {
LIBS += -L$$PWD/../libs/windows/lib/x64
INCLUDEPATH += $$PWD/../libs/windows/include/x64 $$PWD/../libs/windows/include/x64/SDL2
@@ -49,6 +53,10 @@ win32 {
LIBS += ws2_32.lib winmm.lib dxva2.lib ole32.lib gdi32.lib user32.lib d3d9.lib dwmapi.lib dbghelp.lib
}
macx:!disable-prebuilts {
!exists($$PWD/../libs/mac) {
error("Missing dependencies. Please run 'python3 setup-deps.py' to fetch prebuilt libraries.")
}
INCLUDEPATH += $$PWD/../libs/mac/include $$PWD/../libs/mac/include/SDL2
LIBS += -L$$PWD/../libs/mac/lib
}
Submodule libs deleted from 7cf4f7b9d2
+6
View File
@@ -25,6 +25,12 @@ if /I "%BUILD_CONFIG%"=="debug" (
echo Signed release builds must not have unstaged changes!
exit /b 1
)
echo Updating dependencies
powershell %cd%\setup-deps.ps1
if !ERRORLEVEL! NEQ 0 (
exit /b 1
)
) else (
echo Invalid build configuration - expected 'debug' or 'release'
echo Usage: scripts\build-arch.bat ^(release^|debug^)
+3
View File
@@ -23,6 +23,9 @@ else
VERSION=`cat $SOURCE_ROOT/app/version.txt`
fi
echo Updating dependencies
python3 $SOURCE_ROOT/setup-deps.py
echo Cleaning output directories
rm -rf $BUILD_FOLDER
rm -rf $DEPLOY_FOLDER
-92
View File
@@ -1,92 +0,0 @@
LIB_PATH=$(pwd)/libs
while [[ "$#" -gt 0 ]]; do
echo $1
case "$1" in
--sdl2_win)
rm -r $LIB_PATH/windows/include/*/SDL2
rm $LIB_PATH/windows/lib/*/SDL2.* $LIB_PATH/windows/lib/*/SDL2main.*
shift
;;
--sdl2_mac)
rm -r $LIB_PATH/mac/include/SDL2
rm $LIB_PATH/mac/lib/libSDL2.dylib
shift
;;
--sdl3_win)
rm -r $LIB_PATH/windows/include/*/SDL3
rm $LIB_PATH/windows/lib/*/SDL3.* $LIB_PATH/windows/lib/*/SDL3main.*
shift
;;
--sdl3_mac)
rm -r $LIB_PATH/mac/include/SDL3
rm $LIB_PATH/mac/lib/libSDL3.dylib
shift
;;
--sdl_ttf_win)
rm $LIB_PATH/windows/include/*/SDL2/SDL_ttf.h $LIB_PATH/windows/lib/*/SDL2_ttf.*
shift
;;
--sdl_ttf_mac)
rm $LIB_PATH/mac/include/SDL2/SDL_ttf.h $LIB_PATH/mac/lib/libSDL2_ttf.dylib
shift
;;
--detours_win)
rm $LIB_PATH/windows/include/detver.h $LIB_PATH/windows/include/detours.h $LIB_PATH/windows/lib/*/detours.*
shift
;;
--discord-rpc_win)
rm $LIB_PATH/windows/include/discord_*.h $LIB_PATH/windows/lib/*/discord-rpc.*
shift
;;
--discord-rpc_mac)
rm $LIB_PATH/mac/include/discord_*.h $LIB_PATH/mac/lib/libdiscord-rpc.a
shift
;;
--opus_win)
rm $LIB_PATH/windows/include/opus*.h $LIB_PATH/windows/lib/*/opus.*
shift
;;
--opus_mac)
rm $LIB_PATH/mac/include/opus*.h $LIB_PATH/mac/lib/libopus.a
shift
;;
--openssl_win)
rm -r $LIB_PATH/windows/include/*/openssl
rm $LIB_PATH/windows/lib/*/libcrypto* $LIB_PATH/windows/lib/*/libssl*
shift
;;
--openssl_mac)
rm -r $LIB_PATH/mac/include/openssl
rm $LIB_PATH/mac/lib/libssl*.dylib $LIB_PATH/mac/lib/libcrypto*.dylib
shift
;;
--ffmpeg_win)
rm -r $LIB_PATH/windows/include/*/libavcodec $LIB_PATH/windows/include/*/libavutil $LIB_PATH/windows/include/*/libavformat $LIB_PATH/windows/include/*/libswscale
rm $LIB_PATH/windows/lib/*/avcodec* $LIB_PATH/windows/lib/*/avutil* $LIB_PATH/windows/lib/*/avformat* $LIB_PATH/windows/lib/*/swscale*
shift
;;
--dav1d_win)
rm $LIB_PATH/windows/lib/*/dav1d*
shift
;;
--ffmpeg_mac)
rm -r $LIB_PATH/mac/include/libavcodec $LIB_PATH/mac/include/libavutil $LIB_PATH/mac/include/libavformat $LIB_PATH/mac/include/libswscale
rm $LIB_PATH/mac/lib/libavcodec* $LIB_PATH/mac/lib/libavutil* $LIB_PATH/mac/lib/libavformat* $LIB_PATH/mac/lib/libswscale*
shift
;;
--libplacebo_win)
rm -r $LIB_PATH/windows/include/*/libplacebo
rm $LIB_PATH/windows/lib/*/libplacebo*
shift
;;
--)
shift;
break
;;
*)
echo "Unexpected option: $1"
exit
;;
esac
done
+3
View File
@@ -31,6 +31,9 @@ fi
[ "$SIGNING_IDENTITY" == "" ] || git diff-index --quiet HEAD -- || fail "Signed release builds must not have unstaged changes!"
echo Updating dependencies
python3 $SOURCE_ROOT/setup-deps.py
echo Cleaning output directories
rm -rf $BUILD_FOLDER
rm -rf $INSTALLER_FOLDER
+31
View File
@@ -0,0 +1,31 @@
$ErrorActionPreference = 'Stop'
$Organization = "moonlight-stream"
$PrebuiltRepo = "moonlight-qt-deps"
$TargetDir = Join-Path $PSScriptRoot "libs\windows"
$Assets = @("windows-x64.zip", "windows-ARM64.zip")
$Tag = "v1.0.1"
if (Test-Path $TargetDir) {
Write-Host "Cleaning target directory..." -ForegroundColor Cyan
Remove-Item -Path "$TargetDir\*" -Recurse -Force
} else {
New-Item -ItemType Directory -Path $TargetDir | Out-Null
}
foreach ($AssetName in $Assets) {
$Url = "https://github.com/$Organization/$PrebuiltRepo/releases/download/$Tag/$AssetName"
$ArchivePath = Join-Path $env:TEMP $AssetName
Write-Host "Downloading $AssetName..." -ForegroundColor Cyan
curl.exe -s -L -f -o "$ArchivePath" "$Url"
if ($LASTEXITCODE -ne 0) {
exit $LASTEXITCODE
}
Write-Host "Extracting $AssetName..." -ForegroundColor Cyan
Expand-Archive -Path $ArchivePath -DestinationPath $TargetDir -Force
Remove-Item $ArchivePath
}
Write-Host "Dependencies successfully deployed" -ForegroundColor Green
+51
View File
@@ -0,0 +1,51 @@
import os
import sys
import platform
import urllib.request
import zipfile
import shutil
ORGANIZATION = "moonlight-stream"
PREBUILT_REPO = "moonlight-qt-deps"
TAG = "v1.0.1"
def get_platform_config():
system = platform.system()
if system == "Darwin":
return "mac", "macos-universal.zip"
if system == "Linux":
return "steamlink", "steamlink.zip"
print(f"Error: Unsupported platform ({system})")
sys.exit(1)
def download_and_extract():
subfolder, asset_name = get_platform_config()
target_dir = os.path.join(os.getcwd(), "libs", subfolder)
url = f"https://github.com/{ORGANIZATION}/{PREBUILT_REPO}/releases/download/{TAG}/{asset_name}"
if os.path.exists(target_dir):
print("Cleaning target directory...")
shutil.rmtree(target_dir)
os.makedirs(target_dir, exist_ok=True)
archive_path = os.path.join(target_dir, asset_name)
print(f"Downloading {asset_name}...")
try:
urllib.request.urlretrieve(url, archive_path)
except Exception as e:
print(f"Download failed: {e}")
sys.exit(1)
print(f"Extracting {asset_name}...")
with zipfile.ZipFile(archive_path, 'r') as zip_ref:
zip_ref.extractall(target_dir)
os.remove(archive_path)
print(f"Dependencies successfully deployed")
if __name__ == "__main__":
download_and_extract()