Forráskód Böngészése

Mise à jour de 'Dockerfile'

penta 4 napja
szülő
commit
587044cdd6
1 módosított fájl, 67 hozzáadás és 0 törlés
  1. 67 0
      Dockerfile

+ 67 - 0
Dockerfile

@@ -191,6 +191,60 @@ RUN set -eux; \
     cp -a dist/. /out/; \
     test -f /out/index.html
 
+
+FROM docker.io/library/ubuntu:${DISTRIB_RELEASE} AS pixelflux-legacy-builder
+
+ARG DEBIAN_FRONTEND=noninteractive
+ARG PIXELFLUX_VERSION=1.6.4
+
+SHELL ["/bin/bash", "-o", "pipefail", "-c"]
+
+RUN apt-get update \
+    && apt-get install --no-install-recommends -y \
+        ca-certificates \
+        curl \
+        g++ \
+        libavcodec-dev \
+        libavutil-dev \
+        libjpeg-dev \
+        libx11-dev \
+        libx264-dev \
+        libxext-dev \
+        libxfixes-dev \
+        libyuv-dev \
+    && rm -rf /var/lib/apt/lists/*
+
+WORKDIR /tmp/pixelflux
+
+RUN curl -fsSL \
+        "https://codeload.github.com/linuxserver/pixelflux/tar.gz/refs/tags/${PIXELFLUX_VERSION}" \
+        -o /tmp/pixelflux.tar.gz \
+    && tar -xzf /tmp/pixelflux.tar.gz \
+        --strip-components=1 \
+        -C /tmp/pixelflux \
+    && mkdir -p /out \
+    && g++ \
+        -std=c++17 \
+        -Wno-unused-function \
+        -fPIC \
+        -O3 \
+        -flto \
+        -shared \
+        -Ipixelflux/include \
+        -o /out/screen_capture_module.so \
+        pixelflux/screen_capture_module.cpp \
+        pixelflux/include/xxhash.c \
+        -lX11 \
+        -lXext \
+        -lXfixes \
+        -ljpeg \
+        -lx264 \
+        -lyuv \
+        -ldl \
+        -lavcodec \
+        -lavutil \
+    && test -s /out/screen_capture_module.so
+
 # -----------------------------------------------------------------------------
 # Final image
 # -----------------------------------------------------------------------------
@@ -477,6 +531,19 @@ ENV PATH="/opt/selkies/bin:/usr/local/nvidia/bin:${PATH}" \
 # Install the Selkies wheel from the official stable build image.
 COPY --from=selkies-runtime-builder /opt/selkies /opt/selkies
 
+COPY --from=pixelflux-legacy-builder \
+    /out/screen_capture_module.so \
+    /tmp/screen_capture_module.so
+
+RUN set -eux; \
+    PIXELFLUX_DIR="$(/opt/selkies/bin/python -c \
+        'from pathlib import Path; import pixelflux; print(Path(pixelflux.__file__).resolve().parent)')"; \
+    install -m 0755 \
+        /tmp/screen_capture_module.so \
+        "${PIXELFLUX_DIR}/screen_capture_module.so"; \
+    ldd "${PIXELFLUX_DIR}/screen_capture_module.so"; \
+    test -z "$(ldd "${PIXELFLUX_DIR}/screen_capture_module.so" | grep 'not found' || true)"; \
+    rm -f /tmp/screen_capture_module.so
 
 COPY --chown=${USER_UID}:${USER_GID} \
     --from=selkies-web-builder \