The shipped irserver is a 32-bit ARM binary linked against libzip.so.4, which only exists on armhf with Debian 12 or older. On a 64-bit userland or trixie it cannot run, so the role now compiles the bundled 2019 sources on the device there, with GCC 14's new hard errors (implicit declarations, implicit int, pointer/int mix-ups) downgraded rather than the old code patched. Picked from `dpkg --print-architecture` and the distribution version; `pi_irserver_build_from_source: true|false` forces it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
45 lines
1.4 KiB
YAML
45 lines
1.4 KiB
YAML
---
|
|
- name: Install irserver build dependencies
|
|
ansible.builtin.apt:
|
|
name:
|
|
- build-essential
|
|
- libzip-dev
|
|
cache_valid_time: 7200
|
|
|
|
- name: Create irserver source directory
|
|
ansible.builtin.file:
|
|
path: /opt/irserver-src
|
|
state: directory
|
|
mode: "0755"
|
|
|
|
- name: Unpack irserver source
|
|
ansible.builtin.unarchive:
|
|
src: irserver-src.tar.gz
|
|
dest: /opt/irserver-src
|
|
creates: /opt/irserver-src/makefile
|
|
|
|
- name: Build irserver
|
|
# The 2019 sources predate modern C: GCC 14 rejects implicit function declarations,
|
|
# implicit int and a few pointer/int mix-ups as hard errors. They are old but working
|
|
# code, so the errors are downgraded rather than the source patched. libzip comes from
|
|
# libzip-dev (`irserver_arm_noccf` links -lzip); the bundled 32-bit static libzip*.a
|
|
# are not used. `arm/` is where the makefile puts its objects.
|
|
ansible.builtin.shell:
|
|
cmd: |
|
|
set -e
|
|
mkdir -p arm
|
|
make irserver_arm_noccf LDFLAGS="-lzip" \
|
|
CFLAGS="-w -Wno-error=implicit-function-declaration -Wno-error=int-conversion \
|
|
-Wno-error=incompatible-pointer-types -Wno-error=return-mismatch \
|
|
-Wno-error=implicit-int"
|
|
chdir: /opt/irserver-src
|
|
creates: /opt/irserver-src/irserver
|
|
|
|
- name: Install built irserver
|
|
ansible.builtin.copy:
|
|
src: /opt/irserver-src/irserver
|
|
dest: /usr/bin/irserver
|
|
mode: u+rx
|
|
remote_src: true
|
|
notify: Restart irserver
|