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.5/beefy_player-1.2.5.tar.gz" sha256 "344f2266cb63d05bf294349599ecef636b3c8c25c8b29bcf0eff8818394b5f74" license "WTFPL" head "https://tildeforge.dev/beefcarver/beefy-player.git", branch: "master" 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" # Vendored by `brew update-python-resources`; the list is the resolved # closure of the sdist's own dependencies (numpy and pillow excepted above). # Regenerate it whenever the app's dependencies in pyproject.toml change. resource "anyio" do url "https://files.pythonhosted.org/packages/a1/98/7e457a3b014976887a050561955c0b76e1e7e2d6e27b78ecef2ef80518f2/anyio-4.16.0.tar.gz" sha256 "59bb03251907983d1603d27c3087ddb1e93299ea2163adcdba37899a4fb12ffb" end resource "certifi" do url "https://files.pythonhosted.org/packages/fd/11/b524cbd9bbdaca58608e4cf4053fd463417549e1959fa8d3aa18319f9555/certifi-2026.10.23.tar.gz" sha256 "a9895e6e2758b371e0545e321a3a8fd1fcfd9829ada8824a936dfb16aaaf36cd" end resource "dbus-next" do url "https://files.pythonhosted.org/packages/ce/45/6a40fbe886d60a8c26f480e7d12535502b5ba123814b3b9a0b002ebca198/dbus_next-0.2.3.tar.gz" sha256 "f4eae26909332ada528c0a3549dda8d4f088f9b365153952a408e28023a626a5" end resource "h11" do url "https://files.pythonhosted.org/packages/01/ee/02a2c011bdab74c6fb3c75474d40b3052059d95df7e73351460c8588d963/h11-0.16.0.tar.gz" sha256 "4e35b956cf45792e4caa5885e69fba00bdbc6ffafbfa020300e549b208ee5ff1" end resource "httpcore" do url "https://files.pythonhosted.org/packages/06/94/82699a10bca87a5556c9c59b5963f2d039dbd239f25bc2a63907a05a14cb/httpcore-1.0.9.tar.gz" sha256 "6e34463af53fd2ab5d807f399a9b45ea31c3dfa2276f15a2c3f00afff6e176e8" end resource "httpx" do url "https://files.pythonhosted.org/packages/b1/df/48c586a5fe32a0f01324ee087459e112ebb7224f646c0b5023f5e79e9956/httpx-0.28.1.tar.gz" sha256 "75e98c5f16b0f35b567856f597f06ff2270a374470a5c2392242528e3e3e42fc" end resource "idna" do url "https://files.pythonhosted.org/packages/f5/08/8eea9d4b8302028f3abb2c0813953f7aec26d33b7a8960ed760e65ff29fa/idna-3.20.tar.gz" sha256 "a7db850025b95ded1eae8a46181a1a6c56c92c96f0e2b005d9ff8dc0210cab44" end resource "linkify-it-py" do url "https://files.pythonhosted.org/packages/45/98/7a1a5f31fd5c7ba93e963b168e244b8e3dd705b3d2a718e3c3307583bf57/linkify_it_py-2.2.0.tar.gz" sha256 "907acd2d17ac1fbb9ddb62c8957ccbd6158cac602231a15c3b0cd1e215f03cee" end resource "markdown-it-py" do url "https://files.pythonhosted.org/packages/16/fc/cee2c45553c9a9bf77d8b0c391560c556d7ed756b1f0bb35eb5d48db09ea/markdown_it_py-4.3.0.tar.gz" sha256 "91a58fa5b72c71a40cf7177250fd767480d7a2bb3ac426ccfb76fb90305fdaaa" end resource "mdit-py-plugins" do url "https://files.pythonhosted.org/packages/ad/a4/77a4e1be19fd9b08993c76d5e54979ac836b327754f1f5fecfed1b56cc67/mdit_py_plugins-0.7.0.tar.gz" sha256 "26d2179227aaf4d1dc7acffe7a738cbd15cade6b5a61cff0a2cbf9fed93efede" end resource "mdurl" do url "https://files.pythonhosted.org/packages/d6/54/cfe61301667036ec958cb99bd3efefba235e65cdeb9c84d24a8293ba1d90/mdurl-0.1.2.tar.gz" sha256 "bb413d29f5eea38f31dd4754dd7377d4465116fb207585f97bf925588687c1ba" end resource "platformdirs" do url "https://files.pythonhosted.org/packages/d7/9a/8475be631fb33ca1466915e70fd594c42a4e84b512db650eaa14f90fe75d/platformdirs-4.14.5.tar.gz" sha256 "32e9921db7385aa8169bee4fe9501923e5715ba9fb7ea3b9c69b0d8e0639f7a1" end resource "pygments" do url "https://files.pythonhosted.org/packages/49/2e/ced460408999b33da6b31b0021b0f37d329e202d4169aeb164493778f25b/pygments-2.21.0.tar.gz" sha256 "610ca751c9bc2492b38eb9a38a7fbc93edbbb2d7182edaf34e66ae493dee5c8c" end resource "rich" do url "https://files.pythonhosted.org/packages/c0/8f/0722ca900cc807c13a6a0c696dacf35430f72e0ec571c4275d2371fca3e9/rich-15.0.0.tar.gz" sha256 "edd07a4824c6b40189fb7ac9bc4c52536e9780fbbfbddf6f1e2502c31b068c36" end resource "textual" do url "https://files.pythonhosted.org/packages/00/21/39a76b01bd5eea82a04baaca7580e105d8c59450df03998345bb2cfb307b/textual-8.2.8.tar.gz" sha256 "3f106a9fbc73e39dd266c9712432087de78a6d644084c7c241d6a25c3169115b" end resource "typing-extensions" do url "https://files.pythonhosted.org/packages/f6/cc/6253133b5bb138fc3306cebfbda2c520f545d36b5be2c7255cc528bb45d6/typing_extensions-4.16.0.tar.gz" sha256 "dc983d19a509c94dba722ee6abd33940f7c05a89e243c47e907eb4db6f1a43e5" end 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