diff --git a/README.md b/README.md index fbf164b9..b0448d31 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ You can follow development on our [Discord server](https://discord.gg/6ERtzFY). - Gamepad support with force feedback for up to 4 players ## Downloads -- [Windows and macOS](https://github.com/moonlight-stream/moonlight-qt/releases) +- [Windows, macOS, and Steam Link](https://github.com/moonlight-stream/moonlight-qt/releases) - [Snap (for Ubuntu-based Linux distros)](https://snapcraft.io/moonlight) - [Flatpak (for other Linux distros)](https://flathub.org/apps/details/com.moonlight_stream.Moonlight) @@ -27,7 +27,7 @@ You can follow development on our [Discord server](https://discord.gg/6ERtzFY). ### General Build Requirements * Qt 5.9 SDK or later -### Windows-specific Requirements +### Windows-specific Build Requirements * Windows 7 or later * [Visual Studio](https://visualstudio.microsoft.com/downloads/) 2015 or later (Community edition is fine) * Select MSVC Desktop toolchain during Qt installation @@ -35,25 +35,31 @@ You can follow development on our [Discord server](https://discord.gg/6ERtzFY). * [7-Zip](https://www.7-zip.org/) (only if building installers for non-development PCs) * [WiX Toolset](http://wixtoolset.org/releases/) v3.11 or later (only if building installers for non-development PCs) -### Mac-specific Requirements +### Mac-specific Build Requirements * macOS Sierra (10.12) or later * Xcode 10 * [create-dmg](https://github.com/sindresorhus/create-dmg) (only if building DMGs for use on non-development Macs) -### Linux-specific Requirements +### Linux-specific Build Requirements * GCC or Clang * Install your distro equivalents of: `openssl-devel qt5-devel SDL2-devel ffmpeg-devel qt5-qtquickcontrols2-devel libva-devel libvdpau-devel opus-devel pulseaudio-libs-devel alsa-lib-devel SDL2_ttf-devel` * FFmpeg 4.0 is required to build. If your distro doesn't package FFmpeg 4.0, you can build and install it from source on http://ffmpeg.org/ +### Steam Link-specific Build Requirements +* [Steam Link SDK](https://github.com/ValveSoftware/steamlink-sdk) cloned on your build system +* STEAMLINK_SDK_PATH environment variable set to the Steam Link SDK path + ### Build Setup Steps 1. Install the latest Qt SDK (and optionally, the Qt Creator IDE) from https://www.qt.io/download * 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.9 or later. + * This step is not required for building on Steam Link, because the Steam Link SDK includes Qt 5.9. 2. Run `git submodule update --init --recursive` from within `moonlight-qt/` 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\generate-installers.bat`. Execute this script from the root of the repository within a Qt command prompt. Ensure WiX and 7-Zip binary directories are in your `%PATH%`. * For macOS builds, use `scripts/generate-dmg.sh`. Execute this script from the root of the repository and ensure Qt's `bin` folder is in your `$PATH`. + * For Steam Link builds, run `scripts/build-steamlink-app.sh` from the root of the repository. * To build from the command line for development use, run `qmake moonlight-qt.pro` then `make debug` or `make release` ## Contribute diff --git a/app/deploy/steamlink/moonlight.png b/app/deploy/steamlink/moonlight.png new file mode 100644 index 00000000..5b9f7ac0 Binary files /dev/null and b/app/deploy/steamlink/moonlight.png differ diff --git a/app/deploy/steamlink/moonlight.sh b/app/deploy/steamlink/moonlight.sh new file mode 100644 index 00000000..03145ac3 --- /dev/null +++ b/app/deploy/steamlink/moonlight.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +# The default HOME is not persistent, so override +# it to a path on the onboard flash. Otherwise our +# pairing data will be lost each reboot. +HOME=/usr/local/moonlight + +# Write output to a logfile in /tmp +exec ./bin/moonlight > /tmp/moonlight.log diff --git a/app/deploy/steamlink/toc.txt b/app/deploy/steamlink/toc.txt new file mode 100644 index 00000000..c6f994d8 --- /dev/null +++ b/app/deploy/steamlink/toc.txt @@ -0,0 +1,3 @@ +name=Moonlight +icon=moonlight.png +run=moonlight.sh diff --git a/scripts/build-steamlink-app.sh b/scripts/build-steamlink-app.sh new file mode 100755 index 00000000..4fbd8a69 --- /dev/null +++ b/scripts/build-steamlink-app.sh @@ -0,0 +1,50 @@ +BUILD_CONFIG="release" + +fail() +{ + echo "$1" 1>&2 + exit 1 +} + +if [ "$STEAMLINK_SDK_PATH" == "" ]; then + fail "You must set STEAMLINK_SDK_PATH to build for Steam Link" +fi + +BUILD_ROOT=$PWD/build +SOURCE_ROOT=$PWD +BUILD_FOLDER=$BUILD_ROOT/build-$BUILD_CONFIG +DEPLOY_FOLDER=$BUILD_ROOT/deploy-$BUILD_CONFIG +INSTALLER_FOLDER=$BUILD_ROOT/installer-$BUILD_CONFIG +VERSION=`cat $SOURCE_ROOT/app/version.txt` + +echo Cleaning output directories +rm -rf $BUILD_FOLDER +rm -rf $DEPLOY_FOLDER +rm -rf $INSTALLER_FOLDER +mkdir $BUILD_ROOT +mkdir $BUILD_FOLDER +mkdir $DEPLOY_FOLDER +mkdir $INSTALLER_FOLDER + +echo Initializing Steam Link SDK +source $STEAMLINK_SDK_PATH/setenv.sh || fail "SL SDK initialization failed!" + +echo Configuring the project +pushd $BUILD_FOLDER +qmake $SOURCE_ROOT/moonlight-qt.pro || fail "Qmake failed!" +popd + +echo Compiling Moonlight in $BUILD_CONFIG configuration +pushd $BUILD_FOLDER +make -j$(nproc) $(echo "$BUILD_CONFIG" | tr '[:upper:]' '[:lower:]') || fail "Make failed!" +popd + +echo Creating app bundle +mkdir -p $DEPLOY_FOLDER/steamlink/apps/moonlight/bin +cp $BUILD_FOLDER/app/moonlight $DEPLOY_FOLDER/steamlink/apps/moonlight/bin/ || fail "Binary copy failed!" +cp $SOURCE_ROOT/app/deploy/steamlink/* $DEPLOY_FOLDER/steamlink/apps/moonlight/ || fail "Metadata copy failed!" +pushd $DEPLOY_FOLDER +zip -r $INSTALLER_FOLDER/Moonlight-SteamLink-$VERSION.zip . || fail "Zip failed!" +popd + +echo Build completed \ No newline at end of file