Homebrew formulas for installing the Mopidy music server and a selection of Mopidy extensions on macOS, with all required Python and non-Python dependencies.
brew tap mopidy/mopidy
brew install mopidyThen install the extensions you want, for example:
brew install mopidy-mpd mopidy-localTo run Mopidy as a background service that starts at login:
brew services start mopidyOr run it directly in a terminal with mopidy.
| Formula | Description |
|---|---|
mopidy |
The Mopidy music server itself |
mopidy-api-explorer |
HTTP API explorer |
mopidy-beets |
Beets backend |
mopidy-internetarchive |
Internet Archive backend |
mopidy-listenbrainz |
ListenBrainz scrobbler |
mopidy-local |
Local music library backend |
mopidy-mpd |
MPD protocol frontend |
mopidy-nad |
NAD amplifier control |
mopidy-orfradio |
ORF Austrian radio backend |
mopidy-pandora |
Pandora backend |
mopidy-pibox |
Party jukebox web client |
mopidy-podcast |
Podcast backend |
mopidy-podcast-itunes |
Apple iTunes Store podcast directory |
mopidy-scrobbler |
Last.fm scrobbler |
mopidy-somafm |
SomaFM backend |
mopidy-soundcloud |
SoundCloud backend |
mopidy-spotify |
Spotify backend |
mopidy-tunein |
TuneIn backend |
Other Mopidy extensions from PyPI can be installed into Mopidy's
virtualenv with pip, but such installs are not managed by Homebrew and
may break when the mopidy formula is upgraded:
$(brew --prefix mopidy)/libexec/bin/python -m pip install mopidy-somethingelseThis section documents the tap's architecture. Read it before changing any formula, whether you are a human or an AI agent.
- Every formula (
mopidyand each extension) installs its package and Python-only dependencies into its own virtualenv in the formula'slibexec, using Homebrew's standardLanguage::Python::Virtualenvhelper (virtualenv_install_with_resources). - Mopidy discovers extensions through
mopidy.extentry points onsys.path, so each extension formula must get its virtualenv onto thesys.pathof the mopidy process. This works as follows:- Each extension formula writes a
homebrew-<formula>.pthfile into its own#{prefix}/lib/python3.X/site-packagescontainingimport site; site.addsitedir('<extension libexec site-packages>'). brew linksymlinks that.pthfile into$(brew --prefix)/lib/python3.X/site-packages.- Homebrew's
python@3.Xruns asitecustomize.pythat callssite.addsitedir()on that directory — including inside virtualenvs created with--system-site-packages, which is what the virtualenv helper creates by default.addsitedirexecutes the.pthfiles, appending every extension's site-packages tosys.path.
- Each extension formula writes a
sys.pathorder puts mopidy's own virtualenv first, so shared dependencies (pykka, etc.) resolve from themopidyformula. Extension formulas therefore only bundle resources that mopidy itself does not provide.- GStreamer and PyGObject are not pip-installed. They come from the
Homebrew
gstreamerandpygobject3formulas, whose bindings the virtualenv helper injects into mopidy's virtualenv via ahomebrew_deps.pthfile (seevirtualenv_createin Homebrew'sLanguage::Python). - The
spotifyaudiosrcGStreamer element needed bymopidy-spotifyis bundled in Homebrew core'sgstreamerformula (gst-plugins-rs is part of the monolithic gstreamer build since 1.28).
All formulas in this tap must depend on the same versioned
python@3.X formula that Homebrew core's gstreamer depends on
(check with brew deps gstreamer | grep python@). If they diverge:
- mopidy cannot import gstreamer's Python bindings, and
- extensions install their
.pthfiles into alib/python3.Xdirectory that mopidy's Python never reads, so they silently disappear from Mopidy.
When Homebrew core moves gstreamer to a new Python version, update in
lockstep, in a single PR:
- Replace
depends_on "python@3.X"in every formula. - Update the hardcoded
python3.Xstrings in everydef install(theLanguage::Python.site_packages("python3.X")calls and the.pthcomments). - Bump
revisionin every formula so existing users get rebuilt kegs.
The autobump.yml workflow runs brew bump daily and opens PRs for new
PyPI releases automatically. For a manual bump:
brew bump-formula-pr --version=<new-version> mopidy/mopidy/<formula>If the new version changed its Python dependencies, regenerate the
resource blocks:
brew update-python-resources mopidy/mopidy/<formula>Every formula declares a pypi_packages exclude_packages: stanza, which
both brew update-python-resources and brew bump use to leave out the
packages that are provided by other formulas: the mopidy formula
excludes pygobject (provided by pygobject3), and the extension
formulas exclude mopidy (whose whole dependency tree they get from the
mopidy formula's virtualenv at runtime). Excluding a package also prunes
its entire dependency subtree.
Caveats:
- Homebrew resolves PyPI dependencies with a release cooldown
(
--uploaded-prior-to), sobrew update-python-resourcesfails for releases uploaded less than a day ago. Wait a day, or write the resource blocks by hand fromhttps://pypi.org/pypi/<pkg>/json(use the sdist URL and its sha256). - Resources must cover the entire transitive dependency tree (pip runs
with
--no-deps), except packages excluded as described above.
brew tap mopidy/mopidy
# Point the tap at your checkout, or edit the tap checkout directly:
# $(brew --repository)/Library/Taps/mopidy/homebrew-mopidy
brew style mopidy/mopidy
brew audit --strict --online mopidy/mopidy/<formula>
brew install --build-from-source mopidy/mopidy/<formula>
brew test mopidy/mopidy/<formula>End-to-end check that extension discovery works — every installed extension must show up as a config section:
mopidy config- Copy an existing extension formula of similar complexity
(
mopidy-somafm.rbhas no extra resources,mopidy-beets.rbbundles a dependency tree). - Set
desc,homepage,url(PyPI sdist),sha256, andlicense. - Keep the
pypi_packages exclude_packages: "mopidy"stanza — it is required forbrew bumpandbrew update-python-resourcesto generate correct resources. If the extension depends on another extension formula, exclude that too. - Generate resources as described above.
- Keep the
.pthblock indef install, replacing the formula name in the.pthfilename. - Point the
testblock'sassert_matchat the extension's config section name (check withmopidy config— it is usually, but not always, the extension name without themopidy-prefix). - Run the full local testing checklist above.
- Open a PR. The
tests.ymlworkflow runsbrew test-bot, which builds all changed formulas from source and uploads bottles as workflow artifacts. - After review, do not merge with the GitHub UI. Instead, run the
brew pr-pullworkflow (publish.yml) from the Actions tab with the PR number as input. It downloads the bottles, uploads them to a GitHub release, rewrites the formulas'bottle doblocks, and pushes the result tomain.
The formulas in this tap are licensed under the 2-clause BSD license,
just like Homebrew itself. See the file LICENSE-BSD for the license
text.