From ae4853dde4aa7807dd80bb39ed103a06ec688cf8 Mon Sep 17 00:00:00 2001 From: thespad Date: Tue, 3 Dec 2024 09:58:24 +0000 Subject: [PATCH] Patch files at build time --- Dockerfile | 4 +++- {root/patch => patch}/__main__.patch | 0 {root/patch => patch}/process.patch | 0 root/etc/s6-overlay/s6-rc.d/init-piper-config/run | 3 --- 4 files changed, 3 insertions(+), 4 deletions(-) rename {root/patch => patch}/__main__.patch (100%) rename {root/patch => patch}/process.patch (100%) diff --git a/Dockerfile b/Dockerfile index c34c556..845b8b5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,7 +12,7 @@ LABEL maintainer="thespad" ENV DEBIAN_FRONTEND="noninteractive" \ TMPDIR="/run/piper-temp" -RUN \ +RUN --mount=type=bind,source=/patch,target=/patch \ apt-get update && \ apt-get install -y --no-install-recommends \ build-essential \ @@ -53,6 +53,8 @@ RUN \ cmake --build build --config Release && \ cmake --install build && \ cp -dR /tmp/piper-build/install/* /usr/share/piper && \ + patch /lsiopy/lib/python3.12/site-packages/wyoming_piper/__main__.py < /patch/__main__.patch && \ + patch /lsiopy/lib/python3.12/site-packages/wyoming_piper/process.py < /patch/process.patch && \ printf "Linuxserver.io version: ${VERSION}\nBuild-date: ${BUILD_DATE}" > /build_version && \ echo "**** cleanup ****" && \ apt-get purge -y \ diff --git a/root/patch/__main__.patch b/patch/__main__.patch similarity index 100% rename from root/patch/__main__.patch rename to patch/__main__.patch diff --git a/root/patch/process.patch b/patch/process.patch similarity index 100% rename from root/patch/process.patch rename to patch/process.patch diff --git a/root/etc/s6-overlay/s6-rc.d/init-piper-config/run b/root/etc/s6-overlay/s6-rc.d/init-piper-config/run index a4d8945..190762a 100755 --- a/root/etc/s6-overlay/s6-rc.d/init-piper-config/run +++ b/root/etc/s6-overlay/s6-rc.d/init-piper-config/run @@ -3,9 +3,6 @@ mkdir -p /run/piper-temp -patch /lsiopy/lib/python3.12/site-packages/wyoming_piper/process.py < /patch/process.patch -patch /lsiopy/lib/python3.12/site-packages/wyoming_piper/__main__.py < /patch/__main__.patch - # permissions lsiown -R abc:abc \ /config \