Files
Martin Bauer a6d4180b2b Build squeezelite on the device on a 64-bit or trixie userland
The shipped squeezelite is a 32-bit ARM binary linked against libFLAC.so.12 (bookworm
on armhf). Elsewhere the role now builds upstream squeezelite at a pinned commit with
the same options as the old ARM build, installing the -dev packages instead of
soname-specific runtime libraries. `ansible_architecture` is the kernel's, so the
choice reads the userland's architecture from dpkg; override with
`pi_squeezelite_custom_build_from_source: true|false`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-02 23:14:18 +02:00

42 lines
1.4 KiB
YAML

---
- name: Check out squeezelite
ansible.builtin.git:
repo: "{{ pi_squeezelite_custom_repo }}"
dest: /opt/squeezelite-src
version: "{{ pi_squeezelite_custom_version }}"
force: true
register: pi_squeezelite_custom_checkout
- name: Check whether a built binary already exists
ansible.builtin.stat:
path: /opt/squeezelite
register: pi_squeezelite_custom_binary
- name: Write the makefile (upstream Makefile plus this build's options)
# Same options as the ARM build in "custom build/readme_build.md", minus the ARMv6
# -march/-mfpu/-mfloat-abi flags that make no sense for aarch64. No RPI (GPIO switching)
# option. -lasound is added explicitly, as before.
ansible.builtin.copy:
dest: /opt/squeezelite-src/mymakefile
mode: "0644"
content: |
OPTS = -DLINUX -DRESAMPLE -DDSD -DUSE_SSL -DLINKALL -I./include -I./include/opus -I./include/alac -I/usr/local/include
LDFLAGS = -L./lib -L/usr/local/lib -s -lasound
include Makefile
- name: Build squeezelite
ansible.builtin.shell:
cmd: make -f mymakefile clean && make -f mymakefile
chdir: /opt/squeezelite-src
when: pi_squeezelite_custom_checkout.changed or not pi_squeezelite_custom_binary.stat.exists
changed_when: true
- name: Install built squeezelite
ansible.builtin.copy:
src: /opt/squeezelite-src/squeezelite
dest: /opt/squeezelite
mode: "700"
remote_src: true
notify: Restart squeezelite