-
-
Notifications
You must be signed in to change notification settings - Fork 987
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
76 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
require "language/node" | ||
|
||
class @PROJECT_NAME@ < Formula | ||
desc "@PROJECT_DESCRIPTION@" | ||
homepage "@PROJECT_HOMEPAGE_URL@" | ||
url "@GITHUB_CLONE_URL@", branch: "@GITHUB_BRANCH@" | ||
version "@PROJECT_VERSION@" | ||
license all_of: ["GPL-3.0-only"] | ||
head "@GITHUB_CLONE_URL@", branch: "@GITHUB_DEFAULT_BRANCH@" | ||
|
||
depends_on "boost" => :build | ||
depends_on "cmake" => :build | ||
depends_on "node" => :build | ||
depends_on "pkg-config" => :build | ||
depends_on "curl" | ||
depends_on "miniupnpc" | ||
depends_on "openssl" | ||
depends_on "opus" | ||
|
||
def install | ||
ENV["BRANCH"] = "@GITHUB_BRANCH@" | ||
ENV["BUILD_VERSION"] = "@BUILD_VERSION@" | ||
ENV["COMMIT"] = "@GITHUB_COMMIT@" | ||
|
||
args = %W[ | ||
-DBUILD_WERROR=ON | ||
-DCMAKE_INSTALL_PREFIX=#{prefix} | ||
-DOPENSSL_ROOT_DIR=#{Formula["openssl"].opt_prefix} | ||
-DSUNSHINE_ASSETS_DIR=sunshine/assets | ||
-DSUNSHINE_BUILD_HOMEBREW=ON | ||
-DTESTS_ENABLE_PYTHON_TESTS=OFF | ||
] | ||
system "cmake", "-S", ".", "-B", "build", *std_cmake_args, *args | ||
|
||
cd "build" do | ||
system "make", "-j" | ||
system "make", "install" | ||
bin.install "tests/test_sunshine" | ||
end | ||
end | ||
|
||
service do | ||
run [opt_bin/"sunshine", "~/.config/sunshine/sunshine.conf"] | ||
end | ||
|
||
def caveats | ||
<<~EOS | ||
Thanks for installing @PROJECT_NAME@! | ||
To get started, review the documentation at: | ||
https://docs.lizardbyte.dev/projects/sunshine/en/latest/ | ||
Sunshine can only access microphones on macOS due to system limitations. | ||
To stream system audio use "Soundflower" or "BlackHole". | ||
Gamepads are not currently supported on macOS. | ||
EOS | ||
end | ||
|
||
test do | ||
# test that the binary runs at all | ||
system "#{bin}/sunshine", "--version" | ||
|
||
# run the test suite | ||
# cannot build tests with python tests because homebrew destroys the source directory | ||
system "#{bin}/test_sunshine", "--gtest_color=yes" | ||
end | ||
end |