@@ -9,6 +9,18 @@ class @PROJECT_NAME@ < Formula
99 license all_of : [ "GPL-3.0-only" ]
1010 head "@GITHUB_CLONE_URL@" , branch : "@GITHUB_DEFAULT_BRANCH@"
1111
12+ # https://docs.brew.sh/Brew-Livecheck#githublatest-strategy-block
13+ livecheck do
14+ url :stable
15+ regex ( /^v?(\d +\. \d +\. \d +)$/i )
16+ strategy :github_latest do |json , regex |
17+ match = json [ "tag_name" ] &.match ( regex )
18+ next if match . blank?
19+
20+ match [ 1 ]
21+ end
22+ end
23+
1224 depends_on "boost" => :build
1325 depends_on "cmake" => :build
1426 depends_on "node" => :build
@@ -18,6 +30,26 @@ class @PROJECT_NAME@ < Formula
1830 depends_on "openssl"
1931 depends_on "opus"
2032
33+ on_linux do
34+ depends_on "libcap"
35+ depends_on "libdrm"
36+ depends_on "libnotify"
37+ depends_on "libva"
38+ depends_on "libvdpau"
39+ depends_on "libx11"
40+ depends_on "libxcb"
41+ depends_on "libxcursor"
42+ depends_on "libxfixes"
43+ depends_on "libxi"
44+ depends_on "libxinerama"
45+ depends_on "libxrandr"
46+ depends_on "libxtst"
47+ depends_on "numactl"
48+ depends_on "pulseaudio"
49+ depends_on "systemd"
50+ depends_on "wayland"
51+ end
52+
2153 def install
2254 ENV [ "BRANCH" ] = "@GITHUB_BRANCH@"
2355 ENV [ "BUILD_VERSION" ] = "@BUILD_VERSION@"
@@ -26,36 +58,54 @@ def install
2658 args = %W[
2759 -DBUILD_WERROR=ON
2860 -DCMAKE_INSTALL_PREFIX=#{ prefix }
61+ -DHOMEBREW_ALLOW_FETCHCONTENT=ON
2962 -DOPENSSL_ROOT_DIR=#{ Formula [ "openssl" ] . opt_prefix }
3063 -DSUNSHINE_ASSETS_DIR=sunshine/assets
3164 -DSUNSHINE_BUILD_HOMEBREW=ON
65+ -DSUNSHINE_ENABLE_TRAY=OFF
3266 -DTESTS_ENABLE_PYTHON_TESTS=OFF
3367 ]
3468 system "cmake" , "-S" , "." , "-B" , "build" , *std_cmake_args , *args
3569
3670 cd "build" do
37- system "make" , "-j"
71+ system "make"
3872 system "make" , "install"
73+
3974 bin . install "tests/test_sunshine"
4075 end
76+
77+ bin . install "src_assets/linux/misc/postinst" if OS . linux?
4178 end
4279
4380 service do
4481 run [ opt_bin /"sunshine" , "~/.config/sunshine/sunshine.conf" ]
4582 end
4683
4784 def caveats
48- <<~EOS
85+ caveats_message = <<~EOS
4986 Thanks for installing @PROJECT_NAME@!
5087
5188 To get started, review the documentation at:
5289 https://docs.lizardbyte.dev/projects/sunshine/en/latest/
90+ EOS
5391
54- Sunshine can only access microphones on macOS due to system limitations.
55- To stream system audio use "Soundflower" or "BlackHole".
92+ if OS . linux?
93+ caveats_message += <<~EOS
94+ ATTENTION: To complete installation, you must run the following command:
95+ `sudo #{ bin } /postinst`
96+ EOS
97+ end
5698
57- Gamepads are not currently supported on macOS.
58- EOS
99+ if OS . mac?
100+ caveats_message += <<~EOS
101+ Sunshine can only access microphones on macOS due to system limitations.
102+ To stream system audio use "Soundflower" or "BlackHole".
103+
104+ Gamepads are not currently supported on macOS.
105+ EOS
106+ end
107+
108+ caveats_message
59109 end
60110
61111 test do
0 commit comments