From 9a45113aa0f49738da61de335e1bcc423bfdb0e4 Mon Sep 17 00:00:00 2001 From: beefcarver Date: Thu, 5 Nov 2026 11:39:36 -0500 Subject: [PATCH] feat(beefy-player): add formula for v1.2.2 --- Formula/b/beefy-player.rb | 51 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 Formula/b/beefy-player.rb diff --git a/Formula/b/beefy-player.rb b/Formula/b/beefy-player.rb new file mode 100644 index 0000000..c74d86c --- /dev/null +++ b/Formula/b/beefy-player.rb @@ -0,0 +1,51 @@ +class BeefyPlayer < Formula + include Language::Python::Virtualenv + + desc "Terminal player for internet radio with a live spectrum analyser" + homepage "https://tildeforge.dev/beefcarver/beefy-player" + url "https://tildeforge.dev/beefcarver/beefy-player/releases/download/v1.2.2/beefy-player-1.2.2.tar.gz" + sha256 "0000000000000000000000000000000000000000000000000000000000000000" # TODO: release asset + license "WTFPL" + head "https://tildeforge.dev/beefcarver/beefy-player.git", branch: "main" + + depends_on "python@3.14" + + # numpy and pillow are large native builds. Depending on Homebrew's own + # formulae (which have bottles) keeps them out of the app's virtualenv build; + # the venv sees them through system site-packages. + depends_on "numpy" + depends_on "pillow" + + # Runtime tools the app shells out to: mpv for audio, ffmpeg for the stream + # decode fallback of the spectrum analyser. Both are optional at runtime -- + # the UI degrades gracefully -- but a radio player without them is not much fun. + depends_on "ffmpeg" + depends_on "mpv" + + # Tells `brew update-python-resources` what to resolve: numpy/pillow come from + # the formulae above, and dbus-next is marker-gated to Linux upstream so it + # has to be requested explicitly for the Linux side of the tap. + pypi_packages exclude_packages: "numpy,pillow", extra_packages: "dbus-next" + + def install + # system_site_packages is the default, so the excluded numpy/pillow from the + # formulae are importable from the virtualenv. + virtualenv_install_with_resources + end + + def caveats + <<~EOS + The spectrum analyser follows what you hear. On macOS 14.2+ grant your + terminal permission under System Settings > Privacy & Security > System + Audio Recording, otherwise it falls back to decoding the stream. + + Inside tmux, install `tmux` for image passthrough. + EOS + end + + test do + assert_match version.to_s, shell_output("#{bin}/beefy-player --version") + # --offline keeps the test hermetic: cached or bundled stations only. + assert_match(/^# /, shell_output("#{bin}/beefy-player --offline --list")) + end +end