-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
1 parent
3b3e681
commit 00f41d2
Showing
4 changed files
with
145 additions
and
0 deletions.
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
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,50 @@ | ||
require "language/node" | ||
|
||
class @PROJECT_NAME@ < Formula | ||
desc "@PROJECT_DESCRIPTION@" | ||
homepage "@PROJECT_HOMEPAGE_URL@" | ||
# this doesn't work because it doesn't include submodules, and is not a git repo that can clone them | ||
# url "@GITHUB_SOURCE_TARBALL@" | ||
url "@GITHUB_CLONE_URL@", | ||
tag: "@GITHUB_BRANCH@" | ||
version "@PROJECT_VERSION@" | ||
license all_of: ["GPL-3.0-only"] | ||
head "@GITHUB_CLONE_URL@" | ||
|
||
depends_on "boost" => :build | ||
depends_on "cmake" => :build | ||
depends_on "pkg-config" => :build | ||
depends_on "curl" | ||
depends_on "miniupnpc" | ||
depends_on "node" | ||
depends_on "openssl" | ||
depends_on "opus" | ||
|
||
def install | ||
# initialize submodules | ||
system "git", "submodule", "update", "--remote", "--init", "--recursive", "--depth", "1" | ||
|
||
args = %W[ | ||
-DBUIld_WERROR=ON | ||
-DOPENSSL_ROOT_DIR=#{Formula["openssl"].opt_prefix} | ||
-DSUNSHINE_ASSETS_DIR=sunshine/assets | ||
] | ||
system "cmake", "-S", ".", "-B", "build", *std_cmake_args, *args | ||
|
||
cd "build" do | ||
system "make", "-j" | ||
system "make", "install" | ||
end | ||
end | ||
|
||
service do | ||
run [opt_bin/"sunshine", "~/.config/sunshine/sunshine.conf"] | ||
end | ||
|
||
test do | ||
# test that the binary runs at all | ||
shell_output("#{bin}/sunshine --version").strip | ||
|
||
# todo: add unit tests | ||
end | ||
end |