diff --git a/.codeql-prebuild-cpp.sh b/.codeql-prebuild-cpp-Linux.sh similarity index 57% rename from .codeql-prebuild-cpp.sh rename to .codeql-prebuild-cpp-Linux.sh index ba4e4016e0e..8f31178ffe6 100644 --- a/.codeql-prebuild-cpp.sh +++ b/.codeql-prebuild-cpp-Linux.sh @@ -1,20 +1,34 @@ # install dependencies for C++ analysis +set -e +CUDA_VERSION=11.8.0 +CUDA_BUILD=520.61.05 + +# install wget and cuda first sudo apt-get update -y +sudo apt-get install -y \ + wget + +# Install CUDA +url_base="https://developer.download.nvidia.com/compute/cuda/${CUDA_VERSION}/local_installers" +url="${url_base}/cuda_${CUDA_VERSION}_${CUDA_BUILD}_linux.run" +sudo wget -q -O /root/cuda.run ${url} +sudo chmod a+x /root/cuda.run +sudo /root/cuda.run --silent --toolkit --toolkitpath=/usr/local/cuda --no-opengl-libs --no-man-page --no-drm +sudo rm /root/cuda.run + +# Install dependencies sudo apt-get install -y \ build-essential \ gcc-10 \ g++-10 \ libayatana-appindicator3-dev \ libavdevice-dev \ - libboost-filesystem-dev \ - libboost-locale-dev \ - libboost-log-dev \ - libboost-program-options-dev \ libcap-dev \ libcurl4-openssl-dev \ libdrm-dev \ libevdev-dev \ + libminiupnpc-dev \ libmfx-dev \ libnotify-dev \ libnuma-dev \ @@ -30,8 +44,7 @@ sudo apt-get install -y \ libxcb1-dev \ libxfixes-dev \ libxrandr-dev \ - libxtst-dev \ - wget + libxtst-dev # clean apt cache sudo apt-get clean @@ -46,10 +59,18 @@ sudo update-alternatives --install \ --slave /usr/bin/gcc-ar gcc-ar /usr/bin/gcc-ar-10 \ --slave /usr/bin/gcc-ranlib gcc-ranlib /usr/bin/gcc-ranlib-10 -# Install CUDA -sudo wget \ - https://developer.download.nvidia.com/compute/cuda/11.8.0/local_installers/cuda_11.8.0_520.61.05_linux.run \ - --progress=bar:force:noscroll -q --show-progress -O /root/cuda.run -sudo chmod a+x /root/cuda.run -sudo /root/cuda.run --silent --toolkit --toolkitpath=/usr --no-opengl-libs --no-man-page --no-drm -sudo rm /root/cuda.run +# build +mkdir -p build +cd build || exit 1 +cmake \ + -DBUILD_DOCS=OFF \ + -DCMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc \ + -G "Unix Makefiles" \ + .. +make -j"$(nproc)" + +# Delete CUDA +sudo rm -rf /usr/local/cuda + +# skip autobuild +echo "skip_autobuild=true" >> "$GITHUB_OUTPUT" diff --git a/.codeql-prebuild-cpp-Windows.sh b/.codeql-prebuild-cpp-Windows.sh new file mode 100644 index 00000000000..0ada468e242 --- /dev/null +++ b/.codeql-prebuild-cpp-Windows.sh @@ -0,0 +1,45 @@ +# install dependencies for C++ analysis +set -e + +# update pacman +pacman --noconfirm -Suy + +# install wget +pacman --noconfirm -S \ + wget + +# download working curl +wget https://repo.msys2.org/mingw/ucrt64/mingw-w64-ucrt-x86_64-curl-8.8.0-1-any.pkg.tar.zst + +# install dependencies +pacman -U --noconfirm mingw-w64-ucrt-x86_64-curl-8.8.0-1-any.pkg.tar.zst +pacman -Syu --noconfirm --ignore=mingw-w64-ucrt-x86_64-curl \ + base-devel \ + diffutils \ + gcc \ + git \ + make \ + mingw-w64-ucrt-x86_64-boost \ + mingw-w64-ucrt-x86_64-cmake \ + mingw-w64-ucrt-x86_64-cppwinrt \ + mingw-w64-ucrt-x86_64-graphviz \ + mingw-w64-ucrt-x86_64-miniupnpc \ + mingw-w64-ucrt-x86_64-nlohmann-json \ + mingw-w64-ucrt-x86_64-nodejs \ + mingw-w64-ucrt-x86_64-nsis \ + mingw-w64-ucrt-x86_64-onevpl \ + mingw-w64-ucrt-x86_64-openssl \ + mingw-w64-ucrt-x86_64-opus \ + mingw-w64-ucrt-x86_64-rust \ + mingw-w64-ucrt-x86_64-toolchain + +# build +mkdir -p build +cd build || exit 1 +cmake \ + -DBUILD_DOCS=OFF \ + -G "MinGW Makefiles" .. +mingw32-make -j"$(nproc)" + +# skip autobuild +echo "skip_autobuild=true" >> "$GITHUB_OUTPUT" diff --git a/.codeql-prebuild-cpp-macOS.sh b/.codeql-prebuild-cpp-macOS.sh new file mode 100644 index 00000000000..0a505136e88 --- /dev/null +++ b/.codeql-prebuild-cpp-macOS.sh @@ -0,0 +1,23 @@ +# install dependencies for C++ analysis +set -e + +# install dependencies +brew install \ + boost \ + cmake \ + miniupnpc \ + node \ + opus \ + pkg-config + +# build +mkdir -p build +cd build || exit 1 +cmake \ + -DBOOST_USE_STATIC=OFF \ + -DBUILD_DOCS=OFF \ + -G "Unix Makefiles" .. +make -j"$(sysctl -n hw.logicalcpu)" + +# skip autobuild +echo "skip_autobuild=true" >> "$GITHUB_OUTPUT" diff --git a/.dockerignore b/.dockerignore index 15191b977aa..a6ccb41e660 100644 --- a/.dockerignore +++ b/.dockerignore @@ -4,8 +4,11 @@ # do not ignore .git, needed for versioning !/.git +# do not ignore .rstcheck.cfg, needed to test building docs +!/.rstcheck.cfg + # ignore repo directories and files -docs/ +docker/ gh-pages-template/ scripts/ tools/ @@ -13,6 +16,7 @@ crowdin.yml # ignore dev directories build/ +cmake-*/ venv/ # ignore artifacts diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000000..3e0ae29c863 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,6 @@ +# ensure dockerfiles are checked out with LF line endings +Dockerfile text eol=lf +*.dockerfile text eol=lf + +# ensure flatpak lint json files are checked out with LF line endings +*flatpak-lint-*.json text eol=lf diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml index d701774ed37..f03374555f9 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.yml +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -7,33 +7,32 @@ body: value: > **THIS IS NOT THE PLACE TO ASK FOR SUPPORT!** Please use our [Support Center](https://app.lizardbyte.dev/support) for support issues. - Non actionable bug reports will be locked and closed! + Non actionable bug reports will be LOCKED and CLOSED! - type: checkboxes attributes: label: Is there an existing issue for this? description: Please search to see if an issue already exists for the bug you encountered. options: - label: I have searched the existing issues - required: true - type: checkboxes attributes: label: Is your issue described in the documentation? description: Please read our [documentation](https://docs.lizardbyte.dev/projects/sunshine) options: - label: I have read the documentation - required: true - - type: checkboxes + - type: dropdown attributes: - label: Is your issue present in the nightly release? - description: Please test the [nightly](https://github.com/LizardByte/Sunshine/releases/tag/nightly-dev) release + label: Is your issue present in the latest beta/pre-release? + description: Please test the latest [pre-release](https://github.com/LizardByte/Sunshine/releases). options: - - label: This issue is present in the nightly release - required: true + - "I didn't read the issue template" + - "I'm too lazy to test" + - "This issue is present in the latest pre-release" - type: textarea id: description attributes: label: Describe the Bug - description: A clear and concise description of the bug. + description: A clear and concise description of the bug, list the reproduction steps. validations: required: true - type: textarea @@ -81,7 +80,9 @@ body: id: version attributes: label: Sunshine commit or version - placeholder: eg. 0.18.0 + description: | + Use `sunshine --verison` to get the version, or get the version from web UI. + Please don't just copy the latest commit from our repo, if that's not the commit you're actually using. validations: required: true - type: dropdown @@ -94,19 +95,20 @@ body: - Linux - AUR (Third Party) - Linux - deb - Linux - Docker + - Linux - flathub (Third Party) - Linux - flatpak + - Linux - Homebrew - Linux - nixpkgs (Third Party) - - Linux - PKGBUILD - Linux - pkg.tar.zst - Linux - rpm - Linux - solus (Third Party) - - macOS - dmg + - macOS - Homebrew - macOS - Portfile - Windows - Chocolatey (Third Party) - Windows - installer - Windows - portable - Windows - Scoop (Third Party) - - Windows - Winget (Third Party) + - Windows - Winget - other (not listed) - other (self built) - other (fork of this repo) @@ -131,7 +133,6 @@ body: attributes: label: GPU Model description: The model of the installed graphics card. - placeholder: e.g. GeForce RTX 2080 SUPER validations: required: true - type: input @@ -139,15 +140,21 @@ body: attributes: label: GPU Driver/Mesa Version description: The driver/mesa version of the installed graphics card. - placeholder: e.g. 497.29 validations: required: true - - type: input + - type: dropdown id: capture_method attributes: - label: Capture Method (Linux Only) - description: If on Linux, the capture method being used. - placeholder: e.g. PipeWire/KVM/X11/KMS + label: Capture Method + description: The capture method being used. + options: + - AVCaptureScreen (macOS) + - KMX (Linux) + - NvFBC (Linux) + - wlroots (Linux) + - X11 (Linux) + - Desktop Duplication API (Windows) + - Windows.Graphics.Capture (Windows) validations: required: false - type: textarea diff --git a/.github/pr_release_template.md b/.github/pr_release_template.md deleted file mode 100644 index b6f6acf5847..00000000000 --- a/.github/pr_release_template.md +++ /dev/null @@ -1,28 +0,0 @@ -## Description - -This PR was created automatically. - - -### Screenshot - - - -### Issues Fixed or Closed - - - - - -## Type of Change -- [ ] Bug fix (non-breaking change which fixes an issue) -- [ ] New feature (non-breaking change which adds functionality) -- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) -- [ ] Dependency update (updates to dependencies) -- [ ] Documentation update (changes to documentation) -- [ ] Repository update (changes to repository files, e.g. `.github/...`) - -## Branch Updates -- [x] I want maintainers to keep my branch updated - -## Changelog Summary - diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 254a1940dd5..d7b724f4819 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -3,14 +3,14 @@ name: CI on: pull_request: - branches: [master, nightly] + branches: [master] types: [opened, synchronize, reopened] push: - branches: [master, nightly] + branches: [master] workflow_dispatch: concurrency: - group: ${{ github.workflow }}-${{ github.ref }} + group: "${{ github.workflow }}-${{ github.ref }}" cancel-in-progress: true jobs: @@ -25,102 +25,25 @@ jobs: env: GITHUB_CONTEXT: ${{ toJson(github) }} - check_changelog: - name: Check Changelog - runs-on: ubuntu-latest - steps: - - name: Checkout - if: ${{ github.ref == 'refs/heads/master' || github.base_ref == 'master' }} - uses: actions/checkout@v4 - - - name: Verify Changelog - id: verify_changelog - if: ${{ github.ref == 'refs/heads/master' || github.base_ref == 'master' }} - # base_ref for pull request check, ref for push - uses: LizardByte/.github/actions/verify_changelog@master - with: - token: ${{ secrets.GITHUB_TOKEN }} + setup_release: + name: Setup Release outputs: - next_version: ${{ steps.verify_changelog.outputs.changelog_parser_version }} - next_version_bare: ${{ steps.verify_changelog.outputs.changelog_parser_version_bare }} - last_version: ${{ steps.verify_changelog.outputs.latest_release_tag_name }} - release_body: ${{ steps.verify_changelog.outputs.changelog_parser_description }} - - # todo - remove this job once versioning is fully automated by cmake - check_versions: - name: Check Versions + publish_release: ${{ steps.setup_release.outputs.publish_release }} + release_body: ${{ steps.setup_release.outputs.release_body }} + release_commit: ${{ steps.setup_release.outputs.release_commit }} + release_generate_release_notes: ${{ steps.setup_release.outputs.release_generate_release_notes }} + release_tag: ${{ steps.setup_release.outputs.release_tag }} + release_version: ${{ steps.setup_release.outputs.release_version }} runs-on: ubuntu-latest - needs: check_changelog - if: ${{ github.ref == 'refs/heads/master' || github.base_ref == 'master' }} - # base_ref for pull request check, ref for push steps: - name: Checkout uses: actions/checkout@v4 - - name: Check CMakeLists.txt Version - run: | - version=$(grep -o -E '^project\(Sunshine VERSION [0-9]+\.[0-9]+\.[0-9]+' CMakeLists.txt | \ - grep -o -E '[0-9]+\.[0-9]+\.[0-9]+') - echo "cmakelists_version=${version}" >> $GITHUB_ENV - - - name: Compare CMakeList.txt Version - if: ${{ env.cmakelists_version != needs.check_changelog.outputs.next_version_bare }} - run: | - echo CMakeLists version: "$cmakelists_version" - echo Changelog version: "${{ needs.check_changelog.outputs.next_version_bare }}" - echo Within 'CMakeLists.txt' change "project(Sunshine [VERSION $cmakelists_version]" to \ - "project(Sunshine [VERSION ${{ needs.check_changelog.outputs.next_version_bare }}]" - exit 1 - - setup_release: - name: Setup Release - needs: check_changelog - runs-on: ubuntu-latest - steps: - - name: Set release details - id: release_details - env: - RELEASE_BODY: ${{ needs.check_changelog.outputs.release_body }} - run: | - # determine to create a release or not - if [[ $GITHUB_EVENT_NAME == "push" ]]; then - RELEASE=true - else - RELEASE=false - fi - - # set the release tag - COMMIT=${{ github.sha }} - if [[ $GITHUB_REF == refs/heads/master ]]; then - TAG="${{ needs.check_changelog.outputs.next_version }}" - RELEASE_NAME="${{ needs.check_changelog.outputs.next_version }}" - RELEASE_BODY="$RELEASE_BODY" - PRE_RELEASE="false" - elif [[ $GITHUB_REF == refs/heads/nightly ]]; then - TAG="nightly-dev" - RELEASE_NAME="nightly" - RELEASE_BODY="automated nightly release - $(date -u +'%Y-%m-%dT%H:%M:%SZ') - ${COMMIT}" - PRE_RELEASE="true" - fi - - echo "create_release=${RELEASE}" >> $GITHUB_OUTPUT - echo "release_tag=${TAG}" >> $GITHUB_OUTPUT - echo "release_commit=${COMMIT}" >> $GITHUB_OUTPUT - echo "release_name=${RELEASE_NAME}" >> $GITHUB_OUTPUT - echo "pre_release=${PRE_RELEASE}" >> $GITHUB_OUTPUT - - # this is stupid but works for multiline strings - echo "RELEASE_BODY<> $GITHUB_ENV - echo "$RELEASE_BODY" >> $GITHUB_ENV - echo "EOF" >> $GITHUB_ENV - - outputs: - create_release: ${{ steps.release_details.outputs.create_release }} - release_tag: ${{ steps.release_details.outputs.release_tag }} - release_commit: ${{ steps.release_details.outputs.release_commit }} - release_name: ${{ steps.release_details.outputs.release_name }} - release_body: ${{ env.RELEASE_BODY }} - pre_release: ${{ steps.release_details.outputs.pre_release }} + - name: Setup Release + id: setup_release + uses: LizardByte/setup-release-action@v2024.717.220227 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} setup_flatpak_matrix: name: Setup Flatpak Matrix @@ -131,7 +54,7 @@ jobs: # https://www.cynkra.com/blog/2020-12-23-dynamic-gha run: | # determine which architectures to build - if [[ $GITHUB_EVENT_NAME == "push" ]]; then + if [[ "${{ github.event_name }}" == "push" ]]; then matrix=$(( echo '{ "arch" : ["x86_64", "aarch64"] }' ) | jq -c .) @@ -149,6 +72,8 @@ jobs: matrix: ${{ steps.flatpak_matrix.outputs.matrix }} build_linux_flatpak: + env: + APP_ID: dev.lizardbyte.app.Sunshine name: Linux Flatpak runs-on: ubuntu-22.04 needs: [setup_release, setup_flatpak_matrix] @@ -158,35 +83,33 @@ jobs: steps: - name: Maximize build space - uses: easimon/maximize-build-space@v8 + uses: easimon/maximize-build-space@v10 with: root-reserve-mb: 10240 remove-dotnet: 'true' remove-android: 'true' remove-haskell: 'true' remove-codeql: 'true' - remove-docker-images: 'false' + remove-docker-images: 'true' - name: Checkout uses: actions/checkout@v4 - - - name: Checkout Flathub Shared Modules - uses: actions/checkout@v4 with: - repository: flathub/shared-modules - path: build/shared-modules + submodules: recursive - name: Setup Dependencies Linux Flatpak + env: + PLATFORM_VERSION: "22.08" run: | - PLATFORM_VERSION=22.08 - sudo apt-get update -y sudo apt-get install -y \ cmake \ flatpak \ qemu-user-static + sudo su $(whoami) -c "flatpak --user remote-add --if-not-exists flathub \ https://flathub.org/repo/flathub.flatpakrepo" + sudo su $(whoami) -c "flatpak --user install -y flathub \ org.flatpak.Builder \ org.freedesktop.Platform/${{ matrix.arch }}/${PLATFORM_VERSION} \ @@ -196,7 +119,7 @@ jobs: " - name: Cache Flatpak build - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ./build/.flatpak-builder key: flatpak-${{ matrix.arch }}-${{ github.sha }} @@ -206,18 +129,18 @@ jobs: - name: Configure Flatpak Manifest run: | # variables for manifest - branch=${GITHUB_HEAD_REF} + branch="${{ github.head_ref }}" + commit=${{ needs.setup_release.outputs.release_commit }} # check the branch variable if [ -z "$branch" ] then echo "This is a PUSH event" branch=${{ github.ref_name }} - commit=${{ github.sha }} + build_version=${{ needs.setup_release.outputs.release_tag }} clone_url=${{ github.event.repository.clone_url }} else echo "This is a PR event" - commit=${{ github.event.pull_request.head.sha }} clone_url=${{ github.event.pull_request.head.repo.clone_url }} fi echo "Branch: ${branch}" @@ -229,119 +152,164 @@ jobs: cd build cmake -DGITHUB_CLONE_URL=${clone_url} \ + -DBUILD_VERSION=${build_version} \ -DGITHUB_BRANCH=${branch} \ -DGITHUB_COMMIT=${commit} \ -DSUNSHINE_CONFIGURE_FLATPAK_MAN=ON \ -DSUNSHINE_CONFIGURE_ONLY=ON \ .. + - name: Debug Manifest + working-directory: build + run: | + cat ${APP_ID}.yml + - name: Build Linux Flatpak working-directory: build run: | - sudo su $(whoami) -c 'flatpak run org.flatpak.Builder --arch=${{ matrix.arch }} --repo=repo --force-clean \ - --stop-at=cuda build-sunshine dev.lizardbyte.sunshine.yml' + sudo su $(whoami) -c "flatpak run org.flatpak.Builder --arch=${{ matrix.arch }} --repo=repo --force-clean \ + --stop-at=cuda build-sunshine ${APP_ID}.yml" cp -r .flatpak-builder copy-of-flatpak-builder - sudo su $(whoami) -c 'flatpak run org.flatpak.Builder --arch=${{ matrix.arch }} --repo=repo --force-clean \ - build-sunshine dev.lizardbyte.sunshine.yml' + sudo su $(whoami) -c "flatpak run org.flatpak.Builder --arch=${{ matrix.arch }} --repo=repo --force-clean \ + build-sunshine ${APP_ID}.yml" rm -rf .flatpak-builder mv copy-of-flatpak-builder .flatpak-builder - sudo su $(whoami) -c 'flatpak build-bundle --arch=${{ matrix.arch }} ./repo \ - ../artifacts/sunshine_${{ matrix.arch }}.flatpak dev.lizardbyte.sunshine' - sudo su $(whoami) -c 'flatpak build-bundle --runtime --arch=${{ matrix.arch }} ./repo \ - ../artifacts/sunshine_debug_${{ matrix.arch }}.flatpak dev.lizardbyte.sunshine.Debug' + sudo su $(whoami) -c "flatpak build-bundle --arch=${{ matrix.arch }} ./repo \ + ../artifacts/sunshine_${{ matrix.arch }}.flatpak ${APP_ID}" + sudo su $(whoami) -c "flatpak build-bundle --runtime --arch=${{ matrix.arch }} ./repo \ + ../artifacts/sunshine_debug_${{ matrix.arch }}.flatpak ${APP_ID}.Debug" + + - name: Lint Flatpak + working-directory: build + run: | + echo "Linting flatpak manifest" + flatpak run --command=flatpak-builder-lint org.flatpak.Builder \ + manifest ${APP_ID}.yml > _flatpak-lint-exceptions_manifest.json || true + + echo "Linting flatpak repo" + # TODO: add arg + # --mirror-screenshots-url=https://dl.flathub.org/media \ + flatpak run --command=flatpak-builder-lint org.flatpak.Builder \ + repo repo > _flatpak-lint-exceptions_repo.json || true + + checks=(manifest repo) + exit_code=0 + + # check if files are equal + for check in "${checks[@]}"; do + echo "Validating $check" + + # load baseline and result files + baseline="${{ github.workspace }}/packaging/linux/flatpak/flatpak-lint-baseline_${check}.json" + result="_flatpak-lint-exceptions_${check}.json" + + # Extract errors from both JSON files + readarray -t result_errors < <(jq -r '.errors[]' "$result") + readarray -t baseline_errors < <(jq -r '.errors[]' "$baseline") + + # Loop through result errors and check against baseline errors + for error in "${result_errors[@]}"; do + if printf '%s\n' "${baseline_errors[@]}" | grep -q -F "$error"; then + echo "::warning:: '$error'" + else + echo "::error:: '$error'" + exit_code=1 + fi + done + done + + # if exit code is not 0, print results + if [ $exit_code -ne 0 ]; then + echo "Manifest lint results:" + cat _flatpak-lint-exceptions_manifest.json + echo "Repo lint results:" + cat _flatpak-lint-exceptions_repo.json + fi + + # exit with the correct code + exit $exit_code - name: Upload Artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: sunshine-linux-flatpak-${{ matrix.arch }} path: artifacts/ - name: Create/Update GitHub Release - if: ${{ needs.setup_release.outputs.create_release == 'true' }} - uses: ncipollo/release-action@v1 + if: ${{ needs.setup_release.outputs.publish_release == 'true' }} + uses: LizardByte/create-release-action@v2024.614.221009 with: - name: ${{ needs.setup_release.outputs.release_name }} - tag: ${{ needs.setup_release.outputs.release_tag }} - commit: ${{ needs.setup_release.outputs.release_commit }} - artifacts: "*artifacts/*" - token: ${{ secrets.GH_BOT_TOKEN }} allowUpdates: true body: ${{ needs.setup_release.outputs.release_body }} discussionCategory: announcements - prerelease: ${{ needs.setup_release.outputs.pre_release }} + generateReleaseNotes: ${{ needs.setup_release.outputs.release_generate_release_notes }} + name: ${{ needs.setup_release.outputs.release_tag }} + prerelease: true + tag: ${{ needs.setup_release.outputs.release_tag }} + token: ${{ secrets.GH_BOT_TOKEN }} build_linux: name: Linux ${{ matrix.type }} runs-on: ubuntu-${{ matrix.dist }} - needs: [check_changelog, setup_release] + needs: [setup_release] strategy: fail-fast: false # false to test all, true to fail entire job if any fail matrix: include: # package these differently - type: AppImage EXTRA_ARGS: '-DSUNSHINE_BUILD_APPIMAGE=ON' - dist: 20.04 + dist: 22.04 steps: - name: Maximize build space - uses: easimon/maximize-build-space@v8 + uses: easimon/maximize-build-space@v10 with: - root-reserve-mb: 20480 + root-reserve-mb: 30720 remove-dotnet: 'true' remove-android: 'true' remove-haskell: 'true' remove-codeql: 'true' - remove-docker-images: 'false' + remove-docker-images: 'true' - name: Checkout uses: actions/checkout@v4 with: submodules: recursive + - name: Install wget + run: | + sudo apt-get update -y + sudo apt-get install -y \ + wget + + - name: Install CUDA + env: + CUDA_VERSION: 11.8.0 + CUDA_BUILD: 520.61.05 + timeout-minutes: 4 + run: | + url_base="https://developer.download.nvidia.com/compute/cuda/${CUDA_VERSION}/local_installers" + url="${url_base}/cuda_${CUDA_VERSION}_${CUDA_BUILD}_linux.run" + sudo wget -q -O /root/cuda.run ${url} + sudo chmod a+x /root/cuda.run + sudo /root/cuda.run --silent --toolkit --toolkitpath=/usr/local/cuda --no-opengl-libs --no-man-page --no-drm + sudo rm /root/cuda.run + - name: Setup Dependencies Linux + timeout-minutes: 5 run: | + # allow newer gcc sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y - if [[ ${{ matrix.dist }} == "18.04" ]]; then - # Ubuntu 18.04 packages - sudo add-apt-repository ppa:savoury1/boost-defaults-1.71 -y - - sudo apt-get update -y - sudo apt-get install -y \ - libboost-filesystem1.71-dev \ - libboost-locale1.71-dev \ - libboost-log1.71-dev \ - libboost-regex1.71-dev \ - libboost-program-options1.71-dev - - # Install cmake - wget https://cmake.org/files/v3.22/cmake-3.22.2-linux-x86_64.sh - chmod +x cmake-3.22.2-linux-x86_64.sh - mkdir /opt/cmake - ./cmake-3.22.2-linux-x86_64.sh --prefix=/opt/cmake --skip-license - ln --force --symbolic /opt/cmake/bin/cmake /usr/local/bin/cmake - cmake --version - - # install newer tar from focal... appimagelint fails on 18.04 without this - echo "original tar version" - tar --version - wget -O tar.deb http://security.ubuntu.com/ubuntu/pool/main/t/tar/tar_1.30+dfsg-7ubuntu0.20.04.2_amd64.deb - sudo apt-get -y install -f ./tar.deb - echo "new tar version" - tar --version - else - # Ubuntu 20.04+ packages - sudo apt-get update -y - sudo apt-get install -y \ - cmake \ - libboost-filesystem-dev \ - libboost-locale-dev \ - libboost-log-dev \ - libboost-program-options-dev - fi + # allow libfuse2 for appimage on 22.04 + sudo add-apt-repository universe + # libx11-xcb-dev and libxcb-dri3-dev are required for building libva sudo apt-get install -y \ build-essential \ + cmake \ + doxygen \ + graphviz \ gcc-10 \ g++-10 \ libayatana-appindicator3-dev \ @@ -350,23 +318,26 @@ jobs: libcurl4-openssl-dev \ libdrm-dev \ libevdev-dev \ - libmfx-dev \ + libfuse2 \ + libminiupnpc-dev \ libnotify-dev \ libnuma-dev \ libopus-dev \ libpulse-dev \ libssl-dev \ - libva-dev \ libvdpau-dev \ libwayland-dev \ libx11-dev \ + libx11-xcb-dev \ + libxcb-dri3-dev \ libxcb-shm0-dev \ libxcb-xfixes0-dev \ libxcb1-dev \ libxfixes-dev \ libxrandr-dev \ libxtst-dev \ - wget + python3 \ + python3-venv # clean apt cache sudo apt-get clean @@ -381,27 +352,47 @@ jobs: --slave /usr/bin/gcc-ar gcc-ar /usr/bin/gcc-ar-10 \ --slave /usr/bin/gcc-ranlib gcc-ranlib /usr/bin/gcc-ranlib-10 - # Install CUDA - sudo wget \ - https://developer.download.nvidia.com/compute/cuda/11.8.0/local_installers/cuda_11.8.0_520.61.05_linux.run \ - --progress=bar:force:noscroll -q --show-progress -O /root/cuda.run - sudo chmod a+x /root/cuda.run - sudo /root/cuda.run --silent --toolkit --toolkitpath=/usr --no-opengl-libs --no-man-page --no-drm - sudo rm /root/cuda.run + - name: Setup python + id: python + uses: actions/setup-python@v5 + with: + python-version: '3.11' + + - name: Build latest libva + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + timeout-minutes: 5 + run: | + gh release download --archive=tar.gz --repo=intel/libva + tar xzf libva-*.tar.gz && rm libva-*.tar.gz + cd libva-* + ./autogen.sh --prefix=/usr --libdir=/usr/lib/x86_64-linux-gnu \ + --enable-drm \ + --enable-x11 \ + --enable-glx \ + --enable-wayland \ + --without-legacy # emgd, nvctrl, fglrx + make -j $(nproc) + sudo make install + cd .. && rm -rf libva-* - name: Build Linux env: BRANCH: ${{ github.head_ref || github.ref_name }} - BUILD_VERSION: ${{ needs.check_changelog.outputs.next_version_bare }} - COMMIT: ${{ github.event.pull_request.head.sha || github.sha }} + BUILD_VERSION: ${{ needs.setup_release.outputs.release_tag }} + COMMIT: ${{ needs.setup_release.outputs.release_commit }} + timeout-minutes: 10 run: | + echo "nproc: $(nproc)" + mkdir -p build mkdir -p artifacts - npm install - cd build - cmake -DCMAKE_BUILD_TYPE=Release \ + cmake \ + -DBUILD_WERROR=ON \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_CUDA_COMPILER:PATH=/usr/local/cuda/bin/nvcc \ -DCMAKE_INSTALL_PREFIX=/usr \ -DSUNSHINE_ASSETS_DIR=share/sunshine \ -DSUNSHINE_EXECUTABLE_PATH=/usr/bin/sunshine \ @@ -411,25 +402,13 @@ jobs: -DSUNSHINE_ENABLE_CUDA=ON \ ${{ matrix.EXTRA_ARGS }} \ .. - make -j ${nproc} - - - name: Package Linux - CPACK - # todo - this is no longer used - if: ${{ matrix.type == 'cpack' }} - working-directory: build - run: | - cpack -G DEB - mv ./cpack_artifacts/Sunshine.deb ../artifacts/sunshine-${{ matrix.dist }}.deb - - if [[ ${{ matrix.dist }} == "20.04" ]]; then - cpack -G RPM - mv ./cpack_artifacts/Sunshine.rpm ../artifacts/sunshine.rpm - fi + make -j $(expr $(nproc) - 1) # use all but one core - name: Set AppImage Version - if: ${{ matrix.type == 'AppImage' && ( needs.check_changelog.outputs.next_version_bare != needs.check_changelog.outputs.last_version ) }} # yamllint disable-line rule:line-length + if: | + matrix.type == 'AppImage' run: | - version=${{ needs.check_changelog.outputs.next_version_bare }} + version=${{ needs.setup_release.outputs.release_tag }} echo "VERSION=${version}" >> $GITHUB_ENV - name: Package Linux - AppImage @@ -449,12 +428,12 @@ jobs: # AppImage # https://docs.appimage.org/packaging-guide/index.html - wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage + wget -q https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage chmod +x linuxdeploy-x86_64.AppImage # https://github.com/linuxdeploy/linuxdeploy-plugin-gtk sudo apt-get install libgtk-3-dev librsvg2-dev -y - wget https://raw.githubusercontent.com/linuxdeploy/linuxdeploy-plugin-gtk/master/linuxdeploy-plugin-gtk.sh + wget -q https://raw.githubusercontent.com/linuxdeploy/linuxdeploy-plugin-gtk/master/linuxdeploy-plugin-gtk.sh chmod +x linuxdeploy-plugin-gtk.sh export DEPLOY_GTK_VERSION=3 @@ -472,108 +451,237 @@ jobs: # permissions chmod +x ../artifacts/sunshine.AppImage + - name: Delete CUDA + # free up space on the runner + run: | + sudo rm -rf /usr/local/cuda + - name: Verify AppImage if: ${{ matrix.type == 'AppImage' }} run: | wget https://github.com/TheAssassin/appimagelint/releases/download/continuous/appimagelint-x86_64.AppImage chmod +x appimagelint-x86_64.AppImage - # rm -rf ~/.cache/appimagelint/ - ./appimagelint-x86_64.AppImage ./artifacts/sunshine.AppImage - name: Upload Artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: sunshine-linux-${{ matrix.type }}-${{ matrix.dist }} path: artifacts/ + - name: Install test deps + run: | + sudo apt-get update -y + sudo apt-get install -y \ + x11-xserver-utils \ + xvfb + + # clean apt cache + sudo apt-get clean + sudo rm -rf /var/lib/apt/lists/* + + - name: Run tests + id: test + working-directory: build/tests + run: | + export DISPLAY=:1 + Xvfb ${DISPLAY} -screen 0 1024x768x24 & + sleep 5 # give Xvfb time to start + + ./test_sunshine --gtest_color=yes + + - name: Generate gcov report + # any except canceled or skipped + if: always() && (steps.test.outcome == 'success' || steps.test.outcome == 'failure') + id: test_report + working-directory: build + run: | + ${{ steps.python.outputs.python-path }} -m pip install gcovr + ${{ steps.python.outputs.python-path }} -m gcovr -r .. \ + --exclude-noncode-lines \ + --exclude-throw-branches \ + --exclude-unreachable-branches \ + --exclude '.*tests/.*' \ + --exclude '.*third-party/.*' \ + --xml-pretty \ + -o coverage.xml + + - name: Upload coverage + # any except canceled or skipped + if: >- + always() && + (steps.test_report.outcome == 'success') && + startsWith(github.repository, 'LizardByte/') + uses: codecov/codecov-action@v4 + with: + disable_search: true + fail_ci_if_error: true + files: ./build/coverage.xml + flags: ${{ runner.os }} + token: ${{ secrets.CODECOV_TOKEN }} + verbose: true + - name: Create/Update GitHub Release - if: ${{ needs.setup_release.outputs.create_release == 'true' }} - uses: ncipollo/release-action@v1 + if: ${{ needs.setup_release.outputs.publish_release == 'true' }} + uses: LizardByte/create-release-action@v2024.614.221009 with: - name: ${{ needs.setup_release.outputs.release_name }} - tag: ${{ needs.setup_release.outputs.release_tag }} - commit: ${{ needs.setup_release.outputs.release_commit }} - artifacts: "*artifacts/*" - token: ${{ secrets.GH_BOT_TOKEN }} allowUpdates: true body: ${{ needs.setup_release.outputs.release_body }} discussionCategory: announcements - prerelease: ${{ needs.setup_release.outputs.pre_release }} + generateReleaseNotes: ${{ needs.setup_release.outputs.release_generate_release_notes }} + name: ${{ needs.setup_release.outputs.release_tag }} + prerelease: true + tag: ${{ needs.setup_release.outputs.release_tag }} + token: ${{ secrets.GH_BOT_TOKEN }} - build_mac: - name: MacOS - runs-on: macos-11 - needs: [check_changelog, setup_release] + build_homebrew: + needs: [setup_release] + strategy: + fail-fast: false # false to test all, true to fail entire job if any fail + matrix: + include: + # https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories + # while GitHub has larger macOS runners, they are not available for our repos :( + - os_version: "12" + os_name: "macos" + - os_version: "13" + os_name: "macos" + - os_version: "14" + os_name: "macos" + - os_version: "latest" + os_name: "ubuntu" + - os_version: "latest" # this job will only configure the formula for release, no validation + os_name: "ubuntu" + release: true + name: Homebrew (${{ matrix.os_name }}-${{ matrix.os_version }}${{ matrix.release == true && ' (Release)' || '' }}) + runs-on: ${{ matrix.os_name }}-${{ matrix.os_version }} steps: - name: Checkout uses: actions/checkout@v4 - with: - submodules: recursive - - name: Setup Dependencies MacOS + - name: Configure formula run: | - # install dependencies using homebrew - brew install boost cmake curl node opus pkg-config - - # fix openssl header not found - ln -sf /usr/local/opt/openssl/include/openssl /usr/local/include/openssl + # variables for formula + branch="${{ github.head_ref }}" + commit=${{ needs.setup_release.outputs.release_commit }} - - name: Build MacOS - env: - BRANCH: ${{ github.head_ref || github.ref_name }} - BUILD_VERSION: ${{ needs.check_changelog.outputs.next_version_bare }} - COMMIT: ${{ github.event.pull_request.head.sha || github.sha }} - run: | - npm install + # check the branch variable + if [ -z "$branch" ] + then + echo "This is a PUSH event" + build_version=${{ needs.setup_release.outputs.release_tag }} + clone_url=${{ github.event.repository.clone_url }} + branch="${{ github.ref_name }}" + default_branch="${{ github.event.repository.default_branch }}" + + if [ "${{ matrix.release }}" == "true" ]; then + # we will publish the formula with the release tag + tag="${{ needs.setup_release.outputs.release_tag }}" + version="${{ needs.setup_release.outputs.release_version }}" + else + tag="${{ github.ref_name }}" + version="0.0.${{ github.run_number }}" + fi + else + echo "This is a PR event" + build_version="0.0.${{ github.event.number }}" + clone_url=${{ github.event.pull_request.head.repo.clone_url }} + branch="${{ github.event.pull_request.head.ref }}" + default_branch="${{ github.event.pull_request.head.repo.default_branch }}" + tag="${{ github.event.pull_request.head.ref }}" + version="0.0.${{ github.event.number }}" + fi + echo "Branch: ${branch}" + echo "Clone URL: ${clone_url}" + echo "Tag: ${tag}" mkdir build cd build - cmake -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_INSTALL_PREFIX=/usr \ - -DSUNSHINE_ASSETS_DIR=local/sunshine/assets \ - -DSUNSHINE_EXECUTABLE_PATH=/usr/bin/sunshine \ + cmake \ + -DBUILD_VERSION="${build_version}" \ + -DFORMULA_VERSION="${version}" \ + -DGITHUB_BRANCH="${branch}" \ + -DGITHUB_COMMIT="${commit}" \ + -DGITHUB_CLONE_URL="${clone_url}" \ + -DGITHUB_DEFAULT_BRANCH="${default_branch}" \ + -DGITHUB_TAG="${tag}" \ + -DSUNSHINE_CONFIGURE_HOMEBREW=ON \ + -DSUNSHINE_CONFIGURE_ONLY=ON \ .. - make -j ${nproc} + cd .. + + # copy formula to artifacts + mkdir -p homebrew + cp -f ./build/sunshine.rb ./homebrew/sunshine.rb + + # testing + cat ./homebrew/sunshine.rb + + - name: Upload Artifacts + if: ${{ matrix.release }} + uses: actions/upload-artifact@v4 + with: + name: sunshine-homebrew + path: homebrew/ - - name: Package MacOS + - name: Setup Xvfb + if: | + matrix.release != true && + runner.os == 'Linux' run: | - mkdir -p artifacts - cd build + sudo apt-get update -y + sudo apt-get install -y \ + xvfb - # package - cpack -G DragNDrop - mv ./cpack_artifacts/Sunshine.dmg ../artifacts/sunshine.dmg + export DISPLAY=:1 + Xvfb ${DISPLAY} -screen 0 1024x768x24 & - # cpack -G Bundle - # mv ./cpack_artifacts/Sunshine.dmg ../artifacts/sunshine-bundle.dmg + echo "DISPLAY=${DISPLAY}" >> $GITHUB_ENV - - name: Upload Artifacts - uses: actions/upload-artifact@v3 + - name: Validate Homebrew Formula + if: | + matrix.release != true + uses: LizardByte/homebrew-release-action@v2024.612.21058 with: - name: sunshine-macos - path: artifacts/ + formula_file: ${{ github.workspace }}/homebrew/sunshine.rb + git_email: ${{ secrets.GH_BOT_EMAIL }} + git_username: ${{ secrets.GH_BOT_NAME }} + publish: false + token: ${{ secrets.GH_BOT_TOKEN }} + validate: true - name: Create/Update GitHub Release - if: ${{ needs.setup_release.outputs.create_release == 'true' }} - uses: ncipollo/release-action@v1 + if: >- + matrix.release && + needs.setup_release.outputs.publish_release == 'true' + uses: LizardByte/create-release-action@v2024.614.221009 with: - name: ${{ needs.setup_release.outputs.release_name }} - tag: ${{ needs.setup_release.outputs.release_tag }} - commit: ${{ needs.setup_release.outputs.release_commit }} - artifacts: "*artifacts/*" - token: ${{ secrets.GH_BOT_TOKEN }} allowUpdates: true + artifacts: '${{ github.workspace }}/homebrew/*' body: ${{ needs.setup_release.outputs.release_body }} discussionCategory: announcements - prerelease: ${{ needs.setup_release.outputs.pre_release }} + generateReleaseNotes: ${{ needs.setup_release.outputs.release_generate_release_notes }} + name: ${{ needs.setup_release.outputs.release_tag }} + prerelease: true + tag: ${{ needs.setup_release.outputs.release_tag }} + token: ${{ secrets.GH_BOT_TOKEN }} build_mac_port: - name: Macports - needs: [check_changelog, setup_release] - runs-on: macos-11 + needs: [setup_release] + strategy: + fail-fast: false # false to test all, true to fail entire job if any fail + matrix: + include: + # https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories + # while GitHub has larger macOS runners, they are not available for our repos :( + - os_version: "12" + release: true + - os_version: "13" + - os_version: "14" + name: Macports (macOS-${{ matrix.os_version }}) + runs-on: macos-${{ matrix.os_version }} steps: - name: Checkout @@ -597,20 +705,27 @@ jobs: # install dependencies using homebrew brew install cmake + - name: Setup python + id: python + uses: actions/setup-python@v5 + with: + python-version: '3.11' + - name: Configure Portfile run: | # variables for Portfile - branch=${GITHUB_HEAD_REF} + branch="${{ github.head_ref }}" + commit=${{ needs.setup_release.outputs.release_commit }} # check the branch variable if [ -z "$branch" ] then echo "This is a PUSH event" - commit=${{ github.sha }} + branch="${{ github.ref_name }}" + build_version=${{ needs.setup_release.outputs.release_tag }} clone_url=${{ github.event.repository.clone_url }} else echo "This is a PR event" - commit=${{ github.event.pull_request.head.sha }} clone_url=${{ github.event.pull_request.head.repo.clone_url }} fi echo "Commit: ${commit}" @@ -619,6 +734,8 @@ jobs: mkdir build cd build cmake \ + -DBUILD_VERSION=${build_version} \ + -DGITHUB_BRANCH=${branch} \ -DGITHUB_COMMIT=${commit} \ -DGITHUB_CLONE_URL=${clone_url} \ -DSUNSHINE_CONFIGURE_PORTFILE=ON \ @@ -654,6 +771,7 @@ jobs: - name: Build port env: subportlist: ${{ steps.subportlist.outputs.subportlist }} + id: build run: | subport="Sunshine" @@ -675,30 +793,145 @@ jobs: "$subport" echo "::endgroup::" + - name: Build Logs + if: always() + run: | + logfile="/opt/local/var/macports/logs/_Users_runner_work_Sunshine_Sunshine_ports_multimedia_Sunshine/Sunshine/main.log" + cat "$logfile" + sudo mv "${logfile}" "${logfile}.bak" + - name: Upload Artifacts - uses: actions/upload-artifact@v3 + if: ${{ matrix.release }} + uses: actions/upload-artifact@v4 with: name: sunshine-macports path: artifacts/ + - name: Fix permissions + run: | + # https://apple.stackexchange.com/questions/362865/macos-list-apps-authorized-for-full-disk-access + # https://github.com/actions/runner-images/issues/9529 + # https://github.com/actions/runner-images/pull/9530 + + # function to execute sql query for each value + function execute_sql_query { + local value=$1 + local dbPath=$2 + + echo "Executing SQL query for value: $value" + sudo sqlite3 "$dbPath" "INSERT OR IGNORE INTO access VALUES($value);" + } + + # Find all provisioner paths and store them in an array + readarray -t provisioner_paths < <(sudo find /opt /usr -name provisioner) + echo "Provisioner paths: ${provisioner_paths[@]}" + + # Create an empty array + declare -a values=() + + # Loop through the provisioner paths and add them to the values array + for p_path in "${provisioner_paths[@]}"; do + # Adjust the service name and other parameters as needed + values+=("'kTCCServiceAccessibility','${p_path}',1,2,4,1,NULL,NULL,0,'UNUSED',NULL,NULL,1592919552") + values+=("'kTCCServiceScreenCapture','${p_path}',1,2,4,1,NULL,NULL,0,'UNUSED',NULL,0,1687786159") + done + + echo "Values: ${values[@]}" + + if [[ "${{ matrix.os_version }}" == "14" ]]; then + # TCC access table in Sonoma has extra 4 columns: pid, pid_version, boot_uuid, last_reminded + for i in "${!values[@]}"; do + values[$i]="${values[$i]},NULL,NULL,'UNUSED',${values[$i]##*,}" + done + fi + + # system and user databases + dbPaths=( + "/Library/Application Support/com.apple.TCC/TCC.db" + "$HOME/Library/Application Support/com.apple.TCC/TCC.db" + ) + + for value in "${values[@]}"; do + for dbPath in "${dbPaths[@]}"; do + echo "Column names for $dbPath" + echo "-------------------" + sudo sqlite3 "$dbPath" "PRAGMA table_info(access);" + echo "Current permissions for $dbPath" + echo "-------------------" + sudo sqlite3 "$dbPath" "SELECT * FROM access WHERE service='kTCCServiceScreenCapture';" + execute_sql_query "$value" "$dbPath" + echo "Updated permissions for $dbPath" + echo "-------------------" + sudo sqlite3 "$dbPath" "SELECT * FROM access WHERE service='kTCCServiceScreenCapture';" + done + done + + - name: Run tests + id: test + timeout-minutes: 10 + working-directory: + /opt/local/var/macports/build/_Users_runner_work_Sunshine_Sunshine_ports_multimedia_Sunshine/Sunshine/work/build/tests + run: | + sudo ./test_sunshine --gtest_color=yes + + - name: Generate gcov report + # any except canceled or skipped + if: always() && (steps.test.outcome == 'success' || steps.test.outcome == 'failure') + id: test_report + working-directory: + /opt/local/var/macports/build/_Users_runner_work_Sunshine_Sunshine_ports_multimedia_Sunshine/Sunshine/work + run: | + base_dir=$(pwd) + build_dir=${base_dir}/build + + # get the directory name that starts with Sunshine-* + dir=$(ls -d Sunshine-*) + + cd ${build_dir} + ${{ steps.python.outputs.python-path }} -m pip install gcovr + sudo ${{ steps.python.outputs.python-path }} -m gcovr -r ../${dir} \ + --exclude-noncode-lines \ + --exclude-throw-branches \ + --exclude-unreachable-branches \ + --exclude '.*${dir}/tests/.*' \ + --exclude '.*${dir}/third-party/.*' \ + --gcov-object-directory $(pwd) \ + --verbose \ + --xml-pretty \ + -o ${{ github.workspace }}/build/coverage.xml + + - name: Upload coverage + # any except canceled or skipped + if: >- + always() && + (steps.test_report.outcome == 'success') && + startsWith(github.repository, 'LizardByte/') + uses: codecov/codecov-action@v4 + with: + disable_search: true + fail_ci_if_error: false # todo: re-enable this when action is fixed + files: ./build/coverage.xml + flags: ${{ runner.os }}-${{ matrix.os_version }} + token: ${{ secrets.CODECOV_TOKEN }} + verbose: true + - name: Create/Update GitHub Release - if: ${{ needs.setup_release.outputs.create_release == 'true' }} - uses: ncipollo/release-action@v1 + if: ${{ needs.setup_release.outputs.publish_release == 'true' }} + uses: LizardByte/create-release-action@v2024.614.221009 with: - name: ${{ needs.setup_release.outputs.release_name }} - tag: ${{ needs.setup_release.outputs.release_tag }} - commit: ${{ needs.setup_release.outputs.release_commit }} - artifacts: "*artifacts/*" - token: ${{ secrets.GH_BOT_TOKEN }} allowUpdates: true body: ${{ needs.setup_release.outputs.release_body }} discussionCategory: announcements - prerelease: ${{ needs.setup_release.outputs.pre_release }} + generateReleaseNotes: ${{ needs.setup_release.outputs.release_generate_release_notes }} + name: ${{ needs.setup_release.outputs.release_tag }} + prerelease: true + tag: ${{ needs.setup_release.outputs.release_tag }} + token: ${{ secrets.GH_BOT_TOKEN }} build_win: name: Windows runs-on: windows-2019 - needs: [check_changelog, setup_release] + needs: [setup_release] steps: - name: Checkout @@ -706,43 +939,200 @@ jobs: with: submodules: recursive + - name: Prepare tests + id: prepare-tests + if: false # todo: DirectX11 is not available, so even software encoder fails + run: | + # function to download and extract a zip file + function DownloadAndExtract { + param ( + [string]$Uri, + [string]$OutFile + ) + + $maxRetries = 5 + $retryCount = 0 + $success = $false + + while (-not $success -and $retryCount -lt $maxRetries) { + $retryCount++ + Write-Host "Downloading $Uri to $OutFile, attempt $retryCount of $maxRetries" + try { + Invoke-WebRequest -Uri $Uri -OutFile $OutFile + $success = $true + } catch { + Write-Host "Attempt $retryCount of $maxRetries failed with error: $($_.Exception.Message). Retrying..." + Start-Sleep -Seconds 5 + } + } + + if (-not $success) { + Write-Host "Failed to download the file after $maxRetries attempts." + exit 1 + } + + # use .NET to get the base name of the file + $baseName = (Get-Item $OutFile).BaseName + + # Extract the zip file + Expand-Archive -Path $OutFile -DestinationPath $baseName + } + + # virtual display driver + DownloadAndExtract ` + -Uri "https://www.amyuni.com/downloads/usbmmidd_v2.zip" ` + -OutFile "usbmmidd_v2.zip" + + # install + Set-Location -Path usbmmidd_v2/usbmmidd_v2 + ./deviceinstaller64 install usbmmidd.inf usbmmidd + + # create the virtual display + ./deviceinstaller64 enableidd 1 + + # move up a directory + Set-Location -Path ../.. + + # install devcon + DownloadAndExtract ` + -Uri "https://github.com/Drawbackz/DevCon-Installer/releases/download/1.4-rc/Devcon.Installer.zip" ` + -OutFile "Devcon.Installer.zip" + Set-Location -Path Devcon.Installer + # hash needs to match OS version + # https://github.com/Drawbackz/DevCon-Installer/blob/master/devcon_sources.json + Start-Process -FilePath "./Devcon Installer.exe" -Wait -ArgumentList ` + 'install', ` + '-hash', '54004C83EE34F6A55380528A8B29F4C400E61FBB947A19E0AB9E5A193D7D961E', ` + '-addpath', ` + '-update', ` + '-dir', 'C:\Windows\System32' + + # disable Hyper-V Video + # https://stackoverflow.com/a/59490940 + C:\Windows\System32\devcon.exe disable "VMBUS\{da0a7802-e377-4aac-8e77-0558eb1073f8}" + + # move up a directory + Set-Location -Path .. + + # multi monitor tool + DownloadAndExtract ` + -Uri "http://www.nirsoft.net/utils/multimonitortool-x64.zip" ` + -OutFile "multimonitortool.zip" + + # enable the virtual display + # http://www.nirsoft.net/utils/multi_monitor_tool.html + Set-Location -Path multimonitortool + + # Original Hyper-V is \\.\DISPLAY1, it will recreate itself as \\.\DISPLAY6 (or something higher than 2) + # USB Mobile Monitor Virtual Display is \\.\DISPLAY2 + + # these don't seem to work if not using runAs + # todo: do they work if not using runAs? + Start-Process powershell -Verb runAs -ArgumentList '-Command ./MultiMonitorTool.exe /enable \\.\DISPLAY2' + Start-Process powershell -Verb runAs -ArgumentList '-Command ./MultiMonitorTool.exe /SetPrimary \\.\DISPLAY2' + + # wait a few seconds + Start-Sleep -s 5 + + # list monitors + ./MultiMonitorTool.exe /stext monitor_list.txt + + # wait a few seconds + Start-Sleep -s 5 + + # print the monitor list + Get-Content -Path monitor_list.txt + - name: Setup Dependencies Windows uses: msys2/setup-msys2@v2 with: + msystem: ucrt64 update: true install: >- - base-devel - diffutils - git - make - mingw-w64-x86_64-binutils - mingw-w64-x86_64-boost - mingw-w64-x86_64-cmake - mingw-w64-x86_64-curl - mingw-w64-x86_64-onevpl - mingw-w64-x86_64-nsis - mingw-w64-x86_64-openssl - mingw-w64-x86_64-opus - mingw-w64-x86_64-toolchain - nasm wget - yasm - - name: Install npm packages + - name: Update Windows dependencies + shell: msys2 {0} + run: | + # download working curl + wget https://repo.msys2.org/mingw/ucrt64/mingw-w64-ucrt-x86_64-curl-8.8.0-1-any.pkg.tar.zst + + # install dependencies + pacman -U --noconfirm mingw-w64-ucrt-x86_64-curl-8.8.0-1-any.pkg.tar.zst + pacman -Syu --noconfirm \ + --ignore=mingw-w64-ucrt-x86_64-curl \ + git \ + mingw-w64-ucrt-x86_64-boost \ + mingw-w64-ucrt-x86_64-cmake \ + mingw-w64-ucrt-x86_64-cppwinrt \ + mingw-w64-ucrt-x86_64-graphviz \ + mingw-w64-ucrt-x86_64-miniupnpc \ + mingw-w64-ucrt-x86_64-nlohmann-json \ + mingw-w64-ucrt-x86_64-nodejs \ + mingw-w64-ucrt-x86_64-nsis \ + mingw-w64-ucrt-x86_64-onevpl \ + mingw-w64-ucrt-x86_64-openssl \ + mingw-w64-ucrt-x86_64-opus \ + mingw-w64-ucrt-x86_64-toolchain + + - name: Install Doxygen + # GCC compiled doxygen has issues when running graphviz + env: + DOXYGEN_VERSION: "1.11.0" + run: | + # Set version variables + $doxy_ver = $env:DOXYGEN_VERSION + $_doxy_ver = $doxy_ver.Replace(".", "_") + + # Download the Doxygen installer + Invoke-WebRequest -Uri ` + "https://github.com/doxygen/doxygen/releases/download/Release_${_doxy_ver}/doxygen-${doxy_ver}-setup.exe" ` + -OutFile "doxygen-setup.exe" + + # Run the installer + Start-Process ` + -FilePath .\doxygen-setup.exe ` + -ArgumentList ` + '/VERYSILENT' ` + -Wait ` + -NoNewWindow + + # Clean up + Remove-Item -Path doxygen-setup.exe + + - name: Setup python + # use this instead of msys2 python due to known issues using wheels, https://www.msys2.org/docs/python/ + id: setup-python + uses: actions/setup-python@v5 + with: + python-version: '3.11' + + - name: Python Path + id: python-path + shell: msys2 {0} run: | - npm install + # replace backslashes with double backslashes + python_path=$(echo "${{ steps.setup-python.outputs.python-path }}" | sed 's/\\/\\\\/g') + + # step output + echo "python-path=${python_path}" + echo "python-path=${python_path}" >> $GITHUB_OUTPUT - name: Build Windows shell: msys2 {0} env: BRANCH: ${{ github.head_ref || github.ref_name }} - BUILD_VERSION: ${{ needs.check_changelog.outputs.next_version_bare }} - COMMIT: ${{ github.event.pull_request.head.sha || github.sha }} + BUILD_VERSION: ${{ needs.setup_release.outputs.release_tag }} + COMMIT: ${{ needs.setup_release.outputs.release_commit }} run: | mkdir build cd build - cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + cmake \ + -DBUILD_WERROR=ON \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DPython_EXECUTABLE='${{ steps.python-path.outputs.python-path }}' \ -DSUNSHINE_ASSETS_DIR=assets \ + -DTESTS_SOFTWARE_ENCODER_UNAVAILABLE='skip' \ -G "MinGW Makefiles" \ .. mingw32-make -j$(nproc) @@ -761,48 +1151,73 @@ jobs: mv ./cpack_artifacts/Sunshine.exe ../artifacts/sunshine-windows-installer.exe mv ./cpack_artifacts/Sunshine.zip ../artifacts/sunshine-windows-portable.zip + - name: Run tests + id: test + shell: msys2 {0} + working-directory: build/tests + run: | + ./test_sunshine.exe --gtest_color=yes + + - name: Generate gcov report + # any except canceled or skipped + if: always() && (steps.test.outcome == 'success' || steps.test.outcome == 'failure') + id: test_report + shell: msys2 {0} + working-directory: build + run: | + ${{ steps.python-path.outputs.python-path }} -m pip install gcovr + ${{ steps.python-path.outputs.python-path }} -m gcovr -r .. \ + --exclude-noncode-lines \ + --exclude-throw-branches \ + --exclude-unreachable-branches \ + --exclude '.*tests/.*' \ + --exclude '.*third-party/.*' \ + --xml-pretty \ + -o coverage.xml + + - name: Upload coverage + # any except canceled or skipped + if: >- + always() && + (steps.test_report.outcome == 'success') && + startsWith(github.repository, 'LizardByte/') + uses: codecov/codecov-action@v4 + with: + disable_search: true + fail_ci_if_error: true + files: ./build/coverage.xml + flags: ${{ runner.os }} + token: ${{ secrets.CODECOV_TOKEN }} + verbose: true + - name: Package Windows Debug Info working-directory: build run: | - # save the original binaries with debug info + # use .dbg file extension for binaries to avoid confusion with real packages + Get-ChildItem -File -Recurse | ` + % { Rename-Item -Path $_.PSPath -NewName $_.Name.Replace(".exe",".dbg") } + + # save the binaries with debug info 7z -r ` "-xr!CMakeFiles" ` "-xr!cpack_artifacts" ` - a "../artifacts/sunshine-debuginfo-win32.zip" "*.exe" + a "../artifacts/sunshine-win32-debuginfo.7z" "*.dbg" - name: Upload Artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: sunshine-windows path: artifacts/ - name: Create/Update GitHub Release - if: ${{ needs.setup_release.outputs.create_release == 'true' }} - uses: ncipollo/release-action@v1 + if: ${{ needs.setup_release.outputs.publish_release == 'true' }} + uses: LizardByte/create-release-action@v2024.614.221009 with: - name: ${{ needs.setup_release.outputs.release_name }} - tag: ${{ needs.setup_release.outputs.release_tag }} - commit: ${{ needs.setup_release.outputs.release_commit }} - artifacts: "*artifacts/*" - token: ${{ secrets.GH_BOT_TOKEN }} allowUpdates: true body: ${{ needs.setup_release.outputs.release_body }} discussionCategory: announcements - prerelease: ${{ needs.setup_release.outputs.pre_release }} - - release-winget: - name: Release to WinGet - needs: [setup_release, build_win] - if: | - (github.repository_owner == 'LizardByte' && - needs.setup_release.outputs.create_release == 'true' && - github.ref == 'refs/heads/master') - runs-on: ubuntu-latest - steps: - - name: Release to WinGet - uses: vedantmgoyal2009/winget-releaser@v2 - with: - identifier: LizardByte.Sunshine - release-tag: ${{ needs.setup_release.outputs.release_tag }} - installers-regex: '\.exe$' # only .exe files + generateReleaseNotes: ${{ needs.setup_release.outputs.release_generate_release_notes }} + name: ${{ needs.setup_release.outputs.release_tag }} + prerelease: true + tag: ${{ needs.setup_release.outputs.release_tag }} token: ${{ secrets.GH_BOT_TOKEN }} diff --git a/.github/workflows/auto-create-pr.yml b/.github/workflows/auto-create-pr.yml deleted file mode 100644 index 13705dd539c..00000000000 --- a/.github/workflows/auto-create-pr.yml +++ /dev/null @@ -1,35 +0,0 @@ ---- -# This action is centrally managed in https://github.com//.github/ -# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in -# the above-mentioned repo. - -# This workflow creates a PR automatically when anything is merged/pushed into the `nightly` branch. The PR is created -# against the `master` (default) branch. - -name: Auto create PR - -on: - push: - branches: - - 'nightly' - -jobs: - create_pr: - if: startsWith(github.repository, 'LizardByte/') - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Create Pull Request - uses: repo-sync/pull-request@v2 - with: - source_branch: "" # should be "nightly" as it's the triggering branch - destination_branch: "master" - pr_title: "Pulling ${{ github.ref_name }} into master" - pr_template: ".github/pr_release_template.md" - pr_assignee: "${{ secrets.GH_BOT_NAME }}" - pr_draft: true - pr_allow_empty: false - github_token: ${{ secrets.GH_BOT_TOKEN }} diff --git a/.github/workflows/automerge.yml b/.github/workflows/automerge.yml deleted file mode 100644 index 49ddebf4ec1..00000000000 --- a/.github/workflows/automerge.yml +++ /dev/null @@ -1,64 +0,0 @@ ---- -# This action is centrally managed in https://github.com//.github/ -# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in -# the above-mentioned repo. - -# This workflow will, first, automatically approve PRs created by @LizardByte-bot. Then it will automerge relevant PRs. - -name: Automerge PR - -on: - pull_request: - types: - - opened - - synchronize - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - autoapprove: - if: >- - contains(fromJson('["LizardByte-bot"]'), github.event.pull_request.user.login) && - contains(fromJson('["LizardByte-bot"]'), github.actor) && - startsWith(github.repository, 'LizardByte/') - runs-on: ubuntu-latest - steps: - - name: Autoapproving - uses: hmarr/auto-approve-action@v3 - with: - github-token: "${{ secrets.GITHUB_TOKEN }}" - - - name: Label autoapproved - uses: actions/github-script@v6 - with: - github-token: ${{ secrets.GH_BOT_TOKEN }} - script: | - github.rest.issues.addLabels({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - labels: ['autoapproved', 'autoupdate'] - }) - - automerge: - if: startsWith(github.repository, 'LizardByte/') - needs: [autoapprove] - runs-on: ubuntu-latest - - steps: - - name: Automerging - uses: pascalgn/automerge-action@v0.15.6 - env: - BASE_BRANCHES: nightly - GITHUB_TOKEN: ${{ secrets.GH_BOT_TOKEN }} - GITHUB_LOGIN: ${{ secrets.GH_BOT_NAME }} - MERGE_LABELS: "!dependencies" - MERGE_METHOD: "squash" - MERGE_COMMIT_MESSAGE: "{pullRequest.title} (#{pullRequest.number})" - MERGE_DELETE_BRANCH: true - MERGE_ERROR_FAIL: true - MERGE_FILTER_AUTHOR: ${{ secrets.GH_BOT_NAME }} - MERGE_RETRIES: "240" # 1 hour - MERGE_RETRY_SLEEP: "15000" # 15 seconds diff --git a/.github/workflows/ci-docker.yml b/.github/workflows/ci-docker.yml index edeeb2bd9b7..75531176c4d 100644 --- a/.github/workflows/ci-docker.yml +++ b/.github/workflows/ci-docker.yml @@ -22,14 +22,14 @@ name: CI Docker on: pull_request: - branches: [master, nightly] + branches: [master] types: [opened, synchronize, reopened] push: - branches: [master, nightly] + branches: [master] workflow_dispatch: concurrency: - group: ${{ github.workflow }}-${{ github.ref }} + group: "${{ github.workflow }}-${{ github.ref }}" cancel-in-progress: true jobs: @@ -74,82 +74,51 @@ jobs: echo $matrix | jq . echo "matrix=$matrix" >> $GITHUB_OUTPUT + - name: Find dotnet solution file + id: find_dotnet + run: | + solution=$(find . -maxdepth 1 -type f -iname "*.sln") + + echo "found solution: ${solution}" + + # do not quote to keep this as a single line + echo solution=${solution} >> $GITHUB_OUTPUT + + if [[ $solution != "" ]]; then + echo "dotnet=true" >> $GITHUB_OUTPUT + else + echo "dotnet=false" >> $GITHUB_OUTPUT + fi + outputs: dockerfiles: ${{ steps.find.outputs.dockerfiles }} matrix: ${{ steps.find.outputs.matrix }} + dotnet: ${{ steps.find_dotnet.outputs.dotnet }} + solution: ${{ steps.find_dotnet.outputs.solution }} - check_changelog: - name: Check Changelog - needs: [check_dockerfiles] + setup_release: if: ${{ needs.check_dockerfiles.outputs.dockerfiles }} + name: Setup Release + needs: + - check_dockerfiles + outputs: + publish_release: ${{ steps.setup_release.outputs.publish_release }} + release_body: ${{ steps.setup_release.outputs.release_body }} + release_commit: ${{ steps.setup_release.outputs.release_commit }} + release_generate_release_notes: ${{ steps.setup_release.outputs.release_generate_release_notes }} + release_tag: ${{ steps.setup_release.outputs.release_tag }} + release_version: ${{ steps.setup_release.outputs.release_version }} runs-on: ubuntu-latest steps: - name: Checkout - if: ${{ github.ref == 'refs/heads/master' || github.base_ref == 'master' }} uses: actions/checkout@v4 - - name: Verify Changelog - id: verify_changelog - if: ${{ github.ref == 'refs/heads/master' || github.base_ref == 'master' }} - # base_ref for pull request check, ref for push - uses: LizardByte/.github/actions/verify_changelog@master + - name: Setup Release + id: setup_release + uses: LizardByte/setup-release-action@v2024.717.220227 with: - token: ${{ secrets.GITHUB_TOKEN }} - outputs: - next_version: ${{ steps.verify_changelog.outputs.changelog_parser_version }} - next_version_bare: ${{ steps.verify_changelog.outputs.changelog_parser_version_bare }} - last_version: ${{ steps.verify_changelog.outputs.latest_release_tag_name }} - release_body: ${{ steps.verify_changelog.outputs.changelog_parser_description }} - - setup_release: - name: Setup Release - needs: check_changelog - runs-on: ubuntu-latest - steps: - - name: Set release details - id: release_details - env: - RELEASE_BODY: ${{ needs.check_changelog.outputs.release_body }} - run: | - # determine to create a release or not - if [[ $GITHUB_EVENT_NAME == "push" ]]; then - RELEASE=true - else - RELEASE=false - fi - - # set the release tag - COMMIT=${{ github.sha }} - if [[ $GITHUB_REF == refs/heads/master ]]; then - TAG="${{ needs.check_changelog.outputs.next_version }}" - RELEASE_NAME="${{ needs.check_changelog.outputs.next_version }}" - RELEASE_BODY="$RELEASE_BODY" - PRE_RELEASE="false" - elif [[ $GITHUB_REF == refs/heads/nightly ]]; then - TAG="nightly-dev" - RELEASE_NAME="nightly" - RELEASE_BODY="automated nightly release - $(date -u +'%Y-%m-%dT%H:%M:%SZ') - ${COMMIT}" - PRE_RELEASE="true" - fi - - echo "create_release=${RELEASE}" >> $GITHUB_OUTPUT - echo "release_tag=${TAG}" >> $GITHUB_OUTPUT - echo "release_commit=${COMMIT}" >> $GITHUB_OUTPUT - echo "release_name=${RELEASE_NAME}" >> $GITHUB_OUTPUT - echo "pre_release=${PRE_RELEASE}" >> $GITHUB_OUTPUT - - # this is stupid but works for multiline strings - echo "RELEASE_BODY<> $GITHUB_ENV - echo "$RELEASE_BODY" >> $GITHUB_ENV - echo "EOF" >> $GITHUB_ENV - - outputs: - create_release: ${{ steps.release_details.outputs.create_release }} - release_tag: ${{ steps.release_details.outputs.release_tag }} - release_commit: ${{ steps.release_details.outputs.release_commit }} - release_name: ${{ steps.release_details.outputs.release_name }} - release_body: ${{ env.RELEASE_BODY }} - pre_release: ${{ steps.release_details.outputs.pre_release }} + dotnet: ${{ needs.check_dockerfiles.outputs.dotnet }} + github_token: ${{ secrets.GITHUB_TOKEN }} lint_dockerfile: needs: [check_dockerfiles] @@ -180,7 +149,7 @@ jobs: cat "./hadolint.log" >> $GITHUB_STEP_SUMMARY docker: - needs: [check_dockerfiles, check_changelog, setup_release] + needs: [check_dockerfiles, setup_release] if: ${{ needs.check_dockerfiles.outputs.dockerfiles }} runs-on: ubuntu-latest permissions: @@ -193,7 +162,7 @@ jobs: steps: - name: Maximize build space - uses: easimon/maximize-build-space@v8 + uses: easimon/maximize-build-space@v10 with: root-reserve-mb: 30720 # https://github.com/easimon/maximize-build-space#caveats remove-dotnet: 'true' @@ -210,24 +179,20 @@ jobs: - name: Prepare id: prepare env: - NV: ${{ needs.check_changelog.outputs.next_version }} + NV: ${{ needs.setup_release.outputs.release_tag }} run: | # get branch name BRANCH=${GITHUB_HEAD_REF} - RELEASE=false + RELEASE=${{ needs.setup_release.outputs.publish_release }} + COMMIT=${{ needs.setup_release.outputs.release_commit }} if [ -z "$BRANCH" ]; then echo "This is a PUSH event" BRANCH=${{ github.ref_name }} - COMMIT=${{ github.sha }} CLONE_URL=${{ github.event.repository.clone_url }} - if [[ $BRANCH == "master" ]]; then - RELEASE=true - fi else echo "This is a PULL REQUEST event" - COMMIT=${{ github.event.pull_request.head.sha }} CLONE_URL=${{ github.event.pull_request.head.repo.clone_url }} fi @@ -247,8 +212,6 @@ jobs: if [[ $GITHUB_REF == refs/heads/master ]]; then TAGS="${TAGS},${BASE_TAG}:latest${{ matrix.tag }},ghcr.io/${BASE_TAG}:latest${{ matrix.tag }}" TAGS="${TAGS},${BASE_TAG}:master${{ matrix.tag }},ghcr.io/${BASE_TAG}:master${{ matrix.tag }}" - elif [[ $GITHUB_REF == refs/heads/nightly ]]; then - TAGS="${TAGS},${BASE_TAG}:nightly${{ matrix.tag }},ghcr.io/${BASE_TAG}:nightly${{ matrix.tag }}" else TAGS="${TAGS},${BASE_TAG}:test${{ matrix.tag }},ghcr.io/${BASE_TAG}:test${{ matrix.tag }}" fi @@ -260,7 +223,7 @@ jobs: # parse custom directives out of dockerfile # try to get the platforms from the dockerfile custom directive, i.e. `# platforms: xxx,yyy` # directives for PR event, i.e. not push event - if [[ ${PUSH} == "false" ]]; then + if [[ ${RELEASE} == "false" ]]; then while read -r line; do if [[ $line == "# platforms_pr: "* && $PLATFORMS == "" ]]; then # echo the line and use `sed` to remove the custom directive @@ -299,13 +262,10 @@ jobs: echo "branch=${BRANCH}" >> $GITHUB_OUTPUT echo "build_date=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT - echo "commit=${COMMIT}" >> $GITHUB_OUTPUT echo "clone_url=${CLONE_URL}" >> $GITHUB_OUTPUT - echo "release=${RELEASE}" >> $GITHUB_OUTPUT echo "artifacts=${ARTIFACTS}" >> $GITHUB_OUTPUT echo "no_cache_filters=${NO_CACHE_FILTERS}" >> $GITHUB_OUTPUT echo "platforms=${PLATFORMS}" >> $GITHUB_OUTPUT - echo "push=${PUSH}" >> $GITHUB_OUTPUT echo "tags=${TAGS}" >> $GITHUB_OUTPUT - name: Set Up QEMU @@ -316,7 +276,7 @@ jobs: id: buildx - name: Cache Docker Layers - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: /tmp/.buildx-cache key: Docker-buildx${{ matrix.tag }}-${{ github.sha }} @@ -324,14 +284,14 @@ jobs: Docker-buildx${{ matrix.tag }}- - name: Log in to Docker Hub - if: ${{ steps.prepare.outputs.push == 'true' }} # PRs do not have access to secrets + if: ${{ needs.setup_release.outputs.publish_release == 'true' }} # PRs do not have access to secrets uses: docker/login-action@v3 with: username: ${{ secrets.DOCKER_HUB_USERNAME }} password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} - name: Log in to the Container registry - if: ${{ steps.prepare.outputs.push == 'true' }} # PRs do not have access to secrets + if: ${{ needs.setup_release.outputs.publish_release == 'true' }} # PRs do not have access to secrets uses: docker/login-action@v3 with: registry: ghcr.io @@ -341,7 +301,7 @@ jobs: - name: Build artifacts if: ${{ steps.prepare.outputs.artifacts == 'true' }} id: build_artifacts - uses: docker/build-push-action@v5 + uses: docker/build-push-action@v6 with: context: ./ file: ${{ matrix.dockerfile }} @@ -352,10 +312,10 @@ jobs: build-args: | BRANCH=${{ steps.prepare.outputs.branch }} BUILD_DATE=${{ steps.prepare.outputs.build_date }} - BUILD_VERSION=${{ needs.check_changelog.outputs.next_version }} - COMMIT=${{ steps.prepare.outputs.commit }} + BUILD_VERSION=${{ needs.setup_release.outputs.release_tag }} + COMMIT=${{ needs.setup_release.outputs.release_commit }} CLONE_URL=${{ steps.prepare.outputs.clone_url }} - RELEASE=${{ steps.prepare.outputs.release }} + RELEASE=${{ needs.setup_release.outputs.publish_release }} tags: ${{ steps.prepare.outputs.tags }} cache-from: type=local,src=/tmp/.buildx-cache cache-to: type=local,dest=/tmp/.buildx-cache @@ -363,19 +323,19 @@ jobs: - name: Build and push id: build - uses: docker/build-push-action@v5 + uses: docker/build-push-action@v6 with: context: ./ file: ${{ matrix.dockerfile }} - push: ${{ steps.prepare.outputs.push }} + push: ${{ needs.setup_release.outputs.publish_release }} platforms: ${{ steps.prepare.outputs.platforms }} build-args: | BRANCH=${{ steps.prepare.outputs.branch }} BUILD_DATE=${{ steps.prepare.outputs.build_date }} - BUILD_VERSION=${{ needs.check_changelog.outputs.next_version }} - COMMIT=${{ steps.prepare.outputs.commit }} + BUILD_VERSION=${{ needs.setup_release.outputs.release_tag }} + COMMIT=${{ needs.setup_release.outputs.release_commit }} CLONE_URL=${{ steps.prepare.outputs.clone_url }} - RELEASE=${{ steps.prepare.outputs.release }} + RELEASE=${{ needs.setup_release.outputs.publish_release }} tags: ${{ steps.prepare.outputs.tags }} cache-from: type=local,src=/tmp/.buildx-cache cache-to: type=local,dest=/tmp/.buildx-cache @@ -395,28 +355,28 @@ jobs: - name: Upload Artifacts if: ${{ steps.prepare.outputs.artifacts == 'true' }} - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: Docker${{ matrix.tag }} path: artifacts/ - name: Create/Update GitHub Release - if: ${{ needs.setup_release.outputs.create_release == 'true' && steps.prepare.outputs.artifacts == 'true' }} - uses: ncipollo/release-action@v1 + if: ${{ needs.setup_release.outputs.publish_release == 'true' && steps.prepare.outputs.artifacts == 'true' }} + uses: LizardByte/create-release-action@v2024.614.221009 with: - name: ${{ needs.setup_release.outputs.release_name }} - tag: ${{ needs.setup_release.outputs.release_tag }} - commit: ${{ needs.setup_release.outputs.release_commit }} - artifacts: "*artifacts/*" - token: ${{ secrets.GH_BOT_TOKEN }} allowUpdates: true + artifacts: "*artifacts/*" body: ${{ needs.setup_release.outputs.release_body }} discussionCategory: announcements - prerelease: ${{ needs.setup_release.outputs.pre_release }} + generateReleaseNotes: ${{ needs.setup_release.outputs.release_generate_release_notes }} + name: ${{ needs.setup_release.outputs.release_tag }} + prerelease: true + tag: ${{ needs.setup_release.outputs.release_tag }} + token: ${{ secrets.GH_BOT_TOKEN }} - name: Update Docker Hub Description if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} - uses: peter-evans/dockerhub-description@v3 + uses: peter-evans/dockerhub-description@v4 with: username: ${{ secrets.DOCKER_HUB_USERNAME }} password: ${{ secrets.DOCKER_HUB_PASSWORD }} # token is not currently supported diff --git a/.github/workflows/ci-qodana.yml b/.github/workflows/ci-qodana.yml deleted file mode 100644 index efc56349b30..00000000000 --- a/.github/workflows/ci-qodana.yml +++ /dev/null @@ -1,292 +0,0 @@ ---- -# This action is centrally managed in https://github.com//.github/ -# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in -# the above-mentioned repo. - -name: Qodana - -on: - pull_request: - branches: [master, nightly] - types: [opened, synchronize, reopened] - push: - branches: [master, nightly] - workflow_dispatch: - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - qodana_initial_check: - name: Qodana Initial Check - permissions: - actions: write # required to use workflow dispatch on fork PRs - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Prepare - id: prepare - run: | - # check the branch variable - if [ "${{ github.event_name }}" == "push" ] - then - echo "This is a PUSH event" - # use the branch name - destination=${{ github.ref_name }} - target=${{ github.ref_name }} - else - echo "This is a PR event" - # use the PR number - destination=${{ github.event.pull_request.number }} - target=${{ github.event.pull_request.base.ref }} - fi - - echo "checkout_repo=$checkout_repo" >> $GITHUB_OUTPUT - echo "checkout_ref=$checkout_ref" >> $GITHUB_OUTPUT - echo "destination=$destination" >> $GITHUB_OUTPUT - echo "target=$target" >> $GITHUB_OUTPUT - - # prepare urls - base=https://${{ github.repository_owner }}.github.io - report_url=${base}/qodana-reports/${{ github.event.repository.name }}/${destination} - echo "report_url=$report_url" >> $GITHUB_OUTPUT - - # build matrix - files=$(find . -type f -iname "qodana*.yaml") - - echo "files: ${files}" - - # do not quote to keep this as a single line - echo files=${files} >> $GITHUB_OUTPUT - - MATRIX_COMBINATIONS="" - REPORTS_MARKDOWN="" - for FILE in ${files}; do - # extract the language from file name after `qodana-` and before `.yaml` - language=$(echo $FILE | sed -r -z -e 's/(\.\/)*.*\/(qodana.yaml)/default/gm') - if [[ $language != "default" ]]; then - language=$(echo $FILE | sed -r -z -e 's/(\.\/)*.*qodana-(.*).yaml/\2/gm') - fi - MATRIX_COMBINATIONS="$MATRIX_COMBINATIONS {\"file\": \"$FILE\", \"language\": \"$language\"}," - REPORTS_MARKDOWN="$REPORTS_MARKDOWN
- [${language}](${report_url}/${language})" - done - - # removes the last character (i.e. comma) - MATRIX_COMBINATIONS=${MATRIX_COMBINATIONS::-1} - - # setup matrix for later jobs - matrix=$(( - echo "{ \"include\": [$MATRIX_COMBINATIONS] }" - ) | jq -c .) - - echo $matrix - echo $matrix | jq . - echo "matrix=$matrix" >> $GITHUB_OUTPUT - - echo "reports_markdown=$REPORTS_MARKDOWN" >> $GITHUB_OUTPUT - - - name: Setup initial notification inputs - id: inputs - if: >- - startsWith(github.event_name, 'pull_request') && - steps.prepare.outputs.files != '' - run: | - # workflow logs - workflow_url_a=https://github.com/${{ github.repository_owner }}/${{ github.event.repository.name }} - workflow_url=${workflow_url_a}/actions/runs/${{ github.run_id }} - - # multiline message - message=$(cat <<- EOF - :warning: **Qodana is checking this PR** :warning: - Live results available [here](${workflow_url}) - EOF - ) - - # escape json control characters - message=$(jq -n --arg message "$message" '$message' | sed -e 's/\\/\\\\/g' -e 's/"/\\"/g') - - secondary_inputs=$(echo '{ - "issue_message": "'"${message}"'", - "issue_message_id": "'"qodana"'", - "issue_number": "'"${{ github.event.number }}"'", - "issue_repo_owner": "'"${{ github.repository_owner }}"'", - "issue_repo_name": "'"${{ github.event.repository.name }}"'" - }' | jq -r .) - - #escape json control characters - secondary_inputs=$(jq -n --arg secondary_inputs "$secondary_inputs" '$secondary_inputs' \ - | sed -e 's/\\/\\\\/g' -e 's/"/\\"/g') - - echo $secondary_inputs - - # secondary input as string, not JSON - # todo - change dispatch_ref to master instead of nightly - primary_inputs=$(echo '{ - "dispatch_repository": "'"${{ github.repository_owner }}/.github"'", - "dispatch_workflow": "'"dispatch-issue-comment.yml"'", - "dispatch_ref": "'"nightly"'", - "dispatch_inputs": "'"${secondary_inputs}"'" - }' | jq -c .) - - echo $primary_inputs - echo $primary_inputs | jq . - echo "primary_inputs=$primary_inputs" >> $GITHUB_OUTPUT - - - name: Workflow Dispatch - if: >- - startsWith(github.event_name, 'pull_request') && - steps.prepare.outputs.files != '' - uses: benc-uk/workflow-dispatch@v1.2.2 - continue-on-error: true # this might error if the workflow is not found, but we still want to run the next job - with: - ref: ${{ github.base_ref || github.ref_name }} # base ref for PR and branch name for push - workflow: dispatcher.yml - inputs: ${{ steps.inputs.outputs.primary_inputs }} - token: ${{ github.token }} - - outputs: - destination: ${{ steps.prepare.outputs.destination }} - target: ${{ steps.prepare.outputs.target }} - files: ${{ steps.prepare.outputs.files }} - reports_markdown: ${{ steps.prepare.outputs.reports_markdown }} - matrix: ${{ steps.prepare.outputs.matrix }} - - qodana: - if: ${{ needs.qodana_initial_check.outputs.files != '' }} - needs: [qodana_initial_check] - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: ${{ fromJson(needs.qodana_initial_check.outputs.matrix) }} - name: Qodana-Scan-${{ matrix.language }} - continue-on-error: true - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - submodules: recursive - - - name: Get baseline - id: baseline - run: | - # check if destination is not an integer - if ! [[ "${{ needs.qodana_initial_check.outputs.destination }}" =~ ^[0-9]+$ ]] - then - echo "Running for a branch update" - echo "baseline_args=" >> $GITHUB_OUTPUT - else - echo "Running for a PR" - - sarif_file=qodana.sarif.json - repo=${{ github.event.repository.name }} - target=${{ needs.qodana_initial_check.outputs.target }} - language=${{ matrix.language }} - - baseline_file="${repo}/${target}/${language}/results/${sarif_file}" - baseline_file_url="https://lizardbyte.github.io/qodana-reports/${baseline_file}" - - # don't fail if file does not exist - wget ${baseline_file_url} || true - - # check if file exists - if [ -f ${sarif_file} ] - then - echo "baseline exists" - echo "baseline_args=--baseline,${sarif_file}" >> $GITHUB_OUTPUT - else - echo "baseline does not exist" - echo "baseline_args=" >> $GITHUB_OUTPUT - fi - fi - - - name: Rename Qodana config file - id: rename - run: | - # rename the file - if [ "${{ matrix.file }}" != "./qodana.yaml" ] - then - mv -f ${{ matrix.file }} ./qodana.yaml - fi - - - name: Qodana - id: qodana - continue-on-error: true # ensure dispatch-qodana job is run - uses: JetBrains/qodana-action@v2023.2.6 - with: - additional-cache-hash: ${{ github.ref }}-${{ matrix.language }} - artifact-name: qodana-${{ matrix.language }} # yamllint disable-line rule:line-length - args: '--print-problems,${{ steps.baseline.outputs.baseline_args }}' - pr-mode: false - upload-result: true - use-caches: true - - - name: Set output status - id: status - run: | - # check if qodana failed - echo "qodana_status=${{ steps.qodana.outcome }}" >> $GITHUB_OUTPUT - - outputs: - qodana_status: ${{ steps.status.outputs.qodana_status }} - - dispatch-qodana: - # trigger qodana-reports to download artifacts from the matrix runs - needs: [qodana_initial_check, qodana] - runs-on: ubuntu-latest - name: Dispatch Qodana - permissions: - actions: write # required to use workflow dispatch on fork PRs - if: ${{ needs.qodana_initial_check.outputs.files != '' }} - steps: - - name: Setup qodana publish inputs - id: inputs - run: | - # get the artifacts - artifacts=${{ toJson(steps.artifacts.outputs.result) }} - artifacts=$(echo $artifacts | jq -c .) - - # get the target branch - target=${{ needs.qodana_initial_check.outputs.target }} - - # get the destination branch - destination=${{ needs.qodana_initial_check.outputs.destination }} - - # client payload - secondary_inputs=$(echo '{ - "destination": "'"${destination}"'", - "ref": "'"${{ github.ref }}"'", - "repo": "'"${{ github.repository }}"'", - "repo_name": "'"${{ github.event.repository.name }}"'", - "run_id": "'"${{ github.run_id }}"'", - "reports_markdown": "'"${{ needs.qodana_initial_check.outputs.reports_markdown }}"'", - "status": "'"${{ needs.qodana.outputs.qodana_status }}"'" - }' | jq -r .) - - #escape json control characters - secondary_inputs=$(jq -n --arg secondary_inputs "$secondary_inputs" '$secondary_inputs' \ - | sed -e 's/\\/\\\\/g' -e 's/"/\\"/g') - - echo $secondary_inputs - - primary_inputs=$(echo '{ - "dispatch_repository": "'"${{ github.repository_owner }}/qodana-reports"'", - "dispatch_workflow": "'"dispatch-qodana.yml"'", - "dispatch_ref": "'"master"'", - "dispatch_inputs": "'"$secondary_inputs"'" - }' | jq -c .) - - echo $primary_inputs - echo $primary_inputs | jq . - echo "primary_inputs=$primary_inputs" >> $GITHUB_OUTPUT - - - name: Workflow Dispatch - uses: benc-uk/workflow-dispatch@v1.2.2 - continue-on-error: true # this might error if the workflow is not found, but we don't want to fail the workflow - with: - ref: ${{ github.base_ref || github.ref_name }} # base ref for PR and branch name for push - workflow: dispatcher.yml - inputs: ${{ steps.inputs.outputs.primary_inputs }} - token: ${{ github.token }} diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 95349bbc477..60dbef1cc07 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -9,14 +9,14 @@ name: "CodeQL" on: push: - branches: ["master", "nightly"] + branches: ["master"] pull_request: - branches: ["master", "nightly"] + branches: ["master"] schedule: - cron: '00 12 * * 0' # every Sunday at 12:00 UTC concurrency: - group: ${{ github.workflow }}-${{ github.ref }} + group: "${{ github.workflow }}-${{ github.ref }}" cancel-in-progress: true jobs: @@ -28,7 +28,7 @@ jobs: continue: ${{ steps.continue.outputs.result }} steps: - name: Get repo languages - uses: actions/github-script@v6 + uses: actions/github-script@v7 id: lang with: script: | @@ -57,10 +57,27 @@ jobs: console.log(`Remapping language: ${key} to ${remap_languages[key.toLowerCase()]}`) key = remap_languages[key.toLowerCase()] } - if (supported_languages.includes(key.toLowerCase()) && - !matrix['include'].includes({"language": key.toLowerCase()})) { + if (supported_languages.includes(key.toLowerCase())) { console.log(`Found supported language: ${key}`) - matrix['include'].push({"language": key.toLowerCase()}) + let osList = ['ubuntu-latest']; + if (key.toLowerCase() === 'swift') { + osList = ['macos-latest']; + } else if (key.toLowerCase() === 'cpp') { + // TODO: update macos to latest after the below issue is resolved + // https://github.com/github/codeql-action/issues/2266 + osList = ['macos-13', 'ubuntu-latest', 'windows-latest']; + } + for (let os of osList) { + // set name for matrix + if (osList.length == 1) { + name = key.toLowerCase() + } else { + name = `${key.toLowerCase()}, ${os}` + } + + // add to matrix + matrix['include'].push({"language": key.toLowerCase(), "os": os, "name": name}) + } } } @@ -70,7 +87,7 @@ jobs: return matrix - name: Continue - uses: actions/github-script@v6 + uses: actions/github-script@v7 id: continue with: script: | @@ -84,10 +101,15 @@ jobs: } analyze: - name: Analyze + name: Analyze (${{ matrix.name }}) if: ${{ needs.languages.outputs.continue == 'true' }} + defaults: + run: + shell: ${{ matrix.os == 'windows-latest' && 'msys2 {0}' || 'bash' }} + env: + GITHUB_CODEQL_BUILD: true needs: [languages] - runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }} + runs-on: ${{ matrix.os || 'ubuntu-latest' }} timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }} permissions: actions: read @@ -100,9 +122,12 @@ jobs: steps: - name: Maximize build space - uses: easimon/maximize-build-space@v8 + if: >- + runner.os == 'Linux' && + matrix.language == 'cpp' + uses: easimon/maximize-build-space@v10 with: - root-reserve-mb: 20480 + root-reserve-mb: 30720 remove-dotnet: ${{ (matrix.language == 'csharp' && 'false') || 'true' }} remove-android: 'true' remove-haskell: 'true' @@ -114,9 +139,18 @@ jobs: with: submodules: recursive + - name: Setup msys2 + if: >- + runner.os == 'Windows' && + matrix.language == 'cpp' + uses: msys2/setup-msys2@v2 + with: + msystem: ucrt64 + update: true + # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@v2 + uses: github/codeql-action/init@v3 with: languages: ${{ matrix.language }} # If you wish to specify custom queries, you can do so here or in a config file. @@ -126,22 +160,55 @@ jobs: # yamllint disable-line rule:line-length # For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs # queries: security-extended,security-and-quality + config: | + paths-ignore: + - build + - node_modules + - third-party # Pre autobuild # create a file named .codeql-prebuild-${{ matrix.language }}.sh in the root of your repository + # create a file named .codeql-build-${{ matrix.language }}.sh in the root of your repository - name: Prebuild + id: prebuild run: | - # check if .qodeql-prebuild-${{ matrix.language }}.sh exists - if [ -f "./.codeql-prebuild-${{ matrix.language }}.sh" ]; then - echo "Running .codeql-prebuild-${{ matrix.language }}.sh" - ./.codeql-prebuild-${{ matrix.language }}.sh + # check if prebuild script exists + filename=".codeql-prebuild-${{ matrix.language }}-${{ runner.os }}.sh" + if [ -f "./${filename}" ]; then + echo "Running prebuild script: ${filename}" + ./${filename} fi # Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift). - name: Autobuild - uses: github/codeql-action/autobuild@v2 + if: steps.prebuild.outputs.skip_autobuild != 'true' + uses: github/codeql-action/autobuild@v3 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 + uses: github/codeql-action/analyze@v3 with: category: "/language:${{matrix.language}}" + output: sarif-results + upload: failure-only + + - name: filter-sarif + uses: advanced-security/filter-sarif@v1 + with: + input: sarif-results/${{ matrix.language }}.sarif + output: sarif-results/${{ matrix.language }}.sarif + patterns: | + -build/** + -node_modules/** + -third\-party/** + + - name: Upload SARIF + uses: github/codeql-action/upload-sarif@v3 + with: + sarif_file: sarif-results/${{ matrix.language }}.sarif + + - name: Upload loc as a Build Artifact + uses: actions/upload-artifact@v4 + with: + name: sarif-results-${{ matrix.language }}-${{ runner.os }} + path: sarif-results + retention-days: 1 diff --git a/.github/workflows/cpp-lint.yml b/.github/workflows/cpp-lint.yml index 86a2b8d686b..5d0df5ad76c 100644 --- a/.github/workflows/cpp-lint.yml +++ b/.github/workflows/cpp-lint.yml @@ -9,11 +9,11 @@ name: C++ Lint on: pull_request: - branches: [master, nightly] + branches: [master] types: [opened, synchronize, reopened] concurrency: - group: ${{ github.workflow }}-${{ github.ref }} + group: "${{ github.workflow }}-${{ github.ref }}" cancel-in-progress: true jobs: @@ -55,7 +55,7 @@ jobs: - name: Clang format lint if: ${{ steps.find_files.outputs.found_files }} - uses: DoozyX/clang-format-lint-action@v0.16.2 + uses: DoozyX/clang-format-lint-action@v0.17 with: source: ${{ steps.find_files.outputs.found_files }} extensions: 'cpp,h,m,mm' @@ -65,7 +65,7 @@ jobs: - name: Upload Artifacts if: failure() - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: clang-format-fixes path: ${{ steps.find_files.outputs.found_files }} @@ -79,7 +79,7 @@ jobs: uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: '3.11' diff --git a/.github/workflows/dispatcher.yml b/.github/workflows/dispatcher.yml deleted file mode 100644 index c83a233ecea..00000000000 --- a/.github/workflows/dispatcher.yml +++ /dev/null @@ -1,69 +0,0 @@ ---- -# This action is centrally managed in https://github.com//.github/ -# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in -# the above-mentioned repo. - -# This action receives a dispatch event and passes it through to another repo. This is a workaround to avoid issues -# where fork PRs do not have access to secrets. - -name: Dispatcher - -on: - workflow_dispatch: - inputs: - dispatch_repository: - description: 'Repository to dispatch to' - required: true - dispatch_workflow: - description: 'Workflow to dispatch to' - required: true - dispatch_ref: - description: 'Ref/branch to dispatch to' - required: true - dispatch_inputs: - description: 'Inputs to send' - required: true - -jobs: - dispatcher: - name: Repository Dispatch - runs-on: ubuntu-latest - steps: - - name: Unescape JSON control characters - id: inputs - run: | - # get the inputs - dispatch_inputs=${{ github.event.inputs.dispatch_inputs }} - echo "$dispatch_inputs" - - # temporarily replace newlines with a placeholder - dispatch_inputs=$(echo ${dispatch_inputs} | sed 's/\\\\n/_!new_line!_/g') - - # remove newline characters - dispatch_inputs=$(echo ${dispatch_inputs} | sed 's/\\n//g') - - # replace placeholder with newline - dispatch_inputs=$(echo ${dispatch_inputs} | sed 's/_!new_line!_/\\n/g') - - # replace escaped quotes with unescaped quotes - dispatch_inputs=$(echo ${dispatch_inputs} | sed 's/\\"//g') - - # debug echo - echo "$dispatch_inputs" - - # parse as JSON - dispatch_inputs=$(echo "$dispatch_inputs" | jq -c .) - - # debug echo - echo "$dispatch_inputs" - - echo "dispatch_inputs=$dispatch_inputs" >> $GITHUB_OUTPUT - - - name: Workflow Dispatch - uses: benc-uk/workflow-dispatch@v1.2.2 - with: - repo: ${{ github.event.inputs.dispatch_repository }} - ref: ${{ github.event.inputs.dispatch_ref || 'master' }} # default to master if not specified - workflow: ${{ github.event.inputs.dispatch_workflow }} - inputs: ${{ steps.inputs.outputs.dispatch_inputs }} - token: ${{ secrets.GH_BOT_TOKEN || github.token }} # fallback to default token if not specified diff --git a/.github/workflows/issues-stale.yml b/.github/workflows/issues-stale.yml index aecc8243f34..deb3d74b961 100644 --- a/.github/workflows/issues-stale.yml +++ b/.github/workflows/issues-stale.yml @@ -18,7 +18,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Stale - uses: actions/stale@v8 + uses: actions/stale@v9 with: close-issue-message: > This issue was closed because it has been stalled for 10 days with no activity. @@ -43,7 +43,7 @@ jobs: repo-token: ${{ secrets.GH_BOT_TOKEN }} - name: Invalid Template - uses: actions/stale@v8 + uses: actions/stale@v9 with: close-issue-message: > This issue was closed because the the template was not completed after 5 days. diff --git a/.github/workflows/issues.yml b/.github/workflows/issues.yml index d7a1025cdce..aec6006c870 100644 --- a/.github/workflows/issues.yml +++ b/.github/workflows/issues.yml @@ -20,6 +20,6 @@ jobs: runs-on: ubuntu-latest steps: - name: Label Actions - uses: dessant/label-actions@v3 + uses: dessant/label-actions@v4 with: github-token: ${{ secrets.GH_BOT_TOKEN }} diff --git a/.github/workflows/localize.yml b/.github/workflows/localize.yml index eb7e77974a2..da0997a32bc 100644 --- a/.github/workflows/localize.yml +++ b/.github/workflows/localize.yml @@ -3,7 +3,7 @@ name: localize on: push: - branches: [nightly] + branches: [master] paths: # prevents workflow from running unless these files change - '.github/workflows/localize.yml' - 'src/**' @@ -23,7 +23,7 @@ jobs: uses: actions/checkout@v4 - name: Install Python 3.9 - uses: actions/setup-python@v4 # https://github.com/actions/setup-python + uses: actions/setup-python@v5 # https://github.com/actions/setup-python with: python-version: '3.9' @@ -77,7 +77,7 @@ jobs: run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT - name: Create/Update Pull Request - uses: peter-evans/create-pull-request@v5 + uses: peter-evans/create-pull-request@v6 with: add-paths: | locale/*.po @@ -85,7 +85,7 @@ jobs: commit-message: New localization template branch: localize/update delete-branch: true - base: nightly + base: master title: New Babel Updates body: | Update report diff --git a/.github/workflows/python-flake8.yml b/.github/workflows/python-flake8.yml index 4b0d30810da..61e23f741b7 100644 --- a/.github/workflows/python-flake8.yml +++ b/.github/workflows/python-flake8.yml @@ -9,11 +9,11 @@ name: flake8 on: pull_request: - branches: [master, nightly] + branches: [master] types: [opened, synchronize, reopened] concurrency: - group: ${{ github.workflow }}-${{ github.ref }} + group: "${{ github.workflow }}-${{ github.ref }}" cancel-in-progress: true jobs: @@ -24,7 +24,7 @@ jobs: uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v4 # https://github.com/actions/setup-python + uses: actions/setup-python@v5 # https://github.com/actions/setup-python with: python-version: '3.10' diff --git a/.github/workflows/release-notifier-moonlight.yml b/.github/workflows/release-notifier-moonlight.yml index 9ac896f376a..9369a7fabc5 100644 --- a/.github/workflows/release-notifier-moonlight.yml +++ b/.github/workflows/release-notifier-moonlight.yml @@ -3,10 +3,15 @@ name: Release Notifications (Moonlight) on: release: - types: [published] + types: + - released # this triggers when a release is published, but does not include prereleases or drafts jobs: discord: + if: >- + startsWith(github.repository, 'LizardByte/') && + !github.event.release.prerelease && + !github.event.release.draft runs-on: ubuntu-latest steps: - name: discord diff --git a/.github/workflows/release-notifier.yml b/.github/workflows/release-notifier.yml index 5161fc5f5d5..60608394ba1 100644 --- a/.github/workflows/release-notifier.yml +++ b/.github/workflows/release-notifier.yml @@ -9,15 +9,15 @@ name: Release Notifications on: release: - types: [published] - # https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#onevent_nametypes + types: + - released # this triggers when a release is published, but does not include prereleases or drafts jobs: discord: if: >- - (github.repository, 'LizardByte/') and - not(github.event.release.prerelease) and - not(github.event.release.draft) + startsWith(github.repository, 'LizardByte/') && + !github.event.release.prerelease && + !github.event.release.draft runs-on: ubuntu-latest steps: - name: discord @@ -34,9 +34,9 @@ jobs: facebook_group: if: >- - (github.repository, 'LizardByte/') and - not(github.event.release.prerelease) and - not(github.event.release.draft) + startsWith(github.repository, 'LizardByte/') && + !github.event.release.prerelease && + !github.event.release.draft runs-on: ubuntu-latest steps: - name: facebook-post-action @@ -51,9 +51,9 @@ jobs: facebook_page: if: >- - (github.repository, 'LizardByte/') and - not(github.event.release.prerelease) and - not(github.event.release.draft) + startsWith(github.repository, 'LizardByte/') && + !github.event.release.prerelease && + !github.event.release.draft runs-on: ubuntu-latest steps: - name: facebook-post-action @@ -68,9 +68,9 @@ jobs: reddit: if: >- - (github.repository, 'LizardByte/') and - not(github.event.release.prerelease) and - not(github.event.release.draft) + startsWith(github.repository, 'LizardByte/') && + !github.event.release.prerelease && + !github.event.release.draft runs-on: ubuntu-latest steps: - name: reddit @@ -88,9 +88,9 @@ jobs: twitter: if: >- - (github.repository, 'LizardByte/') and - not(github.event.release.prerelease) and - not(github.event.release.draft) + startsWith(github.repository, 'LizardByte/') && + !github.event.release.prerelease && + !github.event.release.draft runs-on: ubuntu-latest steps: - name: twitter diff --git a/.github/workflows/update-changelog.yml b/.github/workflows/update-changelog.yml new file mode 100644 index 00000000000..99d2793e9be --- /dev/null +++ b/.github/workflows/update-changelog.yml @@ -0,0 +1,31 @@ +--- +# This action is centrally managed in https://github.com//.github/ +# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in +# the above-mentioned repo. + +# Update changelog on release events. + +name: Update changelog + +on: + release: + types: [created, edited, deleted] + workflow_dispatch: + +concurrency: + group: "${{ github.workflow }}" + cancel-in-progress: true + +jobs: + update-changelog: + if: >- + github.event_name == 'workflow_dispatch' || + (!github.event.release.prerelease && !github.event.release.draft) + runs-on: ubuntu-latest + steps: + - name: Update Changelog + uses: LizardByte/update-changelog-action@v2024.609.4705 + with: + changelogBranch: changelog + changelogFile: CHANGELOG.md + token: ${{ secrets.GH_BOT_TOKEN }} diff --git a/.github/workflows/update-docs.yml b/.github/workflows/update-docs.yml new file mode 100644 index 00000000000..d1212f656c0 --- /dev/null +++ b/.github/workflows/update-docs.yml @@ -0,0 +1,89 @@ +--- +# This action is centrally managed in https://github.com//.github/ +# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in +# the above-mentioned repo. + +# Use the `rtd` repository label to identify repositories that should trigger have this workflow. +# If the project slug is not the repository name, add a repository variable named `READTHEDOCS_SLUG` with the value of +# the ReadTheDocs project slug. + +# Update readthedocs on release events. + +name: Update docs + +on: + release: + types: [created, edited, deleted] + +concurrency: + group: "${{ github.workflow }}-${{ github.event.release.tag_name }}" + cancel-in-progress: true + +jobs: + update-docs: + env: + RTD_SLUG: ${{ vars.READTHEDOCS_SLUG }} + RTD_TOKEN: ${{ secrets.READTHEDOCS_TOKEN }} + TAG: ${{ github.event.release.tag_name }} + if: >- + !github.event.release.draft + runs-on: ubuntu-latest + steps: + - name: Get RTD_SLUG + run: | + # if the RTD_SLUG is not set, use the repository name in lowercase + if [ -z "${RTD_SLUG}" ]; then + RTD_SLUG=$(echo "${{ github.event.repository.name }}" | tr '[:upper:]' '[:lower:]') + fi + echo "RTD_SLUG=${RTD_SLUG}" >> $GITHUB_ENV + + - name: Deactivate deleted release + if: >- + github.event_name == 'release' && + github.event.action == 'deleted' + run: | + json_body=$(jq -n \ + --arg active "false" \ + --arg hidden "false" \ + --arg privacy_level "public" \ + '{active: $active, hidden: $hidden, privacy_level: $privacy_level}') + + curl \ + -X PATCH \ + -H "Authorization: Token ${RTD_TOKEN}" \ + https://readthedocs.org/api/v3/projects/${RTD_SLUG}/versions/${TAG}/ \ + -H "Content-Type: application/json" \ + -d "$json_body" + + - name: Check if edited release is latest GitHub release + id: check + if: >- + github.event_name == 'release' && + github.event.action == 'edited' + uses: actions/github-script@v7 + with: + script: | + const latestRelease = await github.rest.repos.getLatestRelease({ + owner: context.repo.owner, + repo: context.repo.repo + }); + + core.setOutput('isLatestRelease', latestRelease.data.tag_name === context.payload.release.tag_name); + + - name: Update RTD project + # changing the default branch in readthedocs makes "latest" point to that branch/tag + # we can also update other properties like description, etc. + if: >- + steps.check.outputs.isLatestRelease == 'true' + run: | + json_body=$(jq -n \ + --arg default_branch "${TAG}" \ + --arg description "${{ github.event.repository.description }}" \ + '{default_branch: $default_branch}') + + curl \ + -X PATCH \ + -H "Authorization: Token ${RTD_TOKEN}" \ + https://readthedocs.org/api/v3/projects/${RTD_SLUG}/ \ + -H "Content-Type: application/json" \ + -d "$json_body" diff --git a/.github/workflows/update-homebrew-release.yml b/.github/workflows/update-homebrew-release.yml new file mode 100644 index 00000000000..1ab0e16a741 --- /dev/null +++ b/.github/workflows/update-homebrew-release.yml @@ -0,0 +1,71 @@ +--- +# This action is a candidate to centrally manage in https://github.com//.github/ +# If more Homebrew applications are developed, consider moving this action to the organization's .github repository, +# using the `homebrew-pkg` repository label to identify repositories that should trigger this workflow. + +# Update Homebrew on release events. + +name: Update Homebrew release + +on: + release: + types: [created, edited] + +concurrency: + group: "${{ github.workflow }}-${{ github.event.release.tag_name }}" + cancel-in-progress: true + +jobs: + update-homebrew-release: + if: >- + github.repository_owner == 'LizardByte' && + !github.event.release.draft && !github.event.release.prerelease + runs-on: ubuntu-latest + steps: + - name: Check if Homebrew repo + env: + TOPIC: homebrew-pkg + id: check + uses: actions/github-script@v7 + with: + script: | + const topic = process.env.TOPIC; + console.log(`Checking if repo has topic: ${topic}`); + + const repoTopics = await github.rest.repos.getAllTopics({ + owner: context.repo.owner, + repo: context.repo.repo + }); + console.log(`Repo topics: ${repoTopics.data.names}`); + + const hasTopic = repoTopics.data.names.includes(topic); + console.log(`Has topic: ${hasTopic}`); + + core.setOutput('hasTopic', hasTopic); + + - name: Download release asset + id: download + if: >- + steps.check.outputs.hasTopic == 'true' + uses: robinraju/release-downloader@v1.11 + with: + repository: "${{ github.repository }}" + tag: "${{ github.event.release.tag_name }}" + fileName: "*.rb" + tarBall: false + zipBall: false + out-file-path: "release_downloads" + extract: false + + - name: Publish Homebrew Formula + if: >- + steps.check.outputs.hasTopic == 'true' && + fromJson(steps.download.outputs.downloaded_files)[0] + uses: LizardByte/homebrew-release-action@v2024.612.21058 + with: + formula_file: ${{ fromJson(steps.download.outputs.downloaded_files)[0] }} + git_email: ${{ secrets.GH_BOT_EMAIL }} + git_username: ${{ secrets.GH_BOT_NAME }} + publish: true + token: ${{ secrets.GH_BOT_TOKEN }} + validate: false diff --git a/.github/workflows/update-pacman-repo.yml b/.github/workflows/update-pacman-repo.yml new file mode 100644 index 00000000000..328833a8c30 --- /dev/null +++ b/.github/workflows/update-pacman-repo.yml @@ -0,0 +1,110 @@ +--- +# This action is a candidate to centrally manage in https://github.com//.github/ +# If more pacman packages are developed, consider moving this action to the organization's .github repository, +# using the `pacman-pkg` repository label to identify repositories that should trigger have this workflow. + +# Update pacman repo on release events. + +name: Update pacman repo + +on: + release: + types: [created, edited] + +concurrency: + group: "${{ github.workflow }}-${{ github.event.release.tag_name }}" + cancel-in-progress: true + +jobs: + update-homebrew-release: + if: >- + github.repository_owner == 'LizardByte' && + !github.event.release.draft && !github.event.release.prerelease + runs-on: ubuntu-latest + steps: + - name: Check if pacman repo + env: + TOPIC: pacman-pkg + id: check + uses: actions/github-script@v7 + with: + script: | + const topic = process.env.TOPIC; + console.log(`Checking if repo has topic: ${topic}`); + + const repoTopics = await github.rest.repos.getAllTopics({ + owner: context.repo.owner, + repo: context.repo.repo + }); + console.log(`Repo topics: ${repoTopics.data.names}`); + + const hasTopic = repoTopics.data.names.includes(topic); + console.log(`Has topic: ${hasTopic}`); + + core.setOutput('hasTopic', hasTopic); + + - name: Check if edited release is latest GitHub release + id: check + if: >- + github.event_name == 'release' && + github.event.action == 'edited' + uses: actions/github-script@v7 + with: + script: | + const latestRelease = await github.rest.repos.getLatestRelease({ + owner: context.repo.owner, + repo: context.repo.repo + }); + + core.setOutput('isLatestRelease', latestRelease.data.tag_name === context.payload.release.tag_name); + + - name: Checkout pacman-repo + if: >- + steps.check.outputs.hasTopic == 'true' && + steps.check.outputs.isLatestRelease == 'true' + uses: actions/checkout@v4 + with: + repository: ${{ github.repository_owner }}/pacman-repo + + - name: Prep + id: prep + if: >- + steps.check.outputs.hasTopic == 'true' && + steps.check.outputs.isLatestRelease == 'true' + run: | + echo "pkg_name=$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT + + - name: Download release asset + id: download + if: >- + steps.check.outputs.hasTopic == 'true' && + steps.check.outputs.isLatestRelease == 'true' + uses: robinraju/release-downloader@v1.11 + with: + repository: "${{ github.repository }}" + tag: "${{ github.event.release.tag_name }}" + fileName: "*.pkg.tar.gz" + tarBall: false + zipBall: false + out-file-path: "pkgbuilds/${{ steps.prep.outputs.pkg_name }}" + extract: true + + - name: Create/Update Pull Request + if: >- + steps.check.outputs.hasTopic == 'true'&& + steps.check.outputs.isLatestRelease == 'true' && + fromJson(steps.download.outputs.downloaded_files)[0] + uses: peter-evans/create-pull-request@v6 + with: + add-paths: | + pkgbuilds/* + token: ${{ secrets.GH_BOT_TOKEN }} + commit-message: Update ${{ github.repository }} to ${{ github.event.release.tag_name }} + branch: bot/bump-${{ github.repository }}-${{ github.event.release.tag_name }} + delete-branch: true + base: master + title: Update ${{ github.repository }} to ${{ github.event.release.tag_name }} + body: ${{ github.event.release.body }} + labels: | + auto-approve + auto-merge diff --git a/.github/workflows/update-pages.yml b/.github/workflows/update-pages.yml index 5fbbf97f9f4..5db0f94da68 100644 --- a/.github/workflows/update-pages.yml +++ b/.github/workflows/update-pages.yml @@ -3,14 +3,14 @@ name: Build GH-Pages on: pull_request: - branches: [master, nightly] + branches: [master] types: [opened, synchronize, reopened] push: branches: [master] workflow_dispatch: concurrency: - group: ${{ github.workflow }}-${{ github.ref }} + group: "${{ github.workflow }}-${{ github.ref }}" cancel-in-progress: true jobs: @@ -39,7 +39,7 @@ jobs: - name: Upload Artifacts if: ${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }} - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: gh-pages if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn` @@ -51,7 +51,7 @@ jobs: if: >- (github.event_name == 'push' && github.ref == 'refs/heads/master') || (github.event_name == 'workflow_dispatch') - uses: actions-js/push@v1.4 + uses: actions-js/push@v1.5 with: github_token: ${{ secrets.GH_BOT_TOKEN }} author_email: ${{ secrets.GH_BOT_EMAIL }} diff --git a/.github/workflows/update-winget-release.yml b/.github/workflows/update-winget-release.yml new file mode 100644 index 00000000000..9e3278ecb81 --- /dev/null +++ b/.github/workflows/update-winget-release.yml @@ -0,0 +1,69 @@ +--- +# This action is a candidate to centrally manage in https://github.com//.github/ +# If more Winget applications are developed, consider moving this action to the organization's .github repository, +# using the `winget-pkg` repository label to identify repositories that should trigger this workflow. + +# Update Winget on release events. + +name: Update Winget release + +on: + release: + types: [created, edited] + +concurrency: + group: "${{ github.workflow }}-${{ github.event.release.tag_name }}" + cancel-in-progress: true + +jobs: + update-winget-release: + if: >- + github.repository_owner == 'LizardByte' && + !github.event.release.draft && !github.event.release.prerelease + runs-on: ubuntu-latest + steps: + - name: Check if Winget repo + env: + TOPIC: winget-pkg + id: check + uses: actions/github-script@v7 + with: + script: | + const topic = process.env.TOPIC; + console.log(`Checking if repo has topic: ${topic}`); + + const repoTopics = await github.rest.repos.getAllTopics({ + owner: context.repo.owner, + repo: context.repo.repo + }); + console.log(`Repo topics: ${repoTopics.data.names}`); + + const hasTopic = repoTopics.data.names.includes(topic); + console.log(`Has topic: ${hasTopic}`); + + core.setOutput('hasTopic', hasTopic); + + - name: Download release asset + id: download + if: >- + steps.check.outputs.hasTopic == 'true' + uses: robinraju/release-downloader@v1.11 + with: + repository: "${{ github.repository }}" + tag: "${{ github.event.release.tag_name }}" + fileName: "*.exe" + tarBall: false + zipBall: false + out-file-path: "release_downloads" + extract: false + + - name: Release to WinGet + if: >- + steps.check.outputs.hasTopic == 'true' && + fromJson(steps.download.outputs.downloaded_files)[0] + uses: vedantmgoyal2009/winget-releaser@v2 + with: + identifier: "${{ github.repository_owner }}.${{ github.event.repository.name }}" + release-tag: ${{ github.event.release.tag_name }} + installers-regex: '\.exe$' + token: ${{ secrets.GH_BOT_TOKEN }} diff --git a/.github/workflows/yaml-lint.yml b/.github/workflows/yaml-lint.yml index 7e1fd469409..023b836c0ce 100644 --- a/.github/workflows/yaml-lint.yml +++ b/.github/workflows/yaml-lint.yml @@ -9,11 +9,11 @@ name: yaml lint on: pull_request: - branches: [master, nightly] + branches: [master] types: [opened, synchronize, reopened] concurrency: - group: ${{ github.workflow }}-${{ github.ref }} + group: "${{ github.workflow }}-${{ github.ref }}" cancel-in-progress: true jobs: diff --git a/.gitignore b/.gitignore index c3a04d9652d..ccc8b0c7487 100644 --- a/.gitignore +++ b/.gitignore @@ -1,13 +1,45 @@ -build -cmake-build* -.DS_Store -.vscode -.vs -*.swp -*.kdev4 +# Prerequisites +*.d + +# Compiled Object files +*.slo +*.lo +*.o +*.obj + +# Precompiled Headers +*.gch +*.pch + +# Compiled Dynamic libraries +*.so +*.dylib +*.dll + +# Fortran module files +*.mod +*.smod + +# Compiled Static libraries +*.lai +*.la +*.a +*.lib -.cache -.idea +# Executables +*.exe +*.out +*.app + +# JetBrains IDE +.idea/ + +# VSCode IDE +.vscode/ + +# build directories +build/ +cmake-*/ # npm node_modules/ @@ -16,3 +48,6 @@ package-lock.json # Translations *.mo *.pot + +# Dummy macOS files +.DS_Store diff --git a/.gitmodules b/.gitmodules index 92820c24c47..4aa76d5206f 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,68 +1,60 @@ +[submodule "packaging/linux/flatpak/deps/shared-modules"] + path = packaging/linux/flatpak/deps/shared-modules + url = https://github.com/flathub/shared-modules + branch = master +[submodule "third-party/build-deps"] + path = third-party/build-deps + url = https://github.com/LizardByte/build-deps.git + branch = dist +[submodule "third-party/doxygen-awesome-css"] + path = third-party/doxygen-awesome-css + url = https://github.com/jothepro/doxygen-awesome-css.git + branch = main +[submodule "third-party/googletest"] + path = third-party/googletest + url = https://github.com/google/googletest/ + branch = v1.14.x +[submodule "third-party/inputtino"] + path = third-party/inputtino + url = https://github.com/games-on-whales/inputtino.git + branch = stable [submodule "third-party/moonlight-common-c"] path = third-party/moonlight-common-c url = https://github.com/moonlight-stream/moonlight-common-c.git branch = master -[submodule "third-party/Simple-Web-Server"] - path = third-party/Simple-Web-Server - url = https://gitlab.com/eidheim/Simple-Web-Server.git - branch = master -[submodule "third-party/ViGEmClient"] - path = third-party/ViGEmClient - url = https://github.com/nefarius/ViGEmClient - branch = master -[submodule "third-party/miniupnp"] - path = third-party/miniupnp - url = https://github.com/miniupnp/miniupnp +[submodule "third-party/nanors"] + path = third-party/nanors + url = https://github.com/sleepybishop/nanors.git branch = master [submodule "third-party/nv-codec-headers"] path = third-party/nv-codec-headers url = https://github.com/FFmpeg/nv-codec-headers branch = sdk/12.0 +[submodule "third-party/nvapi-open-source-sdk"] + path = third-party/nvapi-open-source-sdk + url = https://github.com/LizardByte/nvapi-open-source-sdk + branch = sdk +[submodule "third-party/Simple-Web-Server"] + path = third-party/Simple-Web-Server + url = https://gitlab.com/eidheim/Simple-Web-Server.git + branch = master [submodule "third-party/TPCircularBuffer"] path = third-party/TPCircularBuffer url = https://github.com/michaeltyson/TPCircularBuffer branch = master -[submodule "third-party/ffmpeg-windows-x86_64"] - path = third-party/ffmpeg-windows-x86_64 - url = https://github.com/LizardByte/build-deps - branch = ffmpeg-windows-x86_64 -[submodule "third-party/ffmpeg-macos-x86_64"] - path = third-party/ffmpeg-macos-x86_64 - url = https://github.com/LizardByte/build-deps - branch = ffmpeg-macos-x86_64 -[submodule "third-party/ffmpeg-linux-x86_64"] - path = third-party/ffmpeg-linux-x86_64 - url = https://github.com/LizardByte/build-deps - branch = ffmpeg-linux-x86_64 -[submodule "third-party/ffmpeg-linux-aarch64"] - path = third-party/ffmpeg-linux-aarch64 - url = https://github.com/LizardByte/build-deps - branch = ffmpeg-linux-aarch64 -[submodule "third-party/ffmpeg-macos-aarch64"] - path = third-party/ffmpeg-macos-aarch64 - url = https://github.com/LizardByte/build-deps - branch = ffmpeg-macos-aarch64 -[submodule "third-party/nanors"] - path = third-party/nanors - url = https://github.com/sleepybishop/nanors.git - branch = master [submodule "third-party/tray"] path = third-party/tray url = https://github.com/LizardByte/tray branch = master -[submodule "third-party/nvapi-open-source-sdk"] - path = third-party/nvapi-open-source-sdk - url = https://github.com/LizardByte/nvapi-open-source-sdk - branch = sdk -[submodule "third-party/ffmpeg-linux-powerpc64le"] - path = third-party/ffmpeg-linux-powerpc64le - url = https://github.com/LizardByte/build-deps - branch = ffmpeg-linux-powerpc64le +[submodule "third-party/ViGEmClient"] + path = third-party/ViGEmClient + url = https://github.com/LizardByte/Virtual-Gamepad-Emulation-Client.git + branch = master [submodule "third-party/wayland-protocols"] path = third-party/wayland-protocols - url = https://gitlab.freedesktop.org/wayland/wayland-protocols + url = https://gitlab.freedesktop.org/wayland/wayland-protocols.git branch = main [submodule "third-party/wlr-protocols"] path = third-party/wlr-protocols - url = https://gitlab.freedesktop.org/wlroots/wlr-protocols + url = https://gitlab.freedesktop.org/wlroots/wlr-protocols.git branch = master diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 4a6aefb36d5..aa2f75f8063 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -8,11 +8,10 @@ version: 2 # Set the version of Python build: - os: ubuntu-22.04 + os: ubuntu-24.04 tools: - python: "3.11" + python: "miniconda-latest" apt_packages: - - graphviz # required to build diagrams - libboost-locale-dev # required for rstcheck in cpp code block jobs: post_build: @@ -20,6 +19,11 @@ build: - rstcheck -r . # lint rst files # - rstfmt --check --diff -w 120 . # check rst formatting +# using conda, we can get newer doxygen and graphviz than ubuntu provide +# https://github.com/readthedocs/readthedocs.org/issues/8151#issuecomment-890359661 +conda: + environment: docs/environment.yml + # submodules required for include statements submodules: include: all diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index bbeb4028382..00000000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,594 +0,0 @@ -# Changelog - -## [0.21.0] - 2023-10-15 -**Added** -- (Input) Add support for automatically selecting the emulated controller type based on the physical controller connected to the client -- (Input/Windows) Add support for Applications (context menu) key -- (Input/Windows) Implement touchpad, motion sensors, battery state, and LED control for the emulated DualShock 4 controller -- (Input) Advertise support for new input features to clients -- (Linux/Debian) Added Debian Bookworm package -- (Prep-Commands) Expose connection environment variables -- (Input/Windows) Implement pen and touch support -- (Capture/Windows) Add standalone NVENC encoder -- (Capture) Implement AV1 encoding -- (Network) Implement IPv6 support -- (Capture/Windows) Add option to disable realtime hags -- (Graphics/NVIDIA) Add an option to decrease GPU scheduling priority to workaround HAGS video hang -- (Capture/Linux) Add FFmpeg powerpc64le architecture for self compiling Sunshine -- (Capture/Windows) Add support for capturing rotated displays -- (System Tray) Implement streaming event notifications -- (UI) Add port configuration table -- (Applications) Added option to automatically treat launcher type apps as detached commands -- (Input/Gamepad) Allow the Misc button to work as Guide on emulated Xbox 360 controllers - -**Changed** -- (Input) Reduce latency by implementing input batching -- (Logging) Move input packet debug prints off the control stream thread -- (Input) Refactor gamepad emulation code to use DS4 extended report format -- (Graphics/NVIDIA) Modify and restore NVIDIA control panel settings before and after stream, respectively -- (Graphics/NVIDIA) New config page for NVENC -- (Graphics/Windows) Refactor DX shaders -- (Input/Windows) Use our own keycode mapping to avoid installing the US English keyboard layout - -**Fixed** -- (UI) Fix update notifications -- (Dependencies/Linux) Replace libboost chrono and thread with standard chrono and thread -- (Input) Increase maximum gamepad limit to 16 -- (Network) Allow use of multiple ENet channels -- (Network) Consider link-local addresses on LAN -- (Input) Fixed issue where button may sometimes stick on Windows -- (Input) Fix "ControllerNumber not allocated" warning when a gamepad is removed -- (Input) Fix handling of gamepad feedback with multiple clients connected -- (Input) Fix clamping mouse position to aspect ratio adjusted viewport -- (Graphics/AMD) Fix crash during startup on some older AMD GPUs -- (Logging) Fix crash when non-ASCII characters are logged -- (Prep-Commands) Fix resource exhaustion bug which could occur when many prep commands were used -- (Subprocesses) Fix race condition when inserting new processes -- (Logging) Log error if encoder doesn't produce IDR frame on demand -- (Audio) Improve audio capture logic and logging -- (Logging) Fix AMF logging to match configured log level -- (Logging) Log FFmpeg to log file instead of stdout -- (Capture) Reject codecs that are not supported by display device -- (Capture) Add fallbacks for unsupported codec settings -- (Capture) Avoid probing HEVC or AV1 codecs in some cases -- (Caputre) Remove DwmFlush() -- (Capture/Windows) Improvements to capture sleeps for better frame stability -- (Capture/Windows) Adjust capture rate to better match with display -- (Linux/ArchLinux) Fix package version in PKGBUILD and precompiled package -- (UI) Highlight fatal log messages in web ui -- (Commands) Allow stream if prep command fails -- (Capture/Linux) Fix KMS grab VRAM capture with libva 2.20 -- (Capture/macOS) Fix video capture backend -- (Misc/Windows) Don't start the session monitor window when launched in command mode -- (Linux/AppImage) Use the linuxdeploy GTK plugin to correctly deploy GTK3 dependencies -- (Input/Windows) Fix reWASD not recognizing emulated DualShock 4 input - -**Dependencies** -- Bump bootstrap from 5.2.3 to 5.3.2 -- Bump third-party/moonlight-common-c from c9426a6 to 7a6d12f -- Bump gcc-10 in Ubuntu 20.04 docker image -- Bump furo from 2023.5.20 to 2023.9.10 -- Bump sphinx from 7.0.1 to 7.2.6 -- Bump cmake from 3.26 to 3.27 in Fedora docker images -- Move third-party/nv-codec-headers from sdk/11.1 branch to sdk/12.0 branch -- Automatic bump ffmpeg -- Bump actions/checkout from 3 to 4 -- Bump boost from 1.80 to 1.81 in Macport manifest -- Bump @fortawesome/fontawesome-free from 6.4.0 to 6.4.2 - -**Misc** -- (Docs) Force badges to use svg -- (Docs) Add Linux SSH example -- (Docs) Add information about mesa for Linux -- (CI) Free additional space on Docker, Flatpak, and AppImage builds due to internal changes on GitHub runners -- (Docs/Logging/UI) Corrected various typos -- (Docs) Add blurb about Gamescope compatibility -- (Installer/Windows) Use system proxy to download ViGEmBus -- (CI) Ignore third-party directory for clang-format -- (Docs/Linux) Add Plasma-Compatible resolution example -- (Docs) Add Sunshine website available at https://app.lizardbyte.dev/Sunshine -- (Build/Windows) Fix audio code build with new MinGW headers -- (Build/Windows) Fix QoS code build with new MinGW headers -- (CI/Windows) Prevent winget action from creating an update when running in a fork -- (CI/Windows) Change winget job to ubuntu-latest runner -- (CI) Add CodeQL analysis -- (CI/Docker) Fix ArchLinux image caching issue -- (Windows) Manifest improvements -- (CI/macOS) Simplify macport build -- (Docs) Remove deprecated options from readthedocs config -- (CI/Docs) Lint rst files -- (Docs) Update localization information (after consolidating Crowdin projects) -- (Cmake) Split CMakelists into modules -- (Docs) Add Linux Headless/SSH Guide - -## [0.20.0] - 2023-05-28 -**Breaking** -- (Windows) The Windows installer version of Sunshine is now always launched by the Sunshine Service. Manually launching Sunshine.exe from Program Files is no longer supported. This was necessary to address security issues caused by non-admin users having access to Sunshine's config data. If you have set up Task Scheduler or other mechanisms to launch Sunshine automatically, remove those from your system before updating. -- (Windows) The Start Menu shortcut has been redesigned for use with the Sunshine Service. It now launches Sunshine in the background (if not already running) and opens the Web UI, avoiding the persistent Command Prompt window present in prior versions. The Start Menu shortcut is now the recommended method for opening the Web UI and launching Sunshine. -- (Network/UPnP) If the Moonlight Internet Hosting Tool is installed alongside Sunshine, you must remove it or upgrade to v5.6 or later to prevent conflicts with Sunshine's UPnP support. As a reminder, the Moonlight Internet Hosting Tool is not required to stream over the Internet with Sunshine. Instead, simply enable UPnP in the Sunshine Web UI. -- (Windows) If Steam is installed, the Steam Streaming Speakers driver will be automatically installed when starting a stream for the first time. This behavior can be disabled in the Audio/Video tab of the Web UI. This Steam driver enables support for surround sound and muting host audio without requiring any manual configuration. -- (Input) The Back Button Timeout option has been renamed to Guide Button Emulation Timeout and has been disabled by default to ensure long presses on the Back button work by default. The previous behavior can be restored by setting the Guide Button Emulation Timeout to 2000. -- (Windows) The service name of SunshineSvc has been changed to SunshineService to address a false positive in MalwareBytes. If you have any scripts or other logic on your system that is using the service name, you will need to update that for the new name. -- (Windows) To support new installer features, install-service.bat no longer sets the service to auto-start by default. Users executing install-service.bat manually on the Sunshine portable build must also execute autostart-service.bat to start Sunshine on boot. However, installing the service manually like this is not recommended. Instead, use the Sunshine installer which handles service installation and configuration automatically. -- (Linux/Fedora) Fedora 36 builds are removed due to upstream end of support - -**Added** -- (Windows) Added an option to launch apps and prep/undo commands as administrator -- (Installer/Windows) Added an option to choose whether Sunshine launches on boot. If not configured to launch on boot, use the Start Menu shortcut to start Sunshine when desired. -- (Input/Windows) Added option to send VK codes instead of scancodes for compatibility with iOS/Android devices using non-English keyboard layouts -- (UI) The Apply/Restart option is now available in the Web UI for all platforms -- (Systray) Added a Restart option to the system tray context menu -- (Video/Windows) Added host latency data to video frames. This requires future updates to Moonlight to display in the on-screen overlay. -- (Audio) Added support for matching Audio Sink and Virtual Sink values on device names -- (Client) Added friendly error messages for clients when streaming fails to start -- (Video/Windows) Added warning log messages when Windows is hiding DRM-protected content from display capture -- (Interop/Windows) Added warning log messages when GeForce Experience is currently using the same ports as Sunshine -- (Linux/Fedora) Fedora 38 builds are now available - -**Changed** -- (Video) Encoder selection now happens at each stream start for more reliable GPU detection -- (Video/Windows) The host display now stays on while clients are actively streaming -- (Audio) Streaming will no longer fail if audio capture is unavailable -- (Audio/Windows) Sunshine will automatically switch back to the Virtual Sink if the default audio device is changed while streaming -- (Audio) Changes to the host audio playback option will now take effect when resuming a session from Moonlight -- (Audio/Windows) Sunshine will switch to a different default audio device if Steam Streaming Speakers are the default when Sunshine starts. This handles cases where Sunshine terminates unexpectedly without restoring the default audio device. -- (Apps) The Connection Terminated dialog will no longer appear in Moonlight when the app on the host exits normally -- (Systray/Windows) Quitting Sunshine via the system tray will now stop the Sunshine Service rather than leaving it running and allowing it to restart Sunshine -- (UI) The 100.64.0.0/10 CGN IP address range is now treated as a LAN address range -- (Video) Removed a workaround for some versions of Moonlight prior to mid-2022 -- (UI) The PIN field is now cleared after successfully pairing -- (UI) User names are now treated as case-insensitive -- (Linux) Changed udev rule to automatically grant access to virtual input devices -- (UI) Several item descriptions were adjusted to reflect newer configuration recommendations -- (UI) Placeholder text opacity has been reduced to improve contrast with non-placeholder text -- (Video/Windows) Minor capture performance improvements - -**Fixed** -- (Video) VRAM usage while streaming is significantly reduced, particularly with higher display resolutions and HDR -- (Network/UPnP) UPnP support was rewritten to fix several major issues handling router restarts, IP address changes, and port forwarding expiration -- (Input) Fixed modifier keys from the software keyboard on Android clients -- (Audio) Fixed handling of default audio device changes while streaming -- (Windows) Fixed streaming after Microsoft Remote Desktop or Fast User Switching has been used -- (Input) Fixed some games not recognizing emulated Guide button presses -- (Video/Windows) Fixed incorrect gamma when using an Advanced Color SDR display on the host -- (Installer/Windows) The installer is no longer blurry on High DPI systems -- (Systray/Windows) Fixed multiple system tray icons appearing if Sunshine exits unexpectedly -- (Systray/Windows) Fixed the system tray icon not appearing in several situations -- (Windows) Fixed hang on shutdown/restart if mDNS registration fails -- (UI) Fixed missing response headers -- (Stability) Fixed several possible crashes in cases where the client did not successfully connect -- (Stability) Fixed several memory leaks -- (Input/Windows) Back/Select input now correctly generates the Share button when emulating DS4 controllers -- (Audio/Windows) Fixed various bugs in audio-info.exe that led to inaccurate output on some systems -- (Video/Windows) Fixed incorrect resolution values from dxgi-info.exe on High DPI systems -- (Video/Linux) Fixed poor quality encoding from H.264 on Intel encoders -- (Config) Fixed a couple of typos in predefined resolutions - -**Dependencies** -- Bump sphinx-copybutton from 0.5.1 to 0.5.2 -- Bump sphinx from 6.13 to 7.0.1 -- Bump third-party/nv-codec-headers from 2055784 to 2cd175b -- Bump furo from 2023.3.27 to 2023.5.20 - -**Misc** -- (Build/Linux) Add X11 to PLATFORM_LIBARIES when found -- (Build/macOS) Fix compilation with Clang 14 -- (Docs) Fix nvlax URL -- (Docs) Add diagrams using graphviz -- (Docs) Improvements to source code documentation -- (Build) Unpin docker dependencies -- (Build/Linux) Honor install prefix for tray icon -- (Build/Windows) Unstripped binaries are now provided as a debuginfo package to support crash dump debugging -- (Config) Config directories are now created recursively - -## [0.19.1] - 2023-03-30 -**Fixed** -- (Audio) Fixed no audio issue introduced in v0.19.0 - -## [0.19.0] - 2023-03-29 -**Breaking** -- (Linux/Flatpak) Moved Flatpak to org.freedesktop.Platform 22.08 and Cuda 12.0.0 - This will drop support for Nvidia GPUs with compute capability 3.5 - -**Added** -- (Input) Added option to suppress input from gamepads, keyboards, or mice -- (Input/Linux) Added unicode support for remote pasting (may not work on all DEs) -- (Input/Linux) Added XTest input fallback -- (UI) Added version notifications to web UI -- (Linux/Windows) Add system tray icon -- (Windows) Added ability to safely elevate commands that fail due to insufficient permissions when running as a service -- (Config) Added global prep commands, and ability to exclude an app from using global prep commands -- (Installer/Windows) Automatically install ViGEmBus if selected - -**Changed** -- (Logging) Changed client verified messages to debug to prevent spamming the log -- (Config) Only save non default config values -- (Service/Linux) Use xdg-desktop-autostart for systemd service -- (Linux) Added config option to force capture method -- (Windows) Execute prep command in context of current user -- (Linux) Allow disconnected X11 outputs - -**Fixed** -- (Input/Windows) Fix issue where internation keys were not translated correct, and modifier keys appeared stuck -- (Linux) Fixed startup when /dev/dri didn't exist -- (UI) Changes software encoding settings to select menu instead of text input -- (Initialization) Do not terminate upon failure, allowing access to the web UI - -**Dependencies** -- Bump third-party/moonlight-common-c from 07beb0f to c9426a6 -- Bump babel from 2.11.0 to 2.12.1 -- Bump @fortawesome/fontawesome-free from 6.2.1 to 6.4.0 -- Bump third-party/ViGEmClient from 9e842ba to 726404e -- Bump ffmpeg -- Bump third-party/miniupnp from 014c9df to e439318 -- Bump furo from 2022.12.7 to 2023.3.27 -- Bump third-party/nanors from 395e5ad to e9e242e - -**Misc** -- (GitHub) Shared feature request board with Moonlight -- (Docs) Improved application examples -- (Docs) Added WIP documentation for source code using Doxygen and Breathe -- (Build) Fix linux clang build errors -- (Build/Archlinux) Skip irrelevant submodules -- (Build/Archlinux) Disable download timeout -- (Build/macOS) Support compiling for earlier releases of macOS -- (Docs) Add favicon -- (Docs) Add missing config default values -- (Build) Fix compiler warnings due to depreciated elements in C++17 -- (Build) Fix libcurl link errors -- (Clang) Adjusted formatting rules - -## [0.18.4] - 2023-02-20 -**Fixed** -- (Linux/AUR) Drop support of AUR package -- (Docker) General enhancements to docker images - -## [0.18.3] - 2023-02-13 -**Added** -- (Linux) Added PKGBUILD for Archlinux based distros to releases -- (Linux) Added precompiled package for Archlinux based distros to releases -- (Docker) Added archlinux docker image (x86_64 only) - -## [0.18.2] - 2023-02-13 -**Fixed** -- (Video/KMV/Linux) Fixed wayland capture on Nvidia for KMS -- (Video/Linux) Implement vaSyncBuffer stuf for libva <2.9.0 -- (UI) Fix issue where mime type was not being set for node_modules when using a reverse proxy -- (UI/macOS) Added missing audio sink config options -- (Linux) Specify correct Boost dependency versions -- (Video/AMF) Add missing encoder tunables - -## [0.18.1] - 2023-01-31 -**Fixed** -- (Linux) Fixed missing dependencies for deb and rpm packages -- (Linux) Use dynamic boost - -## [0.18.0] - 2023-01-29 -Attention, this release contains critical security fixes. Please update as soon as possible. Additionally, we are -encouraging users to change your Sunshine password, especially if you expose the web UI (i.e. port 47790 by default) -to the internet, or have ever uploaded your logs with verbose output to a public resource. - -**Added** -- (Windows) Add support for Intel QuickSync -- (Linux) Added aarch64 deb and rpm packages -- (Windows) Add support for hybrid graphics systems, such as laptops with both integrated and discrete GPUs -- (Linux) Add support for streaming from Steam Deck Gaming Mode -- (Windows) Add HDR support, see https://docs.lizardbyte.dev/projects/sunshine/en/latest/about/usage.html#hdr-support - -**Fixed** -- (Network) Refactor code for UPnP port forwarding -- (Video) Enforce 10 FPS encoding frame rate minimum to improve static image quality -- (Linux) deb and rpm packages are now specific to destination distro and version -- (Docs) Add nvidia/nvenc preset migration guide -- (Network) Performance optimizations -- (Video/Windows) Fix streaming to multiple clients from hardware encoder -- (Linux) Fix child process spawning -- (Security) Fix security vulnerability in implementation of SimpleWebServer -- (Misc) Rename "Steam BigPicture" to "Steam Big Picture" in default apps.json -- (Security) Scrub basic authorization header from logs -- (Linux) The systemd service will now restart in the event of a crash -- (Video/KMS/Linux) Fixed error: `couldn't import RGB Image: 00003002 and 00003004` -- (Video/Windows) Fix stream freezing triggered by the resolution changed -- (Installer/Windows) Fixes silent installation and other miscellaneous improvements -- (CPU) Significantly improved CPU usage - -## [0.17.0] - 2023-01-08 -If you are running Sunshine as a service on Windows, we are strongly urging you to update to v0.17.0 as soon as -possible. Older Windows versions of Sunshine had a security flaw in which the binary was located in a user-writable -location which is problematic when running as a service or on a multi-user system. Additionally, when running Sunshine -as a service, games and applications were launched as SYSTEM. This could lead to issues with save files and other game -settings. In v0.17.0, games now run under your user account without elevated privileges. - -**Breaking** -- (Apps) Removed automatic desktop entry (Re-add by adding an empty application named "Desktop" with no commands, "desktop.png" can be added as the image.) -- (Windows) Improved user upgrade experience (Suggest to manually uninstall existing Sunshine version before this upgrade. Do NOT select to remove everything, if prompted. Make a backup of config files before uninstall.) -- (Windows) Move config files to specific directory (files will be migrated automatically if using Windows installer) -- (Dependencies) Fix npm path (breaking change for package maintainers) - -**Added** -- (macOS) Added initial support for arm64 on macOS through Macports portfile -- (Input) Added support for foreign keyboard input -- (Misc) Logs inside the WebUI and log to file -- (UI/Windows) Added an Apply button to configuration page when running as a service -- (Input/Windows) Enable Mouse Keys while streaming for systems with no physical mouse - -**Fixed** -- (Video) Improved capture performance -- (Audio) Improved audio bitrate and quality handling -- (Apps/Windows) Fixed PATH environment variable handling -- (Apps/Windows) Use the proper environment variable for the Program Files (x86) folder -- (Service/Windows) Fix SunshineSvc hanging if an error occurs during startup -- (Service/Windows) Spawn Sunshine.exe in a job object, so it is terminated if SunshineSvc.exe dies -- (Video) windows/vram: fix fringing in NV12 colour conversion -- (Apps/Windows) Launch games under the correct user account -- (Video) nvenc, amdvce: rework all user presets/options -- (Network) Generate certificates with unique serial numbers -- (Service/Windows) Graceful termination on shutdown, logoff, and service stop -- (Apps/Windows) Fix launching apps when Sunshine is running as admin -- (Misc) Remove/fix calls to std::abort() -- (Misc) Remove prompt to press enter after Sunshine exits -- (Misc) Make log priority consistent for execution messages -- (Apps) Applications in Moonlight clients are now updated automatically after editing -- (Video/Linux) Fix wayland capture on nvidia -- (Audio) Fix 7.1 surround channel mapping -- (Video) Fix NVENC profile values not applying -- (Network) Fix origin_web_ui_allowed binding -- (Service/Windows) Self terminate/restart service if process hangs for 10 seconds -- (Input/Windows) Fix Windows masked cursor blending with GPU encoders -- (Video) Color conversion fixes and BT.2020 support - -**Dependencies** -- Bump ffmpeg from 4.4 to 5.1 -- ffmpeg_patches: add amfenc delay/buffering fix -- CBS moved to ffmpeg submodules -- Migrate to upstream Simple-Web-Server submodule -- Bump third-party/TPCircularBuffer from `bce9170` to `8833b3a` -- Bump third-party/moonlight-common-c from `8169a31` to `ef9ad52` -- Bump third-party/miniupnp from `6f848ae` to `207cf44` -- Bump third-party/ViGEmClient from `f719a1d` to `9e842ba` -- Bump bootstrap from 5.0.0 to 5.2.3 -- Bump @fortawesome/fontawesome-free from 6.2.0 to 6.2.1 - -## [0.16.0] - 2022-12-13 -**Added** -- Add cover finder -- (Docker) Add arm64 docker image -- (Flatpak) Add installation helper scripts -- (Windows) Add support for Unicode input messages - -**Fixed** -- (Linux) Reintroduce Ubuntu 20.04 and 22.04 specific deb packages -- (Linux) Fixed udev and systemd file locations - -**Dependencies** -- Bump babel from 2.10.3 to 2.11.0 -- Bump sphinx-copybutton from 0.5.0 to 0.5.1 -- Bump KSXGitHub/github-actions-deploy-aur from 2.5.0 to 2.6.0 -- Use npm for web dependencies (breaking change for third-party package maintainers) -- Update moonlight-common-c -- Use pre-built ffmpeg from LizardByte/build-deps for all sunshine builds (breaking change for third-party package maintainers) -- Bump furo from 2022.9.29 to 2022.12.7 - -**Misc** -- Misc org level workflow updates -- Fix misc typos in docs -- Fix winget release - -## [0.15.0] - 2022-10-30 -**Added** -- (Windows) Add firewall rules scripts -- (Windows) Automatically add and remove firewall rules at install/uninstall -- (Windows) Automatically add and remove service at install/uninstall -- (Docker) Official image added -- (Linux) Add aarch64 flatpak package - -**Changed** -- (Windows/Linux/MacOS) - Move default config and apps file to assets directory -- (MacOS) Bump boost to 1.80 for macport builds -- (Linux) Remove backup and restore of config files - -**Fixed** -- (Linux) - Create sunshine config directory if it doesn't exist -- (Linux) Remove portable home and config directories for AppImage -- (Windows) Include service install and uninstall scripts again -- (Windows) Automatically delete start menu entry upon uninstall -- (Windows) Automatically delete program install directory upon uninstall, with user prompt -- (Linux) Handle the case of no default audio sink -- (Windows/Linux/MacOS) Fix default image paths -- (Linux) Fix CUDA RGBA to NV12 conversion - -## [0.14.1] - 2022-08-09 -**Added** -- (Linux) Flatpak package added -- (Linux) AUR package automated updates -- (Windows) Winget package automated updates - -**Changed** -- (General) Moved repo to @LizardByte GitHub org -- (WebUI) Fixed button spacing on home page -- (WebUI) Added Discord WidgetBot Crate - -**Fixed** -- (Linux/Mac) Default config and app files now copied to user home directory -- (Windows) Default config and app files now copied to working directory - -## [0.14.0] - 2022-06-15 - -**Added** -- (Documentation) Added Sphinx documentation available at https://sunshinestream.readthedocs.io/en/latest/ -- (Development) Initial support for Localization -- (Linux) Add rpm package as release asset -- (macOS) Add Portfile as release asset -- (Windows) Add DwmFlush() call to improve capture -- (Windows) Add Windows installer - -**Fixed** -- (AMD) Fixed hwdevice being destroyed before context -- (Linux) Added missing dependencies to AppImage -- (Linux) Fixed rumble events causing game to freeze -- (Linux) Improved Pulse/Pipewire compatibility -- (Linux) Moved to single deb package -- (macOS) Fixed missing TPCircularBuffer submodule -- (Stream) Properly catch exceptions in stream broadcast handlers -- (Stream/Video) AVPacket fix - -## [0.13.0] - 2022-02-27 -**Added** -- (macOS) Initial support for macOS (#40) - -## [0.12.0] - 2022-02-13 -**Added** -- New command line argument `--version` -- Custom png poster support - -**Changed** -- Correct software bitrate calculation -- Increase vbv-bufsize to 1/10 of requested bitrate -- Improvements to Web UI - -## [0.11.1] - 2021-10-04 -**Changed** -- (Linux) Fix search path for config file and assets - -## [0.11.0] - 2021-10-04 -**Added** -- (Linux) Added support for wlroots based compositors on Wayland. -- (Windows) Added an icon for the executable - -**Changed** -- Fixed a bug causing segfault when connecting multiple controllers. -- (Linux) Improved NVENC, it now offloads converting images from RGB to NV12 -- (Linux) Fixed a bug causes stuttering - -## [0.10.1] - 2021-08-21 -**Changed** -- (Linux) Re-enabled KMS - -## [0.10.0] - 2021-08-20 -**Added** -- Added support for Rumble with gamepads. -- Added support for keyboard shortcuts <--- See the README for details. -- (Windows) A very basic script has been added in Sunshine-Windows\tools <-- This will start Sunshine at boot with the highest privileges which is needed to display the login prompt. - -**Changed** -- Some cosmetic changes to the WebUI. -- The first time the WebUI is opened, it will request the creation of a username/password pair from the user. -- Fixed audio crackling introduced in version 0.8.0 -- (Linux) VAAPI hardware encoding now works on Intel i7-6700 at least. <-- For the best experience, using ffmpeg version 4.3 or higher is recommended. -- (Windows) Installing from debian package shouldn't overwrite your configuration files anymore. <-- It's recommended that you back up `/etc/sunshine/` before testing this. - -## [0.9.0] - 2021-07-11 -**Added** -- Added audio encryption -- (Linux) Added basic NVENC support on Linux -- (Windows) The Windows version can now capture the lock screen and the UAC prompt as long as it's run through `PsExec.exe` https://docs.microsoft.com/en-us/sysinternals/downloads/psexec - -**Changed** -- Sunshine will now accept expired or not-yet-valid certificates, as long as they are signed properly. -- Fixed compatibility with iOS version of Moonlight -- Drastically reduced chance of being forced to skip error correction due to video frame size -- (Linux) sunshine.service will be installed automatically. - -## [0.8.0] - 2021-06-30 -**Added** -- Added mDNS support: Moonlight will automatically find Sunshine. -- Added UPnP support. It's off by default. - -## [0.7.7] - 2021-06-24 -**Added** -- (Linux) Added installation package for Debian - -**Changed** -- Fixed incorrect scaling for absolute mouse coordinates when using multiple monitors. -- Fixed incorrect colors when scaling for software encoder - -## [0.7.1] - 2021-06-18 -**Changed** -- (Linux) Fixed an issue where it was impossible to start sunshine on ubuntu 20.04 - -## [0.7.0] - 2021-06-16 -**Added** -- Added a Web Manager. Accessible through: https://localhost:47990 or https://:47990 -- (Linux) Added hardware encoding support for AMD on Linux - -**Changed** -- (Linux) Moved certificates and saved pairings generated during runtime to .config/sunshine on Linux - -## [0.6.0] - 2021-05-26 -**Added** -- Added support for surround audio - -**Changed** -- Maintain aspect ratio when scaling video -- Fix issue where Sunshine is forced to drop frames when they are too large - -## [0.5.0] - 2021-05-13 -**Added** -- Added support for absolute mouse coordinates -- (Linux) Added support for streaming specific monitor on Linux -- (Windows) Added support for AMF on Windows - -## [0.4.0] - 2020-05-03 -**Changed** -- prep-cmd is now optional in apps.json -- Fixed bug causing video artifacts -- Fixed bug preventing Moonlight from closing app on exit -- Fixed bug causing preventing keyboard keys from repeating on latest version of Moonlight -- Fixed bug causing segfault when another session of sunshine was already running -- Fixed bug causing crash when monitor has resolution 1366x768 - -## [0.3.1] - 2020-04-24 -**Changed** -- Fix a memory leak. - -## [0.3.0] - 2020-04-23 -**Changed** -- Hardware acceleration on NVidia GPU's for Video encoding on Windows - -## [0.2.0] - 2020-03-21 -**Changed** -- Multicasting is now supported: You can set the maximum simultaneous connections with the configurable option: channels -- Configuration variables can be overwritten on the command line: "name=value" --> it can be useful to set min_log_level=debug without modifying the configuration file -- Switches to make testing the pairing mechanism more convenient has been added, see "sunshine --help" for details - -## [0.1.1] - 2020-01-30 -**Added** -- (Linux) Added deb package and service for Linux - -## [0.1.0] - 2020-01-27 -**Added** -- The first official release for Sunshine! - -[0.1.0]: https://github.com/LizardByte/Sunshine/releases/tag/v0.1.0 -[0.1.1]: https://github.com/LizardByte/Sunshine/releases/tag/v0.1.1 -[0.2.0]: https://github.com/LizardByte/Sunshine/releases/tag/v0.2.0 -[0.3.0]: https://github.com/LizardByte/Sunshine/releases/tag/v0.3.0 -[0.3.1]: https://github.com/LizardByte/Sunshine/releases/tag/v0.3.1 -[0.4.0]: https://github.com/LizardByte/Sunshine/releases/tag/v0.4.0 -[0.5.0]: https://github.com/LizardByte/Sunshine/releases/tag/0.5.0 -[0.6.0]: https://github.com/LizardByte/Sunshine/releases/tag/v0.6.0 -[0.7.0]: https://github.com/LizardByte/Sunshine/releases/tag/v0.7.0 -[0.7.1]: https://github.com/LizardByte/Sunshine/releases/tag/v0.7.1 -[0.7.7]: https://github.com/LizardByte/Sunshine/releases/tag/v0.7.7 -[0.8.0]: https://github.com/LizardByte/Sunshine/releases/tag/v0.8.0 -[0.9.0]: https://github.com/LizardByte/Sunshine/releases/tag/v0.9.0 -[0.10.0]: https://github.com/LizardByte/Sunshine/releases/tag/v0.10.0 -[0.10.1]: https://github.com/LizardByte/Sunshine/releases/tag/v0.10.1 -[0.11.0]: https://github.com/LizardByte/Sunshine/releases/tag/v0.11.0 -[0.11.1]: https://github.com/LizardByte/Sunshine/releases/tag/v0.11.1 -[0.12.0]: https://github.com/LizardByte/Sunshine/releases/tag/v0.12.0 -[0.13.0]: https://github.com/LizardByte/Sunshine/releases/tag/v0.13.0 -[0.14.0]: https://github.com/LizardByte/Sunshine/releases/tag/v0.14.0 -[0.14.1]: https://github.com/LizardByte/Sunshine/releases/tag/v0.14.1 -[0.15.0]: https://github.com/LizardByte/Sunshine/releases/tag/v0.15.0 -[0.16.0]: https://github.com/LizardByte/Sunshine/releases/tag/v0.16.0 -[0.17.0]: https://github.com/LizardByte/Sunshine/releases/tag/v0.17.0 -[0.18.0]: https://github.com/LizardByte/Sunshine/releases/tag/v0.18.0 -[0.18.1]: https://github.com/LizardByte/Sunshine/releases/tag/v0.18.1 -[0.18.2]: https://github.com/LizardByte/Sunshine/releases/tag/v0.18.2 -[0.18.3]: https://github.com/LizardByte/Sunshine/releases/tag/v0.18.3 -[0.18.4]: https://github.com/LizardByte/Sunshine/releases/tag/v0.18.4 -[0.19.0]: https://github.com/LizardByte/Sunshine/releases/tag/v0.19.0 -[0.19.1]: https://github.com/LizardByte/Sunshine/releases/tag/v0.19.1 -[0.20.0]: https://github.com/LizardByte/Sunshine/releases/tag/v0.20.0 -[0.21.0]: https://github.com/LizardByte/Sunshine/releases/tag/v0.21.0 diff --git a/CMakeLists.txt b/CMakeLists.txt index 9c21b380ab9..90822a36ea0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,13 +1,17 @@ cmake_minimum_required(VERSION 3.18) # `CMAKE_CUDA_ARCHITECTURES` requires 3.18 +# set_source_files_properties requires 3.18 # todo - set this conditionally -# todo - set version to 0.0.0 once confident in automated versioning -project(Sunshine VERSION 0.21.0 - DESCRIPTION "Sunshine is a self-hosted game stream host for Moonlight." +project(Sunshine VERSION 0.0.0 + DESCRIPTION "Self-hosted game stream host for Moonlight" HOMEPAGE_URL "https://app.lizardbyte.dev/Sunshine") -set(PROJECT_LICENSE "GPL-3.0") +set(PROJECT_LICENSE "GPL-3.0-only") + +set(PROJECT_FQDN "dev.lizardbyte.app.Sunshine") + +set(PROJECT_BRIEF_DESCRIPTION "GameStream host for Moonlight") # must be <= 35 characters set(PROJECT_LONG_DESCRIPTION "Offering low latency, cloud gaming server capabilities with support for AMD, Intel, \ and Nvidia GPUs for hardware encoding. Software encoding is also available. You can connect to Sunshine from any \ @@ -20,7 +24,7 @@ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) endif() # set the module path, used for includes -set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake) +set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake") # set version info for this build include(${CMAKE_MODULE_PATH}/prep/build_version.cmake) @@ -28,6 +32,9 @@ include(${CMAKE_MODULE_PATH}/prep/build_version.cmake) # cmake build flags include(${CMAKE_MODULE_PATH}/prep/options.cmake) +# initial prep +include(${CMAKE_MODULE_PATH}/prep/init.cmake) + # configure special package files, such as sunshine.desktop, Flatpak manifest, Portfile , etc. include(${CMAKE_MODULE_PATH}/prep/special_package_configuration.cmake) diff --git a/DOCKER_README.md b/DOCKER_README.md index 7ac9f5c273b..f15fac2cc9e 100644 --- a/DOCKER_README.md +++ b/DOCKER_README.md @@ -19,7 +19,6 @@ ENTRYPOINT steam && sunshine ### SUNSHINE_VERSION - `latest`, `master`, `vX.X.X` -- `nightly` - commit hash ### SUNSHINE_OS @@ -52,8 +51,9 @@ Create and run the container (substitute your ``): ```bash docker run -d \ + --device /dev/dri/ \ --name= \ - --restart=unless-stopped + --restart=unless-stopped \ -e PUID= \ -e PGID= \ -e TZ= \ @@ -86,6 +86,25 @@ services: - "47998-48000:47998-48000/udp" ``` +### Using podman run +Create and run the container (substitute your ``): + +```bash +podman run -d \ + --device /dev/dri/ \ + --name= \ + --restart=unless-stopped \ + --userns=keep-id \ + -e PUID= \ + -e PGID= \ + -e TZ= \ + -v :/config \ + -p 47984-47990:47984-47990/tcp \ + -p 48010:48010 \ + -p 47998-48000:47998-48000/udp \ + +``` + ### Parameters You must substitute the `` with your own settings. @@ -132,8 +151,9 @@ The architectures supported by these images are shown in the table below. | tag suffix | amd64/x86_64 | arm64/aarch64 | |-----------------|--------------|---------------| | archlinux | ✅ | ❌ | +| debian-bookworm | ✅ | ✅ | | debian-bullseye | ✅ | ✅ | -| fedora-36 | ✅ | ✅ | -| fedora-37 | ✅ | ✅ | +| fedora-38 | ✅ | ✅ | +| fedora-39 | ✅ | ✅ | | ubuntu-20.04 | ✅ | ✅ | | ubuntu-22.04 | ✅ | ✅ | diff --git a/README.rst b/README.rst index 41ae6d8488e..b2b7f4634e6 100644 --- a/README.rst +++ b/README.rst @@ -17,69 +17,48 @@ System Requirements **Minimum Requirements** -+------------+------------------------------------------------------------+ -| GPU | AMD: VCE 1.0 or higher, see `obs-amd hardware support`_ | -| +------------------------------------------------------------+ -| | Intel: VAAPI-compatible, see: `VAAPI hardware support`_ | -| +------------------------------------------------------------+ -| | Nvidia: NVENC enabled cards, see `nvenc support matrix`_ | -+------------+------------------------------------------------------------+ -| CPU | AMD: Ryzen 3 or higher | -| +------------------------------------------------------------+ -| | Intel: Core i3 or higher | -+------------+------------------------------------------------------------+ -| RAM | 4GB or more | -+------------+------------------------------------------------------------+ -| OS | Windows: 10+ (Windows Server not supported) | -| +------------------------------------------------------------+ -| | macOS: 11.7+ | -| +------------------------------------------------------------+ -| | Linux/Debian: 11 (bullseye) | -| +------------------------------------------------------------+ -| | Linux/Fedora: 36+ | -| +------------------------------------------------------------+ -| | Linux/Ubuntu: 20.04+ (focal) | -+------------+------------------------------------------------------------+ -| Network | Host: 5GHz, 802.11ac | -| +------------------------------------------------------------+ -| | Client: 5GHz, 802.11ac | -+------------+------------------------------------------------------------+ +.. csv-table:: + :widths: 15, 60 + + "GPU", "AMD: VCE 1.0 or higher, see: `obs-amd hardware support `_" + "", "Intel: VAAPI-compatible, see: `VAAPI hardware support `_" + "", "Nvidia: NVENC enabled cards, see: `nvenc support matrix `_" + "CPU", "AMD: Ryzen 3 or higher" + "", "Intel: Core i3 or higher" + "RAM", "4GB or more" + "OS", "Windows: 10+ (Windows Server does not support virtual gamepads)" + "", "macOS: 12+" + "", "Linux/Debian: 11 (bullseye)" + "", "Linux/Fedora: 39+" + "", "Linux/Ubuntu: 22.04+ (jammy)" + "Network", "Host: 5GHz, 802.11ac" + "", "Client: 5GHz, 802.11ac" **4k Suggestions** -+------------+------------------------------------------------------------+ -| GPU | AMD: Video Coding Engine 3.1 or higher | -| +------------------------------------------------------------+ -| | Intel: HD Graphics 510 or higher | -| +------------------------------------------------------------+ -| | Nvidia: GeForce GTX 1080 or higher | -+------------+------------------------------------------------------------+ -| CPU | AMD: Ryzen 5 or higher | -| +------------------------------------------------------------+ -| | Intel: Core i5 or higher | -+------------+------------------------------------------------------------+ -| Network | Host: CAT5e ethernet or better | -| +------------------------------------------------------------+ -| | Client: CAT5e ethernet or better | -+------------+------------------------------------------------------------+ +.. csv-table:: + :widths: 15, 60 + + "GPU", "AMD: Video Coding Engine 3.1 or higher" + "", "Intel: HD Graphics 510 or higher" + "", "Nvidia: GeForce GTX 1080 or higher" + "CPU", "AMD: Ryzen 5 or higher" + "", "Intel: Core i5 or higher" + "Network", "Host: CAT5e ethernet or better" + "", "Client: CAT5e ethernet or better" **HDR Suggestions** -+------------+------------------------------------------------------------+ -| GPU | AMD: Video Coding Engine 3.4 or higher | -| +------------------------------------------------------------+ -| | Intel: UHD Graphics 730 or higher | -| +------------------------------------------------------------+ -| | Nvidia: Pascal-based GPU (GTX 10-series) or higher | -+------------+------------------------------------------------------------+ -| CPU | AMD: todo | -| +------------------------------------------------------------+ -| | Intel: todo | -+------------+------------------------------------------------------------+ -| Network | Host: CAT5e ethernet or better | -| +------------------------------------------------------------+ -| | Client: CAT5e ethernet or better | -+------------+------------------------------------------------------------+ +.. csv-table:: + :widths: 15, 60 + + "GPU", "AMD: Video Coding Engine 3.4 or higher" + "", "Intel: UHD Graphics 730 or higher" + "", "Nvidia: Pascal-based GPU (GTX 10-series) or higher" + "CPU", "AMD: todo" + "", "Intel: todo" + "Network", "Host: CAT5e ethernet or better" + "", "Client: CAT5e ethernet or better" Integrations ------------ @@ -88,14 +67,18 @@ Integrations :alt: GitHub Workflow Status (CI) :target: https://github.com/LizardByte/Sunshine/actions/workflows/CI.yml?query=branch%3Amaster -.. image:: https://img.shields.io/github/actions/workflow/status/lizardbyte/sunshine/localize.yml.svg?branch=nightly&label=localize%20build&logo=github&style=for-the-badge +.. image:: https://img.shields.io/github/actions/workflow/status/lizardbyte/sunshine/localize.yml.svg?branch=master&label=localize%20build&logo=github&style=for-the-badge :alt: GitHub Workflow Status (localize) - :target: https://github.com/LizardByte/Sunshine/actions/workflows/localize.yml?query=branch%3Anightly + :target: https://github.com/LizardByte/Sunshine/actions/workflows/localize.yml?query=branch%3Amaster .. image:: https://img.shields.io/readthedocs/sunshinestream.svg?label=Docs&style=for-the-badge&logo=readthedocs :alt: Read the Docs :target: http://sunshinestream.readthedocs.io/ +.. image:: https://img.shields.io/codecov/c/gh/LizardByte/Sunshine?token=SMGXQ5NVMJ&style=for-the-badge&logo=codecov&label=codecov + :alt: Codecov + :target: https://codecov.io/gh/LizardByte/Sunshine + Support ------- @@ -113,7 +96,11 @@ Downloads :alt: Docker :target: https://hub.docker.com/r/lizardbyte/sunshine -.. image:: https://img.shields.io/badge/dynamic/xml.svg?color=orange&label=Winget&style=for-the-badge&prefix=v&query=%2F%2Ftr%5B%40id%3D%27winget%27%5D%2Ftd%5B3%5D%2Fspan%2Fa&url=https%3A%2F%2Frepology.org%2Fproject%2Fsunshine%2Fversions&logo=microsoft +.. image:: https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fraw.githubusercontent.com%2Fipitio%2Fghcr-pulls%2Fmaster%2Findex.json&query=%24%5B%3F(%40.owner%3D%3D%22LizardByte%22%20%26%26%20%40.repo%3D%3D%22Sunshine%22%20%26%26%20%40.image%3D%3D%22sunshine%22)%5D.pulls&label=ghcr%20pulls&style=for-the-badge&logo=github + :alt: GHCR + :target: https://github.com/LizardByte/Sunshine/pkgs/container/sunshine + +.. image:: https://img.shields.io/badge/dynamic/json.svg?color=orange&label=Winget&style=for-the-badge&prefix=v&query=$[-1:].name&url=https%3A%2F%2Fapi.github.com%2Frepos%2Fmicrosoft%2Fwinget-pkgs%2Fcontents%2Fmanifests%2Fl%2FLizardByte%2FSunshine&logo=microsoft :alt: Winget Version :target: https://github.com/microsoft/winget-pkgs/tree/master/manifests/l/LizardByte/Sunshine @@ -122,7 +109,3 @@ Stats .. image:: https://img.shields.io/github/stars/lizardbyte/sunshine.svg?logo=github&style=for-the-badge :alt: GitHub stars :target: https://github.com/LizardByte/Sunshine - -.. _nvenc support matrix: https://developer.nvidia.com/video-encode-and-decode-gpu-support-matrix-new -.. _obs-amd hardware support: https://github.com/obsproject/obs-amd-encoder/wiki/Hardware-Support -.. _VAAPI hardware support: https://www.intel.com/content/www/us/en/developer/articles/technical/linuxmedia-vaapi.html diff --git a/cmake/FindLibva.cmake b/cmake/FindLibva.cmake new file mode 100644 index 00000000000..f8dfddc1496 --- /dev/null +++ b/cmake/FindLibva.cmake @@ -0,0 +1,70 @@ +# - Try to find Libva +# This module defines the following variables: +# +# * LIBVA_FOUND - The component was found +# * LIBVA_INCLUDE_DIRS - The component include directory +# * LIBVA_LIBRARIES - The component library Libva +# * LIBVA_DRM_LIBRARIES - The component library Libva DRM + +# Use pkg-config to get the directories and then use these values in the +# find_path() and find_library() calls +# cmake-format: on + +find_package(PkgConfig QUIET) +if(PKG_CONFIG_FOUND) + pkg_check_modules(_LIBVA libva) + pkg_check_modules(_LIBVA_DRM libva-drm) +endif() + +find_path( + LIBVA_INCLUDE_DIR + NAMES va/va.h va/va_drm.h + HINTS ${_LIBVA_INCLUDE_DIRS} + PATHS /usr/include /usr/local/include /opt/local/include) + +find_library( + LIBVA_LIB + NAMES ${_LIBVA_LIBRARIES} libva + HINTS ${_LIBVA_LIBRARY_DIRS} + PATHS /usr/lib /usr/local/lib /opt/local/lib) + +find_library( + LIBVA_DRM_LIB + NAMES ${_LIBVA_DRM_LIBRARIES} libva-drm + HINTS ${_LIBVA_DRM_LIBRARY_DIRS} + PATHS /usr/lib /usr/local/lib /opt/local/lib) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(Libva REQUIRED_VARS LIBVA_INCLUDE_DIR LIBVA_LIB LIBVA_DRM_LIB) +mark_as_advanced(LIBVA_INCLUDE_DIR LIBVA_LIB LIBVA_DRM_LIB) + +if(LIBVA_FOUND) + set(LIBVA_INCLUDE_DIRS ${LIBVA_INCLUDE_DIR}) + set(LIBVA_LIBRARIES ${LIBVA_LIB}) + set(LIBVA_DRM_LIBRARIES ${LIBVA_DRM_LIB}) + + if(NOT TARGET Libva::va) + if(IS_ABSOLUTE "${LIBVA_LIBRARIES}") + add_library(Libva::va UNKNOWN IMPORTED) + set_target_properties(Libva::va PROPERTIES IMPORTED_LOCATION "${LIBVA_LIBRARIES}") + else() + add_library(Libva::va INTERFACE IMPORTED) + set_target_properties(Libva::va PROPERTIES IMPORTED_LIBNAME "${LIBVA_LIBRARIES}") + endif() + + set_target_properties(Libva::va PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${LIBVA_INCLUDE_DIRS}") + endif() + + if(NOT TARGET Libva::drm) + if(IS_ABSOLUTE "${LIBVA_DRM_LIBRARIES}") + add_library(Libva::drm UNKNOWN IMPORTED) + set_target_properties(Libva::drm PROPERTIES IMPORTED_LOCATION "${LIBVA_DRM_LIBRARIES}") + else() + add_library(Libva::drm INTERFACE IMPORTED) + set_target_properties(Libva::drm PROPERTIES IMPORTED_LIBNAME "${LIBVA_DRM_LIBRARIES}") + endif() + + set_target_properties(Libva::drm PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${LIBVA_INCLUDE_DIRS}") + endif() + +endif() diff --git a/cmake/FindSystemd.cmake b/cmake/FindSystemd.cmake new file mode 100644 index 00000000000..c41ca64d248 --- /dev/null +++ b/cmake/FindSystemd.cmake @@ -0,0 +1,34 @@ +# - Try to find Systemd +# Once done this will define +# +# SYSTEMD_FOUND - system has systemd +# SYSTEMD_USER_UNIT_INSTALL_DIR - the systemd system unit install directory +# SYSTEMD_SYSTEM_UNIT_INSTALL_DIR - the systemd user unit install directory + +IF (NOT WIN32) + + find_package(PkgConfig QUIET) + if(PKG_CONFIG_FOUND) + pkg_check_modules(SYSTEMD "systemd") + endif() + + if (SYSTEMD_FOUND) + execute_process(COMMAND ${PKG_CONFIG_EXECUTABLE} + --variable=systemduserunitdir systemd + OUTPUT_VARIABLE SYSTEMD_USER_UNIT_INSTALL_DIR) + + string(REGEX REPLACE "[ \t\n]+" "" SYSTEMD_USER_UNIT_INSTALL_DIR + "${SYSTEMD_USER_UNIT_INSTALL_DIR}") + + execute_process(COMMAND ${PKG_CONFIG_EXECUTABLE} + --variable=systemdsystemunitdir systemd + OUTPUT_VARIABLE SYSTEMD_SYSTEM_UNIT_INSTALL_DIR) + + string(REGEX REPLACE "[ \t\n]+" "" SYSTEMD_SYSTEM_UNIT_INSTALL_DIR + "${SYSTEMD_SYSTEM_UNIT_INSTALL_DIR}") + + mark_as_advanced(SYSTEMD_USER_UNIT_INSTALL_DIR SYSTEMD_SYSTEM_UNIT_INSTALL_DIR) + + endif () + +ENDIF () diff --git a/cmake/FindUdev.cmake b/cmake/FindUdev.cmake new file mode 100644 index 00000000000..8343f791d35 --- /dev/null +++ b/cmake/FindUdev.cmake @@ -0,0 +1,28 @@ +# - Try to find Udev +# Once done this will define +# +# UDEV_FOUND - system has udev +# UDEV_RULES_INSTALL_DIR - the udev rules install directory + +IF (NOT WIN32) + + find_package(PkgConfig QUIET) + if(PKG_CONFIG_FOUND) + pkg_check_modules(UDEV "udev") + endif() + + if (UDEV_FOUND) + execute_process(COMMAND ${PKG_CONFIG_EXECUTABLE} + --variable=udevdir udev + OUTPUT_VARIABLE UDEV_RULES_INSTALL_DIR) + + string(REGEX REPLACE "[ \t\n]+" "" UDEV_RULES_INSTALL_DIR + "${UDEV_RULES_INSTALL_DIR}") + + set(UDEV_RULES_INSTALL_DIR "${UDEV_RULES_INSTALL_DIR}/rules.d") + + mark_as_advanced(UDEV_RULES_INSTALL_DIR) + + endif () + +ENDIF () diff --git a/cmake/compile_definitions/common.cmake b/cmake/compile_definitions/common.cmake index f10b2006cf6..f4a91a78ad0 100644 --- a/cmake/compile_definitions/common.cmake +++ b/cmake/compile_definitions/common.cmake @@ -3,7 +3,25 @@ list(APPEND SUNSHINE_COMPILE_OPTIONS -Wall -Wno-sign-compare) # Wall - enable all warnings +# Werror - treat warnings as errors +# Wno-maybe-uninitialized/Wno-uninitialized - disable warnings for maybe uninitialized variables # Wno-sign-compare - disable warnings for signed/unsigned comparisons +if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + # GCC specific compile options + + # GCC 12 and higher will complain about maybe-uninitialized + if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 12) + list(APPEND SUNSHINE_COMPILE_OPTIONS -Wno-maybe-uninitialized) + endif() +elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + # Clang specific compile options + + # Clang doesn't actually complain about this this, so disabling for now + # list(APPEND SUNSHINE_COMPILE_OPTIONS -Wno-uninitialized) +endif() +if(BUILD_WERROR) + list(APPEND SUNSHINE_COMPILE_OPTIONS -Werror) +endif() # setup assets directory if(NOT SUNSHINE_ASSETS_DIR) @@ -23,72 +41,75 @@ elseif(UNIX) endif() endif() -include_directories(SYSTEM third-party/nv-codec-headers/include) +include_directories(SYSTEM "${CMAKE_SOURCE_DIR}/third-party/nv-codec-headers/include") file(GLOB NVENC_SOURCES CONFIGURE_DEPENDS "src/nvenc/*.cpp" "src/nvenc/*.h") list(APPEND PLATFORM_TARGET_FILES ${NVENC_SOURCES}) -configure_file(src/version.h.in version.h @ONLY) -include_directories(${CMAKE_CURRENT_BINARY_DIR}) +configure_file("${CMAKE_SOURCE_DIR}/src/version.h.in" version.h @ONLY) +include_directories("${CMAKE_CURRENT_BINARY_DIR}") # required for importing version.h set(SUNSHINE_TARGET_FILES - third-party/nanors/rs.c - third-party/nanors/rs.h - third-party/moonlight-common-c/src/Input.h - third-party/moonlight-common-c/src/Rtsp.h - third-party/moonlight-common-c/src/RtspParser.c - third-party/moonlight-common-c/src/Video.h - third-party/tray/tray.h - src/upnp.cpp - src/upnp.h - src/cbs.cpp - src/utility.h - src/uuid.h - src/config.h - src/config.cpp - src/main.cpp - src/main.h - src/crypto.cpp - src/crypto.h - src/nvhttp.cpp - src/nvhttp.h - src/httpcommon.cpp - src/httpcommon.h - src/confighttp.cpp - src/confighttp.h - src/rtsp.cpp - src/rtsp.h - src/stream.cpp - src/stream.h - src/video.cpp - src/video.h - src/video_colorspace.cpp - src/video_colorspace.h - src/input.cpp - src/input.h - src/audio.cpp - src/audio.h - src/platform/common.h - src/process.cpp - src/process.h - src/network.cpp - src/network.h - src/move_by_copy.h - src/system_tray.cpp - src/system_tray.h - src/task_pool.h - src/thread_pool.h - src/thread_safe.h - src/sync.h - src/round_robin.h - src/stat_trackers.h - src/stat_trackers.cpp + "${CMAKE_SOURCE_DIR}/third-party/moonlight-common-c/src/Input.h" + "${CMAKE_SOURCE_DIR}/third-party/moonlight-common-c/src/Rtsp.h" + "${CMAKE_SOURCE_DIR}/third-party/moonlight-common-c/src/RtspParser.c" + "${CMAKE_SOURCE_DIR}/third-party/moonlight-common-c/src/Video.h" + "${CMAKE_SOURCE_DIR}/third-party/tray/src/tray.h" + "${CMAKE_SOURCE_DIR}/src/upnp.cpp" + "${CMAKE_SOURCE_DIR}/src/upnp.h" + "${CMAKE_SOURCE_DIR}/src/cbs.cpp" + "${CMAKE_SOURCE_DIR}/src/utility.h" + "${CMAKE_SOURCE_DIR}/src/uuid.h" + "${CMAKE_SOURCE_DIR}/src/config.h" + "${CMAKE_SOURCE_DIR}/src/config.cpp" + "${CMAKE_SOURCE_DIR}/src/entry_handler.cpp" + "${CMAKE_SOURCE_DIR}/src/entry_handler.h" + "${CMAKE_SOURCE_DIR}/src/file_handler.cpp" + "${CMAKE_SOURCE_DIR}/src/file_handler.h" + "${CMAKE_SOURCE_DIR}/src/globals.cpp" + "${CMAKE_SOURCE_DIR}/src/globals.h" + "${CMAKE_SOURCE_DIR}/src/logging.cpp" + "${CMAKE_SOURCE_DIR}/src/logging.h" + "${CMAKE_SOURCE_DIR}/src/main.cpp" + "${CMAKE_SOURCE_DIR}/src/main.h" + "${CMAKE_SOURCE_DIR}/src/crypto.cpp" + "${CMAKE_SOURCE_DIR}/src/crypto.h" + "${CMAKE_SOURCE_DIR}/src/nvhttp.cpp" + "${CMAKE_SOURCE_DIR}/src/nvhttp.h" + "${CMAKE_SOURCE_DIR}/src/httpcommon.cpp" + "${CMAKE_SOURCE_DIR}/src/httpcommon.h" + "${CMAKE_SOURCE_DIR}/src/confighttp.cpp" + "${CMAKE_SOURCE_DIR}/src/confighttp.h" + "${CMAKE_SOURCE_DIR}/src/rtsp.cpp" + "${CMAKE_SOURCE_DIR}/src/rtsp.h" + "${CMAKE_SOURCE_DIR}/src/stream.cpp" + "${CMAKE_SOURCE_DIR}/src/stream.h" + "${CMAKE_SOURCE_DIR}/src/video.cpp" + "${CMAKE_SOURCE_DIR}/src/video.h" + "${CMAKE_SOURCE_DIR}/src/video_colorspace.cpp" + "${CMAKE_SOURCE_DIR}/src/video_colorspace.h" + "${CMAKE_SOURCE_DIR}/src/input.cpp" + "${CMAKE_SOURCE_DIR}/src/input.h" + "${CMAKE_SOURCE_DIR}/src/audio.cpp" + "${CMAKE_SOURCE_DIR}/src/audio.h" + "${CMAKE_SOURCE_DIR}/src/platform/common.h" + "${CMAKE_SOURCE_DIR}/src/process.cpp" + "${CMAKE_SOURCE_DIR}/src/process.h" + "${CMAKE_SOURCE_DIR}/src/network.cpp" + "${CMAKE_SOURCE_DIR}/src/network.h" + "${CMAKE_SOURCE_DIR}/src/move_by_copy.h" + "${CMAKE_SOURCE_DIR}/src/system_tray.cpp" + "${CMAKE_SOURCE_DIR}/src/system_tray.h" + "${CMAKE_SOURCE_DIR}/src/task_pool.h" + "${CMAKE_SOURCE_DIR}/src/thread_pool.h" + "${CMAKE_SOURCE_DIR}/src/thread_safe.h" + "${CMAKE_SOURCE_DIR}/src/sync.h" + "${CMAKE_SOURCE_DIR}/src/round_robin.h" + "${CMAKE_SOURCE_DIR}/src/stat_trackers.h" + "${CMAKE_SOURCE_DIR}/src/stat_trackers.cpp" + "${CMAKE_SOURCE_DIR}/src/rswrapper.h" + "${CMAKE_SOURCE_DIR}/src/rswrapper.c" ${PLATFORM_TARGET_FILES}) -set_source_files_properties(src/upnp.cpp PROPERTIES COMPILE_FLAGS -Wno-pedantic) - -set_source_files_properties(third-party/nanors/rs.c - PROPERTIES COMPILE_FLAGS "-include deps/obl/autoshim.h -ftree-vectorize") - if(NOT SUNSHINE_ASSETS_DIR_DEF) set(SUNSHINE_ASSETS_DIR_DEF "${SUNSHINE_ASSETS_DIR}") endif() @@ -96,34 +117,24 @@ list(APPEND SUNSHINE_DEFINITIONS SUNSHINE_ASSETS_DIR="${SUNSHINE_ASSETS_DIR_DEF} list(APPEND SUNSHINE_DEFINITIONS SUNSHINE_TRAY=${SUNSHINE_TRAY}) -include_directories(${CMAKE_CURRENT_SOURCE_DIR}) +include_directories("${CMAKE_SOURCE_DIR}") include_directories( SYSTEM - ${CMAKE_CURRENT_SOURCE_DIR}/third-party - ${CMAKE_CURRENT_SOURCE_DIR}/third-party/moonlight-common-c/enet/include - ${CMAKE_CURRENT_SOURCE_DIR}/third-party/nanors - ${CMAKE_CURRENT_SOURCE_DIR}/third-party/nanors/deps/obl + "${CMAKE_SOURCE_DIR}/third-party" + "${CMAKE_SOURCE_DIR}/third-party/moonlight-common-c/enet/include" + "${CMAKE_SOURCE_DIR}/third-party/nanors" + "${CMAKE_SOURCE_DIR}/third-party/nanors/deps/obl" ${FFMPEG_INCLUDE_DIRS} - ${PLATFORM_INCLUDE_DIRS} + ${Boost_INCLUDE_DIRS} # has to be the last, or we get runtime error on macOS ffmpeg encoder ) -string(TOUPPER "x${CMAKE_BUILD_TYPE}" BUILD_TYPE) -if("${BUILD_TYPE}" STREQUAL "XDEBUG") - if(WIN32) - set_source_files_properties(src/nvhttp.cpp PROPERTIES COMPILE_FLAGS -O2) - endif() -else() - add_definitions(-DNDEBUG) -endif() - list(APPEND SUNSHINE_EXTERNAL_LIBRARIES - libminiupnpc-static + ${MINIUPNP_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} enet opus ${FFMPEG_LIBRARIES} ${Boost_LIBRARIES} ${OPENSSL_LIBRARIES} - ${CURL_LIBRARIES} ${PLATFORM_LIBRARIES}) diff --git a/cmake/compile_definitions/linux.cmake b/cmake/compile_definitions/linux.cmake index f28152ee9bb..e07c2a55d8f 100644 --- a/cmake/compile_definitions/linux.cmake +++ b/cmake/compile_definitions/linux.cmake @@ -8,10 +8,6 @@ if(${SUNSHINE_BUILD_APPIMAGE}) string(REPLACE "${CMAKE_INSTALL_PREFIX}" ".${CMAKE_INSTALL_PREFIX}" SUNSHINE_ASSETS_DIR_DEF ${SUNSHINE_ASSETS_DIR}) endif() -if(NOT DEFINED SUNSHINE_EXECUTABLE_PATH) - set(SUNSHINE_EXECUTABLE_PATH "sunshine") -endif() - # cuda set(CUDA_FOUND OFF) if(${SUNSHINE_ENABLE_CUDA}) @@ -89,11 +85,12 @@ if(${SUNSHINE_ENABLE_CUDA}) endif() endif() if(CUDA_FOUND) - include_directories(SYSTEM third-party/nvfbc) + include_directories(SYSTEM "${CMAKE_SOURCE_DIR}/third-party/nvfbc") list(APPEND PLATFORM_TARGET_FILES - src/platform/linux/cuda.cu - src/platform/linux/cuda.cpp - third-party/nvfbc/NvFBC.h) + "${CMAKE_SOURCE_DIR}/src/platform/linux/cuda.h" + "${CMAKE_SOURCE_DIR}/src/platform/linux/cuda.cu" + "${CMAKE_SOURCE_DIR}/src/platform/linux/cuda.cpp" + "${CMAKE_SOURCE_DIR}/third-party/nvfbc/NvFBC.h") add_compile_definitions(SUNSHINE_BUILD_CUDA) endif() @@ -110,7 +107,8 @@ if(LIBDRM_FOUND AND LIBCAP_FOUND) add_compile_definitions(SUNSHINE_BUILD_DRM) include_directories(SYSTEM ${LIBDRM_INCLUDE_DIRS} ${LIBCAP_INCLUDE_DIRS}) list(APPEND PLATFORM_LIBRARIES ${LIBDRM_LIBRARIES} ${LIBCAP_LIBRARIES}) - list(APPEND PLATFORM_TARGET_FILES src/platform/linux/kmsgrab.cpp) + list(APPEND PLATFORM_TARGET_FILES + "${CMAKE_SOURCE_DIR}/src/platform/linux/kmsgrab.cpp") list(APPEND SUNSHINE_DEFINITIONS EGL_NO_X11=1) elseif(NOT LIBDRM_FOUND) message(WARNING "Missing libdrm") @@ -118,6 +116,24 @@ elseif(NOT LIBDRM_FOUND) message(WARNING "Missing libcap") endif() +# evdev +include(dependencies/libevdev_Sunshine) + +# vaapi +if(${SUNSHINE_ENABLE_VAAPI}) + find_package(Libva) +else() + set(LIBVA_FOUND OFF) +endif() +if(LIBVA_FOUND) + add_compile_definitions(SUNSHINE_BUILD_VAAPI) + include_directories(SYSTEM ${LIBVA_INCLUDE_DIR}) + list(APPEND PLATFORM_LIBRARIES ${LIBVA_LIBRARIES} ${LIBVA_DRM_LIBRARIES}) + list(APPEND PLATFORM_TARGET_FILES + "${CMAKE_SOURCE_DIR}/src/platform/linux/vaapi.h" + "${CMAKE_SOURCE_DIR}/src/platform/linux/vaapi.cpp") +endif() + # wayland if(${SUNSHINE_ENABLE_WAYLAND}) find_package(Wayland) @@ -127,8 +143,15 @@ endif() if(WAYLAND_FOUND) add_compile_definitions(SUNSHINE_BUILD_WAYLAND) - GEN_WAYLAND("wayland-protocols" "unstable/xdg-output" xdg-output-unstable-v1) - GEN_WAYLAND("wlr-protocols" "unstable" wlr-export-dmabuf-unstable-v1) + if(NOT SUNSHINE_SYSTEM_WAYLAND_PROTOCOLS) + set(WAYLAND_PROTOCOLS_DIR "${CMAKE_SOURCE_DIR}/third-party/wayland-protocols") + else() + pkg_get_variable(WAYLAND_PROTOCOLS_DIR wayland-protocols pkgdatadir) + pkg_check_modules(WAYLAND_PROTOCOLS wayland-protocols REQUIRED) + endif() + + GEN_WAYLAND("${WAYLAND_PROTOCOLS_DIR}" "unstable/xdg-output" xdg-output-unstable-v1) + GEN_WAYLAND("${CMAKE_SOURCE_DIR}/third-party/wlr-protocols" "unstable" wlr-export-dmabuf-unstable-v1) include_directories( SYSTEM @@ -138,8 +161,9 @@ if(WAYLAND_FOUND) list(APPEND PLATFORM_LIBRARIES ${WAYLAND_LIBRARIES}) list(APPEND PLATFORM_TARGET_FILES - src/platform/linux/wlgrab.cpp - src/platform/linux/wayland.cpp) + "${CMAKE_SOURCE_DIR}/src/platform/linux/wlgrab.cpp" + "${CMAKE_SOURCE_DIR}/src/platform/linux/wayland.h" + "${CMAKE_SOURCE_DIR}/src/platform/linux/wayland.cpp") endif() # x11 @@ -152,22 +176,28 @@ if(X11_FOUND) add_compile_definitions(SUNSHINE_BUILD_X11) include_directories(SYSTEM ${X11_INCLUDE_DIR}) list(APPEND PLATFORM_LIBRARIES ${X11_LIBRARIES}) - list(APPEND PLATFORM_TARGET_FILES src/platform/linux/x11grab.cpp) + list(APPEND PLATFORM_TARGET_FILES + "${CMAKE_SOURCE_DIR}/src/platform/linux/x11grab.h" + "${CMAKE_SOURCE_DIR}/src/platform/linux/x11grab.cpp") endif() -if(NOT ${CUDA_FOUND} AND NOT ${WAYLAND_FOUND} AND NOT ${X11_FOUND} AND NOT (${LIBDRM_FOUND} AND ${LIBCAP_FOUND})) - message(FATAL_ERROR "Couldn't find either x11, wayland, cuda or (libdrm and libcap)") +if(NOT ${CUDA_FOUND} + AND NOT ${WAYLAND_FOUND} + AND NOT ${X11_FOUND} + AND NOT (${LIBDRM_FOUND} AND ${LIBCAP_FOUND}) + AND NOT ${LIBVA_FOUND}) + message(FATAL_ERROR "Couldn't find either cuda, wayland, x11, (libdrm and libcap), or libva") endif() # tray icon if(${SUNSHINE_ENABLE_TRAY}) - pkg_check_modules(APPINDICATOR appindicator3-0.1) + pkg_check_modules(APPINDICATOR ayatana-appindicator3-0.1) if(APPINDICATOR_FOUND) - list(APPEND SUNSHINE_DEFINITIONS TRAY_LEGACY_APPINDICATOR=1) + list(APPEND SUNSHINE_DEFINITIONS TRAY_AYATANA_APPINDICATOR=1) else() - pkg_check_modules(APPINDICATOR ayatana-appindicator3-0.1) + pkg_check_modules(APPINDICATOR appindicator3-0.1) if(APPINDICATOR_FOUND) - list(APPEND SUNSHINE_DEFINITIONS TRAY_AYATANA_APPINDICATOR=1) + list(APPEND SUNSHINE_DEFINITIONS TRAY_LEGACY_APPINDICATOR=1) endif () endif() pkg_check_modules(LIBNOTIFY libnotify) @@ -180,7 +210,7 @@ if(${SUNSHINE_ENABLE_TRAY}) include_directories(SYSTEM ${APPINDICATOR_INCLUDE_DIRS} ${LIBNOTIFY_INCLUDE_DIRS}) link_directories(${APPINDICATOR_LIBRARY_DIRS} ${LIBNOTIFY_LIBRARY_DIRS}) - list(APPEND PLATFORM_TARGET_FILES third-party/tray/tray_linux.c) + list(APPEND PLATFORM_TARGET_FILES "${CMAKE_SOURCE_DIR}/third-party/tray/src/tray_linux.c") list(APPEND SUNSHINE_EXTERNAL_LIBRARIES ${APPINDICATOR_LIBRARIES} ${LIBNOTIFY_LIBRARIES}) endif() else() @@ -188,40 +218,49 @@ else() message(STATUS "Tray icon disabled") endif() -if (${SUNSHINE_TRAY} EQUAL 0 AND SUNSHINE_REQUIRE_TRAY) +if(${SUNSHINE_ENABLE_TRAY} AND ${SUNSHINE_TRAY} EQUAL 0 AND SUNSHINE_REQUIRE_TRAY) message(FATAL_ERROR "Tray icon is required") endif() +if(${SUNSHINE_USE_LEGACY_INPUT}) # TODO: Remove this legacy option after the next stable release + list(APPEND PLATFORM_TARGET_FILES "${CMAKE_SOURCE_DIR}/src/platform/linux/input/legacy_input.cpp") +else() + # These need to be set before adding the inputtino subdirectory in order for them to be picked up + set(LIBEVDEV_CUSTOM_INCLUDE_DIR "${EVDEV_INCLUDE_DIR}") + set(LIBEVDEV_CUSTOM_LIBRARY "${EVDEV_LIBRARY}") + + add_subdirectory("${CMAKE_SOURCE_DIR}/third-party/inputtino") + list(APPEND SUNSHINE_EXTERNAL_LIBRARIES inputtino::libinputtino) + file(GLOB_RECURSE INPUTTINO_SOURCES + ${CMAKE_SOURCE_DIR}/src/platform/linux/input/inputtino*.h + ${CMAKE_SOURCE_DIR}/src/platform/linux/input/inputtino*.cpp) + list(APPEND PLATFORM_TARGET_FILES ${INPUTTINO_SOURCES}) + + # build libevdev before the libinputtino target + if(EXTERNAL_PROJECT_LIBEVDEV_USED) + add_dependencies(libinputtino libevdev) + endif() +endif() + list(APPEND PLATFORM_TARGET_FILES - src/platform/linux/publish.cpp - src/platform/linux/vaapi.h - src/platform/linux/vaapi.cpp - src/platform/linux/cuda.h - src/platform/linux/graphics.h - src/platform/linux/graphics.cpp - src/platform/linux/misc.h - src/platform/linux/misc.cpp - src/platform/linux/audio.cpp - src/platform/linux/input.cpp - src/platform/linux/x11grab.h - src/platform/linux/wayland.h - third-party/glad/src/egl.c - third-party/glad/src/gl.c - third-party/glad/include/EGL/eglplatform.h - third-party/glad/include/KHR/khrplatform.h - third-party/glad/include/glad/gl.h - third-party/glad/include/glad/egl.h) + "${CMAKE_SOURCE_DIR}/src/platform/linux/publish.cpp" + "${CMAKE_SOURCE_DIR}/src/platform/linux/graphics.h" + "${CMAKE_SOURCE_DIR}/src/platform/linux/graphics.cpp" + "${CMAKE_SOURCE_DIR}/src/platform/linux/misc.h" + "${CMAKE_SOURCE_DIR}/src/platform/linux/misc.cpp" + "${CMAKE_SOURCE_DIR}/src/platform/linux/audio.cpp" + "${CMAKE_SOURCE_DIR}/third-party/glad/src/egl.c" + "${CMAKE_SOURCE_DIR}/third-party/glad/src/gl.c" + "${CMAKE_SOURCE_DIR}/third-party/glad/include/EGL/eglplatform.h" + "${CMAKE_SOURCE_DIR}/third-party/glad/include/KHR/khrplatform.h" + "${CMAKE_SOURCE_DIR}/third-party/glad/include/glad/gl.h" + "${CMAKE_SOURCE_DIR}/third-party/glad/include/glad/egl.h") list(APPEND PLATFORM_LIBRARIES - Boost::dynamic_linking dl - evdev - numa pulse pulse-simple) include_directories( SYSTEM - /usr/include/libevdev-1.0 - third-party/nv-codec-headers/include - third-party/glad/include) + "${CMAKE_SOURCE_DIR}/third-party/glad/include") diff --git a/cmake/compile_definitions/macos.cmake b/cmake/compile_definitions/macos.cmake index 3bcf9528361..fb33d3bf235 100644 --- a/cmake/compile_definitions/macos.cmake +++ b/cmake/compile_definitions/macos.cmake @@ -2,48 +2,56 @@ add_compile_definitions(SUNSHINE_PLATFORM="macos") -link_directories(/opt/local/lib) -link_directories(/usr/local/lib) -link_directories(/opt/homebrew/lib) -ADD_DEFINITIONS(-DBOOST_LOG_DYN_LINK) +set(MACOS_LINK_DIRECTORIES + /opt/homebrew/lib + /opt/local/lib + /usr/local/lib) + +foreach(dir ${MACOS_LINK_DIRECTORIES}) + if(EXISTS ${dir}) + link_directories(${dir}) + endif() +endforeach() + +if(NOT BOOST_USE_STATIC AND NOT FETCH_CONTENT_BOOST_USED) + ADD_DEFINITIONS(-DBOOST_LOG_DYN_LINK) +endif() list(APPEND SUNSHINE_EXTERNAL_LIBRARIES + ${APP_KIT_LIBRARY} ${APP_SERVICES_LIBRARY} ${AV_FOUNDATION_LIBRARY} ${CORE_MEDIA_LIBRARY} ${CORE_VIDEO_LIBRARY} - ${VIDEO_TOOLBOX_LIBRARY} - ${FOUNDATION_LIBRARY}) - -set(PLATFORM_INCLUDE_DIRS - ${Boost_INCLUDE_DIR}) + ${FOUNDATION_LIBRARY} + ${VIDEO_TOOLBOX_LIBRARY}) -set(APPLE_PLIST_FILE ${SUNSHINE_SOURCE_ASSETS_DIR}/macos/assets/Info.plist) +set(APPLE_PLIST_FILE "${SUNSHINE_SOURCE_ASSETS_DIR}/macos/assets/Info.plist") # todo - tray is not working on macos set(SUNSHINE_TRAY 0) set(PLATFORM_TARGET_FILES - src/platform/macos/av_audio.h - src/platform/macos/av_audio.m - src/platform/macos/av_img_t.h - src/platform/macos/av_video.h - src/platform/macos/av_video.m - src/platform/macos/display.mm - src/platform/macos/input.cpp - src/platform/macos/microphone.mm - src/platform/macos/misc.mm - src/platform/macos/misc.h - src/platform/macos/nv12_zero_device.cpp - src/platform/macos/nv12_zero_device.h - src/platform/macos/publish.cpp - third-party/TPCircularBuffer/TPCircularBuffer.c - third-party/TPCircularBuffer/TPCircularBuffer.h + "${CMAKE_SOURCE_DIR}/src/platform/macos/av_audio.h" + "${CMAKE_SOURCE_DIR}/src/platform/macos/av_audio.m" + "${CMAKE_SOURCE_DIR}/src/platform/macos/av_img_t.h" + "${CMAKE_SOURCE_DIR}/src/platform/macos/av_video.h" + "${CMAKE_SOURCE_DIR}/src/platform/macos/av_video.m" + "${CMAKE_SOURCE_DIR}/src/platform/macos/display.mm" + "${CMAKE_SOURCE_DIR}/src/platform/macos/input.cpp" + "${CMAKE_SOURCE_DIR}/src/platform/macos/microphone.mm" + "${CMAKE_SOURCE_DIR}/src/platform/macos/misc.mm" + "${CMAKE_SOURCE_DIR}/src/platform/macos/misc.h" + "${CMAKE_SOURCE_DIR}/src/platform/macos/nv12_zero_device.cpp" + "${CMAKE_SOURCE_DIR}/src/platform/macos/nv12_zero_device.h" + "${CMAKE_SOURCE_DIR}/src/platform/macos/publish.cpp" + "${CMAKE_SOURCE_DIR}/third-party/TPCircularBuffer/TPCircularBuffer.c" + "${CMAKE_SOURCE_DIR}/third-party/TPCircularBuffer/TPCircularBuffer.h" ${APPLE_PLIST_FILE}) if(SUNSHINE_ENABLE_TRAY) list(APPEND SUNSHINE_EXTERNAL_LIBRARIES ${COCOA}) list(APPEND PLATFORM_TARGET_FILES - third-party/tray/tray_darwin.m) + "${CMAKE_SOURCE_DIR}/third-party/tray/src/tray_darwin.m") endif() diff --git a/cmake/compile_definitions/unix.cmake b/cmake/compile_definitions/unix.cmake index 5232481ccfb..68660cd1b94 100644 --- a/cmake/compile_definitions/unix.cmake +++ b/cmake/compile_definitions/unix.cmake @@ -1,7 +1,8 @@ # unix specific compile definitions # put anything here that applies to both linux and macos -list(APPEND SUNSHINE_EXTERNAL_LIBRARIES Boost::log) +list(APPEND SUNSHINE_EXTERNAL_LIBRARIES + ${CURL_LIBRARIES}) # add install prefix to assets path if not already there if(NOT SUNSHINE_ASSETS_DIR MATCHES "^${CMAKE_INSTALL_PREFIX}") diff --git a/cmake/compile_definitions/windows.cmake b/cmake/compile_definitions/windows.cmake index ec3e076f4de..7643d1d9efc 100644 --- a/cmake/compile_definitions/windows.cmake +++ b/cmake/compile_definitions/windows.cmake @@ -6,51 +6,57 @@ enable_language(RC) set(CMAKE_RC_COMPILER windres) set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static") +# gcc complains about misleading indentation in some mingw includes +list(APPEND SUNSHINE_COMPILE_OPTIONS -Wno-misleading-indentation) + +# see gcc bug 98723 +add_definitions(-DUSE_BOOST_REGEX) + # curl add_definitions(-DCURL_STATICLIB) include_directories(SYSTEM ${CURL_STATIC_INCLUDE_DIRS}) link_directories(${CURL_STATIC_LIBRARY_DIRS}) +# miniupnpc +add_definitions(-DMINIUPNP_STATICLIB) + # extra tools/binaries for audio/display devices add_subdirectory(tools) # todo - this is temporary, only tools for Windows are needed, for now # nvidia -include_directories(SYSTEM third-party/nvapi-open-source-sdk) +include_directories(SYSTEM "${CMAKE_SOURCE_DIR}/third-party/nvapi-open-source-sdk") file(GLOB NVPREFS_FILES CONFIGURE_DEPENDS - "third-party/nvapi-open-source-sdk/*.h" - "src/platform/windows/nvprefs/*.cpp" - "src/platform/windows/nvprefs/*.h") + "${CMAKE_SOURCE_DIR}/third-party/nvapi-open-source-sdk/*.h" + "${CMAKE_SOURCE_DIR}/src/platform/windows/nvprefs/*.cpp" + "${CMAKE_SOURCE_DIR}/src/platform/windows/nvprefs/*.h") # vigem -include_directories(SYSTEM third-party/ViGEmClient/include) -set_source_files_properties(third-party/ViGEmClient/src/ViGEmClient.cpp - PROPERTIES COMPILE_DEFINITIONS "UNICODE=1;ERROR_INVALID_DEVICE_OBJECT_PARAMETER=650") -set_source_files_properties(third-party/ViGEmClient/src/ViGEmClient.cpp - PROPERTIES COMPILE_FLAGS "-Wno-unknown-pragmas -Wno-misleading-indentation -Wno-class-memaccess") +include_directories(SYSTEM "${CMAKE_SOURCE_DIR}/third-party/ViGEmClient/include") # sunshine icon if(NOT DEFINED SUNSHINE_ICON_PATH) - set(SUNSHINE_ICON_PATH "${CMAKE_CURRENT_SOURCE_DIR}/sunshine.ico") + set(SUNSHINE_ICON_PATH "${CMAKE_SOURCE_DIR}/sunshine.ico") endif() -configure_file(src/platform/windows/windows.rs.in windows.rc @ONLY) +configure_file("${CMAKE_SOURCE_DIR}/src/platform/windows/windows.rs.in" windows.rc @ONLY) set(PLATFORM_TARGET_FILES "${CMAKE_CURRENT_BINARY_DIR}/windows.rc" - src/platform/windows/publish.cpp - src/platform/windows/misc.h - src/platform/windows/misc.cpp - src/platform/windows/input.cpp - src/platform/windows/display.h - src/platform/windows/display_base.cpp - src/platform/windows/display_vram.cpp - src/platform/windows/display_ram.cpp - src/platform/windows/audio.cpp - third-party/ViGEmClient/src/ViGEmClient.cpp - third-party/ViGEmClient/include/ViGEm/Client.h - third-party/ViGEmClient/include/ViGEm/Common.h - third-party/ViGEmClient/include/ViGEm/Util.h - third-party/ViGEmClient/include/ViGEm/km/BusShared.h + "${CMAKE_SOURCE_DIR}/src/platform/windows/publish.cpp" + "${CMAKE_SOURCE_DIR}/src/platform/windows/misc.h" + "${CMAKE_SOURCE_DIR}/src/platform/windows/misc.cpp" + "${CMAKE_SOURCE_DIR}/src/platform/windows/input.cpp" + "${CMAKE_SOURCE_DIR}/src/platform/windows/display.h" + "${CMAKE_SOURCE_DIR}/src/platform/windows/display_base.cpp" + "${CMAKE_SOURCE_DIR}/src/platform/windows/display_vram.cpp" + "${CMAKE_SOURCE_DIR}/src/platform/windows/display_ram.cpp" + "${CMAKE_SOURCE_DIR}/src/platform/windows/display_wgc.cpp" + "${CMAKE_SOURCE_DIR}/src/platform/windows/audio.cpp" + "${CMAKE_SOURCE_DIR}/third-party/ViGEmClient/src/ViGEmClient.cpp" + "${CMAKE_SOURCE_DIR}/third-party/ViGEmClient/include/ViGEm/Client.h" + "${CMAKE_SOURCE_DIR}/third-party/ViGEmClient/include/ViGEm/Common.h" + "${CMAKE_SOURCE_DIR}/third-party/ViGEmClient/include/ViGEm/Util.h" + "${CMAKE_SOURCE_DIR}/third-party/ViGEmClient/include/ViGEm/km/BusShared.h" ${NVPREFS_FILES}) set(OPENSSL_LIBRARIES @@ -61,6 +67,7 @@ list(PREPEND PLATFORM_LIBRARIES libstdc++.a libwinpthread.a libssp.a + ntdll ksuser wsock32 ws2_32 @@ -70,9 +77,12 @@ list(PREPEND PLATFORM_LIBRARIES userenv synchronization.lib avrt + iphlpapi + shlwapi + PkgConfig::NLOHMANN_JSON ${CURL_STATIC_LIBRARIES}) if(SUNSHINE_ENABLE_TRAY) list(APPEND PLATFORM_TARGET_FILES - third-party/tray/tray_windows.c) + "${CMAKE_SOURCE_DIR}/third-party/tray/src/tray_windows.c") endif() diff --git a/cmake/dependencies/Boost_Sunshine.cmake b/cmake/dependencies/Boost_Sunshine.cmake new file mode 100644 index 00000000000..6615a389e5c --- /dev/null +++ b/cmake/dependencies/Boost_Sunshine.cmake @@ -0,0 +1,89 @@ +# +# Loads the boost library giving the priority to the system package first, with a fallback to FetchContent. +# +include_guard(GLOBAL) + +set(BOOST_VERSION 1.85) +set(BOOST_COMPONENTS + filesystem + locale + log + program_options + system) # system is not used by Sunshine, but by Simple-Web-Server, added here for convenience + +if(BOOST_USE_STATIC) + set(Boost_USE_STATIC_LIBS ON) # cmake-lint: disable=C0103 +endif() + +find_package(Boost ${BOOST_VERSION} COMPONENTS ${BOOST_COMPONENTS}) +if(NOT Boost_FOUND) + message(STATUS "Boost v${BOOST_VERSION}.x package not found in the system. Falling back to FetchContent.") + include(FetchContent) + + # Avoid warning about DOWNLOAD_EXTRACT_TIMESTAMP in CMake 3.24: + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.24.0") + cmake_policy(SET CMP0135 NEW) + endif() + + # more components required for compiling boost targets + list(APPEND BOOST_COMPONENTS + asio + crc + format + process + property_tree) + + set(BOOST_ENABLE_CMAKE ON) + + # Limit boost to the required libraries only + set(BOOST_INCLUDE_LIBRARIES + ${BOOST_COMPONENTS}) + set(BOOST_URL + "https://github.com/boostorg/boost/releases/download/boost-1.85.0/boost-1.85.0-cmake.tar.xz") + set(BOOST_HASH + "MD5=BADEA970931766604D4D5F8F4090B176") + + if(CMAKE_VERSION VERSION_LESS "3.24.0") + FetchContent_Declare( + Boost + URL ${BOOST_URL} + URL_HASH ${BOOST_HASH} + ) + elseif(APPLE AND CMAKE_VERSION VERSION_GREATER_EQUAL "3.25.0") + # add SYSTEM to FetchContent_Declare, this fails on debian bookworm + FetchContent_Declare( + Boost + URL ${BOOST_URL} + URL_HASH ${BOOST_HASH} + SYSTEM # requires CMake 3.25+ + OVERRIDE_FIND_PACKAGE # requires CMake 3.24+, but we have a macro to handle it for other versions + ) + elseif(CMAKE_VERSION VERSION_GREATER_EQUAL "3.24.0") + FetchContent_Declare( + Boost + URL ${BOOST_URL} + URL_HASH ${BOOST_HASH} + OVERRIDE_FIND_PACKAGE # requires CMake 3.24+, but we have a macro to handle it for other versions + ) + endif() + + FetchContent_MakeAvailable(Boost) + set(FETCH_CONTENT_BOOST_USED TRUE) + + set(Boost_FOUND TRUE) # cmake-lint: disable=C0103 + set(Boost_INCLUDE_DIRS # cmake-lint: disable=C0103 + "$;$") + + if(WIN32) + # Windows build is failing to create .h file in this directory + file(MAKE_DIRECTORY ${Boost_BINARY_DIR}/libs/log/src/windows) + endif() + + set(Boost_LIBRARIES "") # cmake-lint: disable=C0103 + foreach(component ${BOOST_COMPONENTS}) + list(APPEND Boost_LIBRARIES "Boost::${component}") + endforeach() +endif() + +message(STATUS "Boost include dirs: ${Boost_INCLUDE_DIRS}") +message(STATUS "Boost libraries: ${Boost_LIBRARIES}") diff --git a/cmake/dependencies/common.cmake b/cmake/dependencies/common.cmake index 9bc7c56ceee..01065b387e0 100644 --- a/cmake/dependencies/common.cmake +++ b/cmake/dependencies/common.cmake @@ -1,86 +1,81 @@ # load common dependencies # this file will also load platform specific dependencies +# boost, this should be before Simple-Web-Server as it also depends on boost +include(dependencies/Boost_Sunshine) + # submodules # moonlight common library -set(ENET_NO_INSTALL ON CACHE BOOL "Don't install any libraries build for enet") -add_subdirectory(third-party/moonlight-common-c/enet) +set(ENET_NO_INSTALL ON CACHE BOOL "Don't install any libraries built for enet") +add_subdirectory("${CMAKE_SOURCE_DIR}/third-party/moonlight-common-c/enet") # web server -add_subdirectory(third-party/Simple-Web-Server) +add_subdirectory("${CMAKE_SOURCE_DIR}/third-party/Simple-Web-Server") + +# common dependencies +find_package(OpenSSL REQUIRED) +find_package(PkgConfig REQUIRED) +find_package(Threads REQUIRED) +pkg_check_modules(CURL REQUIRED libcurl) # miniupnp -set(UPNPC_BUILD_SHARED OFF CACHE BOOL "No shared libraries") -set(UPNPC_BUILD_TESTS OFF CACHE BOOL "Don't build tests for miniupnpc") -set(UPNPC_BUILD_SAMPLE OFF CACHE BOOL "Don't build samples for miniupnpc") -set(UPNPC_NO_INSTALL ON CACHE BOOL "Don't install any libraries build for miniupnpc") -add_subdirectory(third-party/miniupnp/miniupnpc) -include_directories(SYSTEM third-party/miniupnp/miniupnpc/include) +pkg_check_modules(MINIUPNP miniupnpc REQUIRED) +include_directories(SYSTEM ${MINIUPNP_INCLUDE_DIRS}) # ffmpeg pre-compiled binaries -if(WIN32) - if(NOT CMAKE_SYSTEM_PROCESSOR STREQUAL "AMD64") - message(FATAL_ERROR "Unsupported system processor:" ${CMAKE_SYSTEM_PROCESSOR}) +if(NOT DEFINED FFMPEG_PREPARED_BINARIES) + if(WIN32) + set(FFMPEG_PLATFORM_LIBRARIES mfplat ole32 strmiids mfuuid vpl) + elseif(UNIX AND NOT APPLE) + set(FFMPEG_PLATFORM_LIBRARIES numa va va-drm va-x11 vdpau X11) endif() - set(FFMPEG_PLATFORM_LIBRARIES mfplat ole32 strmiids mfuuid vpl) - set(FFMPEG_PREPARED_BINARIES "${CMAKE_CURRENT_SOURCE_DIR}/third-party/ffmpeg-windows-x86_64") -elseif(APPLE) - if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") - set(FFMPEG_PREPARED_BINARIES "${CMAKE_CURRENT_SOURCE_DIR}/third-party/ffmpeg-macos-x86_64") - elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64") - set(FFMPEG_PREPARED_BINARIES "${CMAKE_CURRENT_SOURCE_DIR}/third-party/ffmpeg-macos-aarch64") - elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "powerpc") - message(FATAL_ERROR "PowerPC is not supported on macOS") - else() - message(FATAL_ERROR "Unsupported system processor:" ${CMAKE_SYSTEM_PROCESSOR}) + set(FFMPEG_PREPARED_BINARIES + "${CMAKE_SOURCE_DIR}/third-party/build-deps/ffmpeg/${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}") + + # check if the directory exists + if(NOT EXISTS "${FFMPEG_PREPARED_BINARIES}") + message(FATAL_ERROR + "FFmpeg pre-compiled binaries not found at ${FFMPEG_PREPARED_BINARIES}. \ + Please consider contributing to the LizardByte/build-deps repository. \ + Optionally, you can use the FFMPEG_PREPARED_BINARIES option to specify the path to the \ + system-installed FFmpeg libraries") endif() -elseif(UNIX) - set(FFMPEG_PLATFORM_LIBRARIES va va-drm va-x11 vdpau X11) - if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") - list(APPEND FFMPEG_PLATFORM_LIBRARIES mfx) - set(FFMPEG_PREPARED_BINARIES "${CMAKE_CURRENT_SOURCE_DIR}/third-party/ffmpeg-linux-x86_64") - set(CPACK_DEB_PLATFORM_PACKAGE_DEPENDS "libmfx1,") - set(CPACK_RPM_PLATFORM_PACKAGE_REQUIRES "intel-mediasdk >= 22.3.0,") - elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64") - set(FFMPEG_PREPARED_BINARIES "${CMAKE_CURRENT_SOURCE_DIR}/third-party/ffmpeg-linux-aarch64") - elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "ppc64le" OR CMAKE_SYSTEM_PROCESSOR STREQUAL "ppc64") - set(FFMPEG_PREPARED_BINARIES "${CMAKE_CURRENT_SOURCE_DIR}/third-party/ffmpeg-linux-powerpc64le") - else() - message(FATAL_ERROR "Unsupported system processor:" ${CMAKE_SYSTEM_PROCESSOR}) + + if(EXISTS "${FFMPEG_PREPARED_BINARIES}/lib/libhdr10plus.a") + set(HDR10_PLUS_LIBRARY + "${FFMPEG_PREPARED_BINARIES}/lib/libhdr10plus.a") endif() -endif() -set(FFMPEG_INCLUDE_DIRS - ${FFMPEG_PREPARED_BINARIES}/include) -if(EXISTS ${FFMPEG_PREPARED_BINARIES}/lib/libhdr10plus.a) - set(HDR10_PLUS_LIBRARY - ${FFMPEG_PREPARED_BINARIES}/lib/libhdr10plus.a) -endif() -set(FFMPEG_LIBRARIES - ${FFMPEG_PREPARED_BINARIES}/lib/libavcodec.a - ${FFMPEG_PREPARED_BINARIES}/lib/libavutil.a - ${FFMPEG_PREPARED_BINARIES}/lib/libcbs.a - ${FFMPEG_PREPARED_BINARIES}/lib/libSvtAv1Enc.a - ${FFMPEG_PREPARED_BINARIES}/lib/libswscale.a - ${FFMPEG_PREPARED_BINARIES}/lib/libx264.a - ${FFMPEG_PREPARED_BINARIES}/lib/libx265.a - ${HDR10_PLUS_LIBRARY} + set(FFMPEG_LIBRARIES + "${FFMPEG_PREPARED_BINARIES}/lib/libavcodec.a" + "${FFMPEG_PREPARED_BINARIES}/lib/libavutil.a" + "${FFMPEG_PREPARED_BINARIES}/lib/libcbs.a" + "${FFMPEG_PREPARED_BINARIES}/lib/libSvtAv1Enc.a" + "${FFMPEG_PREPARED_BINARIES}/lib/libswscale.a" + "${FFMPEG_PREPARED_BINARIES}/lib/libx264.a" + "${FFMPEG_PREPARED_BINARIES}/lib/libx265.a" + ${HDR10_PLUS_LIBRARY} + ${FFMPEG_PLATFORM_LIBRARIES}) +else() + set(FFMPEG_LIBRARIES + "${FFMPEG_PREPARED_BINARIES}/lib/libavcodec.a" + "${FFMPEG_PREPARED_BINARIES}/lib/libavutil.a" + "${FFMPEG_PREPARED_BINARIES}/lib/libcbs.a" + "${FFMPEG_PREPARED_BINARIES}/lib/libswscale.a" ${FFMPEG_PLATFORM_LIBRARIES}) +endif() -# common dependencies -find_package(OpenSSL REQUIRED) -find_package(PkgConfig REQUIRED) -find_package(Threads REQUIRED) -pkg_check_modules(CURL REQUIRED libcurl) +set(FFMPEG_INCLUDE_DIRS + "${FFMPEG_PREPARED_BINARIES}/include") # platform specific dependencies if(WIN32) - include(${CMAKE_MODULE_PATH}/dependencies/windows.cmake) + include("${CMAKE_MODULE_PATH}/dependencies/windows.cmake") elseif(UNIX) - include(${CMAKE_MODULE_PATH}/dependencies/unix.cmake) + include("${CMAKE_MODULE_PATH}/dependencies/unix.cmake") if(APPLE) - include(${CMAKE_MODULE_PATH}/dependencies/macos.cmake) + include("${CMAKE_MODULE_PATH}/dependencies/macos.cmake") else() - include(${CMAKE_MODULE_PATH}/dependencies/linux.cmake) + include("${CMAKE_MODULE_PATH}/dependencies/linux.cmake") endif() endif() diff --git a/cmake/dependencies/libevdev_Sunshine.cmake b/cmake/dependencies/libevdev_Sunshine.cmake new file mode 100644 index 00000000000..ca9e22dce35 --- /dev/null +++ b/cmake/dependencies/libevdev_Sunshine.cmake @@ -0,0 +1,47 @@ +# +# Loads the libevdev library giving the priority to the system package first, with a fallback to ExternalProject +# +include_guard(GLOBAL) + +set(LIBEVDEV_VERSION libevdev-1.13.2) + +pkg_check_modules(PC_EVDEV libevdev) +if(PC_EVDEV_FOUND) + find_path(EVDEV_INCLUDE_DIR libevdev/libevdev.h + HINTS ${PC_EVDEV_INCLUDE_DIRS} ${PC_EVDEV_INCLUDEDIR}) + find_library(EVDEV_LIBRARY + NAMES evdev libevdev) +else() + include(ExternalProject) + + ExternalProject_Add(libevdev + URL http://www.freedesktop.org/software/libevdev/${LIBEVDEV_VERSION}.tar.xz + PREFIX ${LIBEVDEV_VERSION} + CONFIGURE_COMMAND /configure --prefix= + BUILD_COMMAND "make" + INSTALL_COMMAND "" + ) + + ExternalProject_Get_Property(libevdev SOURCE_DIR) + message(STATUS "libevdev source dir: ${SOURCE_DIR}") + set(EVDEV_INCLUDE_DIR "${SOURCE_DIR}") + + ExternalProject_Get_Property(libevdev BINARY_DIR) + message(STATUS "libevdev binary dir: ${BINARY_DIR}") + set(EVDEV_LIBRARY "${BINARY_DIR}/libevdev/.libs/libevdev.a") + + # compile libevdev before sunshine + set(SUNSHINE_TARGET_DEPENDENCIES ${SUNSHINE_TARGET_DEPENDENCIES} libevdev) + + set(EXTERNAL_PROJECT_LIBEVDEV_USED TRUE) +endif() + +if(EVDEV_INCLUDE_DIR AND EVDEV_LIBRARY) + message(STATUS "Found libevdev library: ${EVDEV_LIBRARY}") + message(STATUS "Found libevdev include directory: ${EVDEV_INCLUDE_DIR}") + + include_directories(SYSTEM ${EVDEV_INCLUDE_DIR}) + list(APPEND PLATFORM_LIBRARIES ${EVDEV_LIBRARY}) +else() + message(FATAL_ERROR "Couldn't find or fetch libevdev") +endif() diff --git a/cmake/dependencies/macos.cmake b/cmake/dependencies/macos.cmake index 7d8e211e242..61efc6a902b 100644 --- a/cmake/dependencies/macos.cmake +++ b/cmake/dependencies/macos.cmake @@ -1,5 +1,6 @@ # macos specific dependencies +FIND_LIBRARY(APP_KIT_LIBRARY AppKit) FIND_LIBRARY(APP_SERVICES_LIBRARY ApplicationServices) FIND_LIBRARY(AV_FOUNDATION_LIBRARY AVFoundation) FIND_LIBRARY(CORE_MEDIA_LIBRARY CoreMedia) diff --git a/cmake/dependencies/unix.cmake b/cmake/dependencies/unix.cmake index 5b13bf60403..1f5ffd3adc8 100644 --- a/cmake/dependencies/unix.cmake +++ b/cmake/dependencies/unix.cmake @@ -1,4 +1,2 @@ # unix specific dependencies # put anything here that applies to both linux and macos - -find_package(Boost COMPONENTS locale log filesystem program_options REQUIRED) diff --git a/cmake/dependencies/windows.cmake b/cmake/dependencies/windows.cmake index 3ce9a9da234..0563e567817 100644 --- a/cmake/dependencies/windows.cmake +++ b/cmake/dependencies/windows.cmake @@ -1,6 +1,4 @@ # windows specific dependencies -set(Boost_USE_STATIC_LIBS ON) # cmake-lint: disable=C0103 -# Boost >= 1.82.0 is required for boost::json::value::set_at_pointer() support -# todo - are we actually using json? I think this was attempted to be used in a PR, but we ended up not using json -find_package(Boost 1.82.0 COMPONENTS locale log filesystem program_options json REQUIRED) +# nlohmann_json +pkg_check_modules(NLOHMANN_JSON nlohmann_json REQUIRED IMPORTED_TARGET) diff --git a/cmake/macros/common.cmake b/cmake/macros/common.cmake index 24592355fbb..53a3c694afe 100644 --- a/cmake/macros/common.cmake +++ b/cmake/macros/common.cmake @@ -13,3 +13,17 @@ elseif(UNIX) include(${CMAKE_MODULE_PATH}/macros/linux.cmake) endif() endif() + +# override find_package function +macro(find_package) # cmake-lint: disable=C0103 + string(TOLOWER "${ARGV0}" ARGV0_LOWER) + if( + (("${ARGV0_LOWER}" STREQUAL "boost") AND DEFINED FETCH_CONTENT_BOOST_USED) OR + (("${ARGV0_LOWER}" STREQUAL "libevdev") AND DEFINED EXTERNAL_PROJECT_LIBEVDEV_USED) + ) + # Do nothing, as the package has already been fetched + else() + # Call the original find_package function + _find_package(${ARGV}) + endif() +endmacro() diff --git a/cmake/macros/linux.cmake b/cmake/macros/linux.cmake index d84d0452568..0bb5e043bf2 100644 --- a/cmake/macros/linux.cmake +++ b/cmake/macros/linux.cmake @@ -5,17 +5,17 @@ macro(GEN_WAYLAND wayland_directory subdirectory filename) file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/generated-src) message("wayland-scanner private-code \ -${CMAKE_SOURCE_DIR}/third-party/${wayland_directory}/${subdirectory}/${filename}.xml \ +${wayland_directory}/${subdirectory}/${filename}.xml \ ${CMAKE_BINARY_DIR}/generated-src/${filename}.c") message("wayland-scanner client-header \ -${CMAKE_SOURCE_DIR}/third-party/${wayland_directory}/${subdirectory}/${filename}.xml \ +${wayland_directory}/${subdirectory}/${filename}.xml \ ${CMAKE_BINARY_DIR}/generated-src/${filename}.h") execute_process( COMMAND wayland-scanner private-code - ${CMAKE_SOURCE_DIR}/third-party/${wayland_directory}/${subdirectory}/${filename}.xml + ${wayland_directory}/${subdirectory}/${filename}.xml ${CMAKE_BINARY_DIR}/generated-src/${filename}.c COMMAND wayland-scanner client-header - ${CMAKE_SOURCE_DIR}/third-party/${wayland_directory}/${subdirectory}/${filename}.xml + ${wayland_directory}/${subdirectory}/${filename}.xml ${CMAKE_BINARY_DIR}/generated-src/${filename}.h RESULT_VARIABLE EXIT_INT diff --git a/cmake/packaging/common.cmake b/cmake/packaging/common.cmake index 0b41524f6cb..c7c5b3a5cc9 100644 --- a/cmake/packaging/common.cmake +++ b/cmake/packaging/common.cmake @@ -12,9 +12,22 @@ set(CPACK_PACKAGE_ICON ${PROJECT_SOURCE_DIR}/sunshine.png) set(CPACK_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}") set(CPACK_STRIP_FILES YES) -# install npm modules -install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/node_modules" - DESTINATION "${SUNSHINE_ASSETS_DIR}/web") +# install common assets +install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/common/assets/" + DESTINATION "${SUNSHINE_ASSETS_DIR}" + PATTERN "web" EXCLUDE) +# copy assets to build directory, for running without install +file(GLOB_RECURSE ALL_ASSETS + RELATIVE "${SUNSHINE_SOURCE_ASSETS_DIR}/common/assets/" "${SUNSHINE_SOURCE_ASSETS_DIR}/common/assets/*") +list(FILTER ALL_ASSETS EXCLUDE REGEX "^web/.*$") # Filter out the web directory +foreach(asset ${ALL_ASSETS}) # Copy assets to build directory, excluding the web directory + file(COPY "${SUNSHINE_SOURCE_ASSETS_DIR}/common/assets/${asset}" + DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/assets") +endforeach() + +# install built vite assets +install(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/assets/web" + DESTINATION "${SUNSHINE_ASSETS_DIR}") # platform specific packaging if(WIN32) diff --git a/cmake/packaging/linux.cmake b/cmake/packaging/linux.cmake index aee40cb7f1b..5fa6d2dfb7c 100644 --- a/cmake/packaging/linux.cmake +++ b/cmake/packaging/linux.cmake @@ -2,16 +2,22 @@ install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/linux/assets/" DESTINATION "${SUNSHINE_ASSETS_DIR}") +# copy assets to build directory, for running without install +file(COPY "${SUNSHINE_SOURCE_ASSETS_DIR}/linux/assets/" + DESTINATION "${CMAKE_BINARY_DIR}/assets") if(${SUNSHINE_BUILD_APPIMAGE} OR ${SUNSHINE_BUILD_FLATPAK}) - install(FILES "${SUNSHINE_SOURCE_ASSETS_DIR}/linux/misc/85-sunshine.rules" + install(FILES "${SUNSHINE_SOURCE_ASSETS_DIR}/linux/misc/60-sunshine.rules" DESTINATION "${SUNSHINE_ASSETS_DIR}/udev/rules.d") install(FILES "${CMAKE_CURRENT_BINARY_DIR}/sunshine.service" DESTINATION "${SUNSHINE_ASSETS_DIR}/systemd/user") else() - install(FILES "${SUNSHINE_SOURCE_ASSETS_DIR}/linux/misc/85-sunshine.rules" - DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/udev/rules.d") + find_package(Systemd) + find_package(Udev) + + install(FILES "${SUNSHINE_SOURCE_ASSETS_DIR}/linux/misc/60-sunshine.rules" + DESTINATION "${UDEV_RULES_INSTALL_DIR}") install(FILES "${CMAKE_CURRENT_BINARY_DIR}/sunshine.service" - DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/systemd/user") + DESTINATION "${SYSTEMD_USER_UNIT_INSTALL_DIR}") endif() # Post install @@ -22,10 +28,6 @@ set(CPACK_RPM_POST_INSTALL_SCRIPT_FILE "${SUNSHINE_SOURCE_ASSETS_DIR}/linux/misc set(CPACK_DEB_COMPONENT_INSTALL ON) set(CPACK_DEBIAN_PACKAGE_DEPENDS "\ ${CPACK_DEB_PLATFORM_PACKAGE_DEPENDS} \ - libboost-filesystem${Boost_VERSION}, \ - libboost-locale${Boost_VERSION}, \ - libboost-log${Boost_VERSION}, \ - libboost-program-options${Boost_VERSION}, \ libcap2, \ libcurl4, \ libdrm2, \ @@ -38,13 +40,10 @@ set(CPACK_DEBIAN_PACKAGE_DEPENDS "\ libvdpau1, \ libwayland-client0, \ libx11-6, \ + miniupnpc, \ openssl | libssl3") set(CPACK_RPM_PACKAGE_REQUIRES "\ ${CPACK_RPM_PLATFORM_PACKAGE_REQUIRES} \ - boost-filesystem >= ${Boost_VERSION}, \ - boost-locale >= ${Boost_VERSION}, \ - boost-log >= ${Boost_VERSION}, \ - boost-program-options >= ${Boost_VERSION}, \ libcap >= 2.22, \ libcurl >= 7.0, \ libdrm >= 2.4.97, \ @@ -54,28 +53,50 @@ set(CPACK_RPM_PACKAGE_REQUIRES "\ libvdpau >= 1.5, \ libwayland-client >= 1.20.0, \ libX11 >= 1.7.3.1, \ + miniupnpc >= 2.2.4, \ numactl-libs >= 2.0.14, \ openssl >= 3.0.2, \ pulseaudio-libs >= 10.0") +if(NOT BOOST_USE_STATIC) + set(CPACK_DEBIAN_PACKAGE_DEPENDS "\ + ${CPACK_DEBIAN_PACKAGE_DEPENDS}, \ + libboost-filesystem${Boost_VERSION}, \ + libboost-locale${Boost_VERSION}, \ + libboost-log${Boost_VERSION}, \ + libboost-program-options${Boost_VERSION}") + set(CPACK_RPM_PACKAGE_REQUIRES "\ + ${CPACK_RPM_PACKAGE_REQUIRES}, \ + boost-filesystem >= ${Boost_VERSION}, \ + boost-locale >= ${Boost_VERSION}, \ + boost-log >= ${Boost_VERSION}, \ + boost-program-options >= ${Boost_VERSION}") +endif() + # This should automatically figure out dependencies, doesn't work with the current config set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS OFF) # application icon -install(FILES "${CMAKE_SOURCE_DIR}/sunshine.svg" - DESTINATION "${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/scalable/apps") +if(NOT ${SUNSHINE_BUILD_FLATPAK}) + install(FILES "${CMAKE_SOURCE_DIR}/sunshine.svg" + DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/scalable/apps") +else() + install(FILES "${CMAKE_SOURCE_DIR}/sunshine.svg" + DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/scalable/apps" + RENAME "${PROJECT_FQDN}.svg") +endif() # tray icon if(${SUNSHINE_TRAY} STREQUAL 1) install(FILES "${CMAKE_SOURCE_DIR}/sunshine.svg" - DESTINATION "${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/scalable/status" + DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/scalable/status" RENAME "sunshine-tray.svg") - install(FILES "${SUNSHINE_SOURCE_ASSETS_DIR}/common/assets/web/images/sunshine-playing.svg" - DESTINATION "${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/scalable/status") - install(FILES "${SUNSHINE_SOURCE_ASSETS_DIR}/common/assets/web/images/sunshine-pausing.svg" - DESTINATION "${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/scalable/status") - install(FILES "${SUNSHINE_SOURCE_ASSETS_DIR}/common/assets/web/images/sunshine-locked.svg" - DESTINATION "${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/scalable/status") + install(FILES "${SUNSHINE_SOURCE_ASSETS_DIR}/common/assets/web/public/images/sunshine-playing.svg" + DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/scalable/status") + install(FILES "${SUNSHINE_SOURCE_ASSETS_DIR}/common/assets/web/public/images/sunshine-pausing.svg" + DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/scalable/status") + install(FILES "${SUNSHINE_SOURCE_ASSETS_DIR}/common/assets/web/public/images/sunshine-locked.svg" + DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/scalable/status") set(CPACK_DEBIAN_PACKAGE_DEPENDS "\ ${CPACK_DEBIAN_PACKAGE_DEPENDS}, \ @@ -88,13 +109,32 @@ endif() # desktop file # todo - validate desktop files with `desktop-file-validate` -install(FILES "${CMAKE_CURRENT_BINARY_DIR}/sunshine.desktop" DESTINATION "${CMAKE_INSTALL_PREFIX}/share/applications") -if(${SUNSHINE_BUILD_FLATPAK}) +if(NOT ${SUNSHINE_BUILD_FLATPAK}) + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/sunshine.desktop" + DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/applications") +else() + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/sunshine.desktop" + DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/applications" + RENAME "${PROJECT_FQDN}.desktop") install(FILES "${CMAKE_CURRENT_BINARY_DIR}/sunshine_kms.desktop" - DESTINATION "${CMAKE_INSTALL_PREFIX}/share/applications") + DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/applications" + RENAME "${PROJECT_FQDN}_kms.desktop") +endif() +if(${SUNSHINE_BUILD_FLATPAK}) + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/sunshine_terminal.desktop" + DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/applications" + RENAME "${PROJECT_FQDN}_terminal.desktop") +elseif(NOT ${SUNSHINE_BUILD_APPIMAGE}) + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/sunshine_terminal.desktop" + DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/applications") endif() # metadata file # todo - validate file with `appstream-util validate-relax` -install(FILES "${CMAKE_CURRENT_BINARY_DIR}/sunshine.appdata.xml" - DESTINATION "${CMAKE_INSTALL_PREFIX}/share/metainfo") +if(NOT ${SUNSHINE_BUILD_FLATPAK}) + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/sunshine.appdata.xml" + DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/metainfo") +else() + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_FQDN}.metainfo.xml" + DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/metainfo") +endif() diff --git a/cmake/packaging/macos.cmake b/cmake/packaging/macos.cmake index 2b173393bbf..a16fdb66a26 100644 --- a/cmake/packaging/macos.cmake +++ b/cmake/packaging/macos.cmake @@ -10,17 +10,16 @@ if(SUNSHINE_PACKAGE_MACOS) # todo set(MAC_PREFIX "${CMAKE_PROJECT_NAME}.app/Contents") set(INSTALL_RUNTIME_DIR "${MAC_PREFIX}/MacOS") - install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/common/assets/" - DESTINATION "${SUNSHINE_ASSETS_DIR}") - install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/macos/assets/" - DESTINATION "${SUNSHINE_ASSETS_DIR}") - install(TARGETS sunshine BUNDLE DESTINATION . COMPONENT Runtime RUNTIME DESTINATION ${INSTALL_RUNTIME_DIR} COMPONENT Runtime) else() - install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/macos/assets/" - DESTINATION "${SUNSHINE_ASSETS_DIR}") install(FILES "${SUNSHINE_SOURCE_ASSETS_DIR}/macos/misc/uninstall_pkg.sh" DESTINATION "${SUNSHINE_ASSETS_DIR}") endif() + +install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/macos/assets/" + DESTINATION "${SUNSHINE_ASSETS_DIR}") +# copy assets to build directory, for running without install +file(COPY "${SUNSHINE_SOURCE_ASSETS_DIR}/macos/assets/" + DESTINATION "${CMAKE_BINARY_DIR}/assets") diff --git a/cmake/packaging/unix.cmake b/cmake/packaging/unix.cmake index 660811f3b33..bacbfc910de 100644 --- a/cmake/packaging/unix.cmake +++ b/cmake/packaging/unix.cmake @@ -13,6 +13,3 @@ if(NOT CMAKE_INSTALL_PREFIX) endif() install(TARGETS sunshine RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") - -install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/common/assets/" - DESTINATION "${SUNSHINE_ASSETS_DIR}") diff --git a/cmake/packaging/windows.cmake b/cmake/packaging/windows.cmake index 0d4f1dd9cce..bbd497ee3a0 100644 --- a/cmake/packaging/windows.cmake +++ b/cmake/packaging/windows.cmake @@ -36,15 +36,15 @@ install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/windows/misc/gamepad/" COMPONENT gamepad) # Sunshine assets -install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/common/assets/" - DESTINATION "${SUNSHINE_ASSETS_DIR}" - COMPONENT assets) install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/windows/assets/" DESTINATION "${SUNSHINE_ASSETS_DIR}" COMPONENT assets) +# copy assets to build directory, for running without install +file(COPY "${SUNSHINE_SOURCE_ASSETS_DIR}/windows/assets/" + DESTINATION "${CMAKE_BINARY_DIR}/assets") # set(CPACK_NSIS_MUI_HEADERIMAGE "") # TODO: image should be 150x57 bmp -set(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}\\\\sunshine.ico") +set(CPACK_PACKAGE_ICON "${CMAKE_SOURCE_DIR}\\\\sunshine.ico") set(CPACK_NSIS_INSTALLED_ICON_NAME "${PROJECT__DIR}\\\\${PROJECT_EXE}") # The name of the directory that will be created in C:/Program files/ set(CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_NAME}") @@ -60,8 +60,8 @@ SET(CPACK_NSIS_EXTRA_INSTALL_COMMANDS nsExec::ExecToLog 'icacls \\\"$INSTDIR\\\" /reset' nsExec::ExecToLog '\\\"$INSTDIR\\\\scripts\\\\migrate-config.bat\\\"' nsExec::ExecToLog '\\\"$INSTDIR\\\\scripts\\\\add-firewall-rule.bat\\\"' - nsExec::ExecToLog '\\\"$INSTDIR\\\\scripts\\\\install-service.bat\\\"' nsExec::ExecToLog '\\\"$INSTDIR\\\\scripts\\\\install-gamepad.bat\\\"' + nsExec::ExecToLog '\\\"$INSTDIR\\\\scripts\\\\install-service.bat\\\"' nsExec::ExecToLog '\\\"$INSTDIR\\\\scripts\\\\autostart-service.bat\\\"' NoController: ") @@ -103,7 +103,7 @@ set(CPACK_NSIS_DELETE_ICONS_EXTRA # Checking for previous installed versions set(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL "ON") -set(CPACK_NSIS_HELP_LINK "https://sunshinestream.readthedocs.io/about/installation.html") +set(CPACK_NSIS_HELP_LINK "https://sunshinestream.readthedocs.io/en/latest/about/installation.html") set(CPACK_NSIS_URL_INFO_ABOUT "${CMAKE_PROJECT_HOMEPAGE_URL}") set(CPACK_NSIS_CONTACT "${CMAKE_PROJECT_HOMEPAGE_URL}/support") diff --git a/cmake/prep/build_version.cmake b/cmake/prep/build_version.cmake index 49f85f9b585..56a4eddafcf 100644 --- a/cmake/prep/build_version.cmake +++ b/cmake/prep/build_version.cmake @@ -5,7 +5,7 @@ if((DEFINED ENV{BRANCH}) AND (DEFINED ENV{BUILD_VERSION}) AND (DEFINED ENV{COMMI MESSAGE("Got from CI master branch and version $ENV{BUILD_VERSION}") set(PROJECT_VERSION $ENV{BUILD_VERSION}) elseif((DEFINED ENV{BRANCH}) AND (DEFINED ENV{COMMIT})) - # If BRANCH is set but not BUILD_VERSION we are building nightly, we gather only the commit hash + # If BRANCH is set but not BUILD_VERSION we are building a PR, we gather only the commit hash MESSAGE("Got from CI $ENV{BRANCH} branch and commit $ENV{COMMIT}") set(PROJECT_VERSION ${PROJECT_VERSION}.$ENV{COMMIT}) endif() @@ -14,12 +14,11 @@ if((DEFINED ENV{BRANCH}) AND (DEFINED ENV{BUILD_VERSION}) AND (DEFINED ENV{COMMI else() find_package(Git) if(GIT_EXECUTABLE) - MESSAGE("${CMAKE_CURRENT_SOURCE_DIR}") - get_filename_component(SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR} DIRECTORY) + MESSAGE("${CMAKE_SOURCE_DIR}") + get_filename_component(SRC_DIR "${CMAKE_SOURCE_DIR}" DIRECTORY) #Get current Branch execute_process( COMMAND ${GIT_EXECUTABLE} rev-parse --abbrev-ref HEAD - #WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} OUTPUT_VARIABLE GIT_DESCRIBE_BRANCH RESULT_VARIABLE GIT_DESCRIBE_ERROR_CODE OUTPUT_STRIP_TRAILING_WHITESPACE @@ -27,7 +26,6 @@ else() # Gather current commit execute_process( COMMAND ${GIT_EXECUTABLE} rev-parse --short HEAD - #WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} OUTPUT_VARIABLE GIT_DESCRIBE_VERSION RESULT_VARIABLE GIT_DESCRIBE_ERROR_CODE OUTPUT_STRIP_TRAILING_WHITESPACE @@ -35,7 +33,6 @@ else() # Check if Dirty execute_process( COMMAND ${GIT_EXECUTABLE} diff --quiet --exit-code - #WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} RESULT_VARIABLE GIT_IS_DIRTY OUTPUT_STRIP_TRAILING_WHITESPACE ) diff --git a/cmake/prep/constants.cmake b/cmake/prep/constants.cmake index 4f7a9e48aeb..b80be1e3480 100644 --- a/cmake/prep/constants.cmake +++ b/cmake/prep/constants.cmake @@ -1,5 +1,5 @@ # source assets will be installed from this directory -set(SUNSHINE_SOURCE_ASSETS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src_assets") +set(SUNSHINE_SOURCE_ASSETS_DIR "${CMAKE_SOURCE_DIR}/src_assets") # enable system tray, we will disable this later if we cannot find the required package config on linux set(SUNSHINE_TRAY 1) diff --git a/cmake/prep/init.cmake b/cmake/prep/init.cmake new file mode 100644 index 00000000000..ae15d9f2673 --- /dev/null +++ b/cmake/prep/init.cmake @@ -0,0 +1,17 @@ +if (WIN32) +elseif (APPLE) +elseif (UNIX) + include(GNUInstallDirs) + + if(NOT DEFINED SUNSHINE_EXECUTABLE_PATH) + set(SUNSHINE_EXECUTABLE_PATH "sunshine") + endif() + + if(SUNSHINE_BUILD_FLATPAK) + set(SUNSHINE_SERVICE_START_COMMAND "ExecStart=${PROJECT_FQDN}") + set(SUNSHINE_SERVICE_STOP_COMMAND "ExecStop=flatpak kill ${PROJECT_FQDN}") + else() + set(SUNSHINE_SERVICE_START_COMMAND "ExecStart=${SUNSHINE_EXECUTABLE_PATH}") + set(SUNSHINE_SERVICE_STOP_COMMAND "") + endif() +endif () diff --git a/cmake/prep/options.cmake b/cmake/prep/options.cmake index 1a216d263c8..f358f7273fe 100644 --- a/cmake/prep/options.cmake +++ b/cmake/prep/options.cmake @@ -1,9 +1,38 @@ +option(BUILD_DOCS "Build documentation" ON) +option(BUILD_TESTS "Build tests" ON) +option(TESTS_ENABLE_PYTHON_TESTS "Enable Python tests" ON) + +# DirectX11 is not available in GitHub runners, so even software encoding fails +set(TESTS_SOFTWARE_ENCODER_UNAVAILABLE "fail" + CACHE STRING "How to handle unavailable software encoders in tests. 'fail/skip'") + +option(BUILD_WERROR "Enable -Werror flag." OFF) + # if this option is set, the build will exit after configuring special package configuration files option(SUNSHINE_CONFIGURE_ONLY "Configure special files only, then exit." OFF) option(SUNSHINE_ENABLE_TRAY "Enable system tray icon. This option will be ignored on macOS." ON) option(SUNSHINE_REQUIRE_TRAY "Require system tray icon. Fail the build if tray requirements are not met." ON) +option(SUNSHINE_SYSTEM_WAYLAND_PROTOCOLS "Use system installation of wayland-protocols rather than the submodule." OFF) + +if(APPLE) + option(BOOST_USE_STATIC "Use static boost libraries." OFF) +else() + option(BOOST_USE_STATIC "Use static boost libraries." ON) +endif() + +option(CUDA_INHERIT_COMPILE_OPTIONS + "When building CUDA code, inherit compile options from the the main project. You may want to disable this if + your IDE throws errors about unknown flags after running cmake." ON) + +if(UNIX) + option(SUNSHINE_BUILD_HOMEBREW + "Enable a Homebrew build." OFF) + option(SUNSHINE_CONFIGURE_HOMEBREW + "Configure Homebrew formula. Recommended to use with SUNSHINE_CONFIGURE_ONLY" OFF) +endif() + if(APPLE) option(SUNSHINE_CONFIGURE_PORTFILE "Configure macOS Portfile. Recommended to use with SUNSHINE_CONFIGURE_ONLY" OFF) @@ -24,8 +53,12 @@ elseif(UNIX) # Linux "Enable cuda specific code." ON) option(SUNSHINE_ENABLE_DRM "Enable KMS grab if available." ON) + option(SUNSHINE_ENABLE_VAAPI + "Enable building vaapi specific code." ON) option(SUNSHINE_ENABLE_WAYLAND "Enable building wayland specific code." ON) option(SUNSHINE_ENABLE_X11 "Enable X11 grab if available." ON) + option(SUNSHINE_USE_LEGACY_INPUT # TODO: Remove this legacy option after the next stable release + "Use the legacy virtual input implementation." OFF) endif() diff --git a/cmake/prep/special_package_configuration.cmake b/cmake/prep/special_package_configuration.cmake index cd285a65acc..3e5c5d9c370 100644 --- a/cmake/prep/special_package_configuration.cmake +++ b/cmake/prep/special_package_configuration.cmake @@ -1,16 +1,28 @@ -if (APPLE) +if(UNIX) + if(${SUNSHINE_CONFIGURE_HOMEBREW}) + configure_file(packaging/sunshine.rb sunshine.rb @ONLY) + endif() +endif() + +if(APPLE) if(${SUNSHINE_CONFIGURE_PORTFILE}) configure_file(packaging/macos/Portfile Portfile @ONLY) endif() -elseif (UNIX) +elseif(UNIX) # configure the .desktop file + set(SUNSHINE_DESKTOP_ICON "sunshine.svg") if(${SUNSHINE_BUILD_APPIMAGE}) configure_file(packaging/linux/AppImage/sunshine.desktop sunshine.desktop @ONLY) elseif(${SUNSHINE_BUILD_FLATPAK}) + set(SUNSHINE_DESKTOP_ICON "${PROJECT_FQDN}.svg") configure_file(packaging/linux/flatpak/sunshine.desktop sunshine.desktop @ONLY) configure_file(packaging/linux/flatpak/sunshine_kms.desktop sunshine_kms.desktop @ONLY) + configure_file(packaging/linux/sunshine_terminal.desktop sunshine_terminal.desktop @ONLY) + configure_file(packaging/linux/flatpak/${PROJECT_FQDN}.metainfo.xml + ${PROJECT_FQDN}.metainfo.xml @ONLY) else() configure_file(packaging/linux/sunshine.desktop sunshine.desktop @ONLY) + configure_file(packaging/linux/sunshine_terminal.desktop sunshine_terminal.desktop @ONLY) endif() # configure metadata file @@ -22,11 +34,14 @@ elseif (UNIX) # configure the arch linux pkgbuild if(${SUNSHINE_CONFIGURE_PKGBUILD}) configure_file(packaging/linux/Arch/PKGBUILD PKGBUILD @ONLY) + configure_file(packaging/linux/Arch/sunshine.install sunshine.install @ONLY) endif() # configure the flatpak manifest if(${SUNSHINE_CONFIGURE_FLATPAK_MAN}) - configure_file(packaging/linux/flatpak/dev.lizardbyte.sunshine.yml dev.lizardbyte.sunshine.yml @ONLY) + configure_file(packaging/linux/flatpak/${PROJECT_FQDN}.yml ${PROJECT_FQDN}.yml @ONLY) + file(COPY packaging/linux/flatpak/deps/ DESTINATION ${CMAKE_BINARY_DIR}) + file(COPY packaging/linux/flatpak/modules DESTINATION ${CMAKE_BINARY_DIR}) endif() endif() diff --git a/cmake/targets/common.cmake b/cmake/targets/common.cmake index 72f89bf5182..d8e5ce3c515 100644 --- a/cmake/targets/common.cmake +++ b/cmake/targets/common.cmake @@ -2,6 +2,9 @@ # this file will also load platform specific macros add_executable(sunshine ${SUNSHINE_TARGET_FILES}) +foreach(dep ${SUNSHINE_TARGET_DEPENDENCIES}) + add_dependencies(sunshine ${dep}) # compile these before sunshine +endforeach() # platform specific target definitions if(WIN32) @@ -24,12 +27,89 @@ endif() target_link_libraries(sunshine ${SUNSHINE_EXTERNAL_LIBRARIES} ${EXTRA_LIBS}) target_compile_definitions(sunshine PUBLIC ${SUNSHINE_DEFINITIONS}) -set_target_properties(sunshine PROPERTIES CXX_STANDARD 17 +set_target_properties(sunshine PROPERTIES CXX_STANDARD 20 VERSION ${PROJECT_VERSION} SOVERSION ${PROJECT_VERSION_MAJOR}) -foreach(flag IN LISTS SUNSHINE_COMPILE_OPTIONS) - list(APPEND SUNSHINE_COMPILE_OPTIONS_CUDA "$<$:--compiler-options=${flag}>") -endforeach() +# CLion complains about unknown flags after running cmake, and cannot add symbols to the index for cuda files +if(CUDA_INHERIT_COMPILE_OPTIONS) + foreach(flag IN LISTS SUNSHINE_COMPILE_OPTIONS) + list(APPEND SUNSHINE_COMPILE_OPTIONS_CUDA "$<$:--compiler-options=${flag}>") + endforeach() +endif() target_compile_options(sunshine PRIVATE $<$:${SUNSHINE_COMPILE_OPTIONS}>;$<$:${SUNSHINE_COMPILE_OPTIONS_CUDA};-std=c++17>) # cmake-lint: disable=C0301 + +# Homebrew build fails the vite build if we set these environment variables +if(${SUNSHINE_BUILD_HOMEBREW}) + set(NPM_SOURCE_ASSETS_DIR "") + set(NPM_ASSETS_DIR "") + set(NPM_BUILD_HOMEBREW "true") +else() + set(NPM_SOURCE_ASSETS_DIR ${SUNSHINE_SOURCE_ASSETS_DIR}) + set(NPM_ASSETS_DIR ${CMAKE_BINARY_DIR}) + set(NPM_BUILD_HOMEBREW "") +endif() + +#WebUI build +find_program(NPM npm REQUIRED) +add_custom_target(web-ui ALL + WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" + COMMENT "Installing NPM Dependencies and Building the Web UI" + COMMAND "$<$:cmd;/C>" "${NPM}" install + COMMAND "${CMAKE_COMMAND}" -E env "SUNSHINE_BUILD_HOMEBREW=${NPM_BUILD_HOMEBREW}" "SUNSHINE_SOURCE_ASSETS_DIR=${NPM_SOURCE_ASSETS_DIR}" "SUNSHINE_ASSETS_DIR=${NPM_ASSETS_DIR}" "$<$:cmd;/C>" "${NPM}" run build # cmake-lint: disable=C0301 + COMMAND_EXPAND_LISTS + VERBATIM) + +# docs +if(BUILD_DOCS) + add_subdirectory(docs) +endif() + +# tests +if(BUILD_TESTS) + add_subdirectory(tests) +endif() + +# custom compile flags, must be after adding tests + +if (NOT BUILD_TESTS) + set(TEST_DIR "") +else() + set(TEST_DIR "${CMAKE_SOURCE_DIR}/tests") +endif() + +# src/upnp +set_source_files_properties("${CMAKE_SOURCE_DIR}/src/upnp.cpp" + DIRECTORY "${CMAKE_SOURCE_DIR}" "${TEST_DIR}" + PROPERTIES COMPILE_FLAGS -Wno-pedantic) + +# third-party/nanors +set_source_files_properties("${CMAKE_SOURCE_DIR}/src/rswrapper.c" + DIRECTORY "${CMAKE_SOURCE_DIR}" "${TEST_DIR}" + PROPERTIES COMPILE_FLAGS "-ftree-vectorize -funroll-loops") + +# third-party/ViGEmClient +set(VIGEM_COMPILE_FLAGS "") +string(APPEND VIGEM_COMPILE_FLAGS "-Wno-unknown-pragmas ") +string(APPEND VIGEM_COMPILE_FLAGS "-Wno-misleading-indentation ") +string(APPEND VIGEM_COMPILE_FLAGS "-Wno-class-memaccess ") +string(APPEND VIGEM_COMPILE_FLAGS "-Wno-unused-function ") +string(APPEND VIGEM_COMPILE_FLAGS "-Wno-unused-variable ") +set_source_files_properties("${CMAKE_SOURCE_DIR}/third-party/ViGEmClient/src/ViGEmClient.cpp" + DIRECTORY "${CMAKE_SOURCE_DIR}" "${TEST_DIR}" + PROPERTIES + COMPILE_DEFINITIONS "UNICODE=1;ERROR_INVALID_DEVICE_OBJECT_PARAMETER=650" + COMPILE_FLAGS ${VIGEM_COMPILE_FLAGS}) + +# src/nvhttp +string(TOUPPER "x${CMAKE_BUILD_TYPE}" BUILD_TYPE) +if("${BUILD_TYPE}" STREQUAL "XDEBUG") + if(WIN32) + set_source_files_properties("${CMAKE_SOURCE_DIR}/src/nvhttp.cpp" + DIRECTORY "${CMAKE_SOURCE_DIR}" "${CMAKE_SOURCE_DIR}/tests" + PROPERTIES COMPILE_FLAGS -O2) + endif() +else() + add_definitions(-DNDEBUG) +endif() diff --git a/cmake/targets/windows.cmake b/cmake/targets/windows.cmake index 341d7c2e74e..b7f8fbcfe7a 100644 --- a/cmake/targets/windows.cmake +++ b/cmake/targets/windows.cmake @@ -3,4 +3,5 @@ set_target_properties(sunshine PROPERTIES LINK_SEARCH_START_STATIC 1) set(CMAKE_FIND_LIBRARY_SUFFIXES ".dll") find_library(ZLIB ZLIB1) list(APPEND SUNSHINE_EXTERNAL_LIBRARIES + Windowsapp.lib Wtsapi32.lib) diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 00000000000..e9c9c87d87d --- /dev/null +++ b/codecov.yml @@ -0,0 +1,19 @@ +--- +codecov: + branch: master + +coverage: + status: + project: + default: + target: auto + threshold: 10% + +comment: + layout: "diff, flags, files" + behavior: default + require_changes: false # if true: only post the comment if coverage changes + +ignore: + - "tests" + - "third-party" diff --git a/crowdin.yml b/crowdin.yml index 0be504ba7d8..3dd19366ef0 100644 --- a/crowdin.yml +++ b/crowdin.yml @@ -1,7 +1,7 @@ --- "base_path": "." "base_url": "https://api.crowdin.com" # optional (for Crowdin Enterprise only) -"preserve_hierarchy": false # flatten tree on crowdin +"preserve_hierarchy": true # false will flatten tree on crowdin, but doesn't work with dest option "pull_request_labels": [ "crowdin", "l10n" @@ -10,6 +10,7 @@ "files": [ { "source": "/locale/*.po", + "dest": "/%original_file_name%", "translation": "/locale/%two_letters_code%/LC_MESSAGES/%original_file_name%", "languages_mapping": { "two_letters_code": { @@ -17,6 +18,13 @@ "en-GB": "en_GB", "en-US": "en_US" } - } + }, + "update_option": "update_as_unapproved" + }, + { + "source": "/src_assets/common/assets/web/public/assets/locale/en.json", + "dest": "/sunshine.json", + "translation": "/src_assets/common/assets/web/public/assets/locale/%two_letters_code%.%file_extension%", + "update_option": "update_as_unapproved" } ] diff --git a/docker/archlinux.dockerfile b/docker/archlinux.dockerfile index 15cb5d23685..5edb44169da 100644 --- a/docker/archlinux.dockerfile +++ b/docker/archlinux.dockerfile @@ -3,23 +3,20 @@ # platforms: linux/amd64 # archlinux does not have an arm64 base image # no-cache-filters: artifacts,sunshine -ARG BASE=archlinux +ARG BASE=archlinux/archlinux ARG TAG=base-devel FROM ${BASE}:${TAG} AS sunshine-base -# install dependencies +# Update keyring to avoid signature errors, and update system RUN <<_DEPS #!/bin/bash set -e -pacman -Syu --disable-download-timeout --needed --noconfirm \ +pacman -Syy --disable-download-timeout --needed --noconfirm \ archlinux-keyring +pacman -Syu --disable-download-timeout --noconfirm +pacman -Scc --noconfirm _DEPS -# Setup builder user, arch prevents running makepkg as root -RUN useradd -m builder && \ - echo 'builder ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers -# makepkg is used in sunshine-build and uploader build stages - FROM sunshine-base as sunshine-build ARG BRANCH @@ -33,8 +30,16 @@ ENV BUILD_VERSION=${BUILD_VERSION} ENV COMMIT=${COMMIT} SHELL ["/bin/bash", "-o", "pipefail", "-c"] + +# Setup builder user, arch prevents running makepkg as root +RUN useradd -m builder && \ + echo 'builder ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers + +# patch the build flags +# hadolint ignore=SC2016 +RUN sed -i 's,#MAKEFLAGS="-j2",MAKEFLAGS="-j$(nproc)",g' /etc/makepkg.conf + # install dependencies -# cuda, libcap, and libdrm are optional dependencies for PKGBUILD RUN <<_DEPS #!/bin/bash set -e @@ -43,9 +48,9 @@ pacman -Syu --disable-download-timeout --needed --noconfirm \ cmake \ cuda \ git \ - libcap \ - libdrm \ - namcap + namcap \ + xorg-server-xvfb +pacman -Scc --noconfirm _DEPS # Setup builder user @@ -80,35 +85,48 @@ _MAKE WORKDIR /build/sunshine/pkg RUN mv /build/sunshine/build/PKGBUILD . +RUN mv /build/sunshine/build/sunshine.install . +RUN makepkg --printsrcinfo > .SRCINFO + +# create a PKGBUILD archive +USER root +RUN <<_REPO +#!/bin/bash +set -e +tar -czf /build/sunshine/sunshine.pkg.tar.gz . +_REPO # namcap and build PKGBUILD file +USER builder RUN <<_PKGBUILD #!/bin/bash set -e +# shellcheck source=/dev/null +source /etc/profile # ensure cuda is in the PATH +export DISPLAY=:1 +Xvfb ${DISPLAY} -screen 0 1024x768x24 & namcap -i PKGBUILD makepkg -si --noconfirm +rm -f /build/sunshine/pkg/sunshine-debug*.pkg.tar.zst ls -a _PKGBUILD FROM scratch as artifacts -COPY --link --from=sunshine-build /build/sunshine/pkg/PKGBUILD /PKGBUILD COPY --link --from=sunshine-build /build/sunshine/pkg/sunshine*.pkg.tar.zst /sunshine.pkg.tar.zst +COPY --link --from=sunshine-build /build/sunshine/sunshine.pkg.tar.gz /sunshine.pkg.tar.gz FROM sunshine-base as sunshine -# copy from uploader instead of artifacts or uploader stage will not run COPY --link --from=artifacts /sunshine.pkg.tar.zst / # install sunshine RUN <<_INSTALL_SUNSHINE #!/bin/bash set -e -# update keyring to prevent cached keyring errors -pacman -Syu --disable-download-timeout --needed --noconfirm \ - archlinux-keyring pacman -U --disable-download-timeout --needed --noconfirm \ /sunshine.pkg.tar.zst +pacman -Scc --noconfirm _INSTALL_SUNSHINE # network setup @@ -131,10 +149,6 @@ ENV HOME=/home/$UNAME RUN <<_SETUP_USER #!/bin/bash set -e -# first delete the builder user -userdel -r builder - -# then create the lizard user groupadd -f -g "${PGID}" "${UNAME}" useradd -lm -d ${HOME} -s /bin/bash -g "${PGID}" -u "${PUID}" "${UNAME}" mkdir -p ${HOME}/.config/sunshine diff --git a/docker/clion-toolchain.dockerfile b/docker/clion-toolchain.dockerfile new file mode 100644 index 00000000000..3ffd483fdbb --- /dev/null +++ b/docker/clion-toolchain.dockerfile @@ -0,0 +1,124 @@ +# syntax=docker/dockerfile:1.4 +# artifacts: false +# platforms: linux/amd64 +# platforms_pr: linux/amd64 +# no-cache-filters: toolchain-base,toolchain +ARG BASE=ubuntu +ARG TAG=22.04 +FROM ${BASE}:${TAG} AS toolchain-base + +ENV DEBIAN_FRONTEND=noninteractive + +FROM toolchain-base as toolchain + +ARG TARGETPLATFORM +RUN echo "target_platform: ${TARGETPLATFORM}" + +ENV DISPLAY=:0 + +SHELL ["/bin/bash", "-o", "pipefail", "-c"] +# install dependencies +RUN <<_DEPS +#!/bin/bash +set -e +apt-get update -y +apt-get install -y --no-install-recommends \ + build-essential \ + cmake=3.22.* \ + ca-certificates \ + doxygen \ + gcc=4:11.2.* \ + g++=4:11.2.* \ + gdb \ + git \ + graphviz \ + libayatana-appindicator3-dev \ + libcap-dev \ + libcurl4-openssl-dev \ + libdrm-dev \ + libevdev-dev \ + libminiupnpc-dev \ + libnotify-dev \ + libnuma-dev \ + libopus-dev \ + libpulse-dev \ + libssl-dev \ + libva-dev \ + libvdpau-dev \ + libwayland-dev \ + libx11-dev \ + libxcb-shm0-dev \ + libxcb-xfixes0-dev \ + libxcb1-dev \ + libxfixes-dev \ + libxrandr-dev \ + libxtst-dev \ + python3.10 \ + python3.10-venv \ + udev \ + wget \ + x11-xserver-utils \ + xvfb +apt-get clean +rm -rf /var/lib/apt/lists/* +_DEPS + +#Install Node +# hadolint ignore=SC1091 +RUN <<_INSTALL_NODE +#!/bin/bash +set -e +node_version="20.9.0" +wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash +source "$HOME/.nvm/nvm.sh" +nvm install "$node_version" +nvm use "$node_version" +nvm alias default "$node_version" +_INSTALL_NODE + +# install cuda +WORKDIR /build/cuda +# versions: https://developer.nvidia.com/cuda-toolkit-archive +ENV CUDA_VERSION="11.8.0" +ENV CUDA_BUILD="520.61.05" +# hadolint ignore=SC3010 +RUN <<_INSTALL_CUDA +#!/bin/bash +set -e +cuda_prefix="https://developer.download.nvidia.com/compute/cuda/" +cuda_suffix="" +if [[ "${TARGETPLATFORM}" == 'linux/arm64' ]]; then + cuda_suffix="_sbsa" +fi +url="${cuda_prefix}${CUDA_VERSION}/local_installers/cuda_${CUDA_VERSION}_${CUDA_BUILD}_linux${cuda_suffix}.run" +echo "cuda url: ${url}" +wget "$url" --progress=bar:force:noscroll -q --show-progress -O ./cuda.run +chmod a+x ./cuda.run +./cuda.run --silent --toolkit --toolkitpath=/usr/local --no-opengl-libs --no-man-page --no-drm +rm ./cuda.run +_INSTALL_CUDA + +WORKDIR / +# Write a shell script that starts Xvfb and then runs a shell +RUN <<_ENTRYPOINT +#!/bin/bash +set -e +cat < /entrypoint.sh +#!/bin/bash +Xvfb ${DISPLAY} -screen 0 1024x768x24 & +if [ "\$#" -eq 0 ]; then + exec "/bin/bash" +else + exec "\$@" +fi +EOF +_ENTRYPOINT + +# Make the script executable +RUN chmod +x /entrypoint.sh + +# Note about CLion +RUN echo "ATTENTION: CLion will override the entrypoint, you can disable this in the toolchain settings" + +# Use the shell script as the entrypoint +ENTRYPOINT ["/entrypoint.sh"] diff --git a/docker/debian-bookworm.dockerfile b/docker/debian-bookworm.dockerfile index 1172d35a5e9..481790577cf 100644 --- a/docker/debian-bookworm.dockerfile +++ b/docker/debian-bookworm.dockerfile @@ -32,17 +32,15 @@ apt-get update -y apt-get install -y --no-install-recommends \ build-essential \ cmake=3.25.* \ + doxygen \ git \ - libavdevice-dev \ + graphviz \ libayatana-appindicator3-dev \ - libboost-filesystem-dev=1.74.* \ - libboost-locale-dev=1.74.* \ - libboost-log-dev=1.74.* \ - libboost-program-options-dev=1.74.* \ libcap-dev \ libcurl4-openssl-dev \ libdrm-dev \ libevdev-dev \ + libminiupnpc-dev \ libnotify-dev \ libnuma-dev \ libopus-dev \ @@ -60,11 +58,12 @@ apt-get install -y --no-install-recommends \ libxtst-dev \ nodejs \ npm \ - wget -if [[ "${TARGETPLATFORM}" == 'linux/amd64' ]]; then - apt-get install -y --no-install-recommends \ - libmfx-dev -fi + python3.11 \ + python3.11-venv \ + udev \ + wget \ + x11-xserver-utils \ + xvfb apt-get clean rm -rf /var/lib/apt/lists/* _DEPS @@ -95,9 +94,6 @@ _INSTALL_CUDA WORKDIR /build/sunshine/ COPY --link .. . -# setup npm dependencies -RUN npm install - # setup build directory WORKDIR /build/sunshine/build @@ -106,6 +102,7 @@ RUN <<_MAKE #!/bin/bash set -e cmake \ + -DBUILD_WERROR=ON \ -DCMAKE_CUDA_COMPILER:PATH=/build/cuda/bin/nvcc \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX=/usr \ @@ -120,6 +117,17 @@ make -j "$(nproc)" cpack -G DEB _MAKE +# run tests +WORKDIR /build/sunshine/build/tests +# hadolint ignore=SC1091 +RUN <<_TEST +#!/bin/bash +set -e +export DISPLAY=:1 +Xvfb ${DISPLAY} -screen 0 1024x768x24 & +./test_sunshine --gtest_color=yes +_TEST + FROM scratch AS artifacts ARG BASE ARG TAG diff --git a/docker/fedora-37.dockerfile b/docker/fedora-39.dockerfile similarity index 80% rename from docker/fedora-37.dockerfile rename to docker/fedora-39.dockerfile index c6aa0593a6b..40d45ed152f 100644 --- a/docker/fedora-37.dockerfile +++ b/docker/fedora-39.dockerfile @@ -1,10 +1,10 @@ # syntax=docker/dockerfile:1.4 # artifacts: true -# platforms: linux/amd64,linux/arm64/v8 +# platforms: linux/amd64 # platforms_pr: linux/amd64 # no-cache-filters: sunshine-base,artifacts,sunshine ARG BASE=fedora -ARG TAG=37 +ARG TAG=39 FROM ${BASE}:${TAG} AS sunshine-base FROM sunshine-base as sunshine-build @@ -30,10 +30,9 @@ set -e dnf -y update dnf -y group install "Development Tools" dnf -y install \ - boost-devel-1.78.* \ cmake-3.27.* \ - gcc-12.2.* \ - gcc-c++-12.2.* \ + gcc-13.2.* \ + gcc-c++-13.2.* \ git \ libappindicator-gtk3-devel \ libcap-devel \ @@ -52,17 +51,16 @@ dnf -y install \ libXrandr-devel \ libXtst-devel \ mesa-libGL-devel \ - nodejs-npm \ + miniupnpc-devel \ + nodejs \ numactl-devel \ openssl-devel \ opus-devel \ pulseaudio-libs-devel \ rpm-build \ wget \ - which -if [[ "${TARGETPLATFORM}" == 'linux/amd64' ]]; then - dnf -y install intel-mediasdk-devel -fi + which \ + xorg-x11-server-Xvfb dnf clean all rm -rf /var/cache/yum _DEPS @@ -70,8 +68,8 @@ _DEPS # install cuda WORKDIR /build/cuda # versions: https://developer.nvidia.com/cuda-toolkit-archive -ENV CUDA_VERSION="12.0.0" -ENV CUDA_BUILD="525.60.13" +ENV CUDA_VERSION="12.4.0" +ENV CUDA_BUILD="550.54.14" # hadolint ignore=SC3010 RUN <<_INSTALL_CUDA #!/bin/bash @@ -80,6 +78,13 @@ cuda_prefix="https://developer.download.nvidia.com/compute/cuda/" cuda_suffix="" if [[ "${TARGETPLATFORM}" == 'linux/arm64' ]]; then cuda_suffix="_sbsa" + + # patch headers https://bugs.launchpad.net/ubuntu/+source/mumax3/+bug/2032624 + sed -i 's/__Float32x4_t/int/g' /usr/include/bits/math-vector.h + sed -i 's/__Float64x2_t/int/g' /usr/include/bits/math-vector.h + sed -i 's/__SVFloat32_t/float/g' /usr/include/bits/math-vector.h + sed -i 's/__SVFloat64_t/float/g' /usr/include/bits/math-vector.h + sed -i 's/__SVBool_t/int/g' /usr/include/bits/math-vector.h fi url="${cuda_prefix}${CUDA_VERSION}/local_installers/cuda_${CUDA_VERSION}_${CUDA_BUILD}_linux${cuda_suffix}.run" echo "cuda url: ${url}" @@ -93,9 +98,6 @@ _INSTALL_CUDA WORKDIR /build/sunshine/ COPY --link .. . -# setup npm dependencies -RUN npm install - # setup build directory WORKDIR /build/sunshine/build @@ -105,6 +107,8 @@ RUN <<_MAKE set -e cmake \ -DCMAKE_CUDA_COMPILER:PATH=/build/cuda/bin/nvcc \ + -DBUILD_DOCS=OFF \ + -DBUILD_WERROR=ON \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX=/usr \ -DSUNSHINE_ASSETS_DIR=share/sunshine \ @@ -118,6 +122,17 @@ make -j "$(nproc)" cpack -G RPM _MAKE +# run tests +WORKDIR /build/sunshine/build/tests +# hadolint ignore=SC1091 +RUN <<_TEST +#!/bin/bash +set -e +export DISPLAY=:1 +Xvfb ${DISPLAY} -screen 0 1024x768x24 & +./test_sunshine --gtest_color=yes +_TEST + FROM scratch AS artifacts ARG BASE ARG TAG diff --git a/docker/fedora-38.dockerfile b/docker/fedora-40.dockerfile similarity index 76% rename from docker/fedora-38.dockerfile rename to docker/fedora-40.dockerfile index 2245ba9b9aa..c97f81d2f06 100644 --- a/docker/fedora-38.dockerfile +++ b/docker/fedora-40.dockerfile @@ -1,10 +1,10 @@ # syntax=docker/dockerfile:1.4 # artifacts: true -# platforms: linux/amd64,linux/arm64/v8 +# platforms: linux/amd64 # platforms_pr: linux/amd64 # no-cache-filters: sunshine-base,artifacts,sunshine ARG BASE=fedora -ARG TAG=38 +ARG TAG=40 FROM ${BASE}:${TAG} AS sunshine-base FROM sunshine-base as sunshine-build @@ -30,11 +30,12 @@ set -e dnf -y update dnf -y group install "Development Tools" dnf -y install \ - boost-devel-1.78.0* \ - cmake-3.27.* \ - gcc-13.2.* \ - gcc-c++-13.2.* \ + cmake-3.28.* \ + doxygen \ + gcc-14.1.* \ + gcc-c++-14.1.* \ git \ + graphviz \ libappindicator-gtk3-devel \ libcap-devel \ libcurl-devel \ @@ -52,27 +53,27 @@ dnf -y install \ libXrandr-devel \ libXtst-devel \ mesa-libGL-devel \ - nodejs-npm \ + miniupnpc-devel \ + nodejs \ numactl-devel \ openssl-devel \ opus-devel \ pulseaudio-libs-devel \ + python3.11 \ rpm-build \ wget \ - which -if [[ "${TARGETPLATFORM}" == 'linux/amd64' ]]; then - dnf -y install intel-mediasdk-devel -fi + which \ + xorg-x11-server-Xvfb dnf clean all rm -rf /var/cache/yum _DEPS -# todo - enable cuda once it's supported for gcc 13 and fedora 38 +# TODO: re-enable cuda once cuda supports gcc-14 ## install cuda #WORKDIR /build/cuda ## versions: https://developer.nvidia.com/cuda-toolkit-archive -#ENV CUDA_VERSION="12.0.0" -#ENV CUDA_BUILD="525.60.13" +#ENV CUDA_VERSION="12.4.0" +#ENV CUDA_BUILD="550.54.14" ## hadolint ignore=SC3010 #RUN <<_INSTALL_CUDA ##!/bin/bash @@ -81,6 +82,13 @@ _DEPS #cuda_suffix="" #if [[ "${TARGETPLATFORM}" == 'linux/arm64' ]]; then # cuda_suffix="_sbsa" +# +# # patch headers https://bugs.launchpad.net/ubuntu/+source/mumax3/+bug/2032624 +# sed -i 's/__Float32x4_t/int/g' /usr/include/bits/math-vector.h +# sed -i 's/__Float64x2_t/int/g' /usr/include/bits/math-vector.h +# sed -i 's/__SVFloat32_t/float/g' /usr/include/bits/math-vector.h +# sed -i 's/__SVFloat64_t/float/g' /usr/include/bits/math-vector.h +# sed -i 's/__SVBool_t/int/g' /usr/include/bits/math-vector.h #fi #url="${cuda_prefix}${CUDA_VERSION}/local_installers/cuda_${CUDA_VERSION}_${CUDA_BUILD}_linux${cuda_suffix}.run" #echo "cuda url: ${url}" @@ -94,19 +102,17 @@ _DEPS WORKDIR /build/sunshine/ COPY --link .. . -# setup npm dependencies -RUN npm install - # setup build directory WORKDIR /build/sunshine/build +# TODO: re-add as first cmake argument: -DCMAKE_CUDA_COMPILER:PATH=/build/cuda/bin/nvcc \ +# TODO: enable cuda flag # cmake and cpack -# todo - add cmake argument back in for cuda support "-DCMAKE_CUDA_COMPILER:PATH=/build/cuda/bin/nvcc \" -# todo - re-enable "DSUNSHINE_ENABLE_CUDA" RUN <<_MAKE #!/bin/bash set -e cmake \ + -DBUILD_WERROR=ON \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX=/usr \ -DSUNSHINE_ASSETS_DIR=share/sunshine \ @@ -120,6 +126,17 @@ make -j "$(nproc)" cpack -G RPM _MAKE +# run tests +WORKDIR /build/sunshine/build/tests +# hadolint ignore=SC1091 +RUN <<_TEST +#!/bin/bash +set -e +export DISPLAY=:1 +Xvfb ${DISPLAY} -screen 0 1024x768x24 & +./test_sunshine --gtest_color=yes +_TEST + FROM scratch AS artifacts ARG BASE ARG TAG diff --git a/docker/ubuntu-20.04.dockerfile b/docker/ubuntu-20.04.dockerfile deleted file mode 100644 index 5634d48e0c0..00000000000 --- a/docker/ubuntu-20.04.dockerfile +++ /dev/null @@ -1,211 +0,0 @@ -# syntax=docker/dockerfile:1.4 -# artifacts: true -# platforms: linux/amd64,linux/arm64/v8 -# platforms_pr: linux/amd64 -# no-cache-filters: sunshine-base,artifacts,sunshine -ARG BASE=ubuntu -ARG TAG=20.04 -FROM ${BASE}:${TAG} AS sunshine-base - -ENV DEBIAN_FRONTEND=noninteractive - -FROM sunshine-base as sunshine-build - -ARG TARGETPLATFORM -RUN echo "target_platform: ${TARGETPLATFORM}" - -ARG BRANCH -ARG BUILD_VERSION -ARG COMMIT -# note: BUILD_VERSION may be blank - -ENV BRANCH=${BRANCH} -ENV BUILD_VERSION=${BUILD_VERSION} -ENV COMMIT=${COMMIT} - -SHELL ["/bin/bash", "-o", "pipefail", "-c"] -# install dependencies -RUN <<_DEPS -#!/bin/bash -set -e -apt-get update -y -apt-get install -y --no-install-recommends \ - build-essential \ - gcc-10=10.5.* \ - g++-10=10.5.* \ - git \ - libayatana-appindicator3-dev \ - libavdevice-dev \ - libboost-filesystem-dev=1.71.* \ - libboost-locale-dev=1.71.* \ - libboost-log-dev=1.71.* \ - libboost-program-options-dev=1.71.* \ - libcap-dev \ - libcurl4-openssl-dev \ - libdrm-dev \ - libevdev-dev \ - libnotify-dev \ - libnuma-dev \ - libopus-dev \ - libpulse-dev \ - libssl-dev \ - libva-dev \ - libvdpau-dev \ - libwayland-dev \ - libx11-dev \ - libxcb-shm0-dev \ - libxcb-xfixes0-dev \ - libxcb1-dev \ - libxfixes-dev \ - libxrandr-dev \ - libxtst-dev \ - nodejs \ - npm \ - wget -if [[ "${TARGETPLATFORM}" == 'linux/amd64' ]]; then - apt-get install -y --no-install-recommends \ - libmfx-dev -fi -apt-get clean -rm -rf /var/lib/apt/lists/* -_DEPS - -# Update gcc alias -# https://stackoverflow.com/a/70653945/11214013 -RUN <<_GCC_ALIAS -#!/bin/bash -set -e -update-alternatives --install \ - /usr/bin/gcc gcc /usr/bin/gcc-10 100 \ - --slave /usr/bin/g++ g++ /usr/bin/g++-10 \ - --slave /usr/bin/gcov gcov /usr/bin/gcov-10 \ - --slave /usr/bin/gcc-ar gcc-ar /usr/bin/gcc-ar-10 \ - --slave /usr/bin/gcc-ranlib gcc-ranlib /usr/bin/gcc-ranlib-10 -_GCC_ALIAS - -# install cmake -# sunshine requires cmake >= 3.18 -WORKDIR /build/cmake -# https://cmake.org/download/ -ENV CMAKE_VERSION="3.25.1" -# hadolint ignore=SC3010 -RUN <<_INSTALL_CMAKE -#!/bin/bash -set -e -cmake_prefix="https://github.com/Kitware/CMake/releases/download/v" -if [[ "${TARGETPLATFORM}" == 'linux/amd64' ]]; then - cmake_arch="x86_64" -elif [[ "${TARGETPLATFORM}" == 'linux/arm64' ]]; then - cmake_arch="aarch64" -fi -url="${cmake_prefix}${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-${cmake_arch}.sh" -echo "cmake url: ${url}" -wget "$url" --progress=bar:force:noscroll -q --show-progress -O ./cmake.sh -sh ./cmake.sh --prefix=/usr/local --skip-license -rm ./cmake.sh -_INSTALL_CMAKE - -# install cuda -WORKDIR /build/cuda -# versions: https://developer.nvidia.com/cuda-toolkit-archive -ENV CUDA_VERSION="11.8.0" -ENV CUDA_BUILD="520.61.05" -# hadolint ignore=SC3010 -RUN <<_INSTALL_CUDA -#!/bin/bash -set -e -cuda_prefix="https://developer.download.nvidia.com/compute/cuda/" -cuda_suffix="" -if [[ "${TARGETPLATFORM}" == 'linux/arm64' ]]; then - cuda_suffix="_sbsa" -fi -url="${cuda_prefix}${CUDA_VERSION}/local_installers/cuda_${CUDA_VERSION}_${CUDA_BUILD}_linux${cuda_suffix}.run" -echo "cuda url: ${url}" -wget "$url" --progress=bar:force:noscroll -q --show-progress -O ./cuda.run -chmod a+x ./cuda.run -./cuda.run --silent --toolkit --toolkitpath=/build/cuda --no-opengl-libs --no-man-page --no-drm -rm ./cuda.run -_INSTALL_CUDA - -# copy repository -WORKDIR /build/sunshine/ -COPY --link .. . - -# setup npm dependencies -RUN npm install - -# setup build directory -WORKDIR /build/sunshine/build - -# cmake and cpack -RUN <<_MAKE -#!/bin/bash -set -e -cmake \ - -DCMAKE_CUDA_COMPILER:PATH=/build/cuda/bin/nvcc \ - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_INSTALL_PREFIX=/usr \ - -DSUNSHINE_ASSETS_DIR=share/sunshine \ - -DSUNSHINE_EXECUTABLE_PATH=/usr/bin/sunshine \ - -DSUNSHINE_ENABLE_WAYLAND=ON \ - -DSUNSHINE_ENABLE_X11=ON \ - -DSUNSHINE_ENABLE_DRM=ON \ - -DSUNSHINE_ENABLE_CUDA=ON \ - /build/sunshine -make -j "$(nproc)" -cpack -G DEB -_MAKE - -FROM scratch AS artifacts -ARG BASE -ARG TAG -ARG TARGETARCH -COPY --link --from=sunshine-build /build/sunshine/build/cpack_artifacts/Sunshine.deb /sunshine-${BASE}-${TAG}-${TARGETARCH}.deb - -FROM sunshine-base as sunshine - -# copy deb from builder -COPY --link --from=artifacts /sunshine*.deb /sunshine.deb - -# install sunshine -RUN <<_INSTALL_SUNSHINE -#!/bin/bash -set -e -apt-get update -y -apt-get install -y --no-install-recommends /sunshine.deb -apt-get clean -rm -rf /var/lib/apt/lists/* -_INSTALL_SUNSHINE - -# network setup -EXPOSE 47984-47990/tcp -EXPOSE 48010 -EXPOSE 47998-48000/udp - -# setup user -ARG PGID=1000 -ENV PGID=${PGID} -ARG PUID=1000 -ENV PUID=${PUID} -ENV TZ="UTC" -ARG UNAME=lizard -ENV UNAME=${UNAME} - -ENV HOME=/home/$UNAME - -# setup user -RUN <<_SETUP_USER -#!/bin/bash -set -e -groupadd -f -g "${PGID}" "${UNAME}" -useradd -lm -d ${HOME} -s /bin/bash -g "${PGID}" -u "${PUID}" "${UNAME}" -mkdir -p ${HOME}/.config/sunshine -ln -s ${HOME}/.config/sunshine /config -chown -R ${UNAME} ${HOME} -_SETUP_USER - -USER ${UNAME} -WORKDIR ${HOME} - -# entrypoint -ENTRYPOINT ["/usr/bin/sunshine"] diff --git a/docker/ubuntu-22.04.dockerfile b/docker/ubuntu-22.04.dockerfile index c9c6b70db89..9ccf75687dd 100644 --- a/docker/ubuntu-22.04.dockerfile +++ b/docker/ubuntu-22.04.dockerfile @@ -32,17 +32,16 @@ apt-get update -y apt-get install -y --no-install-recommends \ build-essential \ cmake=3.22.* \ + ca-certificates \ + doxygen \ git \ + graphviz \ libayatana-appindicator3-dev \ - libavdevice-dev \ - libboost-filesystem-dev=1.74.* \ - libboost-locale-dev=1.74.* \ - libboost-log-dev=1.74.* \ - libboost-program-options-dev=1.74.* \ libcap-dev \ libcurl4-openssl-dev \ libdrm-dev \ libevdev-dev \ + libminiupnpc-dev \ libnotify-dev \ libnuma-dev \ libopus-dev \ @@ -58,17 +57,48 @@ apt-get install -y --no-install-recommends \ libxfixes-dev \ libxrandr-dev \ libxtst-dev \ - nodejs \ - npm \ - wget -if [[ "${TARGETPLATFORM}" == 'linux/amd64' ]]; then - apt-get install -y --no-install-recommends \ - libmfx-dev -fi + python3.10 \ + python3.10-venv \ + udev \ + wget \ + x11-xserver-utils \ + xvfb apt-get clean rm -rf /var/lib/apt/lists/* _DEPS +# install cmake +# sunshine requires cmake >= 3.25 +WORKDIR /build/cmake +# https://cmake.org/download/ +ENV CMAKE_VERSION="3.30.1" +# hadolint ignore=SC3010 +RUN <<_INSTALL_CMAKE +#!/bin/bash +cmake_prefix="https://github.com/Kitware/CMake/releases/download/v" +if [[ "${TARGETPLATFORM}" == 'linux/amd64' ]]; then + cmake_arch="x86_64" +elif [[ "${TARGETPLATFORM}" == 'linux/arm64' ]]; then + cmake_arch="aarch64" +fi +url="${cmake_prefix}${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-${cmake_arch}.sh" +echo "cmake url: ${url}" +wget "$url" --progress=bar:force:noscroll -q --show-progress -O ./cmake.sh +sh ./cmake.sh --prefix=/usr/local --skip-license +cmake --version +_INSTALL_CMAKE + +#Install Node +# hadolint ignore=SC1091 +RUN <<_INSTALL_NODE +#!/bin/bash +set -e +wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash +source "$HOME/.nvm/nvm.sh" +nvm install 20.9.0 +nvm use 20.9.0 +_INSTALL_NODE + # install cuda WORKDIR /build/cuda # versions: https://developer.nvidia.com/cuda-toolkit-archive @@ -95,17 +125,20 @@ _INSTALL_CUDA WORKDIR /build/sunshine/ COPY --link .. . -# setup npm dependencies -RUN npm install - # setup build directory WORKDIR /build/sunshine/build # cmake and cpack +# hadolint ignore=SC1091 RUN <<_MAKE #!/bin/bash set -e +#Set Node version +source "$HOME/.nvm/nvm.sh" +nvm use 20.9.0 +#Actually build cmake \ + -DBUILD_WERROR=ON \ -DCMAKE_CUDA_COMPILER:PATH=/build/cuda/bin/nvcc \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX=/usr \ @@ -120,6 +153,17 @@ make -j "$(nproc)" cpack -G DEB _MAKE +# run tests +WORKDIR /build/sunshine/build/tests +# hadolint ignore=SC1091 +RUN <<_TEST +#!/bin/bash +set -e +export DISPLAY=:1 +Xvfb ${DISPLAY} -screen 0 1024x768x24 & +./test_sunshine --gtest_color=yes +_TEST + FROM scratch AS artifacts ARG BASE ARG TAG diff --git a/docker/debian-bullseye.dockerfile b/docker/ubuntu-24.04.dockerfile similarity index 73% rename from docker/debian-bullseye.dockerfile rename to docker/ubuntu-24.04.dockerfile index 6d7ebdd30af..765a6b85f31 100644 --- a/docker/debian-bullseye.dockerfile +++ b/docker/ubuntu-24.04.dockerfile @@ -1,10 +1,10 @@ # syntax=docker/dockerfile:1.4 # artifacts: true -# platforms: linux/amd64,linux/arm64/v8 +# platforms: linux/amd64 # platforms_pr: linux/amd64 # no-cache-filters: sunshine-base,artifacts,sunshine -ARG BASE=debian -ARG TAG=bullseye +ARG BASE=ubuntu +ARG TAG=24.04 FROM ${BASE}:${TAG} AS sunshine-base ENV DEBIAN_FRONTEND=noninteractive @@ -31,18 +31,19 @@ set -e apt-get update -y apt-get install -y --no-install-recommends \ build-essential \ - cmake=3.18.* \ + cmake=3.28.* \ + ca-certificates \ + doxygen \ + gcc-11 \ + g++-11 \ git \ - libavdevice-dev \ + graphviz \ libayatana-appindicator3-dev \ - libboost-filesystem-dev=1.74.* \ - libboost-locale-dev=1.74.* \ - libboost-log-dev=1.74.* \ - libboost-program-options-dev=1.74.* \ libcap-dev \ libcurl4-openssl-dev \ libdrm-dev \ libevdev-dev \ + libminiupnpc-dev \ libnotify-dev \ libnuma-dev \ libopus-dev \ @@ -58,17 +59,41 @@ apt-get install -y --no-install-recommends \ libxfixes-dev \ libxrandr-dev \ libxtst-dev \ - nodejs \ - npm \ - wget -if [[ "${TARGETPLATFORM}" == 'linux/amd64' ]]; then - apt-get install -y --no-install-recommends \ - libmfx-dev -fi + python3.12 \ + python3.12-venv \ + udev \ + wget \ + x11-xserver-utils \ + xvfb apt-get clean rm -rf /var/lib/apt/lists/* _DEPS + +#Install Node +# hadolint ignore=SC1091 +RUN <<_INSTALL_NODE +#!/bin/bash +set -e +wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash +source "$HOME/.nvm/nvm.sh" +nvm install 20.9.0 +nvm use 20.9.0 +_INSTALL_NODE + +# Update gcc alias +# https://stackoverflow.com/a/70653945/11214013 +RUN <<_GCC_ALIAS +#!/bin/bash +set -e +update-alternatives --install \ + /usr/bin/gcc gcc /usr/bin/gcc-11 100 \ + --slave /usr/bin/g++ g++ /usr/bin/g++-11 \ + --slave /usr/bin/gcov gcov /usr/bin/gcov-11 \ + --slave /usr/bin/gcc-ar gcc-ar /usr/bin/gcc-ar-11 \ + --slave /usr/bin/gcc-ranlib gcc-ranlib /usr/bin/gcc-ranlib-11 +_GCC_ALIAS + # install cuda WORKDIR /build/cuda # versions: https://developer.nvidia.com/cuda-toolkit-archive @@ -95,17 +120,20 @@ _INSTALL_CUDA WORKDIR /build/sunshine/ COPY --link .. . -# setup npm dependencies -RUN npm install - # setup build directory WORKDIR /build/sunshine/build # cmake and cpack +# hadolint ignore=SC1091 RUN <<_MAKE #!/bin/bash set -e +#Set Node version +source "$HOME/.nvm/nvm.sh" +nvm use 20.9.0 +#Actually build cmake \ + -DBUILD_WERROR=ON \ -DCMAKE_CUDA_COMPILER:PATH=/build/cuda/bin/nvcc \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX=/usr \ @@ -120,6 +148,17 @@ make -j "$(nproc)" cpack -G DEB _MAKE +# run tests +WORKDIR /build/sunshine/build/tests +# hadolint ignore=SC1091 +RUN <<_TEST +#!/bin/bash +set -e +export DISPLAY=:1 +Xvfb ${DISPLAY} -screen 0 1024x768x24 & +./test_sunshine --gtest_color=yes +_TEST + FROM scratch AS artifacts ARG BASE ARG TAG @@ -147,9 +186,9 @@ EXPOSE 48010 EXPOSE 47998-48000/udp # setup user -ARG PGID=1000 +ARG PGID=1001 ENV PGID=${PGID} -ARG PUID=1000 +ARG PUID=1001 ENV PUID=${PUID} ENV TZ="UTC" ARG UNAME=lizard diff --git a/docs/CMakeLists.txt b/docs/CMakeLists.txt new file mode 100644 index 00000000000..31d0f48cc96 --- /dev/null +++ b/docs/CMakeLists.txt @@ -0,0 +1,126 @@ +cmake_minimum_required(VERSION 3.19) + +# find doxygen and graphviz +find_package(Doxygen + REQUIRED dot) + +if(POLICY CMP0094) # https://cmake.org/cmake/help/latest/policy/CMP0094.html + cmake_policy(SET CMP0094 NEW) # FindPython should return the first matching Python +endif() + +# needed on GitHub Actions CI: actions/setup-python does not touch registry/frameworks on Windows/macOS +# this mirrors PythonInterp behavior which did not consult registry/frameworks first +if(NOT DEFINED Python_FIND_REGISTRY) + set(Python_FIND_REGISTRY "LAST") # cmake-lint: disable=C0103 +endif() +if(NOT DEFINED Python_FIND_FRAMEWORK) + set(Python_FIND_FRAMEWORK "LAST") # cmake-lint: disable=C0103 +endif() + +# find python +if(NOT DEFINED Python_EXECUTABLE) + find_package(Python3 3.9 REQUIRED COMPONENTS Interpreter) +else() + set(Python3_EXECUTABLE "${Python_EXECUTABLE}") # cmake-lint: disable=C0103 + message(STATUS "Using Python3_EXECUTABLE: ${Python3_EXECUTABLE}") +endif() + +# create venv in build dir +set(VENV_DIR "${CMAKE_BINARY_DIR}/venv") + +# create venv +execute_process( + COMMAND ${Python3_EXECUTABLE} -m venv ${VENV_DIR} + COMMAND_ERROR_IS_FATAL LAST + RESULT_VARIABLE VENV_RESULT +) + +unset(Python3_EXECUTABLE) + +set(VENV_PATTERNS + ${VENV_DIR}/bin/python + ${VENV_DIR}/bin/python.exe + ${VENV_DIR}/Scripts/python.exe +) + +# set Python3_EXECUTABLE to the python interpreter in the venv +foreach(pattern ${VENV_PATTERNS}) + if(EXISTS ${pattern}) + set(Python3_EXECUTABLE "${pattern}") # cmake-lint: disable=C0103 + get_filename_component(Python3_ROOT_DIR ${pattern} DIRECTORY) + message(STATUS "Using Python3_EXECUTABLE (venv): ${Python3_EXECUTABLE}") + message(STATUS "Using Python3_ROOT_DIR (venv): ${Python3_ROOT_DIR}") + break() + endif() +endforeach() + +# fail if Python3_ROOT_DIR is not set +if(NOT DEFINED Python3_EXECUTABLE) + message(FATAL_ERROR "Unable to setup python venv") +endif() + +# call a simple python command +execute_process( + COMMAND ${Python3_EXECUTABLE} -c "print(' Testing Python3_EXECUTABLE')" + COMMAND_ERROR_IS_FATAL ANY + RESULT_VARIABLE PYTHON_RESULT +) + +# fail if the python command failed +if(NOT PYTHON_RESULT EQUAL 0) + message(FATAL_ERROR "Python3_EXECUTABLE failed") +endif() + +# install doc requirements +execute_process( + COMMAND ${Python3_EXECUTABLE} -m pip install -r ${CMAKE_CURRENT_SOURCE_DIR}/requirements.txt + COMMAND_ERROR_IS_FATAL ANY + RESULT_VARIABLE PIP_RESULT +) + +# rst check +set(RST_PATTERNS + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/README.rst +) + +# check rst files +foreach(pattern ${RST_PATTERNS}) + message(STATUS "Checking RST files: ${pattern}") + execute_process( + COMMAND "${Python3_ROOT_DIR}/rstcheck" -r "${pattern}" + COMMAND_ERROR_IS_FATAL ANY + RESULT_VARIABLE RST_RESULT + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} + ) +endforeach() + +# commands +list(APPEND SPHINX_BUILD_HTML_COMMAND + "${Python3_ROOT_DIR}/sphinx-build" + "-M" + "html" + "${CMAKE_CURRENT_SOURCE_DIR}/source" + "${CMAKE_CURRENT_BINARY_DIR}/build/html" + "-W" + "--keep-going" +) + +list(APPEND SPHINX_BUILD_EPUB_COMMAND + "${Python3_ROOT_DIR}/sphinx-build" + "-M" + "epub" + "${CMAKE_CURRENT_SOURCE_DIR}/source" + "${CMAKE_CURRENT_BINARY_DIR}/build/epub" + "-W" + "--keep-going" +) + +# build docs +add_custom_target(docs ALL + WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" + COMMENT "Building documentation" + COMMAND ${CMAKE_COMMAND} -E env DOXY_PATH=$ ${SPHINX_BUILD_HTML_COMMAND} + COMMAND ${CMAKE_COMMAND} -E env DOXY_PATH=$ ${SPHINX_BUILD_EPUB_COMMAND} + VERBATIM +) diff --git a/docs/Doxyfile b/docs/Doxyfile index 5d909b5335e..05903d7c317 100644 --- a/docs/Doxyfile +++ b/docs/Doxyfile @@ -1,5 +1,3 @@ -# Doxyfile 1.9.6 - # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project. # @@ -23,2757 +21,82 @@ # replacement variables: # doxygen -x_noenv [configFile] -#--------------------------------------------------------------------------- -# Project related configuration options -#--------------------------------------------------------------------------- - -# This tag specifies the encoding used for all characters in the configuration -# file that follow. The default is UTF-8 which is also the encoding used for all -# text before the first occurrence of this tag. Doxygen uses libiconv (or the -# iconv built into libc) for the transcoding. See -# https://www.gnu.org/software/libiconv/ for the list of possible encodings. -# The default value is: UTF-8. - -DOXYFILE_ENCODING = UTF-8 - -# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by -# double-quotes, unless you are using Doxywizard) that should identify the -# project for which the documentation is generated. This name is used in the -# title of most generated pages and in a few other places. -# The default value is: My Project. - -PROJECT_NAME = "Sunshine" - -# The PROJECT_NUMBER tag can be used to enter a project or revision number. This -# could be handy for archiving the generated documentation or if some version -# control system is used. - -PROJECT_NUMBER = - -# Using the PROJECT_BRIEF tag one can provide an optional one line description -# for a project that appears at the top of each page and should give viewer a -# quick idea about the purpose of the project. Keep the description short. - -PROJECT_BRIEF = "Sunshine is a Gamestream host for Moonlight." - -# With the PROJECT_LOGO tag one can specify a logo or an icon that is included -# in the documentation. The maximum height of the logo should not exceed 55 -# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy -# the logo to the output directory. - -PROJECT_LOGO = ../sunshine.png - -# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path -# into which the generated documentation will be written. If a relative path is -# entered, it will be relative to the location where doxygen was started. If -# left blank the current directory will be used. - -OUTPUT_DIRECTORY = build - -# If the CREATE_SUBDIRS tag is set to YES then doxygen will create up to 4096 -# sub-directories (in 2 levels) under the output directory of each output format -# and will distribute the generated files over these directories. Enabling this -# option can be useful when feeding doxygen a huge amount of source files, where -# putting all generated files in the same directory would otherwise causes -# performance problems for the file system. Adapt CREATE_SUBDIRS_LEVEL to -# control the number of sub-directories. -# The default value is: NO. - -CREATE_SUBDIRS = NO - -# Controls the number of sub-directories that will be created when -# CREATE_SUBDIRS tag is set to YES. Level 0 represents 16 directories, and every -# level increment doubles the number of directories, resulting in 4096 -# directories at level 8 which is the default and also the maximum value. The -# sub-directories are organized in 2 levels, the first level always has a fixed -# number of 16 directories. -# Minimum value: 0, maximum value: 8, default value: 8. -# This tag requires that the tag CREATE_SUBDIRS is set to YES. - -CREATE_SUBDIRS_LEVEL = 8 - -# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII -# characters to appear in the names of generated files. If set to NO, non-ASCII -# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode -# U+3044. -# The default value is: NO. - -ALLOW_UNICODE_NAMES = NO - -# The OUTPUT_LANGUAGE tag is used to specify the language in which all -# documentation generated by doxygen is written. Doxygen will use this -# information to generate all constant output in the proper language. -# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Bulgarian, -# Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish, Dutch, English -# (United States), Esperanto, Farsi (Persian), Finnish, French, German, Greek, -# Hindi, Hungarian, Indonesian, Italian, Japanese, Japanese-en (Japanese with -# English messages), Korean, Korean-en (Korean with English messages), Latvian, -# Lithuanian, Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, -# Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, -# Swedish, Turkish, Ukrainian and Vietnamese. -# The default value is: English. - -OUTPUT_LANGUAGE = English - -# If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member -# descriptions after the members that are listed in the file and class -# documentation (similar to Javadoc). Set to NO to disable this. -# The default value is: YES. - -BRIEF_MEMBER_DESC = YES - -# If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief -# description of a member or function before the detailed description -# -# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the -# brief descriptions will be completely suppressed. -# The default value is: YES. - -REPEAT_BRIEF = YES - -# This tag implements a quasi-intelligent brief description abbreviator that is -# used to form the text in various listings. Each string in this list, if found -# as the leading text of the brief description, will be stripped from the text -# and the result, after processing the whole list, is used as the annotated -# text. Otherwise, the brief description is used as-is. If left blank, the -# following values are used ($name is automatically replaced with the name of -# the entity):The $name class, The $name widget, The $name file, is, provides, -# specifies, contains, represents, a, an and the. - -ABBREVIATE_BRIEF = "The $name class" \ - "The $name widget" \ - "The $name file" \ - is \ - provides \ - specifies \ - contains \ - represents \ - a \ - an \ - the - -# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then -# doxygen will generate a detailed section even if there is only a brief -# description. -# The default value is: NO. - -ALWAYS_DETAILED_SEC = NO - -# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all -# inherited members of a class in the documentation of that class as if those -# members were ordinary class members. Constructors, destructors and assignment -# operators of the base classes will not be shown. -# The default value is: NO. - -INLINE_INHERITED_MEMB = NO - -# If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path -# before files name in the file list and in the header files. If set to NO the -# shortest path that makes the file name unique will be used -# The default value is: YES. - -FULL_PATH_NAMES = YES - -# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path. -# Stripping is only done if one of the specified strings matches the left-hand -# part of the path. The tag can be used to show relative paths in the file list. -# If left blank the directory from which doxygen is run is used as the path to -# strip. -# -# Note that you can specify absolute paths here, but also relative paths, which -# will be relative from the directory where doxygen is started. -# This tag requires that the tag FULL_PATH_NAMES is set to YES. - -STRIP_FROM_PATH = ../ - -# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the -# path mentioned in the documentation of a class, which tells the reader which -# header file to include in order to use a class. If left blank only the name of -# the header file containing the class definition is used. Otherwise one should -# specify the list of include paths that are normally passed to the compiler -# using the -I flag. - -STRIP_FROM_INC_PATH = ../ - -# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but -# less readable) file names. This can be useful is your file systems doesn't -# support long names like on DOS, Mac, or CD-ROM. -# The default value is: NO. - -SHORT_NAMES = NO - -# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the -# first line (until the first dot) of a Javadoc-style comment as the brief -# description. If set to NO, the Javadoc-style will behave just like regular Qt- -# style comments (thus requiring an explicit @brief command for a brief -# description.) -# The default value is: NO. - -JAVADOC_AUTOBRIEF = NO - -# If the JAVADOC_BANNER tag is set to YES then doxygen will interpret a line -# such as -# /*************** -# as being the beginning of a Javadoc-style comment "banner". If set to NO, the -# Javadoc-style will behave just like regular comments and it will not be -# interpreted by doxygen. -# The default value is: NO. - -JAVADOC_BANNER = NO - -# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first -# line (until the first dot) of a Qt-style comment as the brief description. If -# set to NO, the Qt-style will behave just like regular Qt-style comments (thus -# requiring an explicit \brief command for a brief description.) -# The default value is: NO. - -QT_AUTOBRIEF = NO - -# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a -# multi-line C++ special comment block (i.e. a block of //! or /// comments) as -# a brief description. This used to be the default behavior. The new default is -# to treat a multi-line C++ comment block as a detailed description. Set this -# tag to YES if you prefer the old behavior instead. -# -# Note that setting this tag to YES also means that rational rose comments are -# not recognized any more. -# The default value is: NO. - -MULTILINE_CPP_IS_BRIEF = NO - -# By default Python docstrings are displayed as preformatted text and doxygen's -# special commands cannot be used. By setting PYTHON_DOCSTRING to NO the -# doxygen's special commands can be used and the contents of the docstring -# documentation blocks is shown as doxygen documentation. -# The default value is: YES. - -PYTHON_DOCSTRING = YES - -# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the -# documentation from any documented member that it re-implements. -# The default value is: YES. - -INHERIT_DOCS = YES - -# If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new -# page for each member. If set to NO, the documentation of a member will be part -# of the file/class/namespace that contains it. -# The default value is: NO. - -SEPARATE_MEMBER_PAGES = NO - -# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen -# uses this value to replace tabs by spaces in code fragments. -# Minimum value: 1, maximum value: 16, default value: 4. - -TAB_SIZE = 4 - -# This tag can be used to specify a number of aliases that act as commands in -# the documentation. An alias has the form: -# name=value -# For example adding -# "sideeffect=@par Side Effects:^^" -# will allow you to put the command \sideeffect (or @sideeffect) in the -# documentation, which will result in a user-defined paragraph with heading -# "Side Effects:". Note that you cannot put \n's in the value part of an alias -# to insert newlines (in the resulting output). You can put ^^ in the value part -# of an alias to insert a newline as if a physical newline was in the original -# file. When you need a literal { or } or , in the value part of an alias you -# have to escape them by means of a backslash (\), this can lead to conflicts -# with the commands \{ and \} for these it is advised to use the version @{ and -# @} or use a double escape (\\{ and \\}) - -# https://breathe.readthedocs.io/en/latest/markups.html#aliases -ALIASES = "rst=^^\verbatim embed:rst:leading-asterisk^^" -ALIASES += "endrst=\endverbatim" - -# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources -# only. Doxygen will then generate output that is more tailored for C. For -# instance, some of the names that are used will be different. The list of all -# members will be omitted, etc. -# The default value is: NO. - -OPTIMIZE_OUTPUT_FOR_C = NO - -# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or -# Python sources only. Doxygen will then generate output that is more tailored -# for that language. For instance, namespaces will be presented as packages, -# qualified scopes will look different, etc. -# The default value is: NO. - -OPTIMIZE_OUTPUT_JAVA = NO - -# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran -# sources. Doxygen will then generate output that is tailored for Fortran. -# The default value is: NO. - -OPTIMIZE_FOR_FORTRAN = NO - -# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL -# sources. Doxygen will then generate output that is tailored for VHDL. -# The default value is: NO. - -OPTIMIZE_OUTPUT_VHDL = NO - -# Set the OPTIMIZE_OUTPUT_SLICE tag to YES if your project consists of Slice -# sources only. Doxygen will then generate output that is more tailored for that -# language. For instance, namespaces will be presented as modules, types will be -# separated into more groups, etc. -# The default value is: NO. - -OPTIMIZE_OUTPUT_SLICE = NO - -# Doxygen selects the parser to use depending on the extension of the files it -# parses. With this tag you can assign which parser to use for a given -# extension. Doxygen has a built-in mapping, but you can override or extend it -# using this tag. The format is ext=language, where ext is a file extension, and -# language is one of the parsers supported by doxygen: IDL, Java, JavaScript, -# Csharp (C#), C, C++, Lex, D, PHP, md (Markdown), Objective-C, Python, Slice, -# VHDL, Fortran (fixed format Fortran: FortranFixed, free formatted Fortran: -# FortranFree, unknown formatted Fortran: Fortran. In the later case the parser -# tries to guess whether the code is fixed or free formatted code, this is the -# default for Fortran type files). For instance to make doxygen treat .inc files -# as Fortran files (default is PHP), and .f files as C (default is Fortran), -# use: inc=Fortran f=C. -# -# Note: For files without extension you can use no_extension as a placeholder. -# -# Note that for custom extensions you also need to set FILE_PATTERNS otherwise -# the files are not read by doxygen. When specifying no_extension you should add -# * to the FILE_PATTERNS. -# -# Note see also the list of default file extension mappings. - -EXTENSION_MAPPING = - -# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments -# according to the Markdown format, which allows for more readable -# documentation. See https://daringfireball.net/projects/markdown/ for details. -# The output of markdown processing is further processed by doxygen, so you can -# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in -# case of backward compatibilities issues. -# The default value is: YES. - -MARKDOWN_SUPPORT = YES - -# When the TOC_INCLUDE_HEADINGS tag is set to a non-zero value, all headings up -# to that level are automatically included in the table of contents, even if -# they do not have an id attribute. -# Note: This feature currently applies only to Markdown headings. -# Minimum value: 0, maximum value: 99, default value: 5. -# This tag requires that the tag MARKDOWN_SUPPORT is set to YES. - -TOC_INCLUDE_HEADINGS = 5 - -# When enabled doxygen tries to link words that correspond to documented -# classes, or namespaces to their corresponding documentation. Such a link can -# be prevented in individual cases by putting a % sign in front of the word or -# globally by setting AUTOLINK_SUPPORT to NO. -# The default value is: YES. - -AUTOLINK_SUPPORT = YES - -# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want -# to include (a tag file for) the STL sources as input, then you should set this -# tag to YES in order to let doxygen match functions declarations and -# definitions whose arguments contain STL classes (e.g. func(std::string); -# versus func(std::string) {}). This also make the inheritance and collaboration -# diagrams that involve STL classes more complete and accurate. -# The default value is: NO. - -BUILTIN_STL_SUPPORT = NO - -# If you use Microsoft's C++/CLI language, you should set this option to YES to -# enable parsing support. -# The default value is: NO. - -CPP_CLI_SUPPORT = NO - -# Set the SIP_SUPPORT tag to YES if your project consists of sip (see: -# https://www.riverbankcomputing.com/software/sip/intro) sources only. Doxygen -# will parse them like normal C++ but will assume all classes use public instead -# of private inheritance when no explicit protection keyword is present. -# The default value is: NO. - -SIP_SUPPORT = NO - -# For Microsoft's IDL there are propget and propput attributes to indicate -# getter and setter methods for a property. Setting this option to YES will make -# doxygen to replace the get and set methods by a property in the documentation. -# This will only work if the methods are indeed getting or setting a simple -# type. If this is not the case, or you want to show the methods anyway, you -# should set this option to NO. -# The default value is: YES. - -IDL_PROPERTY_SUPPORT = YES - -# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC -# tag is set to YES then doxygen will reuse the documentation of the first -# member in the group (if any) for the other members of the group. By default -# all members of a group must be documented explicitly. -# The default value is: NO. - -DISTRIBUTE_GROUP_DOC = NO - -# If one adds a struct or class to a group and this option is enabled, then also -# any nested class or struct is added to the same group. By default this option -# is disabled and one has to add nested compounds explicitly via \ingroup. -# The default value is: NO. - -GROUP_NESTED_COMPOUNDS = NO - -# Set the SUBGROUPING tag to YES to allow class member groups of the same type -# (for instance a group of public functions) to be put as a subgroup of that -# type (e.g. under the Public Functions section). Set it to NO to prevent -# subgrouping. Alternatively, this can be done per class using the -# \nosubgrouping command. -# The default value is: YES. - -SUBGROUPING = YES - -# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions -# are shown inside the group in which they are included (e.g. using \ingroup) -# instead of on a separate page (for HTML and Man pages) or section (for LaTeX -# and RTF). -# -# Note that this feature does not work in combination with -# SEPARATE_MEMBER_PAGES. -# The default value is: NO. - -INLINE_GROUPED_CLASSES = NO - -# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions -# with only public data fields or simple typedef fields will be shown inline in -# the documentation of the scope in which they are defined (i.e. file, -# namespace, or group documentation), provided this scope is documented. If set -# to NO, structs, classes, and unions are shown on a separate page (for HTML and -# Man pages) or section (for LaTeX and RTF). -# The default value is: NO. - -INLINE_SIMPLE_STRUCTS = NO - -# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or -# enum is documented as struct, union, or enum with the name of the typedef. So -# typedef struct TypeS {} TypeT, will appear in the documentation as a struct -# with name TypeT. When disabled the typedef will appear as a member of a file, -# namespace, or class. And the struct will be named TypeS. This can typically be -# useful for C code in case the coding convention dictates that all compound -# types are typedef'ed and only the typedef is referenced, never the tag name. -# The default value is: NO. - -TYPEDEF_HIDES_STRUCT = NO - -# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This -# cache is used to resolve symbols given their name and scope. Since this can be -# an expensive process and often the same symbol appears multiple times in the -# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small -# doxygen will become slower. If the cache is too large, memory is wasted. The -# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range -# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536 -# symbols. At the end of a run doxygen will report the cache usage and suggest -# the optimal cache size from a speed point of view. -# Minimum value: 0, maximum value: 9, default value: 0. - -LOOKUP_CACHE_SIZE = 0 - -# The NUM_PROC_THREADS specifies the number of threads doxygen is allowed to use -# during processing. When set to 0 doxygen will based this on the number of -# cores available in the system. You can set it explicitly to a value larger -# than 0 to get more control over the balance between CPU load and processing -# speed. At this moment only the input processing can be done using multiple -# threads. Since this is still an experimental feature the default is set to 1, -# which effectively disables parallel processing. Please report any issues you -# encounter. Generating dot graphs in parallel is controlled by the -# DOT_NUM_THREADS setting. -# Minimum value: 0, maximum value: 32, default value: 1. - -NUM_PROC_THREADS = 0 - -#--------------------------------------------------------------------------- -# Build related configuration options -#--------------------------------------------------------------------------- - -# If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in -# documentation are documented, even if no documentation was available. Private -# class members and static file members will be hidden unless the -# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES. -# Note: This will also disable the warnings about undocumented members that are -# normally produced when WARNINGS is set to YES. -# The default value is: NO. - -EXTRACT_ALL = NO - -# If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will -# be included in the documentation. -# The default value is: NO. - -EXTRACT_PRIVATE = NO - -# If the EXTRACT_PRIV_VIRTUAL tag is set to YES, documented private virtual -# methods of a class will be included in the documentation. -# The default value is: NO. - -EXTRACT_PRIV_VIRTUAL = NO - -# If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal -# scope will be included in the documentation. -# The default value is: NO. - -EXTRACT_PACKAGE = NO - -# If the EXTRACT_STATIC tag is set to YES, all static members of a file will be -# included in the documentation. -# The default value is: NO. - -EXTRACT_STATIC = NO - -# If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined -# locally in source files will be included in the documentation. If set to NO, -# only classes defined in header files are included. Does not have any effect -# for Java sources. -# The default value is: YES. - -EXTRACT_LOCAL_CLASSES = YES - -# This flag is only useful for Objective-C code. If set to YES, local methods, -# which are defined in the implementation section but not in the interface are -# included in the documentation. If set to NO, only methods in the interface are -# included. -# The default value is: NO. - -EXTRACT_LOCAL_METHODS = NO - -# If this flag is set to YES, the members of anonymous namespaces will be -# extracted and appear in the documentation as a namespace called -# 'anonymous_namespace{file}', where file will be replaced with the base name of -# the file that contains the anonymous namespace. By default anonymous namespace -# are hidden. -# The default value is: NO. - -EXTRACT_ANON_NSPACES = NO - -# If this flag is set to YES, the name of an unnamed parameter in a declaration -# will be determined by the corresponding definition. By default unnamed -# parameters remain unnamed in the output. -# The default value is: YES. - -RESOLVE_UNNAMED_PARAMS = YES - -# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all -# undocumented members inside documented classes or files. If set to NO these -# members will be included in the various overviews, but no documentation -# section is generated. This option has no effect if EXTRACT_ALL is enabled. -# The default value is: NO. - -HIDE_UNDOC_MEMBERS = NO - -# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all -# undocumented classes that are normally visible in the class hierarchy. If set -# to NO, these classes will be included in the various overviews. This option -# will also hide undocumented C++ concepts if enabled. This option has no effect -# if EXTRACT_ALL is enabled. -# The default value is: NO. - -HIDE_UNDOC_CLASSES = NO - -# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend -# declarations. If set to NO, these declarations will be included in the -# documentation. -# The default value is: NO. - -HIDE_FRIEND_COMPOUNDS = NO - -# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any -# documentation blocks found inside the body of a function. If set to NO, these -# blocks will be appended to the function's detailed documentation block. -# The default value is: NO. - -HIDE_IN_BODY_DOCS = NO - -# The INTERNAL_DOCS tag determines if documentation that is typed after a -# \internal command is included. If the tag is set to NO then the documentation -# will be excluded. Set it to YES to include the internal documentation. -# The default value is: NO. - -INTERNAL_DOCS = NO - -# With the correct setting of option CASE_SENSE_NAMES doxygen will better be -# able to match the capabilities of the underlying filesystem. In case the -# filesystem is case sensitive (i.e. it supports files in the same directory -# whose names only differ in casing), the option must be set to YES to properly -# deal with such files in case they appear in the input. For filesystems that -# are not case sensitive the option should be set to NO to properly deal with -# output files written for symbols that only differ in casing, such as for two -# classes, one named CLASS and the other named Class, and to also support -# references to files without having to specify the exact matching casing. On -# Windows (including Cygwin) and MacOS, users should typically set this option -# to NO, whereas on Linux or other Unix flavors it should typically be set to -# YES. -# Possible values are: SYSTEM, NO and YES. -# The default value is: SYSTEM. - -CASE_SENSE_NAMES = SYSTEM - -# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with -# their full class and namespace scopes in the documentation. If set to YES, the -# scope will be hidden. -# The default value is: NO. - -HIDE_SCOPE_NAMES = NO - -# If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will -# append additional text to a page's title, such as Class Reference. If set to -# YES the compound reference will be hidden. -# The default value is: NO. - -HIDE_COMPOUND_REFERENCE= NO - -# If the SHOW_HEADERFILE tag is set to YES then the documentation for a class -# will show which file needs to be included to use the class. -# The default value is: YES. - -SHOW_HEADERFILE = YES - -# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of -# the files that are included by a file in the documentation of that file. -# The default value is: YES. - -SHOW_INCLUDE_FILES = YES - -# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each -# grouped member an include statement to the documentation, telling the reader -# which file to include in order to use the member. -# The default value is: NO. - -SHOW_GROUPED_MEMB_INC = NO - -# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include -# files with double quotes in the documentation rather than with sharp brackets. -# The default value is: NO. - -FORCE_LOCAL_INCLUDES = NO - -# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the -# documentation for inline members. -# The default value is: YES. - -INLINE_INFO = YES - -# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the -# (detailed) documentation of file and class members alphabetically by member -# name. If set to NO, the members will appear in declaration order. -# The default value is: YES. - -SORT_MEMBER_DOCS = YES - -# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief -# descriptions of file, namespace and class members alphabetically by member -# name. If set to NO, the members will appear in declaration order. Note that -# this will also influence the order of the classes in the class list. -# The default value is: NO. - -SORT_BRIEF_DOCS = YES - -# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the -# (brief and detailed) documentation of class members so that constructors and -# destructors are listed first. If set to NO the constructors will appear in the -# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS. -# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief -# member documentation. -# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting -# detailed member documentation. -# The default value is: NO. - -SORT_MEMBERS_CTORS_1ST = NO - -# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy -# of group names into alphabetical order. If set to NO the group names will -# appear in their defined order. -# The default value is: NO. - -SORT_GROUP_NAMES = NO - -# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by -# fully-qualified names, including namespaces. If set to NO, the class list will -# be sorted only by class name, not including the namespace part. -# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. -# Note: This option applies only to the class list, not to the alphabetical -# list. -# The default value is: NO. - -SORT_BY_SCOPE_NAME = NO - -# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper -# type resolution of all parameters of a function it will reject a match between -# the prototype and the implementation of a member function even if there is -# only one candidate or it is obvious which candidate to choose by doing a -# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still -# accept a match between prototype and implementation in such cases. -# The default value is: NO. - -STRICT_PROTO_MATCHING = NO - -# The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo -# list. This list is created by putting \todo commands in the documentation. -# The default value is: YES. - -GENERATE_TODOLIST = YES - -# The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test -# list. This list is created by putting \test commands in the documentation. -# The default value is: YES. - -GENERATE_TESTLIST = YES - -# The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug -# list. This list is created by putting \bug commands in the documentation. -# The default value is: YES. - -GENERATE_BUGLIST = YES - -# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO) -# the deprecated list. This list is created by putting \deprecated commands in -# the documentation. -# The default value is: YES. - -GENERATE_DEPRECATEDLIST= YES - -# The ENABLED_SECTIONS tag can be used to enable conditional documentation -# sections, marked by \if ... \endif and \cond -# ... \endcond blocks. - -ENABLED_SECTIONS = - -# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the -# initial value of a variable or macro / define can have for it to appear in the -# documentation. If the initializer consists of more lines than specified here -# it will be hidden. Use a value of 0 to hide initializers completely. The -# appearance of the value of individual variables and macros / defines can be -# controlled using \showinitializer or \hideinitializer command in the -# documentation regardless of this setting. -# Minimum value: 0, maximum value: 10000, default value: 30. - -MAX_INITIALIZER_LINES = 30 - -# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at -# the bottom of the documentation of classes and structs. If set to YES, the -# list will mention the files that were used to generate the documentation. -# The default value is: YES. - -SHOW_USED_FILES = YES - -# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This -# will remove the Files entry from the Quick Index and from the Folder Tree View -# (if specified). -# The default value is: YES. - -SHOW_FILES = YES - -# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces -# page. This will remove the Namespaces entry from the Quick Index and from the -# Folder Tree View (if specified). -# The default value is: YES. - -SHOW_NAMESPACES = YES - -# The FILE_VERSION_FILTER tag can be used to specify a program or script that -# doxygen should invoke to get the current version for each file (typically from -# the version control system). Doxygen will invoke the program by executing (via -# popen()) the command command input-file, where command is the value of the -# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided -# by doxygen. Whatever the program writes to standard output is used as the file -# version. For an example see the documentation. - -FILE_VERSION_FILTER = - -# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed -# by doxygen. The layout file controls the global structure of the generated -# output files in an output format independent way. To create the layout file -# that represents doxygen's defaults, run doxygen with the -l option. You can -# optionally specify a file name after the option, if omitted DoxygenLayout.xml -# will be used as the name of the layout file. See also section "Changing the -# layout of pages" for information. -# -# Note that if you run doxygen from a directory containing a file called -# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE -# tag is left empty. - -LAYOUT_FILE = - -# The CITE_BIB_FILES tag can be used to specify one or more bib files containing -# the reference definitions. This must be a list of .bib files. The .bib -# extension is automatically appended if omitted. This requires the bibtex tool -# to be installed. See also https://en.wikipedia.org/wiki/BibTeX for more info. -# For LaTeX the style of the bibliography can be controlled using -# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the -# search path. See also \cite for info how to create references. - -CITE_BIB_FILES = - -#--------------------------------------------------------------------------- -# Configuration options related to warning and progress messages -#--------------------------------------------------------------------------- - -# The QUIET tag can be used to turn on/off the messages that are generated to -# standard output by doxygen. If QUIET is set to YES this implies that the -# messages are off. -# The default value is: NO. - -QUIET = NO - -# The WARNINGS tag can be used to turn on/off the warning messages that are -# generated to standard error (stderr) by doxygen. If WARNINGS is set to YES -# this implies that the warnings are on. -# -# Tip: Turn warnings on while writing the documentation. -# The default value is: YES. - -WARNINGS = YES - -# If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate -# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag -# will automatically be disabled. -# The default value is: YES. - -WARN_IF_UNDOCUMENTED = YES - -# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for -# potential errors in the documentation, such as documenting some parameters in -# a documented function twice, or documenting parameters that don't exist or -# using markup commands wrongly. -# The default value is: YES. - -WARN_IF_DOC_ERROR = YES - -# If WARN_IF_INCOMPLETE_DOC is set to YES, doxygen will warn about incomplete -# function parameter documentation. If set to NO, doxygen will accept that some -# parameters have no documentation without warning. -# The default value is: YES. - +# must be first +DOXYFILE_ENCODING = UTF-8 + +ALIASES = "" +ALIASES += "examples=^^**Examples**^^@code{.cpp}" +ALIASES += "examples_end=@endcode^^" +ALIASES += "rst=^^\verbatim embed:rst:leading-asterisk^^" +ALIASES += "rst_end=\endverbatim" + +CASE_SENSE_NAMES = YES +DISABLE_INDEX = NO +DOCBOOK_OUTPUT = doxydocbook +DOCSET_BUNDLE_ID = dev.lizardbyte.Sunshine +DOCSET_PUBLISHER_ID = dev.lizardbyte.Sunshine.documentation +DOCSET_PUBLISHER_NAME = LizardByte +DOT_GRAPH_MAX_NODES = 60 +DOT_IMAGE_FORMAT = svg + +# TODO: On Windows, Doxygen hangs when creating dot graphs if this is set to 0 +DOT_NUM_THREADS = 1 + +EXTRACT_ALL = NO +FULL_SIDEBAR = NO +GENERATE_HTML = YES +GENERATE_LATEX = NO +GENERATE_TREEVIEW = YES + +# TODO: Sphinx/Breathe does not support Objective-C right now, so disable XML +# https://github.com/breathe-doc/breathe/issues/129 +GENERATE_XML = NO + +HAVE_DOT = YES +HTML_COLORSTYLE = LIGHT # required with Doxygen >= 1.9.5 +HTML_COPY_CLIPBOARD = NO # required for Doxygen >= 1.10.0 +HTML_EXTRA_FILES = ../third-party/doxygen-awesome-css/doxygen-awesome-darkmode-toggle.js +HTML_EXTRA_FILES += ../third-party/doxygen-awesome-css/doxygen-awesome-fragment-copy-button.js +HTML_EXTRA_FILES += ../third-party/doxygen-awesome-css/doxygen-awesome-paragraph-link.js +HTML_EXTRA_FILES += ../third-party/doxygen-awesome-css/doxygen-awesome-interactive-toc.js +HTML_EXTRA_STYLESHEET = ../third-party/doxygen-awesome-css/doxygen-awesome.css +HTML_HEADER = doxygen/header.html +HTML_OUTPUT = doxyhtml +INCLUDE_PATH = ../third-party/build-deps/ffmpeg/Linux-x86_64/include/ +INPUT = ../src +INTERACTIVE_SVG = YES +LATEX_OUTPUT = doxylatex +MACRO_EXPANSION = YES +MAN_OUTPUT = doxyman +NUM_PROC_THREADS = 1 +PREDEFINED = DOXYGEN +PREDEFINED += __APPLE__ +PREDEFINED += linux +PREDEFINED += __linux +PREDEFINED += __linux__ +PREDEFINED += __MACH__ +PREDEFINED += _WIN32 +PREDEFINED += SUNSHINE_BUILD_WAYLAND +PREDEFINED += SUNSHINE_TRAY=1 +PROJECT_BRIEF = "Self-hosted game stream host for Moonlight." +PROJECT_ICON = ../sunshine.ico +PROJECT_LOGO = ../sunshine.png +PROJECT_NAME = Sunshine +OUTPUT_DIRECTORY = build/doxygen +RECURSIVE = YES +RTF_OUTPUT = doxyrtf +SORT_BRIEF_DOCS = YES +STRIP_FROM_INC_PATH = ../ +STRIP_FROM_PATH = ../ +WARN_AS_ERROR = FAIL_ON_WARNINGS + +# TODO: Enable this when we have complete documentation +WARN_IF_UNDOCUMENTED = NO + +WARN_IF_DOC_ERROR = YES WARN_IF_INCOMPLETE_DOC = YES +WARN_IF_UNDOC_ENUM_VAL = YES +WARN_NO_PARAMDOC = YES +WARNINGS = YES -# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that -# are documented, but have no documentation for their parameters or return -# value. If set to NO, doxygen will only warn about wrong parameter -# documentation, but not about the absence of documentation. If EXTRACT_ALL is -# set to YES then this flag will automatically be disabled. See also -# WARN_IF_INCOMPLETE_DOC -# The default value is: NO. - -WARN_NO_PARAMDOC = NO - -# If WARN_IF_UNDOC_ENUM_VAL option is set to YES, doxygen will warn about -# undocumented enumeration values. If set to NO, doxygen will accept -# undocumented enumeration values. If EXTRACT_ALL is set to YES then this flag -# will automatically be disabled. -# The default value is: NO. - -WARN_IF_UNDOC_ENUM_VAL = NO - -# If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when -# a warning is encountered. If the WARN_AS_ERROR tag is set to FAIL_ON_WARNINGS -# then doxygen will continue running as if WARN_AS_ERROR tag is set to NO, but -# at the end of the doxygen process doxygen will return with a non-zero status. -# Possible values are: NO, YES and FAIL_ON_WARNINGS. -# The default value is: NO. - -WARN_AS_ERROR = NO -# todo - ideally this will eventually become FAIL_ON_WARNINGS - -# The WARN_FORMAT tag determines the format of the warning messages that doxygen -# can produce. The string should contain the $file, $line, and $text tags, which -# will be replaced by the file and line number from which the warning originated -# and the warning text. Optionally the format may contain $version, which will -# be replaced by the version of the file (if it could be obtained via -# FILE_VERSION_FILTER) -# See also: WARN_LINE_FORMAT -# The default value is: $file:$line: $text. - -WARN_FORMAT = "$file:$line: $text" - -# In the $text part of the WARN_FORMAT command it is possible that a reference -# to a more specific place is given. To make it easier to jump to this place -# (outside of doxygen) the user can define a custom "cut" / "paste" string. -# Example: -# WARN_LINE_FORMAT = "'vi $file +$line'" -# See also: WARN_FORMAT -# The default value is: at line $line of file $file. - -WARN_LINE_FORMAT = "at line $line of file $file" - -# The WARN_LOGFILE tag can be used to specify a file to which warning and error -# messages should be written. If left blank the output is written to standard -# error (stderr). In case the file specified cannot be opened for writing the -# warning and error messages are written to standard error. When as file - is -# specified the warning and error messages are written to standard output -# (stdout). - -WARN_LOGFILE = - -#--------------------------------------------------------------------------- -# Configuration options related to the input files -#--------------------------------------------------------------------------- - -# The INPUT tag is used to specify the files and/or directories that contain -# documented source files. You may enter file names like myfile.cpp or -# directories like /usr/src/myproject. Separate the files or directories with -# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING -# Note: If this tag is empty the current directory is searched. - -INPUT = ../src - -# This tag can be used to specify the character encoding of the source files -# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses -# libiconv (or the iconv built into libc) for the transcoding. See the libiconv -# documentation (see: -# https://www.gnu.org/software/libiconv/) for the list of possible encodings. -# See also: INPUT_FILE_ENCODING -# The default value is: UTF-8. - -INPUT_ENCODING = UTF-8 - -# This tag can be used to specify the character encoding of the source files -# that doxygen parses The INPUT_FILE_ENCODING tag can be used to specify -# character encoding on a per file pattern basis. Doxygen will compare the file -# name with each pattern and apply the encoding instead of the default -# INPUT_ENCODING) if there is a match. The character encodings are a list of the -# form: pattern=encoding (like *.php=ISO-8859-1). See cfg_input_encoding -# "INPUT_ENCODING" for further information on supported encodings. - -INPUT_FILE_ENCODING = - -# If the value of the INPUT tag contains directories, you can use the -# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and -# *.h) to filter out the source-files in the directories. -# -# Note that for custom extensions or not directly supported extensions you also -# need to set EXTENSION_MAPPING for the extension otherwise the files are not -# read by doxygen. -# -# Note the list of default checked file patterns might differ from the list of -# default file extension mappings. -# -# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp, -# *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, -# *.hh, *.hxx, *.hpp, *.h++, *.l, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, -# *.inc, *.m, *.markdown, *.md, *.mm, *.dox (to be provided as doxygen C -# comment), *.py, *.pyw, *.f90, *.f95, *.f03, *.f08, *.f18, *.f, *.for, *.vhd, -# *.vhdl, *.ucf, *.qsf and *.ice. - -FILE_PATTERNS = *.c \ - *.cc \ - *.cxx \ - *.cpp \ - *.c++ \ - *.java \ - *.ii \ - *.ixx \ - *.ipp \ - *.i++ \ - *.inl \ - *.idl \ - *.ddl \ - *.odl \ - *.h \ - *.hh \ - *.hxx \ - *.hpp \ - *.h++ \ - *.l \ - *.cs \ - *.d \ - *.php \ - *.php4 \ - *.php5 \ - *.phtml \ - *.inc \ - *.m \ - *.markdown \ - *.md \ - *.mm \ - *.dox \ - *.py \ - *.pyw \ - *.f90 \ - *.f95 \ - *.f03 \ - *.f08 \ - *.f18 \ - *.f \ - *.for \ - *.vhd \ - *.vhdl \ - *.ucf \ - *.qsf \ - *.ice - -# The RECURSIVE tag can be used to specify whether or not subdirectories should -# be searched for input files as well. -# The default value is: NO. - -RECURSIVE = YES - -# The EXCLUDE tag can be used to specify files and/or directories that should be -# excluded from the INPUT source files. This way you can easily exclude a -# subdirectory from a directory tree whose root is specified with the INPUT tag. -# -# Note that relative paths are relative to the directory from which doxygen is -# run. - -EXCLUDE = - -# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or -# directories that are symbolic links (a Unix file system feature) are excluded -# from the input. -# The default value is: NO. - -EXCLUDE_SYMLINKS = NO - -# If the value of the INPUT tag contains directories, you can use the -# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude -# certain files from those directories. -# -# Note that the wildcards are matched against the file with absolute path, so to -# exclude all test directories for example use the pattern */test/* - -EXCLUDE_PATTERNS = - -# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names -# (namespaces, classes, functions, etc.) that should be excluded from the -# output. The symbol name can be a fully qualified name, a word, or if the -# wildcard * is used, a substring. Examples: ANamespace, AClass, -# ANamespace::AClass, ANamespace::*Test -# -# Note that the wildcards are matched against the file with absolute path, so to -# exclude all test directories use the pattern */test/* - -EXCLUDE_SYMBOLS = - -# The EXAMPLE_PATH tag can be used to specify one or more files or directories -# that contain example code fragments that are included (see the \include -# command). - -EXAMPLE_PATH = - -# If the value of the EXAMPLE_PATH tag contains directories, you can use the -# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and -# *.h) to filter out the source-files in the directories. If left blank all -# files are included. - -EXAMPLE_PATTERNS = * - -# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be -# searched for input files to be used with the \include or \dontinclude commands -# irrespective of the value of the RECURSIVE tag. -# The default value is: NO. - -EXAMPLE_RECURSIVE = NO - -# The IMAGE_PATH tag can be used to specify one or more files or directories -# that contain images that are to be included in the documentation (see the -# \image command). - -IMAGE_PATH = - -# The INPUT_FILTER tag can be used to specify a program that doxygen should -# invoke to filter for each input file. Doxygen will invoke the filter program -# by executing (via popen()) the command: -# -# -# -# where is the value of the INPUT_FILTER tag, and is the -# name of an input file. Doxygen will then use the output that the filter -# program writes to standard output. If FILTER_PATTERNS is specified, this tag -# will be ignored. -# -# Note that the filter must not add or remove lines; it is applied before the -# code is scanned, but not when the output code is generated. If lines are added -# or removed, the anchors will not be placed correctly. -# -# Note that doxygen will use the data processed and written to standard output -# for further processing, therefore nothing else, like debug statements or used -# commands (so in case of a Windows batch file always use @echo OFF), should be -# written to standard output. -# -# Note that for custom extensions or not directly supported extensions you also -# need to set EXTENSION_MAPPING for the extension otherwise the files are not -# properly processed by doxygen. - -INPUT_FILTER = - -# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern -# basis. Doxygen will compare the file name with each pattern and apply the -# filter if there is a match. The filters are a list of the form: pattern=filter -# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how -# filters are used. If the FILTER_PATTERNS tag is empty or if none of the -# patterns match the file name, INPUT_FILTER is applied. -# -# Note that for custom extensions or not directly supported extensions you also -# need to set EXTENSION_MAPPING for the extension otherwise the files are not -# properly processed by doxygen. - -FILTER_PATTERNS = - -# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using -# INPUT_FILTER) will also be used to filter the input files that are used for -# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES). -# The default value is: NO. - -FILTER_SOURCE_FILES = NO - -# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file -# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and -# it is also possible to disable source filtering for a specific pattern using -# *.ext= (so without naming a filter). -# This tag requires that the tag FILTER_SOURCE_FILES is set to YES. - -FILTER_SOURCE_PATTERNS = - -# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that -# is part of the input, its contents will be placed on the main page -# (index.html). This can be useful if you have a project on for instance GitHub -# and want to reuse the introduction page also for the doxygen output. - -USE_MDFILE_AS_MAINPAGE = - -# The Fortran standard specifies that for fixed formatted Fortran code all -# characters from position 72 are to be considered as comment. A common -# extension is to allow longer lines before the automatic comment starts. The -# setting FORTRAN_COMMENT_AFTER will also make it possible that longer lines can -# be processed before the automatic comment starts. -# Minimum value: 7, maximum value: 10000, default value: 72. - -FORTRAN_COMMENT_AFTER = 72 - -#--------------------------------------------------------------------------- -# Configuration options related to source browsing -#--------------------------------------------------------------------------- - -# If the SOURCE_BROWSER tag is set to YES then a list of source files will be -# generated. Documented entities will be cross-referenced with these sources. -# -# Note: To get rid of all source code in the generated output, make sure that -# also VERBATIM_HEADERS is set to NO. -# The default value is: NO. - -SOURCE_BROWSER = NO - -# Setting the INLINE_SOURCES tag to YES will include the body of functions, -# classes and enums directly into the documentation. -# The default value is: NO. - -INLINE_SOURCES = NO - -# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any -# special comment blocks from generated source code fragments. Normal C, C++ and -# Fortran comments will always remain visible. -# The default value is: YES. - -STRIP_CODE_COMMENTS = YES - -# If the REFERENCED_BY_RELATION tag is set to YES then for each documented -# entity all documented functions referencing it will be listed. -# The default value is: NO. - -REFERENCED_BY_RELATION = NO - -# If the REFERENCES_RELATION tag is set to YES then for each documented function -# all documented entities called/used by that function will be listed. -# The default value is: NO. - -REFERENCES_RELATION = NO - -# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set -# to YES then the hyperlinks from functions in REFERENCES_RELATION and -# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will -# link to the documentation. -# The default value is: YES. - -REFERENCES_LINK_SOURCE = YES - -# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the -# source code will show a tooltip with additional information such as prototype, -# brief description and links to the definition and documentation. Since this -# will make the HTML file larger and loading of large files a bit slower, you -# can opt to disable this feature. -# The default value is: YES. -# This tag requires that the tag SOURCE_BROWSER is set to YES. - -SOURCE_TOOLTIPS = YES - -# If the USE_HTAGS tag is set to YES then the references to source code will -# point to the HTML generated by the htags(1) tool instead of doxygen built-in -# source browser. The htags tool is part of GNU's global source tagging system -# (see https://www.gnu.org/software/global/global.html). You will need version -# 4.8.6 or higher. -# -# To use it do the following: -# - Install the latest version of global -# - Enable SOURCE_BROWSER and USE_HTAGS in the configuration file -# - Make sure the INPUT points to the root of the source tree -# - Run doxygen as normal -# -# Doxygen will invoke htags (and that will in turn invoke gtags), so these -# tools must be available from the command line (i.e. in the search path). -# -# The result: instead of the source browser generated by doxygen, the links to -# source code will now point to the output of htags. -# The default value is: NO. -# This tag requires that the tag SOURCE_BROWSER is set to YES. - -USE_HTAGS = NO - -# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a -# verbatim copy of the header file for each class for which an include is -# specified. Set to NO to disable this. -# See also: Section \class. -# The default value is: YES. - -VERBATIM_HEADERS = YES - -# If the CLANG_ASSISTED_PARSING tag is set to YES then doxygen will use the -# clang parser (see: -# http://clang.llvm.org/) for more accurate parsing at the cost of reduced -# performance. This can be particularly helpful with template rich C++ code for -# which doxygen's built-in parser lacks the necessary type information. -# Note: The availability of this option depends on whether or not doxygen was -# generated with the -Duse_libclang=ON option for CMake. -# The default value is: NO. - -CLANG_ASSISTED_PARSING = NO - -# If the CLANG_ASSISTED_PARSING tag is set to YES and the CLANG_ADD_INC_PATHS -# tag is set to YES then doxygen will add the directory of each input to the -# include path. -# The default value is: YES. -# This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES. - -CLANG_ADD_INC_PATHS = YES - -# If clang assisted parsing is enabled you can provide the compiler with command -# line options that you would normally use when invoking the compiler. Note that -# the include paths will already be set by doxygen for the files and directories -# specified with INPUT and INCLUDE_PATH. -# This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES. - -CLANG_OPTIONS = - -# If clang assisted parsing is enabled you can provide the clang parser with the -# path to the directory containing a file called compile_commands.json. This -# file is the compilation database (see: -# http://clang.llvm.org/docs/HowToSetupToolingForLLVM.html) containing the -# options used when the source files were built. This is equivalent to -# specifying the -p option to a clang tool, such as clang-check. These options -# will then be passed to the parser. Any options specified with CLANG_OPTIONS -# will be added as well. -# Note: The availability of this option depends on whether or not doxygen was -# generated with the -Duse_libclang=ON option for CMake. - -CLANG_DATABASE_PATH = - -#--------------------------------------------------------------------------- -# Configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- - -# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all -# compounds will be generated. Enable this if the project contains a lot of -# classes, structs, unions or interfaces. -# The default value is: YES. - -ALPHABETICAL_INDEX = YES - -# The IGNORE_PREFIX tag can be used to specify a prefix (or a list of prefixes) -# that should be ignored while generating the index headers. The IGNORE_PREFIX -# tag works for classes, function and member names. The entity will be placed in -# the alphabetical list under the first letter of the entity name that remains -# after removing the prefix. -# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. - -IGNORE_PREFIX = - -#--------------------------------------------------------------------------- -# Configuration options related to the HTML output -#--------------------------------------------------------------------------- - -# If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output -# The default value is: YES. - -GENERATE_HTML = NO - -# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a -# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of -# it. -# The default directory is: html. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_OUTPUT = doxyhtml - -# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each -# generated HTML page (for example: .htm, .php, .asp). -# The default value is: .html. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_FILE_EXTENSION = .html - -# The HTML_HEADER tag can be used to specify a user-defined HTML header file for -# each generated HTML page. If the tag is left blank doxygen will generate a -# standard header. -# -# To get valid HTML the header file that includes any scripts and style sheets -# that doxygen needs, which is dependent on the configuration options used (e.g. -# the setting GENERATE_TREEVIEW). It is highly recommended to start with a -# default header using -# doxygen -w html new_header.html new_footer.html new_stylesheet.css -# YourConfigFile -# and then modify the file new_header.html. See also section "Doxygen usage" -# for information on how to generate the default header that doxygen normally -# uses. -# Note: The header is subject to change so you typically have to regenerate the -# default header when upgrading to a newer version of doxygen. For a description -# of the possible markers and block names see the documentation. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_HEADER = - -# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each -# generated HTML page. If the tag is left blank doxygen will generate a standard -# footer. See HTML_HEADER for more information on how to generate a default -# footer and what special commands can be used inside the footer. See also -# section "Doxygen usage" for information on how to generate the default footer -# that doxygen normally uses. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_FOOTER = - -# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style -# sheet that is used by each HTML page. It can be used to fine-tune the look of -# the HTML output. If left blank doxygen will generate a default style sheet. -# See also section "Doxygen usage" for information on how to generate the style -# sheet that doxygen normally uses. -# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as -# it is more robust and this tag (HTML_STYLESHEET) will in the future become -# obsolete. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_STYLESHEET = - -# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined -# cascading style sheets that are included after the standard style sheets -# created by doxygen. Using this option one can overrule certain style aspects. -# This is preferred over using HTML_STYLESHEET since it does not replace the -# standard style sheet and is therefore more robust against future updates. -# Doxygen will copy the style sheet files to the output directory. -# Note: The order of the extra style sheet files is of importance (e.g. the last -# style sheet in the list overrules the setting of the previous ones in the -# list). -# Note: Since the styling of scrollbars can currently not be overruled in -# Webkit/Chromium, the styling will be left out of the default doxygen.css if -# one or more extra stylesheets have been specified. So if scrollbar -# customization is desired it has to be added explicitly. For an example see the -# documentation. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_EXTRA_STYLESHEET = - -# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or -# other source files which should be copied to the HTML output directory. Note -# that these files will be copied to the base HTML output directory. Use the -# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these -# files. In the HTML_STYLESHEET file, use the file name only. Also note that the -# files will be copied as-is; there are no commands or markers available. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_EXTRA_FILES = - -# The HTML_COLORSTYLE tag can be used to specify if the generated HTML output -# should be rendered with a dark or light theme. -# Possible values are: LIGHT always generate light mode output, DARK always -# generate dark mode output, AUTO_LIGHT automatically set the mode according to -# the user preference, use light mode if no preference is set (the default), -# AUTO_DARK automatically set the mode according to the user preference, use -# dark mode if no preference is set and TOGGLE allow to user to switch between -# light and dark mode via a button. -# The default value is: AUTO_LIGHT. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_COLORSTYLE = AUTO_LIGHT - -# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen -# will adjust the colors in the style sheet and background images according to -# this color. Hue is specified as an angle on a color-wheel, see -# https://en.wikipedia.org/wiki/Hue for more information. For instance the value -# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 -# purple, and 360 is red again. -# Minimum value: 0, maximum value: 359, default value: 220. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_COLORSTYLE_HUE = 220 - -# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors -# in the HTML output. For a value of 0 the output will use gray-scales only. A -# value of 255 will produce the most vivid colors. -# Minimum value: 0, maximum value: 255, default value: 100. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_COLORSTYLE_SAT = 100 - -# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the -# luminance component of the colors in the HTML output. Values below 100 -# gradually make the output lighter, whereas values above 100 make the output -# darker. The value divided by 100 is the actual gamma applied, so 80 represents -# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not -# change the gamma. -# Minimum value: 40, maximum value: 240, default value: 80. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_COLORSTYLE_GAMMA = 80 - -# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML -# page will contain the date and time when the page was generated. Setting this -# to YES can help to show when doxygen was last run and thus if the -# documentation is up to date. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_TIMESTAMP = NO - -# If the HTML_DYNAMIC_MENUS tag is set to YES then the generated HTML -# documentation will contain a main index with vertical navigation menus that -# are dynamically created via JavaScript. If disabled, the navigation index will -# consists of multiple levels of tabs that are statically embedded in every HTML -# page. Disable this option to support browsers that do not have JavaScript, -# like the Qt help browser. -# The default value is: YES. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_DYNAMIC_MENUS = YES - -# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML -# documentation will contain sections that can be hidden and shown after the -# page has loaded. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_DYNAMIC_SECTIONS = NO - -# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries -# shown in the various tree structured indices initially; the user can expand -# and collapse entries dynamically later on. Doxygen will expand the tree to -# such a level that at most the specified number of entries are visible (unless -# a fully collapsed tree already exceeds this amount). So setting the number of -# entries 1 will produce a full collapsed tree by default. 0 is a special value -# representing an infinite number of entries and will result in a full expanded -# tree by default. -# Minimum value: 0, maximum value: 9999, default value: 100. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_INDEX_NUM_ENTRIES = 100 - -# If the GENERATE_DOCSET tag is set to YES, additional index files will be -# generated that can be used as input for Apple's Xcode 3 integrated development -# environment (see: -# https://developer.apple.com/xcode/), introduced with OSX 10.5 (Leopard). To -# create a documentation set, doxygen will generate a Makefile in the HTML -# output directory. Running make will produce the docset in that directory and -# running make install will install the docset in -# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at -# startup. See https://developer.apple.com/library/archive/featuredarticles/Doxy -# genXcode/_index.html for more information. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -GENERATE_DOCSET = NO - -# This tag determines the name of the docset feed. A documentation feed provides -# an umbrella under which multiple documentation sets from a single provider -# (such as a company or product suite) can be grouped. -# The default value is: Doxygen generated docs. -# This tag requires that the tag GENERATE_DOCSET is set to YES. - -DOCSET_FEEDNAME = "Doxygen generated docs" - -# This tag determines the URL of the docset feed. A documentation feed provides -# an umbrella under which multiple documentation sets from a single provider -# (such as a company or product suite) can be grouped. -# This tag requires that the tag GENERATE_DOCSET is set to YES. - -DOCSET_FEEDURL = - -# This tag specifies a string that should uniquely identify the documentation -# set bundle. This should be a reverse domain-name style string, e.g. -# com.mycompany.MyDocSet. Doxygen will append .docset to the name. -# The default value is: org.doxygen.Project. -# This tag requires that the tag GENERATE_DOCSET is set to YES. - -DOCSET_BUNDLE_ID = org.doxygen.Project - -# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify -# the documentation publisher. This should be a reverse domain-name style -# string, e.g. com.mycompany.MyDocSet.documentation. -# The default value is: org.doxygen.Publisher. -# This tag requires that the tag GENERATE_DOCSET is set to YES. - -DOCSET_PUBLISHER_ID = org.doxygen.Publisher - -# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher. -# The default value is: Publisher. -# This tag requires that the tag GENERATE_DOCSET is set to YES. - -DOCSET_PUBLISHER_NAME = Publisher - -# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three -# additional HTML index files: index.hhp, index.hhc, and index.hhk. The -# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop -# on Windows. In the beginning of 2021 Microsoft took the original page, with -# a.o. the download links, offline the HTML help workshop was already many years -# in maintenance mode). You can download the HTML help workshop from the web -# archives at Installation executable (see: -# http://web.archive.org/web/20160201063255/http://download.microsoft.com/downlo -# ad/0/A/9/0A939EF6-E31C-430F-A3DF-DFAE7960D564/htmlhelp.exe). -# -# The HTML Help Workshop contains a compiler that can convert all HTML output -# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML -# files are now used as the Windows 98 help format, and will replace the old -# Windows help format (.hlp) on all Windows platforms in the future. Compressed -# HTML files also contain an index, a table of contents, and you can search for -# words in the documentation. The HTML workshop also contains a viewer for -# compressed HTML files. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -GENERATE_HTMLHELP = NO - -# The CHM_FILE tag can be used to specify the file name of the resulting .chm -# file. You can add a path in front of the file if the result should not be -# written to the html output directory. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -CHM_FILE = - -# The HHC_LOCATION tag can be used to specify the location (absolute path -# including file name) of the HTML help compiler (hhc.exe). If non-empty, -# doxygen will try to run the HTML help compiler on the generated index.hhp. -# The file has to be specified with full path. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -HHC_LOCATION = - -# The GENERATE_CHI flag controls if a separate .chi index file is generated -# (YES) or that it should be included in the main .chm file (NO). -# The default value is: NO. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -GENERATE_CHI = NO - -# The CHM_INDEX_ENCODING is used to encode HtmlHelp index (hhk), content (hhc) -# and project file content. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -CHM_INDEX_ENCODING = - -# The BINARY_TOC flag controls whether a binary table of contents is generated -# (YES) or a normal table of contents (NO) in the .chm file. Furthermore it -# enables the Previous and Next buttons. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -BINARY_TOC = NO - -# The TOC_EXPAND flag can be set to YES to add extra items for group members to -# the table of contents of the HTML help documentation and to the tree view. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -TOC_EXPAND = NO - -# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and -# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that -# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help -# (.qch) of the generated HTML documentation. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -GENERATE_QHP = NO - -# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify -# the file name of the resulting .qch file. The path specified is relative to -# the HTML output folder. -# This tag requires that the tag GENERATE_QHP is set to YES. - -QCH_FILE = - -# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help -# Project output. For more information please see Qt Help Project / Namespace -# (see: -# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#namespace). -# The default value is: org.doxygen.Project. -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHP_NAMESPACE = org.doxygen.Project - -# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt -# Help Project output. For more information please see Qt Help Project / Virtual -# Folders (see: -# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#virtual-folders). -# The default value is: doc. -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHP_VIRTUAL_FOLDER = doc - -# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom -# filter to add. For more information please see Qt Help Project / Custom -# Filters (see: -# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-filters). -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHP_CUST_FILTER_NAME = - -# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the -# custom filter to add. For more information please see Qt Help Project / Custom -# Filters (see: -# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-filters). -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHP_CUST_FILTER_ATTRS = - -# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this -# project's filter section matches. Qt Help Project / Filter Attributes (see: -# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#filter-attributes). -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHP_SECT_FILTER_ATTRS = - -# The QHG_LOCATION tag can be used to specify the location (absolute path -# including file name) of Qt's qhelpgenerator. If non-empty doxygen will try to -# run qhelpgenerator on the generated .qhp file. -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHG_LOCATION = - -# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be -# generated, together with the HTML files, they form an Eclipse help plugin. To -# install this plugin and make it available under the help contents menu in -# Eclipse, the contents of the directory containing the HTML and XML files needs -# to be copied into the plugins directory of eclipse. The name of the directory -# within the plugins directory should be the same as the ECLIPSE_DOC_ID value. -# After copying Eclipse needs to be restarted before the help appears. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -GENERATE_ECLIPSEHELP = NO - -# A unique identifier for the Eclipse help plugin. When installing the plugin -# the directory name containing the HTML and XML files should also have this -# name. Each documentation set should have its own identifier. -# The default value is: org.doxygen.Project. -# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES. - -ECLIPSE_DOC_ID = org.doxygen.Project - -# If you want full control over the layout of the generated HTML pages it might -# be necessary to disable the index and replace it with your own. The -# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top -# of each HTML page. A value of NO enables the index and the value YES disables -# it. Since the tabs in the index contain the same information as the navigation -# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -DISABLE_INDEX = NO - -# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index -# structure should be generated to display hierarchical information. If the tag -# value is set to YES, a side panel will be generated containing a tree-like -# index structure (just like the one that is generated for HTML Help). For this -# to work a browser that supports JavaScript, DHTML, CSS and frames is required -# (i.e. any modern browser). Windows users are probably better off using the -# HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can -# further fine tune the look of the index (see "Fine-tuning the output"). As an -# example, the default style sheet generated by doxygen has an example that -# shows how to put an image at the root of the tree instead of the PROJECT_NAME. -# Since the tree basically has the same information as the tab index, you could -# consider setting DISABLE_INDEX to YES when enabling this option. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -GENERATE_TREEVIEW = NO - -# When both GENERATE_TREEVIEW and DISABLE_INDEX are set to YES, then the -# FULL_SIDEBAR option determines if the side bar is limited to only the treeview -# area (value NO) or if it should extend to the full height of the window (value -# YES). Setting this to YES gives a layout similar to -# https://docs.readthedocs.io with more room for contents, but less room for the -# project logo, title, and description. If either GENERATE_TREEVIEW or -# DISABLE_INDEX is set to NO, this option has no effect. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -FULL_SIDEBAR = NO - -# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that -# doxygen will group on one line in the generated HTML documentation. -# -# Note that a value of 0 will completely suppress the enum values from appearing -# in the overview section. -# Minimum value: 0, maximum value: 20, default value: 4. -# This tag requires that the tag GENERATE_HTML is set to YES. - -ENUM_VALUES_PER_LINE = 4 - -# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used -# to set the initial width (in pixels) of the frame in which the tree is shown. -# Minimum value: 0, maximum value: 1500, default value: 250. -# This tag requires that the tag GENERATE_HTML is set to YES. - -TREEVIEW_WIDTH = 250 - -# If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to -# external symbols imported via tag files in a separate window. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -EXT_LINKS_IN_WINDOW = NO - -# If the OBFUSCATE_EMAILS tag is set to YES, doxygen will obfuscate email -# addresses. -# The default value is: YES. -# This tag requires that the tag GENERATE_HTML is set to YES. - -OBFUSCATE_EMAILS = YES - -# If the HTML_FORMULA_FORMAT option is set to svg, doxygen will use the pdf2svg -# tool (see https://github.com/dawbarton/pdf2svg) or inkscape (see -# https://inkscape.org) to generate formulas as SVG images instead of PNGs for -# the HTML output. These images will generally look nicer at scaled resolutions. -# Possible values are: png (the default) and svg (looks nicer but requires the -# pdf2svg or inkscape tool). -# The default value is: png. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_FORMULA_FORMAT = png - -# Use this tag to change the font size of LaTeX formulas included as images in -# the HTML documentation. When you change the font size after a successful -# doxygen run you need to manually remove any form_*.png images from the HTML -# output directory to force them to be regenerated. -# Minimum value: 8, maximum value: 50, default value: 10. -# This tag requires that the tag GENERATE_HTML is set to YES. - -FORMULA_FONTSIZE = 10 - -# The FORMULA_MACROFILE can contain LaTeX \newcommand and \renewcommand commands -# to create new LaTeX commands to be used in formulas as building blocks. See -# the section "Including formulas" for details. - -FORMULA_MACROFILE = - -# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see -# https://www.mathjax.org) which uses client side JavaScript for the rendering -# instead of using pre-rendered bitmaps. Use this if you do not have LaTeX -# installed or if you want to formulas look prettier in the HTML output. When -# enabled you may also need to install MathJax separately and configure the path -# to it using the MATHJAX_RELPATH option. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -USE_MATHJAX = NO - -# With MATHJAX_VERSION it is possible to specify the MathJax version to be used. -# Note that the different versions of MathJax have different requirements with -# regards to the different settings, so it is possible that also other MathJax -# settings have to be changed when switching between the different MathJax -# versions. -# Possible values are: MathJax_2 and MathJax_3. -# The default value is: MathJax_2. -# This tag requires that the tag USE_MATHJAX is set to YES. - -MATHJAX_VERSION = MathJax_2 - -# When MathJax is enabled you can set the default output format to be used for -# the MathJax output. For more details about the output format see MathJax -# version 2 (see: -# http://docs.mathjax.org/en/v2.7-latest/output.html) and MathJax version 3 -# (see: -# http://docs.mathjax.org/en/latest/web/components/output.html). -# Possible values are: HTML-CSS (which is slower, but has the best -# compatibility. This is the name for Mathjax version 2, for MathJax version 3 -# this will be translated into chtml), NativeMML (i.e. MathML. Only supported -# for NathJax 2. For MathJax version 3 chtml will be used instead.), chtml (This -# is the name for Mathjax version 3, for MathJax version 2 this will be -# translated into HTML-CSS) and SVG. -# The default value is: HTML-CSS. -# This tag requires that the tag USE_MATHJAX is set to YES. - -MATHJAX_FORMAT = HTML-CSS - -# When MathJax is enabled you need to specify the location relative to the HTML -# output directory using the MATHJAX_RELPATH option. The destination directory -# should contain the MathJax.js script. For instance, if the mathjax directory -# is located at the same level as the HTML output directory, then -# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax -# Content Delivery Network so you can quickly see the result without installing -# MathJax. However, it is strongly recommended to install a local copy of -# MathJax from https://www.mathjax.org before deployment. The default value is: -# - in case of MathJax version 2: https://cdn.jsdelivr.net/npm/mathjax@2 -# - in case of MathJax version 3: https://cdn.jsdelivr.net/npm/mathjax@3 -# This tag requires that the tag USE_MATHJAX is set to YES. - -MATHJAX_RELPATH = - -# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax -# extension names that should be enabled during MathJax rendering. For example -# for MathJax version 2 (see -# https://docs.mathjax.org/en/v2.7-latest/tex.html#tex-and-latex-extensions): -# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols -# For example for MathJax version 3 (see -# http://docs.mathjax.org/en/latest/input/tex/extensions/index.html): -# MATHJAX_EXTENSIONS = ams -# This tag requires that the tag USE_MATHJAX is set to YES. - -MATHJAX_EXTENSIONS = - -# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces -# of code that will be used on startup of the MathJax code. See the MathJax site -# (see: -# http://docs.mathjax.org/en/v2.7-latest/output.html) for more details. For an -# example see the documentation. -# This tag requires that the tag USE_MATHJAX is set to YES. - -MATHJAX_CODEFILE = - -# When the SEARCHENGINE tag is enabled doxygen will generate a search box for -# the HTML output. The underlying search engine uses javascript and DHTML and -# should work on any modern browser. Note that when using HTML help -# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) -# there is already a search function so this one should typically be disabled. -# For large projects the javascript based search engine can be slow, then -# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to -# search using the keyboard; to jump to the search box use + S -# (what the is depends on the OS and browser, but it is typically -# , /