Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Any interest in a Homebrew formula for sunshine #342

Closed
ak2k opened this issue Aug 24, 2022 · 6 comments · Fixed by #2222
Closed

Any interest in a Homebrew formula for sunshine #342

ak2k opened this issue Aug 24, 2022 · 6 comments · Fixed by #2222
Labels
os:macOS OS is macOS

Comments

@ak2k
Copy link

ak2k commented Aug 24, 2022

Describe the Bug

Might you be interested in a contributed Homebrew formula for Mac that builds sunshine?

I haven't had the chance to additionally add a Homebrew service config to the formula and don't think I'll have the chance to circle back to this near term, so wanted to offer up in case useful in the meanwhile.

Formula attached.
sunshine.rb.txt

Expected Behavior

No response

Additional Context

No response

Host Operating System

macOS

Operating System Version

12.5.1

Architecture

x86_64

Sunshine Version

0.14.1

GPU Type

AMD

GPU Model

Radeon Pro Vega 64 16 GB

GPU Driver/Mesa Version

01.01.114

Capture Method (Linux Only)

No response

Relevant log output

No response

@ReenigneArcher ReenigneArcher added the os:macOS OS is macOS label Aug 24, 2022
@ReenigneArcher
Copy link
Member

It would be nice to add this to Homebrew. We have some packaging issues to address with macOS as well.

@ak2k
Copy link
Author

ak2k commented Aug 24, 2022

I would submit myself, but alas might not be the right person to go through the Homebrew committers' review process, hence hopefully someone else would be interested in doing so.

@ReenigneArcher
Copy link
Member

The macports one (macports/macports-ports#15143) was an eye opening experience, hopefully the Homebrew one will be less chaotic. I'll need to redo that one at some point since I closed it.

@ReenigneArcher
Copy link
Member

ReenigneArcher commented Aug 24, 2022

pasting the attachment here for easier viewing:

class Sunshine < Formula
  desc "Gamestream host/server for Moonlight"
  homepage "https://app.lizardbyte.dev"
  url "https://github.com/LizardByte/Sunshine.git",
      tag:      "v0.14.1",
      revision: "6000b85b1a4ec574d93fbc7545f5bf48f3d5aaa7"
  license all_of: ["GPL-3.0", "BSD-3-Clause", "MIT"]
  head "https://github.com/LizardByte/Sunshine.git"

  depends_on "boost" => :build
  depends_on "cmake" => :build
  depends_on "ffmpeg"
  depends_on "openssl@1.1"
  depends_on "opus"

  def install
    args = %W[
      -DOPENSSL_ROOT_DIR=#{Formula["openssl"].opt_prefix}
      -DSUNSHINE_ASSETS_DIR=local/sunshine/assets
      -DSUNSHINE_CONFIG_DIR=local/sunshine/config
    ]
    system "cmake", "-S", ".", "-B", "build", *std_cmake_args, *args

    cd "build" do
      system "make", "-j"
      system "make", "install"
    end
  end

  test do
    # No discernable tests in project, making do with cli output
    system "touch", "sunshine.conf"
    assert_match "Sunshine version: v0.14.1", shell_output("#{bin}/sunshine sunshine.conf --version").strip
  end
end

and tweaks required after #330 is merged:

class Sunshine < Formula
  desc "@PROJECT_DESCRIPTION@"
  homepage "@PROJECT_HOMEPAGE_URL@"
  url "@GITHUB_CLONE_URL@",
      # is tag required? won't be available until after a release is published
      # tag:      "v0.14.1",
      revision: "@GITHUB_COMMIT@"
  license all_of: ["GPL-3.0", "BSD-3-Clause", "MIT"]
  head "https://github.com/LizardByte/Sunshine.git"

  depends_on "boost" => :build
  depends_on "cmake" => :build
  depends_on "ffmpeg"
  depends_on "openssl@1.1"
  depends_on "opus"

  def install
    args = %W[
      -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

  test do
    # test that version numbers match
    assert_match "Sunshine version: v@PROJECT_VERSION@", shell_output("#{bin}/sunshine --version").strip
  end
end
  • file to be configured by cmake to populate properties
  • in this PR sunshine is able to create the config file if it doesn't exist as well as the destination directory

@ak2k
Copy link
Author

ak2k commented Aug 24, 2022 via email

@ReenigneArcher
Copy link
Member

Some of these GitHub actions could be of interest, https://github.com/marketplace?type=actions&query=homebrew+

@LizardByte LizardByte locked and limited conversation to collaborators Oct 5, 2022
@ReenigneArcher ReenigneArcher converted this issue into a discussion Oct 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
os:macOS OS is macOS
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants