# Monitorize desktop with its bundled Sunshine streaming engine. app-id: com.vinnavan.Monitorize runtime: org.freedesktop.Platform runtime-version: "24.08" sdk: org.freedesktop.Sdk sdk-extensions: - org.freedesktop.Sdk.Extension.node20 command: monitorize finish-args: - --device=all - --env=MONITORIZE_SUNSHINE_ASSETS_DIR=/app/share/sunshine - --env=MONITORIZE_SUNSHINE_BIN=/app/bin/sunshine - --env=PULSE_PROP_media.category=Manager - --env=QT_PLUGIN_PATH=/app/lib/python3.12/site-packages/PyQt6/Qt6/plugins - --env=QML2_IMPORT_PATH=/app/lib/python3.12/site-packages/PyQt6/Qt6/qml # Matches the working Flathub Sunshine Portal security context. - --filesystem=home - --filesystem=xdg-run/pipewire-0 - --share=ipc - --share=network - --socket=pulseaudio - --socket=wayland - --socket=x11 - --socket=fallback-x11 - --talk-name=org.freedesktop.Flatpak - --talk-name=org.gnome.Mutter.ScreenCast - --talk-name=org.gnome.Mutter.DisplayConfig - --system-talk-name=org.freedesktop.Avahi modules: - ../../external/sunshine/packaging/linux/flatpak/modules/nlohmann_json.json - ../../external/sunshine/packaging/linux/flatpak/modules/avahi.json # Boost's b2 ignores Flatpak Builder's --jobs setting, so cap it explicitly # to keep local builds within ordinary desktop memory limits. - name: boost buildsystem: simple build-commands: - cd tools/build && bison -y -d -o src/engine/jamgram.cpp src/engine/jamgram.y - ./bootstrap.sh --prefix=$FLATPAK_DEST --with-libraries=filesystem,locale,log,program_options - ./b2 -j2 install variant=release link=shared runtime-link=shared cxxflags="$CXXFLAGS" sources: - type: archive url: https://github.com/boostorg/boost/releases/download/boost-1.89.0/boost-1.89.0-cmake.tar.xz sha256: 67acec02d0d118b5de9eb441f5fb707b3a1cdd884be00ca24b9a73c995511f74 - ../../external/sunshine/packaging/linux/flatpak/modules/libevdev.json - ../../external/sunshine/packaging/linux/flatpak/modules/miniupnpc.json - ../../external/sunshine/packaging/linux/flatpak/modules/numactl.json # Sunshine's upstream build-only CUDA toolkit module enables NVENC. The host # NVIDIA driver remains supplied by Flatpak's matching GL runtime extension. - ../../external/sunshine/packaging/linux/flatpak/modules/cuda.json # Keep this local override in sync with LizardByte's current build-deps # release. The older FFmpeg 8.1 bundle aborts while tearing down some # VA-API HEVC sessions; FFmpeg 9 handles sustained HEVC on the same GPU. - modules/ffmpeg.json # QtNetwork in the PyQt6 wheel requires MIT Kerberos at load time. - name: krb5 buildsystem: simple build-commands: - cd src && ./configure --prefix=${FLATPAK_DEST} --disable-static --without-keyutils - make -C src -j2 - make -C src install sources: - type: archive url: https://kerberos.org/dist/krb5/1.21/krb5-1.21.3.tar.gz sha256: b7a4cd5ead67fb08b980b21abd150ff7217e85ea320c9ed0c6dadd304840ad35 - name: python3-jinja2 buildsystem: simple build-commands: - pip3 install --ignore-installed --no-deps --no-build-isolation --prefix=${FLATPAK_DEST} ./markupsafe ./jinja2-3.1.6-py3-none-any.whl sources: - type: file url: https://files.pythonhosted.org/packages/62/a1/3d680cbfd5f4b8f15abc1d571870c5fc3e594bb582bc3b64ea099db13e56/jinja2-3.1.6-py3-none-any.whl sha256: 85ece4451f492d0c13c5dd7c13a64681a86afae63a5f347908daf103ce6d2f67 - type: archive url: https://files.pythonhosted.org/packages/7e/99/7690b6d4034fffd95959cbe0c02de8deb3098cc577c67bb6a24fe5d7caa7/markupsafe-3.0.3.tar.gz sha256: 722695808f4b6457b320fdc131280796bdceb04ab50fe1795cd540799ebe1698 dest: markupsafe # The GNOME virtual-monitor backend uses dbus-python to call Mutter's # ScreenCast and DisplayConfig services. PyGObject/GLib is in the runtime, # but dbus-python is not. - name: dbus-python buildsystem: meson config-opts: - -Dtests=disabled - -Ddoc=disabled sources: - type: archive url: https://files.pythonhosted.org/packages/ff/24/63118050c7dd7be04b1ccd60eab53fef00abe844442e1b6dec92dae505d6/dbus-python-1.4.0.tar.gz sha256: 991666e498f60dbf3e49b8b7678f5559b8a65034fdf61aae62cdecdb7d89c770 # Freedesktop does not ship Qt or PyQt. These wheels provide the unchanged # PyQt6/Qt Quick UI. - name: pyqt6 buildsystem: simple build-commands: - >- pip3 install --no-deps --no-index --prefix=${FLATPAK_DEST} ./pyqt6-6.11.0-cp310-abi3-manylinux_2_34_x86_64.whl ./pyqt6_qt6-6.11.2-py3-none-manylinux_2_34_x86_64.whl ./pyqt6_sip-13.12.0-cp312-cp312-manylinux1_x86_64.manylinux_2_5_x86_64.whl sources: - type: file url: https://files.pythonhosted.org/packages/c3/a0/bd1399740dfa80c0a94d20b02d89962a31458233dcf70eaa09bfbccf3d0f/pyqt6-6.11.0-cp310-abi3-manylinux_2_34_x86_64.whl sha256: 8555277989fa7d114cb3c3443fd261d566909f7268ceedd41d93a5f02d37ec05 - type: file url: https://files.pythonhosted.org/packages/69/ef/e34054e814c874f5230326ffc791f602a13b2f5590ca9599ba45b5fc4bc0/pyqt6_qt6-6.11.2-py3-none-manylinux_2_34_x86_64.whl sha256: da7d747ad917f044d841ff834f17d2c50a0cc5d0e3b16479d8662544207d0567 - type: file url: https://files.pythonhosted.org/packages/63/4c/3d4217383269153a3026e825dd109968561638d20394671e4dc8e13c6a95/pyqt6_sip-13.12.0-cp312-cp312-manylinux1_x86_64.manylinux_2_5_x86_64.whl sha256: 3476132fc5c85d7136eb14cb7d9e1909e9f5ee94a85d892e4ac244990ba541b3 - name: sunshine buildsystem: cmake-ninja builddir: true build-options: append-path: /usr/lib/sdk/node20/bin env: BUILD_VERSION: 0.39 BRANCH: monitorize COMMIT: e3ce79f3b966df388e905a3c6b3784832a328e34 PYTHONPATH: /app/lib/python3.12/site-packages XDG_CACHE_HOME: /run/build/sunshine/flatpak-node/cache npm_config_cache: /run/build/sunshine/flatpak-node/npm-cache npm_config_nodedir: /usr/lib/sdk/node20 npm_config_offline: "true" config-opts: - -DBOOST_USE_STATIC=OFF - -DBUILD_DOCS=OFF - -DBUILD_TESTS=OFF - -DBUILD_WERROR=ON - -DCMAKE_BUILD_TYPE=Release - -DCMAKE_CUDA_COMPILER=/app/cuda/bin/nvcc - -DFFMPEG_PREPARED_BINARIES=/app/ffmpeg - -DGLAD_SKIP_PIP_INSTALL=ON - -DSUNSHINE_ASSETS_DIR=share/sunshine - -DSUNSHINE_BUILD_FLATPAK=ON - -DSUNSHINE_ENABLE_CUDA=ON - -DSUNSHINE_ENABLE_DRM=ON - -DSUNSHINE_ENABLE_KWIN=ON - -DSUNSHINE_ENABLE_PORTAL=ON # Monitorize owns the UI; Sunshine's optional Qt system tray is unused. - -DSUNSHINE_ENABLE_TRAY=OFF - -DSUNSHINE_ENABLE_WAYLAND=ON - -DSUNSHINE_ENABLE_X11=ON - -DSUNSHINE_EXECUTABLE_PATH=/app/bin/sunshine post-install: - install -Dm644 $FLATPAK_BUILDER_BUILDDIR/packaging/linux/flatpak/apps.json /app/share/sunshine/apps.json sources: - sunshine-node-sources.json - type: git url: https://github.com/vinnavannewton/monitorize-sunshine.git commit: e3ce79f3b966df388e905a3c6b3784832a328e34 - type: patch path: sunshine-flatpak-portal.patch # Portal DMA-BUFs are not reliably importable by a different Intel/AMD # encode GPU. Keep VA-API hardware encoding but bridge capture via mapped # PipeWire memory for cross-vendor and hybrid-GPU reliability. - type: patch path: sunshine-flatpak-vaapi.patch # FFmpeg 9 renumbered NVENC's P1-P7 preset values. Sunshine's older # legacy mapping otherwise passes 12-18, outside FFmpeg 9's 0-9 range. - type: patch path: sunshine-flatpak-ffmpeg9-nvenc-preset.patch - type: patch path: sunshine-flatpak-session-reuse.patch - type: patch path: ../sunshine-strict-selection.patch - type: patch path: sunshine-mirror-selection.patch - name: monitorize buildsystem: simple build-commands: - cc -O2 -Wall -Wextra linux/native/portal_resize.c -o ${FLATPAK_DEST}/bin/monitorize-pipewire-resize $(pkg-config --cflags --libs libpipewire-0.3) - pip3 install --no-deps --no-build-isolation --prefix=${FLATPAK_DEST} . - install -Dm644 com.vinnavan.Monitorize.desktop -t ${FLATPAK_DEST}/share/applications - install -Dm644 com.vinnavan.Monitorize.png ${FLATPAK_DEST}/share/icons/hicolor/512x512/apps/${FLATPAK_ID}.png sources: - type: file path: ../../pyproject.toml - type: file path: ../../README.md - type: file path: ../../LICENSE - type: dir path: ../../linux dest: linux - type: file path: com.vinnavan.Monitorize.desktop - type: file path: com.vinnavan.Monitorize.png