Skip to content

Commit 4c17909

Browse files
matteiusclaude
andcommitted
Add Debian stable (trixie) .deb package builds
Parameterize the Dockerfile with DEBIAN_SUITE build arg (default: sid) so the same Dockerfile builds for both Debian sid and trixie (stable). Key changes: - Both FROM lines now use debian:${DEBIAN_SUITE}-slim - Runtime stage lets ffmpeg pull correct libav* versions per suite - Remove hardcoded libsimdjson30 (transitive dep, let apt resolve) - Add GOTOOLCHAIN=auto for go2rtc build (trixie Go 1.24 → auto-downloads 1.26) - Expand CI matrix to 6 builds (3 arches × 2 suites) - Generate suite-specific DEBIAN/control dependencies - .deb filenames now include suite: lightnvr_{ver}_{suite}_{arch}.deb Closes #349 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 57d3d2e commit 4c17909

2 files changed

Lines changed: 52 additions & 14 deletions

File tree

.github/workflows/debian-package.yml

Lines changed: 41 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,38 @@ permissions:
1212

1313
jobs:
1414
build-deb:
15-
name: Build .deb (${{ matrix.deb_arch }})
15+
name: Build .deb (${{ matrix.debian_suite }}/${{ matrix.deb_arch }})
1616
runs-on: ${{ matrix.runner }}
1717
strategy:
1818
fail-fast: false
1919
matrix:
2020
include:
21+
# Debian sid (unstable) builds
2122
- runner: ubuntu-latest
2223
platform: linux/amd64
2324
deb_arch: amd64
25+
debian_suite: sid
2426
- runner: ubuntu-24.04-arm
2527
platform: linux/arm64
2628
deb_arch: arm64
29+
debian_suite: sid
2730
- runner: ubuntu-latest
2831
platform: linux/arm/v7
2932
deb_arch: armhf
33+
debian_suite: sid
34+
# Debian trixie (13/stable) builds
35+
- runner: ubuntu-latest
36+
platform: linux/amd64
37+
deb_arch: amd64
38+
debian_suite: trixie
39+
- runner: ubuntu-24.04-arm
40+
platform: linux/arm64
41+
deb_arch: arm64
42+
debian_suite: trixie
43+
- runner: ubuntu-latest
44+
platform: linux/arm/v7
45+
deb_arch: armhf
46+
debian_suite: trixie
3047

