music-assistant-server
3.7 KB•MD
README.md
3.7 KB • 155 lines • markdown
1# Shairport-Sync Binaries
2
3This directory contains the bundled shairport-sync binary for macOS development.
4
5Linux deployments do not use bundled binaries: the docker image builds shairport-sync
6from source in `Dockerfile.base` (see the `shairport-builder` stage), and the provider
7finds it via its system PATH lookup. Other Linux installs should install shairport-sync
8via their system package manager.
9
10## Bundled Binaries
11
12- `shairport-sync-macos-arm64` - macOS Apple Silicon (local development)
13
14## Installation Options
15
16### Option 1: System Package Manager (Recommended)
17
18The easiest way to use this plugin is to install shairport-sync via your system's package manager:
19
20**Debian/Ubuntu:**
21```bash
22apt-get update
23apt-get install -y shairport-sync
24```
25
26**macOS (Homebrew):**
27```bash
28brew install shairport-sync
29```
30
31**Arch Linux:**
32```bash
33pacman -S shairport-sync
34```
35
36### Option 2: Build Static Binaries
37
38If you want to include pre-built binaries with Music Assistant, you'll need to build them yourself. See `build_binaries.sh` for a script that helps with this process.
39
40## Building Shairport-Sync
41
42### Prerequisites
43
44Shairport-sync requires several dependencies:
45- OpenSSL
46- Avahi (for mDNS/Bonjour)
47- ALSA (Linux only)
48- libpopt
49- libconfig
50- libsndfile
51- libsoxr (optional, for resampling)
52
53### Build Instructions
54
55#### Linux (Static Build with musl)
56
57```bash
58# Install dependencies
59apk add --no-cache \
60 build-base \
61 git \
62 autoconf \
63 automake \
64 libtool \
65 alsa-lib-dev \
66 libconfig-dev \
67 popt-dev \
68 openssl-dev \
69 avahi-dev \
70 libsndfile-dev \
71 libsoxr-dev
72
73# Clone and build
74git clone https://github.com/mikebrady/shairport-sync.git
75cd shairport-sync
76git checkout tags/4.3.7 # Use latest stable version
77autoreconf -fi
78./configure \
79 --with-pipe \
80 --with-metadata \
81 --with-avahi \
82 --with-ssl=openssl \
83 --with-stdout \
84 --with-soxr \
85 LDFLAGS="-static"
86make
87strip shairport-sync
88
89# Copy to provider bin directory
90cp shairport-sync ../music_assistant/providers/airplay_receiver/bin/shairport-sync-linux-$(uname -m)
91```
92
93#### macOS
94
95```bash
96# Install dependencies
97brew install autoconf automake libtool pkg-config openssl libsodium libsoxr popt libconfig
98
99# Clone and build
100git clone https://github.com/mikebrady/shairport-sync.git
101cd shairport-sync
102git checkout tags/4.3.7
103autoreconf -fi
104./configure \
105 --with-pipe \
106 --with-metadata \
107 --with-ssl=openssl \
108 --with-stdout \
109 --with-soxr \
110 PKG_CONFIG_PATH="/opt/homebrew/opt/openssl/lib/pkgconfig"
111make
112strip shairport-sync
113
114# Copy to provider bin directory
115cp shairport-sync ../music_assistant/providers/airplay_receiver/bin/shairport-sync-macos-$(uname -m)
116```
117
118## Docker Integration
119
120The Music Assistant base image (`Dockerfile.base`, `shairport-builder` stage) builds
121shairport-sync from source with the same configuration as `build_binaries.sh`, so the
122binary is always linked against the image's own libraries.
123
124### macOS Binary
125- **shairport-sync-macos-arm64** (~262 KB)
126
127â ï¸ **Important**: The macOS binary requires Homebrew libraries to be installed:
128```bash
129brew install openssl libdaemon libconfig popt libao pulseaudio libsoxr
130```
131
132For macOS development, it's easier to just install shairport-sync via Homebrew:
133```bash
134brew install shairport-sync
135```
136
137**For local Linux development:**
138```bash
139# Debian/Ubuntu (recommended)
140sudo apt-get install shairport-sync
141
142# Arch Linux
143sudo pacman -S shairport-sync
144
145# Fedora
146sudo dnf install shairport-sync
147```
148
149## Notes
150
151- The helper code in `helpers.py` will automatically:
152 1. Check for a bundled binary in this directory first (macOS only)
153 2. Fall back to system-installed shairport-sync in PATH (docker image, package managers)
154- Static linking is not feasible due to shairport-sync's numerous dependencies (glib, openssl, etc.)
155