Skip to content

Commit

Permalink
ci: fix linux tray (LizardByte#1650)
Browse files Browse the repository at this point in the history
  • Loading branch information
ReenigneArcher committed Sep 18, 2023
1 parent 376bb76 commit b989d33
Show file tree
Hide file tree
Showing 14 changed files with 170 additions and 10 deletions.
3 changes: 2 additions & 1 deletion .codeql-prebuild-cpp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ sudo apt-get install -y \
build-essential \
gcc-10 \
g++-10 \
libappindicator3-dev \
libayatana-appindicator3-dev \
libavdevice-dev \
libboost-filesystem-dev \
libboost-locale-dev \
Expand All @@ -16,6 +16,7 @@ sudo apt-get install -y \
libdrm-dev \
libevdev-dev \
libmfx-dev \
libnotify-dev \
libnuma-dev \
libopus-dev \
libpulse-dev \
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,12 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Checkout Flathub Shared Modules
uses: actions/checkout@v4
with:
repository: flathub/shared-modules
path: build/shared-modules

- name: Setup Dependencies Linux Flatpak
run: |
PLATFORM_VERSION=22.08
Expand All @@ -186,6 +192,7 @@ jobs:
org.freedesktop.Platform/${{ matrix.arch }}/${PLATFORM_VERSION} \
org.freedesktop.Sdk/${{ matrix.arch }}/${PLATFORM_VERSION} \
org.freedesktop.Sdk.Extension.node18/${{ matrix.arch }}/${PLATFORM_VERSION} \
org.freedesktop.Sdk.Extension.vala/${{ matrix.arch }}/${PLATFORM_VERSION} \
"
- name: Cache Flatpak build
Expand Down Expand Up @@ -337,13 +344,14 @@ jobs:
build-essential \
gcc-10 \
g++-10 \
libappindicator3-dev \
libayatana-appindicator3-dev \
libavdevice-dev \
libcap-dev \
libcurl4-openssl-dev \
libdrm-dev \
libevdev-dev \
libmfx-dev \
libnotify-dev \
libnuma-dev \
libopus-dev \
libpulse-dev \
Expand Down
16 changes: 14 additions & 2 deletions cmake/compile_definitions/linux.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -156,13 +156,20 @@ endif()
# tray icon
if(${SUNSHINE_ENABLE_TRAY})
pkg_check_modules(APPINDICATOR appindicator3-0.1)
if(NOT APPINDICATOR_FOUND)
if(APPINDICATOR_FOUND)
list(APPEND SUNSHINE_DEFINITIONS TRAY_LEGACY_APPINDICATOR=1)
else()
pkg_check_modules(APPINDICATOR ayatana-appindicator3-0.1)
if(APPINDICATOR_FOUND)
list(APPEND SUNSHINE_DEFINITIONS TRAY_AYATANA_APPINDICATOR=1)
endif ()
endif()
pkg_check_modules(LIBNOTIFY libnotify)
if(NOT APPINDICATOR_FOUND OR NOT LIBNOTIFY_FOUND)
message(WARNING "Missing appindicator, disabling tray icon")
set(SUNSHINE_TRAY 0)
message(WARNING "Missing appindicator or libnotify, disabling tray icon")
message(STATUS "APPINDICATOR_FOUND: ${APPINDICATOR_FOUND}")
message(STATUS "LIBNOTIFY_FOUND: ${LIBNOTIFY_FOUND}")
else()
include_directories(SYSTEM ${APPINDICATOR_INCLUDE_DIRS} ${LIBNOTIFY_INCLUDE_DIRS})
link_directories(${APPINDICATOR_LIBRARY_DIRS} ${LIBNOTIFY_LIBRARY_DIRS})
Expand All @@ -172,6 +179,11 @@ if(${SUNSHINE_ENABLE_TRAY})
endif()
else()
set(SUNSHINE_TRAY 0)
message(STATUS "Tray icon disabled")
endif()

if (${SUNSHINE_TRAY} EQUAL 0 AND SUNSHINE_REQUIRE_TRAY)
message(FATAL_ERROR "Tray icon is required")
endif()

list(APPEND PLATFORM_TARGET_FILES
Expand Down
1 change: 1 addition & 0 deletions cmake/prep/options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
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)

if(APPLE)
option(SUNSHINE_CONFIGURE_PORTFILE
Expand Down
2 changes: 2 additions & 0 deletions docker/debian-bookworm.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ apt-get install -y --no-install-recommends \
cmake=3.25.* \
git \
libavdevice-dev \
libayatana-appindicator3-dev \
libboost-filesystem-dev=1.74.* \
libboost-locale-dev=1.74.* \
libboost-log-dev=1.74.* \
Expand All @@ -42,6 +43,7 @@ apt-get install -y --no-install-recommends \
libcurl4-openssl-dev \
libdrm-dev \
libevdev-dev \
libnotify-dev \
libnuma-dev \
libopus-dev \
libpulse-dev \
Expand Down
2 changes: 2 additions & 0 deletions docker/debian-bullseye.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ apt-get install -y --no-install-recommends \
cmake=3.18.* \
git \
libavdevice-dev \
libayatana-appindicator3-dev \
libboost-filesystem-dev=1.74.* \
libboost-locale-dev=1.74.* \
libboost-log-dev=1.74.* \
Expand All @@ -42,6 +43,7 @@ apt-get install -y --no-install-recommends \
libcurl4-openssl-dev \
libdrm-dev \
libevdev-dev \
libnotify-dev \
libnuma-dev \
libopus-dev \
libpulse-dev \
Expand Down
1 change: 1 addition & 0 deletions docker/fedora-37.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ dnf -y install \
libcurl-devel \
libdrm-devel \
libevdev-devel \
libnotify-devel \
libva-devel \
libvdpau-devel \
libX11-devel \
Expand Down
1 change: 1 addition & 0 deletions docker/fedora-38.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ dnf -y install \
libcurl-devel \
libdrm-devel \
libevdev-devel \
libnotify-devel \
libva-devel \
libvdpau-devel \
libX11-devel \
Expand Down
3 changes: 2 additions & 1 deletion docker/ubuntu-20.04.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ apt-get install -y --no-install-recommends \
gcc-10=10.5.* \
g++-10=10.5.* \
git \
libappindicator3-dev \
libayatana-appindicator3-dev \
libavdevice-dev \
libboost-filesystem-dev=1.71.* \
libboost-locale-dev=1.71.* \
Expand All @@ -44,6 +44,7 @@ apt-get install -y --no-install-recommends \
libcurl4-openssl-dev \
libdrm-dev \
libevdev-dev \
libnotify-dev \
libnuma-dev \
libopus-dev \
libpulse-dev \
Expand Down
3 changes: 2 additions & 1 deletion docker/ubuntu-22.04.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ apt-get install -y --no-install-recommends \
build-essential \
cmake=3.22.* \
git \
libappindicator3-dev \
libayatana-appindicator3-dev \
libavdevice-dev \
libboost-filesystem-dev=1.74.* \
libboost-locale-dev=1.74.* \
Expand All @@ -43,6 +43,7 @@ apt-get install -y --no-install-recommends \
libcurl4-openssl-dev \
libdrm-dev \
libevdev-dev \
libnotify-dev \
libnuma-dev \
libopus-dev \
libpulse-dev \
Expand Down
7 changes: 6 additions & 1 deletion docs/source/building/linux.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Install Requirements
build-essential \
cmake \
libavdevice-dev \
libayatana-appindicator3-dev \
libboost-filesystem-dev \
libboost-locale-dev \
libboost-log-dev \
Expand All @@ -25,6 +26,7 @@ Install Requirements
libdrm-dev \ # KMS
libevdev-dev \
libmfx-dev \ # x86_64 only
libnotify-dev \
libnuma-dev \
libopus-dev \
libpulse-dev \
Expand Down Expand Up @@ -63,6 +65,7 @@ Install Requirements
libcurl-devel \
libdrm-devel \
libevdev-devel \
libnotify-devel \
libva-devel \
libvdpau-devel \
libX11-devel \ # X11
Expand Down Expand Up @@ -94,7 +97,7 @@ Install Requirements
build-essential \
cmake \
g++-10 \
libappindicator3-dev \
libayatana-appindicator3-dev \
libavdevice-dev \
libboost-filesystem-dev \
libboost-locale-dev \
Expand All @@ -104,6 +107,7 @@ Install Requirements
libdrm-dev \ # KMS
libevdev-dev \
libmfx-dev \ # x86_64 only
libnotify-dev \
libnuma-dev \
libopus-dev \
libpulse-dev \
Expand Down Expand Up @@ -152,6 +156,7 @@ Install Requirements
libdrm-dev \ # KMS
libevdev-dev \
libmfx-dev \ # x86_64 only
libnotify-dev \
libnuma-dev \
libopus-dev \
libpulse-dev \
Expand Down
27 changes: 25 additions & 2 deletions packaging/linux/Arch/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,31 @@ arch=('x86_64' 'aarch64')
url=@PROJECT_HOMEPAGE_URL@
license=('GPL3')

depends=('avahi' 'boost-libs' 'curl' 'libappindicator-gtk3' 'libevdev' 'libmfx' 'libpulse' 'libva' 'libvdpau' 'libx11' 'libxcb' 'libxfixes' 'libxrandr' 'libxtst' 'numactl' 'openssl' 'opus' 'udev')
makedepends=('boost' 'cmake' 'git' 'make' 'nodejs' 'npm')
depends=('avahi'
'boost-libs'
'curl'
'libayatana-appindicator'
'libevdev'
'libmfx'
'libnotify'
'libpulse'
'libva'
'libvdpau'
'libx11'
'libxcb'
'libxfixes'
'libxrandr'
'libxtst'
'numactl'
'openssl'
'opus'
'udev')
makedepends=('boost'
'cmake'
'git'
'make'
'nodejs'
'npm')
optdepends=('cuda: NvFBC capture support'
'libcap'
'libdrm')
Expand Down
102 changes: 102 additions & 0 deletions packaging/linux/flatpak/dev.lizardbyte.sunshine.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ runtime-version: "22.08"
sdk: org.freedesktop.Sdk
sdk-extensions:
- org.freedesktop.Sdk.Extension.node18
- org.freedesktop.Sdk.Extension.vala
command: sunshine
separate-locales: false
finish-args:
Expand All @@ -27,6 +28,10 @@ cleanup:
- /lib/*.a
- /share/man

build-options:
append-path: /usr/lib/sdk/vala/bin
prepend-ld-library-path: /usr/lib/sdk/vala/lib

modules:
- name: boost
disabled: false
Expand Down Expand Up @@ -88,6 +93,79 @@ modules:
- for n in $(cat patches/series); do if [[ $n != "#"* ]]; then patch -Np1 -i "patches/$n" -d .; fi; done
- autoreconf -ivf

# yamllint disable-line rule:line-length
# https://github.com/flathub/org.localsend.localsend_app/blob/7465669c22a2a4fc35e707e1e4e7e882772adc0e/org.localsend.localsend_app.yml#L27-L106
# https://github.com/flathub/app.vup.Vup/blob/8c5073c7c5b8f24805013abc85a0860ca2439396/app.vup.Vup.yaml#L30-L78
- name: libayatana-appindicator
buildsystem: cmake-ninja
config-opts:
- -DENABLE_BINDINGS_MONO=NO
- -DENABLE_BINDINGS_VALA=NO
modules:
- shared-modules/intltool/intltool-0.51.json
- name: libdbusmenu-gtk3 # Dependency of libayatana-appindicator
buildsystem: autotools
build-options:
cflags: -Wno-error
env:
HAVE_VALGRIND_FALSE: '#'
HAVE_VALGRIND_TRUE: ''
config-opts:
- --with-gtk=3
- --disable-dumper
- --disable-static
- --disable-tests
- --disable-gtk-doc
- --enable-introspection=no
- --disable-vala
sources:
- type: archive
url: https://launchpad.net/libdbusmenu/16.04/16.04.0/+download/libdbusmenu-16.04.0.tar.gz
sha256: b9cc4a2acd74509435892823607d966d424bd9ad5d0b00938f27240a1bfa878a
cleanup:
- /include
- /libexec
- /lib/pkgconfig
- /lib/*.la
- /share/doc
- /share/libdbusmenu
- /share/gtk-doc
- /share/gir-1.0
- name: ayatana-ido
buildsystem: cmake-ninja
sources:
- type: git
url: https://github.com/AyatanaIndicators/ayatana-ido.git
tag: 0.10.1
commit: 13402a2cc4616b4b5f4244413599e635fcfc1401
x-checker-data:
type: anitya
project-id: 18445
tag-template: $version
stable-only: true
- name: libayatana-indicator
buildsystem: cmake-ninja
sources:
- type: git
url: https://github.com/AyatanaIndicators/libayatana-indicator.git
tag: 0.9.3
commit: a62e8ca13040554a8fc2536ce7e6aa888c5729d9
x-checker-data:
type: anitya
project-id: 18447
tag-template: $version
stable-only: true
sources:
- type: git
url: https://github.com/AyatanaIndicators/libayatana-appindicator.git
tag: 0.5.92
commit: d214fe3e7a6b1ba8faea68d70586310b34dc643c
x-checker-data:
type: anitya
project-id: 18446
tag-template: $version
stable-only: true

- name: libevdev
disabled: false
buildsystem: meson
Expand All @@ -107,6 +185,30 @@ modules:
commands:
- for n in $(cat patches/series); do if [[ $n != "#"* ]]; then patch -Np1 -i "patches/$n" -d .; fi; done

- name: libnotify
buildsystem: meson
config-opts:
- -Dtests=false
- -Dintrospection=disabled
- -Dman=false
- -Dgtk_doc=false
- -Ddocbook_docs=disabled
sources:
- type: archive
url: https://download.gnome.org/sources/libnotify/0.8/libnotify-0.8.2.tar.xz
sha256: c5f4ed3d1f86e5b118c76415aacb861873ed3e6f0c6b3181b828cf584fc5c616
x-checker-data:
type: gnome
name: libnotify
stable-only: true
- type: archive
url: https://download.gnome.org/sources/gnome-common/3.18/gnome-common-3.18.0.tar.xz
sha256: 22569e370ae755e04527b76328befc4c73b62bfd4a572499fde116b8318af8cf
x-checker-data:
type: gnome
name: gnome-common
stable-only: true

- name: intel-mediasdk
disabled: false
buildsystem: cmake
Expand Down
2 changes: 1 addition & 1 deletion third-party/tray

0 comments on commit b989d33

Please sign in to comment.