3148
steps:
3249
- name: Checkout
@@ -56,12 +73,15 @@ jobs:
5673
push: false
5774
load: true
5875
tags: lightnvr-pkg:local
76+
build-args: |
77+
DEBIAN_SUITE=${{ matrix.debian_suite }}
5978
6079
- name: Extract files and create .deb package
6180
run: |
6281
VERSION="${{ steps.version.outputs.version }}"
6382
DEB_ARCH="${{ matrix.deb_arch }}"
64-
PKG_NAME="lightnvr_${VERSION}_${DEB_ARCH}"
83+
DEBIAN_SUITE="${{ matrix.debian_suite }}"
84+
PKG_NAME="lightnvr_${VERSION}_${DEBIAN_SUITE}_${DEB_ARCH}"
6585
PKG_DIR="$(pwd)/pkg/${PKG_NAME}"
6686
6787
# ── Directory structure ──────────────────────────────────────────────
@@ -186,6 +206,22 @@ jobs:
186206
# Un-indent the service file (heredoc indented for readability)
187207
sed -i 's/^ //' "${PKG_DIR}/lib/systemd/system/lightnvr.service"
188208
209+
# ── Suite-specific FFmpeg dependency names ─────────────────────────
210+
case "${DEBIAN_SUITE}" in
211+
sid)
212+
FFMPEG_DEPS="libavcodec62 | libavcodec-extra, libavformat62, libavutil60, libswscale9"
213+
SUITE_NOTE="Note: This package targets Debian sid (unstable)."
214+
;;
215+
trixie)
216+
FFMPEG_DEPS="libavcodec61 | libavcodec-extra, libavformat61, libavutil59, libswscale8"
217+
SUITE_NOTE="Note: This package targets Debian 13 trixie (stable)."
218+
;;
219+
*)
220+
echo "ERROR: Unknown Debian suite: ${DEBIAN_SUITE}"
221+
exit 1
222+
;;
223+
esac
224+
189225
# ── DEBIAN/control ──────────────────────────────────────────────────
190226
INSTALLED_SIZE=$(du -sk "${PKG_DIR}" | cut -f1)
191227
cat > "${PKG_DIR}/DEBIAN/control" << CONTROL_EOF
@@ -194,7 +230,7 @@ jobs:
194230
Architecture: ${DEB_ARCH}
195231
Maintainer: OpenSensor <support@opensensor.io>
196232
Installed-Size: ${INSTALLED_SIZE}
197-
Depends: ffmpeg, libavcodec62 | libavcodec-extra, libavformat62, libavutil60, libswscale9, libcurl4t64 | libcurl4, libmbedtls21, libmosquitto1, libcjson1, procps
233+
Depends: ffmpeg, ${FFMPEG_DEPS}, libcurl4t64 | libcurl4, libmbedtls21, libmosquitto1, libcjson1, procps
198234
Section: net
199235
Priority: optional
200236
Homepage: https://github.com/opensensor/lightNVR
@@ -205,7 +241,7 @@ jobs:
205241
Features: RTSP recording, WebRTC streaming (go2rtc), object detection
206242
(SOD), ONVIF discovery, MQTT integration, and a web-based UI.
207243
.
208-
Note: This package targets Debian sid. Ubuntu users are encouraged to
244+
${SUITE_NOTE} Ubuntu users are encouraged to
209245
use the official Docker image (ghcr.io/opensensor/lightnvr).
210246
CONTROL_EOF
211247
sed -i 's/^ //' "${PKG_DIR}/DEBIAN/control"
@@ -267,7 +303,7 @@ jobs:
267303
- name: Upload .deb artifact
268304
uses: actions/upload-artifact@v6
269305
with:
270-
name: deb-${{ matrix.deb_arch }}
306+
name: deb-${{ matrix.debian_suite }}-${{ matrix.deb_arch }}
271307
path: pkg/*.deb
272308
retention-days: 7
273309

Dockerfile

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
# Stage 1: Build image
2+
ARG DEBIAN_SUITE=sid
23
ARG SQLITE_YEAR=2026
34
ARG SQLITE_AUTOCONF_VERSION=3520000
45
ARG LIBUV_VERSION=1.52.1
56
ARG LLHTTP_VERSION=9.3.1
67

7-
FROM debian:sid-slim AS builder
8+
FROM debian:${DEBIAN_SUITE}-slim AS builder
89

10+
ARG DEBIAN_SUITE
911
ARG SQLITE_YEAR
1012
ARG SQLITE_AUTOCONF_VERSION
1113
ARG LIBUV_VERSION
@@ -15,14 +17,14 @@ ARG LLHTTP_VERSION
1517
ENV DEBIAN_FRONTEND=noninteractive
1618

1719
# Install build dependencies including Node.js and FFmpeg dev libraries
18-
# Debian sid ships Go 1.26, Node.js 22.x, npm, and FFmpeg 8.0.1 natively
20+
# sid ships Go 1.26+/Node 22.x/FFmpeg 8.x; trixie ships Go 1.24+/Node 20.x/FFmpeg 7.x
1921
RUN apt-get update && apt-get install -y \
2022
git cmake build-essential pkg-config file \
2123
libavcodec-dev libavformat-dev libavutil-dev libswscale-dev \
2224
libcurl4-openssl-dev \
2325
libmbedtls-dev curl wget ca-certificates gpg libcjson-dev \
2426
libmosquitto-dev \
25-
nodejs npm libsimdjson30 \
27+
nodejs npm \
2628
golang-go && \
2729
# Verify installation
2830
node --version && \
@@ -107,8 +109,8 @@ RUN mkdir -p /usr/lib/pkgconfig && \
107109
RUN mkdir -p /bin /etc/lightnvr/go2rtc && \
108110
# Build go2rtc from local submodule (already copied by COPY . .)
109111
cd /opt/go2rtc && \
110-
go mod tidy && \
111-
CGO_ENABLED=0 go build -ldflags "-s -w" -trimpath -o /bin/go2rtc . && \
112+
GOTOOLCHAIN=auto go mod tidy && \
113+
GOTOOLCHAIN=auto CGO_ENABLED=0 go build -ldflags "-s -w" -trimpath -o /bin/go2rtc . && \
112114
chmod +x /bin/go2rtc && \
113115
# Create basic configuration file
114116
echo "# go2rtc configuration file" > /etc/lightnvr/go2rtc/go2rtc.yaml && \
@@ -168,19 +170,19 @@ RUN mkdir -p /etc/lightnvr /var/lib/lightnvr/data /var/log/lightnvr /var/run/lig
168170
./scripts/install.sh --prefix=/ --with-go2rtc --go2rtc-config-dir=/etc/lightnvr/go2rtc --without-systemd
169171

170172
# Stage 2: Minimal runtime image
171-
FROM debian:sid-slim AS runtime
173+
FROM debian:${DEBIAN_SUITE}-slim AS runtime
172174

175+
ARG DEBIAN_SUITE
173176
ARG SQLITE_YEAR
174177
ARG SQLITE_AUTOCONF_VERSION
175178

176179
ENV DEBIAN_FRONTEND=noninteractive
177180

178181
# Install only necessary runtime dependencies
179-
# Debian sid ships FFmpeg 8.0.1: libavcodec62, libavformat62, libavutil60, libswscale9
180-
# ffmpeg CLI is needed by go2rtc for audio transcoding (AAC→OPUS for WebRTC)
182+
# ffmpeg pulls the correct versioned libavcodec/libavformat/libavutil/libswscale
183+
# for the target suite (e.g. libavcodec62 on sid, libavcodec61 on trixie)
181184
RUN apt-get update && apt-get install -y --no-install-recommends \
182185
ffmpeg \
183-
libavcodec62 libavformat62 libavutil60 libswscale9 \
184186
libcurl4t64 libmbedtls21 libmbedcrypto16 procps curl ca-certificates \
185187
libmosquitto1 && \
186188
rm -rf /var/lib/apt/lists/*

0 commit comments

Comments
 (0)