Use templating with Dockerfile in order to have less rebuilds

This commit is contained in:
Ilya Fedin 2022-06-28 15:32:29 +04:00 committed by John Preston
parent 653f17915e
commit 9502ce8b32
8 changed files with 316 additions and 198 deletions

View File

@ -24,8 +24,16 @@ jobs:
with: with:
submodules: recursive submodules: recursive
- name: First set up.
run: |
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python -
echo $HOME/.poetry/bin >> $GITHUB_PATH
- name: Docker image build. - name: Docker image build.
run: docker build -t $IMAGE_TAG --build-arg DEBUG= Telegram/build/docker/centos_env run: |
cd Telegram/build/docker/centos_env
poetry install
DEBUG= poetry run gen_dockerfile | docker build -t $IMAGE_TAG -
- name: Push the Docker image. - name: Push the Docker image.
if: ${{ github.ref_name == github.event.repository.default_branch }} if: ${{ github.ref_name == github.event.repository.default_branch }}

View File

@ -0,0 +1 @@
__pycache__

View File

@ -1,21 +1,18 @@
ARG DEBUG 1 {%- set GIT = "https://github.com" -%}
{%- set GIT_FREEDESKTOP = GIT ~ "/gitlab-freedesktop-mirrors" -%}
{%- set QT = "6_3_1" -%}
{%- set QT_TAG = "v6.3.1" -%}
{%- set QT_PREFIX = "/usr/local/desktop-app/Qt-6.3.1" -%}
{%- set OPENSSL_VER = "1_1_1" -%}
{%- set OPENSSL_PREFIX = "/usr/local/desktop-app/openssl-1.1.1" -%}
{%- set CMAKE_VER = "3.21.3" -%}
{%- set CMAKE_FILE = "cmake-" ~ CMAKE_VER ~ "-Linux-x86_64.sh" -%}
{%- set HFLAGS_DEBUG = "-fstack-protector-all -fstack-clash-protection -fPIC" -%}
{%- set HFLAGS = HFLAGS_DEBUG ~ " -D_FORTIFY_SOURCE=2" -%}
{%- set LibrariesPath = "/usr/src/Libraries" -%}
FROM centos:7 AS builder FROM centos:7 AS builder
ENV GIT https://github.com
ENV GIT_FREEDESKTOP ${GIT}/gitlab-freedesktop-mirrors
ENV PKG_CONFIG_PATH /usr/local/lib64/pkgconfig:/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig ENV PKG_CONFIG_PATH /usr/local/lib64/pkgconfig:/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig
ENV QT 6_3_1
ENV QT_TAG v6.3.1
ENV QT_PREFIX /usr/local/desktop-app/Qt-6.3.1
ENV OPENSSL_VER 1_1_1
ENV OPENSSL_PREFIX /usr/local/desktop-app/openssl-1.1.1
ENV OPENSSL_ROOT_DIR ${OPENSSL_PREFIX}
ENV CMAKE_VER 3.21.3
ENV CMAKE_FILE cmake-$CMAKE_VER-Linux-x86_64.sh
ENV CMAKE_PREFIX_PATH ${QT_PREFIX}
ENV PATH ${QT_PREFIX}/bin:${PATH}
ENV HFLAGS_DEBUG "-fstack-protector-all -fstack-clash-protection -fPIC"
ENV HFLAGS "$HFLAGS_DEBUG -D_FORTIFY_SOURCE=2"
RUN yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm \ RUN yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm \
&& yum -y install https://packages.endpointdev.com/rhel/7/os/x86_64/endpoint-repo.x86_64.rpm \ && yum -y install https://packages.endpointdev.com/rhel/7/os/x86_64/endpoint-repo.x86_64.rpm \
@ -35,88 +32,87 @@ RUN sed -i 's/char \*__block/char */' /usr/include/unistd.h
SHELL [ "bash", "-c", ". /opt/rh/devtoolset-10/enable; exec bash -c \"$@\"", "-s"] SHELL [ "bash", "-c", ". /opt/rh/devtoolset-10/enable; exec bash -c \"$@\"", "-s"]
ENV LibrariesPath /usr/src/Libraries WORKDIR {{ LibrariesPath }}
WORKDIR $LibrariesPath
RUN mkdir /opt/cmake \ RUN mkdir /opt/cmake \
&& curl -sSLo $CMAKE_FILE $GIT/Kitware/CMake/releases/download/v$CMAKE_VER/$CMAKE_FILE \ && curl -sSLo {{ CMAKE_FILE }} {{ GIT }}/Kitware/CMake/releases/download/v{{ CMAKE_VER }}/{{ CMAKE_FILE }} \
&& sh $CMAKE_FILE --prefix=/opt/cmake --skip-license \ && sh {{ CMAKE_FILE }} --prefix=/opt/cmake --skip-license \
&& ln -s /opt/cmake/bin/cmake /usr/local/bin/cmake \ && ln -s /opt/cmake/bin/cmake /usr/local/bin/cmake \
&& rm $CMAKE_FILE && rm {{ CMAKE_FILE }}
FROM builder AS patches FROM builder AS patches
RUN git clone $GIT/desktop-app/patches.git \ RUN git clone {{ GIT }}/desktop-app/patches.git \
&& cd patches \ && cd patches \
&& git checkout 4a5c759f8f \ && git checkout 4a5c759f8f \
&& rm -rf .git && rm -rf .git
FROM builder AS libffi FROM builder AS libffi
RUN git clone -b v3.4.2 --depth=1 $GIT/libffi/libffi.git \ RUN git clone -b v3.4.2 --depth=1 {{ GIT }}/libffi/libffi.git \
&& cd libffi \ && cd libffi \
&& ./autogen.sh \ && ./autogen.sh \
&& ./configure --enable-static --disable-docs \ && ./configure --enable-static --disable-docs \
&& make -j$(nproc) \ && make -j$(nproc) \
&& make DESTDIR="$LibrariesPath/libffi-cache" install \ && make DESTDIR="{{ LibrariesPath }}/libffi-cache" install \
&& cd .. \ && cd .. \
&& rm -rf libffi && rm -rf libffi
FROM builder AS zlib FROM builder AS zlib
RUN git clone -b v1.2.11 --depth=1 $GIT/madler/zlib.git \ RUN git clone -b v1.2.11 --depth=1 {{ GIT }}/madler/zlib.git \
&& cd zlib \ && cd zlib \
&& CFLAGS="-O3 $HFLAGS" ./configure --static \ && CFLAGS="-O3 {{ HFLAGS }}" ./configure --static \
&& make -j$(nproc) \ && make -j$(nproc) \
&& make DESTDIR="$LibrariesPath/zlib-cache" install \ && make DESTDIR="{{ LibrariesPath }}/zlib-cache" install \
&& cd .. \ && cd .. \
&& rm -rf zlib && rm -rf zlib
FROM builder AS xz FROM builder AS xz
RUN git clone -b v5.2.5 https://git.tukaani.org/xz.git \ RUN git clone -b v5.2.5 https://git.tukaani.org/xz.git \
&& cd xz \ && cd xz \
&& CFLAGS="$HFLAGS" cmake -GNinja -B build . -DCMAKE_BUILD_TYPE=Release \ && CFLAGS="{{ HFLAGS }}" cmake -GNinja -B build . -DCMAKE_BUILD_TYPE=Release \
&& cmake --build build --parallel \ && cmake --build build --parallel \
&& DESTDIR="$LibrariesPath/xz-cache" cmake --install build \ && DESTDIR="{{ LibrariesPath }}/xz-cache" cmake --install build \
&& cd .. \ && cd .. \
&& rm -rf xz && rm -rf xz
FROM patches AS libproxy FROM patches AS libproxy
RUN git clone -b 0.4.17 --depth=1 $GIT/libproxy/libproxy.git \ RUN git clone -b 0.4.17 --depth=1 {{ GIT }}/libproxy/libproxy.git \
&& cd libproxy \ && cd libproxy \
&& git apply ../patches/libproxy.patch \ && git apply ../patches/libproxy.patch \
&& CFLAGS="$HFLAGS" CXXFLAGS="$HFLAGS" cmake -GNinja -B build . \ && CFLAGS="{{ HFLAGS }}" CXXFLAGS="{{ HFLAGS }}" cmake -GNinja -B build . \
-DCMAKE_BUILD_TYPE=Release \ -DCMAKE_BUILD_TYPE=Release \
-DWITH_DBUS=OFF \ -DWITH_DBUS=OFF \
-DWITH_NM=OFF \ -DWITH_NM=OFF \
-DWITH_NMold=OFF \ -DWITH_NMold=OFF \
&& cmake --build build --parallel \ && cmake --build build --parallel \
&& DESTDIR="$LibrariesPath/libproxy-cache" cmake --install build \ && DESTDIR="{{ LibrariesPath }}/libproxy-cache" cmake --install build \
&& cd .. \ && cd .. \
&& rm -rf libproxy && rm -rf libproxy
FROM builder AS mozjpeg FROM builder AS mozjpeg
RUN git clone -b v4.0.3 --depth=1 $GIT/mozilla/mozjpeg.git \ RUN git clone -b v4.0.3 --depth=1 {{ GIT }}/mozilla/mozjpeg.git \
&& cd mozjpeg \ && cd mozjpeg \
&& CFLAGS="$HFLAGS" cmake -GNinja -B build . \ && CFLAGS="{{ HFLAGS }}" cmake -GNinja -B build . \
-DCMAKE_BUILD_TYPE=Release \ -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr/local \ -DCMAKE_INSTALL_PREFIX=/usr/local \
-DWITH_JPEG8=ON \ -DWITH_JPEG8=ON \
-DPNG_SUPPORTED=OFF \ -DPNG_SUPPORTED=OFF \
&& cmake --build build --parallel \ && cmake --build build --parallel \
&& DESTDIR="$LibrariesPath/mozjpeg-cache" cmake --install build \ && DESTDIR="{{ LibrariesPath }}/mozjpeg-cache" cmake --install build \
&& cd .. \ && cd .. \
&& rm -rf mozjpeg && rm -rf mozjpeg
FROM builder AS opus FROM builder AS opus
RUN git clone -b v1.3.1 --depth=1 $GIT/xiph/opus.git \ RUN git clone -b v1.3.1 --depth=1 {{ GIT }}/xiph/opus.git \
&& cd opus \ && cd opus \
&& ./autogen.sh \ && ./autogen.sh \
&& CFLAGS="-g -O2 $HFLAGS" ./configure \ && CFLAGS="-g -O2 {{ HFLAGS }}" ./configure \
&& make -j$(nproc) \ && make -j$(nproc) \
&& make DESTDIR="$LibrariesPath/opus-cache" install \ && make DESTDIR="{{ LibrariesPath }}/opus-cache" install \
&& cd .. \ && cd .. \
&& rm -rf opus && rm -rf opus
FROM builder AS libvpx FROM builder AS libvpx
RUN git clone -b v1.11.0 --depth=1 $GIT/webmproject/libvpx.git \ RUN git clone -b v1.11.0 --depth=1 {{ GIT }}/webmproject/libvpx.git \
&& cd libvpx \ && cd libvpx \
&& ./configure \ && ./configure \
--disable-examples \ --disable-examples \
@ -127,156 +123,156 @@ RUN git clone -b v1.11.0 --depth=1 $GIT/webmproject/libvpx.git \
--enable-vp9 \ --enable-vp9 \
--enable-webm-io \ --enable-webm-io \
&& make -j$(nproc) \ && make -j$(nproc) \
&& make DESTDIR="$LibrariesPath/libvpx-cache" install \ && make DESTDIR="{{ LibrariesPath }}/libvpx-cache" install \
&& cd .. \ && cd .. \
&& rm -rf libvpx && rm -rf libvpx
FROM builder AS rnnoise FROM builder AS rnnoise
RUN git clone -b master --depth=1 $GIT/desktop-app/rnnoise \ RUN git clone -b master --depth=1 {{ GIT }}/desktop-app/rnnoise \
&& cd rnnoise \ && cd rnnoise \
&& CFLAGS="$HFLAGS" cmake -GNinja -B build . -DCMAKE_BUILD_TYPE=Release \ && CFLAGS="{{ HFLAGS }}" cmake -GNinja -B build . -DCMAKE_BUILD_TYPE=Release \
&& cmake --build build --parallel \ && cmake --build build --parallel \
&& mkdir -p "$LibrariesPath/rnnoise-cache/usr/local/include" \ && mkdir -p "{{ LibrariesPath }}/rnnoise-cache/usr/local/include" \
&& cp "include/rnnoise.h" "$LibrariesPath/rnnoise-cache/usr/local/include/" \ && cp "include/rnnoise.h" "{{ LibrariesPath }}/rnnoise-cache/usr/local/include/" \
&& mkdir -p "$LibrariesPath/rnnoise-cache/usr/local/lib" \ && mkdir -p "{{ LibrariesPath }}/rnnoise-cache/usr/local/lib" \
&& cp "build/librnnoise.a" "$LibrariesPath/rnnoise-cache/usr/local/lib/" \ && cp "build/librnnoise.a" "{{ LibrariesPath }}/rnnoise-cache/usr/local/lib/" \
&& cd .. \ && cd .. \
&& rm -rf rnnoise && rm -rf rnnoise
FROM builder AS xcb-proto FROM builder AS xcb-proto
RUN git clone -b xcb-proto-1.14.1 --depth=1 $GIT_FREEDESKTOP/xcbproto.git \ RUN git clone -b xcb-proto-1.14.1 --depth=1 {{ GIT_FREEDESKTOP }}/xcbproto.git \
&& cd xcbproto \ && cd xcbproto \
&& ./autogen.sh \ && ./autogen.sh \
&& make -j$(nproc) \ && make -j$(nproc) \
&& make DESTDIR="$LibrariesPath/xcb-proto-cache" install \ && make DESTDIR="{{ LibrariesPath }}/xcb-proto-cache" install \
&& cd .. \ && cd .. \
&& rm -rf xcbproto && rm -rf xcbproto
FROM builder AS xcb FROM builder AS xcb
COPY --from=xcb-proto ${LibrariesPath}/xcb-proto-cache / COPY --from=xcb-proto {{ LibrariesPath }}/xcb-proto-cache /
RUN git clone -b libxcb-1.14 --depth=1 $GIT_FREEDESKTOP/libxcb.git \ RUN git clone -b libxcb-1.14 --depth=1 {{ GIT_FREEDESKTOP }}/libxcb.git \
&& cd libxcb \ && cd libxcb \
&& CFLAGS="-g -O2 $HFLAGS" ./autogen.sh --enable-static \ && CFLAGS="-g -O2 {{ HFLAGS }}" ./autogen.sh --enable-static \
&& make -j$(nproc) \ && make -j$(nproc) \
&& make DESTDIR="$LibrariesPath/xcb-cache" install \ && make DESTDIR="{{ LibrariesPath }}/xcb-cache" install \
&& cd .. \ && cd .. \
&& rm -rf libxcb && rm -rf libxcb
FROM builder AS xcb-wm FROM builder AS xcb-wm
RUN git clone -b 0.4.1 --depth=1 --recursive $GIT_FREEDESKTOP/libxcb-wm.git \ RUN git clone -b 0.4.1 --depth=1 --recursive {{ GIT_FREEDESKTOP }}/libxcb-wm.git \
&& cd libxcb-wm \ && cd libxcb-wm \
&& ./autogen.sh --enable-static \ && ./autogen.sh --enable-static \
&& make -j$(nproc) \ && make -j$(nproc) \
&& make DESTDIR="$LibrariesPath/xcb-wm-cache" install \ && make DESTDIR="{{ LibrariesPath }}/xcb-wm-cache" install \
&& cd .. \ && cd .. \
&& rm -rf libxcb-wm && rm -rf libxcb-wm
FROM builder AS xcb-util FROM builder AS xcb-util
RUN git clone -b 0.4.0 --depth=1 --recursive $GIT_FREEDESKTOP/libxcb-util.git \ RUN git clone -b 0.4.0 --depth=1 --recursive {{ GIT_FREEDESKTOP }}/libxcb-util.git \
&& cd libxcb-util \ && cd libxcb-util \
&& ./autogen.sh --enable-static \ && ./autogen.sh --enable-static \
&& make -j$(nproc) \ && make -j$(nproc) \
&& make DESTDIR="$LibrariesPath/xcb-util-cache" install \ && make DESTDIR="{{ LibrariesPath }}/xcb-util-cache" install \
&& cd .. \ && cd .. \
&& rm -rf libxcb-util && rm -rf libxcb-util
FROM builder AS xcb-image FROM builder AS xcb-image
COPY --from=xcb-util ${LibrariesPath}/xcb-util-cache / COPY --from=xcb-util {{ LibrariesPath }}/xcb-util-cache /
RUN git clone -b 0.4.0 --depth=1 --recursive $GIT_FREEDESKTOP/libxcb-image.git \ RUN git clone -b 0.4.0 --depth=1 --recursive {{ GIT_FREEDESKTOP }}/libxcb-image.git \
&& cd libxcb-image \ && cd libxcb-image \
&& CFLAGS="-g -O2 $HFLAGS" ./autogen.sh --enable-static \ && CFLAGS="-g -O2 {{ HFLAGS }}" ./autogen.sh --enable-static \
&& make -j$(nproc) \ && make -j$(nproc) \
&& make DESTDIR="$LibrariesPath/xcb-image-cache" install \ && make DESTDIR="{{ LibrariesPath }}/xcb-image-cache" install \
&& cd .. \ && cd .. \
&& rm -rf libxcb-image && rm -rf libxcb-image
FROM builder AS xcb-keysyms FROM builder AS xcb-keysyms
RUN git clone -b 0.4.0 --depth=1 --recursive $GIT_FREEDESKTOP/libxcb-keysyms.git \ RUN git clone -b 0.4.0 --depth=1 --recursive {{ GIT_FREEDESKTOP }}/libxcb-keysyms.git \
&& cd libxcb-keysyms \ && cd libxcb-keysyms \
&& CFLAGS="-g -O2 $HFLAGS" ./autogen.sh --enable-static \ && CFLAGS="-g -O2 {{ HFLAGS }}" ./autogen.sh --enable-static \
&& make -j$(nproc) \ && make -j$(nproc) \
&& make DESTDIR="$LibrariesPath/xcb-keysyms-cache" install \ && make DESTDIR="{{ LibrariesPath }}/xcb-keysyms-cache" install \
&& cd .. \ && cd .. \
&& rm -rf libxcb-keysyms && rm -rf libxcb-keysyms
FROM builder AS xcb-render-util FROM builder AS xcb-render-util
RUN git clone -b 0.3.9 --depth=1 --recursive $GIT_FREEDESKTOP/libxcb-render-util.git \ RUN git clone -b 0.3.9 --depth=1 --recursive {{ GIT_FREEDESKTOP }}/libxcb-render-util.git \
&& cd libxcb-render-util \ && cd libxcb-render-util \
&& CFLAGS="-g -O2 $HFLAGS" ./autogen.sh --enable-static \ && CFLAGS="-g -O2 {{ HFLAGS }}" ./autogen.sh --enable-static \
&& make -j$(nproc) \ && make -j$(nproc) \
&& make DESTDIR="$LibrariesPath/xcb-render-util-cache" install \ && make DESTDIR="{{ LibrariesPath }}/xcb-render-util-cache" install \
&& cd .. \ && cd .. \
&& rm -rf libxcb-render-util && rm -rf libxcb-render-util
FROM builder AS libXext FROM builder AS libXext
RUN git clone -b libXext-1.3.4 --depth=1 $GIT_FREEDESKTOP/libxext.git \ RUN git clone -b libXext-1.3.4 --depth=1 {{ GIT_FREEDESKTOP }}/libxext.git \
&& cd libxext \ && cd libxext \
&& CFLAGS="-g -O2 $HFLAGS" ./autogen.sh --enable-static \ && CFLAGS="-g -O2 {{ HFLAGS }}" ./autogen.sh --enable-static \
&& make -j$(nproc) \ && make -j$(nproc) \
&& make DESTDIR="$LibrariesPath/libXext-cache" install \ && make DESTDIR="{{ LibrariesPath }}/libXext-cache" install \
&& cd .. \ && cd .. \
&& rm -rf libxext && rm -rf libxext
FROM builder AS libXtst FROM builder AS libXtst
RUN git clone -b libXtst-1.2.3 --depth=1 $GIT_FREEDESKTOP/libxtst.git \ RUN git clone -b libXtst-1.2.3 --depth=1 {{ GIT_FREEDESKTOP }}/libxtst.git \
&& cd libxtst \ && cd libxtst \
&& CFLAGS="-g -O2 $HFLAGS" ./autogen.sh --enable-static \ && CFLAGS="-g -O2 {{ HFLAGS }}" ./autogen.sh --enable-static \
&& make -j$(nproc) \ && make -j$(nproc) \
&& make DESTDIR="$LibrariesPath/libXtst-cache" install \ && make DESTDIR="{{ LibrariesPath }}/libXtst-cache" install \
&& cd .. \ && cd .. \
&& rm -rf libxtst && rm -rf libxtst
FROM builder AS libXfixes FROM builder AS libXfixes
RUN git clone -b libXfixes-5.0.3 --depth=1 $GIT_FREEDESKTOP/libxfixes.git \ RUN git clone -b libXfixes-5.0.3 --depth=1 {{ GIT_FREEDESKTOP }}/libxfixes.git \
&& cd libxfixes \ && cd libxfixes \
&& CFLAGS="-g -O2 $HFLAGS" ./autogen.sh --enable-static \ && CFLAGS="-g -O2 {{ HFLAGS }}" ./autogen.sh --enable-static \
&& make -j$(nproc) \ && make -j$(nproc) \
&& make DESTDIR="$LibrariesPath/libXfixes-cache" install \ && make DESTDIR="{{ LibrariesPath }}/libXfixes-cache" install \
&& cd .. \ && cd .. \
&& rm -rf libxfixes && rm -rf libxfixes
FROM builder AS libXrandr FROM builder AS libXrandr
RUN git clone -b libXrandr-1.5.2 --depth=1 $GIT_FREEDESKTOP/libxrandr.git \ RUN git clone -b libXrandr-1.5.2 --depth=1 {{ GIT_FREEDESKTOP }}/libxrandr.git \
&& cd libxrandr \ && cd libxrandr \
&& CFLAGS="-g -O2 $HFLAGS" ./autogen.sh --enable-static \ && CFLAGS="-g -O2 {{ HFLAGS }}" ./autogen.sh --enable-static \
&& make -j$(nproc) \ && make -j$(nproc) \
&& make DESTDIR="$LibrariesPath/libXrandr-cache" install \ && make DESTDIR="{{ LibrariesPath }}/libXrandr-cache" install \
&& cd .. \ && cd .. \
&& rm -rf libxrandr && rm -rf libxrandr
FROM builder AS libXrender FROM builder AS libXrender
RUN git clone -b libXrender-0.9.10 --depth=1 $GIT_FREEDESKTOP/libxrender.git \ RUN git clone -b libXrender-0.9.10 --depth=1 {{ GIT_FREEDESKTOP }}/libxrender.git \
&& cd libxrender \ && cd libxrender \
&& CFLAGS="-g -O2 $HFLAGS" ./autogen.sh --enable-static \ && CFLAGS="-g -O2 {{ HFLAGS }}" ./autogen.sh --enable-static \
&& make -j$(nproc) \ && make -j$(nproc) \
&& make DESTDIR="$LibrariesPath/libXrender-cache" install \ && make DESTDIR="{{ LibrariesPath }}/libXrender-cache" install \
&& cd .. \ && cd .. \
&& rm -rf libxrender && rm -rf libxrender
FROM builder AS libXdamage FROM builder AS libXdamage
RUN git clone -b libXdamage-1.1.5 --depth=1 $GIT_FREEDESKTOP/libxdamage.git \ RUN git clone -b libXdamage-1.1.5 --depth=1 {{ GIT_FREEDESKTOP }}/libxdamage.git \
&& cd libxdamage \ && cd libxdamage \
&& CFLAGS="-g -O2 $HFLAGS" ./autogen.sh --enable-static \ && CFLAGS="-g -O2 {{ HFLAGS }}" ./autogen.sh --enable-static \
&& make -j$(nproc) \ && make -j$(nproc) \
&& make DESTDIR="$LibrariesPath/libXdamage-cache" install \ && make DESTDIR="{{ LibrariesPath }}/libXdamage-cache" install \
&& cd .. \ && cd .. \
&& rm -rf libxdamage && rm -rf libxdamage
FROM builder AS libXcomposite FROM builder AS libXcomposite
RUN git clone -b libXcomposite-0.4.5 --depth=1 $GIT_FREEDESKTOP/libxcomposite.git \ RUN git clone -b libXcomposite-0.4.5 --depth=1 {{ GIT_FREEDESKTOP }}/libxcomposite.git \
&& cd libxcomposite \ && cd libxcomposite \
&& CFLAGS="-g -O2 $HFLAGS" ./autogen.sh --enable-static \ && CFLAGS="-g -O2 {{ HFLAGS }}" ./autogen.sh --enable-static \
&& make -j$(nproc) \ && make -j$(nproc) \
&& make DESTDIR="$LibrariesPath/libXcomposite-cache" install \ && make DESTDIR="{{ LibrariesPath }}/libXcomposite-cache" install \
&& cd .. \ && cd .. \
&& rm -rf libxcomposite && rm -rf libxcomposite
FROM builder AS wayland FROM builder AS wayland
COPY --from=libffi ${LibrariesPath}/libffi-cache / COPY --from=libffi {{ LibrariesPath }}/libffi-cache /
RUN git clone -b 1.20.0 --depth=1 $GIT_FREEDESKTOP/wayland.git \ RUN git clone -b 1.20.0 --depth=1 {{ GIT_FREEDESKTOP }}/wayland.git \
&& cd wayland \ && cd wayland \
&& meson build \ && meson build \
--buildtype=release \ --buildtype=release \
@ -286,28 +282,28 @@ RUN git clone -b 1.20.0 --depth=1 $GIT_FREEDESKTOP/wayland.git \
-Ddtd_validation=false \ -Ddtd_validation=false \
-Dicon_directory=/usr/share/icons \ -Dicon_directory=/usr/share/icons \
&& meson compile -C build \ && meson compile -C build \
&& DESTDIR="$LibrariesPath/wayland-cache" meson install -C build \ && DESTDIR="{{ LibrariesPath }}/wayland-cache" meson install -C build \
&& cd .. \ && cd .. \
&& rm -rf wayland && rm -rf wayland
FROM builder AS nv-codec-headers FROM builder AS nv-codec-headers
RUN git clone -b n11.1.5.1 --depth=1 https://github.com/FFmpeg/nv-codec-headers.git \ RUN git clone -b n11.1.5.1 --depth=1 {{ GIT }}/FFmpeg/nv-codec-headers.git \
&& DESTDIR="$LibrariesPath/nv-codec-headers-cache" make -C nv-codec-headers install \ && DESTDIR="{{ LibrariesPath }}/nv-codec-headers-cache" make -C nv-codec-headers install \
&& rm -rf nv-codec-headers && rm -rf nv-codec-headers
FROM builder AS ffmpeg FROM builder AS ffmpeg
COPY --from=opus ${LibrariesPath}/opus-cache / COPY --from=opus {{ LibrariesPath }}/opus-cache /
COPY --from=libvpx ${LibrariesPath}/libvpx-cache / COPY --from=libvpx {{ LibrariesPath }}/libvpx-cache /
COPY --from=nv-codec-headers ${LibrariesPath}/nv-codec-headers-cache / COPY --from=nv-codec-headers {{ LibrariesPath }}/nv-codec-headers-cache /
RUN git init ffmpeg \ RUN git init ffmpeg \
&& cd ffmpeg \ && cd ffmpeg \
&& git remote add origin $GIT/FFmpeg/FFmpeg.git \ && git remote add origin {{ GIT }}/FFmpeg/FFmpeg.git \
&& git fetch --depth=1 origin cc33e73618a981de7fd96385ecb34719de031f16 \ && git fetch --depth=1 origin cc33e73618a981de7fd96385ecb34719de031f16 \
&& git reset --hard FETCH_HEAD \ && git reset --hard FETCH_HEAD \
&& ./configure \ && ./configure \
--extra-cflags="-DCONFIG_SAFE_BITSTREAM_READER=1 $HFLAGS" \ --extra-cflags="-DCONFIG_SAFE_BITSTREAM_READER=1 {{ HFLAGS }}" \
--extra-cxxflags="-DCONFIG_SAFE_BITSTREAM_READER=1 $HFLAGS" \ --extra-cxxflags="-DCONFIG_SAFE_BITSTREAM_READER=1 {{ HFLAGS }}" \
--disable-debug \ --disable-debug \
--disable-programs \ --disable-programs \
--disable-doc \ --disable-doc \
@ -417,12 +413,12 @@ RUN git init ffmpeg \
--enable-muxer=ogg \ --enable-muxer=ogg \
--enable-muxer=opus \ --enable-muxer=opus \
&& make -j$(nproc) \ && make -j$(nproc) \
&& make DESTDIR="$LibrariesPath/ffmpeg-cache" install \ && make DESTDIR="{{ LibrariesPath }}/ffmpeg-cache" install \
&& cd .. \ && cd .. \
&& rm -rf ffmpeg && rm -rf ffmpeg
FROM builder AS pipewire FROM builder AS pipewire
RUN git clone -b 0.3.25 --depth=1 $GIT/PipeWire/pipewire.git \ RUN git clone -b 0.3.25 --depth=1 {{ GIT }}/PipeWire/pipewire.git \
&& cd pipewire \ && cd pipewire \
&& meson build \ && meson build \
--buildtype=release \ --buildtype=release \
@ -430,44 +426,44 @@ RUN git clone -b 0.3.25 --depth=1 $GIT/PipeWire/pipewire.git \
-Dexamples=disabled \ -Dexamples=disabled \
-Dspa-plugins=disabled \ -Dspa-plugins=disabled \
&& meson compile -C build \ && meson compile -C build \
&& DESTDIR="$LibrariesPath/pipewire-cache" meson install -C build \ && DESTDIR="{{ LibrariesPath }}/pipewire-cache" meson install -C build \
&& cd .. \ && cd .. \
&& rm -rf pipewire && rm -rf pipewire
FROM builder AS openal FROM builder AS openal
COPY --from=pipewire ${LibrariesPath}/pipewire-cache / COPY --from=pipewire {{ LibrariesPath }}/pipewire-cache /
RUN git clone -b 1.22.2 --depth=1 $GIT/kcat/openal-soft.git \ RUN git clone -b 1.22.2 --depth=1 {{ GIT }}/kcat/openal-soft.git \
&& cd openal-soft \ && cd openal-soft \
&& CFLAGS="$HFLAGS" CXXFLAGS="$HFLAGS" cmake -GNinja -B build . \ && CFLAGS="{{ HFLAGS }}" CXXFLAGS="{{ HFLAGS }}" cmake -GNinja -B build . \
-DCMAKE_BUILD_TYPE=Release \ -DCMAKE_BUILD_TYPE=Release \
-DLIBTYPE:STRING=STATIC \ -DLIBTYPE:STRING=STATIC \
-DALSOFT_EXAMPLES=OFF \ -DALSOFT_EXAMPLES=OFF \
-DALSOFT_UTILS=OFF \ -DALSOFT_UTILS=OFF \
-DALSOFT_INSTALL_CONFIG=OFF \ -DALSOFT_INSTALL_CONFIG=OFF \
&& cmake --build build --parallel \ && cmake --build build --parallel \
&& DESTDIR="$LibrariesPath/openal-cache" cmake --install build \ && DESTDIR="{{ LibrariesPath }}/openal-cache" cmake --install build \
&& cd .. \ && cd .. \
&& rm -rf openal-soft && rm -rf openal-soft
FROM builder AS openssl FROM builder AS openssl
ENV opensslDir openssl_${OPENSSL_VER} ENV opensslDir openssl_{{ OPENSSL_VER }}
RUN git clone -b OpenSSL_${OPENSSL_VER}-stable --depth=1 $GIT/openssl/openssl.git $opensslDir \ RUN git clone -b OpenSSL_{{ OPENSSL_VER }}-stable --depth=1 {{ GIT }}/openssl/openssl.git $opensslDir \
&& cd $opensslDir \ && cd $opensslDir \
&& ./config \ && ./config \
--prefix="$OPENSSL_PREFIX" \ --prefix="{{ OPENSSL_PREFIX }}" \
--openssldir=/etc/ssl \ --openssldir=/etc/ssl \
no-tests \ no-tests \
no-dso \ no-dso \
&& make -j$(nproc) \ && make -j$(nproc) \
&& make DESTDIR="$LibrariesPath/openssl-cache" install_sw \ && make DESTDIR="{{ LibrariesPath }}/openssl-cache" install_sw \
&& cd .. \ && cd .. \
&& rm -rf $opensslDir && rm -rf $opensslDir
FROM builder AS xkbcommon FROM builder AS xkbcommon
COPY --from=xcb ${LibrariesPath}/xcb-cache / COPY --from=xcb {{ LibrariesPath }}/xcb-cache /
RUN git clone -b xkbcommon-1.3.1 --depth=1 $GIT/xkbcommon/libxkbcommon.git \ RUN git clone -b xkbcommon-1.3.1 --depth=1 {{ GIT }}/xkbcommon/libxkbcommon.git \
&& cd libxkbcommon \ && cd libxkbcommon \
&& meson build \ && meson build \
--buildtype=release \ --buildtype=release \
@ -479,80 +475,83 @@ RUN git clone -b xkbcommon-1.3.1 --depth=1 $GIT/xkbcommon/libxkbcommon.git \
-Dxkb-config-extra-path=/etc/xkb \ -Dxkb-config-extra-path=/etc/xkb \
-Dx-locale-root=/usr/share/X11/locale \ -Dx-locale-root=/usr/share/X11/locale \
&& meson compile -C build \ && meson compile -C build \
&& DESTDIR="$LibrariesPath/xkbcommon-cache" meson install -C build \ && DESTDIR="{{ LibrariesPath }}/xkbcommon-cache" meson install -C build \
&& cd .. \ && cd .. \
&& rm -rf libxkbcommon && rm -rf libxkbcommon
FROM builder AS mm-common FROM builder AS mm-common
RUN git clone -b 1.0.3 --depth=1 $GIT/GNOME/mm-common.git \ RUN git clone -b 1.0.3 --depth=1 {{ GIT }}/GNOME/mm-common.git \
&& cd mm-common \ && cd mm-common \
&& NOCONFIGURE=1 ./autogen.sh \ && NOCONFIGURE=1 ./autogen.sh \
&& ./configure --enable-network \ && ./configure --enable-network \
&& make -j$(nproc) \ && make -j$(nproc) \
&& make DESTDIR="$LibrariesPath/mm-common-cache" install \ && make DESTDIR="{{ LibrariesPath }}/mm-common-cache" install \
&& cd .. \ && cd .. \
&& rm -rf mm-common && rm -rf mm-common
FROM builder AS libsigcplusplus FROM builder AS libsigcplusplus
COPY --from=mm-common ${LibrariesPath}/mm-common-cache / COPY --from=mm-common {{ LibrariesPath }}/mm-common-cache /
RUN git clone -b 2.10.7 --depth=1 $GIT/libsigcplusplus/libsigcplusplus.git \ RUN git clone -b 2.10.7 --depth=1 {{ GIT }}/libsigcplusplus/libsigcplusplus.git \
&& cd libsigcplusplus \ && cd libsigcplusplus \
&& export ACLOCAL_PATH="/usr/local/share/aclocal" \ && export ACLOCAL_PATH="/usr/local/share/aclocal" \
&& NOCONFIGURE=1 ./autogen.sh \ && NOCONFIGURE=1 ./autogen.sh \
&& CFLAGS="-g -O2 $HFLAGS" CXXFLAGS="-g -O2 $HFLAGS" ./configure \ && CFLAGS="-g -O2 {{ HFLAGS }}" CXXFLAGS="-g -O2 {{ HFLAGS }}" ./configure \
--enable-maintainer-mode \ --enable-maintainer-mode \
--enable-static \ --enable-static \
--disable-documentation \ --disable-documentation \
&& make -j$(nproc) \ && make -j$(nproc) \
&& make DESTDIR="$LibrariesPath/libsigcplusplus-cache" install \ && make DESTDIR="{{ LibrariesPath }}/libsigcplusplus-cache" install \
&& cd .. \ && cd .. \
&& rm -rf libsigcplusplus && rm -rf libsigcplusplus
FROM patches AS glibmm FROM patches AS glibmm
COPY --from=mm-common ${LibrariesPath}/mm-common-cache / COPY --from=mm-common {{ LibrariesPath }}/mm-common-cache /
COPY --from=libsigcplusplus ${LibrariesPath}/libsigcplusplus-cache / COPY --from=libsigcplusplus {{ LibrariesPath }}/libsigcplusplus-cache /
# equals to glib version of Ubuntu 14.04 # equals to glib version of Ubuntu 14.04
RUN git clone -b 2.40.0 --depth=1 $GIT/GNOME/glibmm.git \ RUN git clone -b 2.40.0 --depth=1 {{ GIT }}/GNOME/glibmm.git \
&& cd glibmm \ && cd glibmm \
&& git apply ../patches/glibmm.patch \ && git apply ../patches/glibmm.patch \
&& export ACLOCAL_PATH="/usr/local/share/aclocal" \ && export ACLOCAL_PATH="/usr/local/share/aclocal" \
&& NOCONFIGURE=1 ./autogen.sh \ && NOCONFIGURE=1 ./autogen.sh \
&& CC="gcc -flto $HFLAGS" CXX="g++ -flto $HFLAGS" AR=gcc-ar RANLIB=gcc-ranlib ./configure \ && CC="gcc -flto {{ HFLAGS }}" CXX="g++ -flto {{ HFLAGS }}" AR=gcc-ar RANLIB=gcc-ranlib ./configure \
--enable-maintainer-mode \ --enable-maintainer-mode \
--enable-static \ --enable-static \
--disable-documentation \ --disable-documentation \
&& make -j$(nproc) \ && make -j$(nproc) \
&& make DESTDIR="$LibrariesPath/glibmm-cache" install \ && make DESTDIR="{{ LibrariesPath }}/glibmm-cache" install \
&& cd .. \ && cd .. \
&& rm -rf glibmm && rm -rf glibmm
FROM patches AS qt FROM patches AS qt
COPY --from=libffi ${LibrariesPath}/libffi-cache / COPY --from=libffi {{ LibrariesPath }}/libffi-cache /
COPY --from=zlib ${LibrariesPath}/zlib-cache / COPY --from=zlib {{ LibrariesPath }}/zlib-cache /
COPY --from=libproxy ${LibrariesPath}/libproxy-cache / COPY --from=libproxy {{ LibrariesPath }}/libproxy-cache /
COPY --from=mozjpeg ${LibrariesPath}/mozjpeg-cache / COPY --from=mozjpeg {{ LibrariesPath }}/mozjpeg-cache /
COPY --from=xcb ${LibrariesPath}/xcb-cache / COPY --from=xcb {{ LibrariesPath }}/xcb-cache /
COPY --from=xcb-wm ${LibrariesPath}/xcb-wm-cache / COPY --from=xcb-wm {{ LibrariesPath }}/xcb-wm-cache /
COPY --from=xcb-util ${LibrariesPath}/xcb-util-cache / COPY --from=xcb-util {{ LibrariesPath }}/xcb-util-cache /
COPY --from=xcb-image ${LibrariesPath}/xcb-image-cache / COPY --from=xcb-image {{ LibrariesPath }}/xcb-image-cache /
COPY --from=xcb-keysyms ${LibrariesPath}/xcb-keysyms-cache / COPY --from=xcb-keysyms {{ LibrariesPath }}/xcb-keysyms-cache /
COPY --from=xcb-render-util ${LibrariesPath}/xcb-render-util-cache / COPY --from=xcb-render-util {{ LibrariesPath }}/xcb-render-util-cache /
COPY --from=wayland ${LibrariesPath}/wayland-cache / COPY --from=wayland {{ LibrariesPath }}/wayland-cache /
COPY --from=openssl ${LibrariesPath}/openssl-cache / COPY --from=openssl {{ LibrariesPath }}/openssl-cache /
COPY --from=xkbcommon ${LibrariesPath}/xkbcommon-cache / COPY --from=xkbcommon {{ LibrariesPath }}/xkbcommon-cache /
ARG DEBUG ENV OPENSSL_ROOT_DIR {{ OPENSSL_PREFIX }}
RUN git clone -b ${QT_TAG} --depth=1 git://code.qt.io/qt/qt5.git qt_${QT} \
&& cd qt_${QT} \ RUN git clone -b {{ QT_TAG }} --depth=1 git://code.qt.io/qt/qt5.git qt_{{ QT }} \
&& cd qt_{{ QT }} \
&& git submodule update --init --recursive --depth=1 qtbase qtwayland qtimageformats qtsvg qt5compat \ && git submodule update --init --recursive --depth=1 qtbase qtwayland qtimageformats qtsvg qt5compat \
&& cd qtbase \ && cd qtbase \
&& find ../../patches/qtbase_${QT} -type f -print0 | sort -z | xargs -r0 git apply \ && find ../../patches/qtbase_{{ QT }} -type f -print0 | sort -z | xargs -r0 git apply \
&& cd .. \ && cd .. \
&& ./configure -prefix "$QT_PREFIX" \ && ./configure -prefix "{{ QT_PREFIX }}" \
-release \ -release \
${DEBUG:+-force-debug-info} \ {%- if DEBUG %}
-force-debug-info \
{%- endif %}
-opensource \ -opensource \
-confirm-license \ -confirm-license \
-libproxy \ -libproxy \
@ -570,9 +569,9 @@ RUN git clone -b ${QT_TAG} --depth=1 git://code.qt.io/qt/qt5.git qt_${QT} \
-nomake examples \ -nomake examples \
-nomake tests \ -nomake tests \
&& cmake --build . --parallel \ && cmake --build . --parallel \
&& DESTDIR="$LibrariesPath/qt-cache" cmake --install . \ && DESTDIR="{{ LibrariesPath }}/qt-cache" cmake --install . \
&& cd .. \ && cd .. \
&& rm -rf qt_${QT} && rm -rf qt_{{ QT }}
FROM patches AS breakpad FROM patches AS breakpad
RUN git clone https://chromium.googlesource.com/breakpad/breakpad.git \ RUN git clone https://chromium.googlesource.com/breakpad/breakpad.git \
@ -585,35 +584,35 @@ RUN git clone https://chromium.googlesource.com/breakpad/breakpad.git \
&& cd ../../.. \ && cd ../../.. \
&& ./configure \ && ./configure \
&& make -j$(nproc) \ && make -j$(nproc) \
&& make DESTDIR="${LibrariesPath}/breakpad-cache" install \ && make DESTDIR="{{ LibrariesPath }}/breakpad-cache" install \
&& cd .. \ && cd .. \
&& rm -rf breakpad && rm -rf breakpad
FROM builder AS webrtc FROM builder AS webrtc
COPY --from=mozjpeg ${LibrariesPath}/mozjpeg-cache / COPY --from=mozjpeg {{ LibrariesPath }}/mozjpeg-cache /
COPY --from=opus ${LibrariesPath}/opus-cache / COPY --from=opus {{ LibrariesPath }}/opus-cache /
COPY --from=libvpx ${LibrariesPath}/libvpx-cache / COPY --from=libvpx {{ LibrariesPath }}/libvpx-cache /
COPY --from=ffmpeg ${LibrariesPath}/ffmpeg-cache / COPY --from=ffmpeg {{ LibrariesPath }}/ffmpeg-cache /
COPY --from=openssl ${LibrariesPath}/openssl-cache / COPY --from=openssl {{ LibrariesPath }}/openssl-cache /
COPY --from=libXtst ${LibrariesPath}/libXtst-cache / COPY --from=libXtst {{ LibrariesPath }}/libXtst-cache /
COPY --from=pipewire ${LibrariesPath}/pipewire-cache / COPY --from=pipewire {{ LibrariesPath }}/pipewire-cache /
# Shallow clone on a specific commit. # Shallow clone on a specific commit.
RUN git init tg_owt \ RUN git init tg_owt \
&& cd tg_owt \ && cd tg_owt \
&& git remote add origin $GIT/desktop-app/tg_owt.git \ && git remote add origin {{ GIT }}/desktop-app/tg_owt.git \
&& git fetch --depth=1 origin 442d5bb593c0ae314960308d78f2016ad1f80c3e \ && git fetch --depth=1 origin 442d5bb593c0ae314960308d78f2016ad1f80c3e \
&& git reset --hard FETCH_HEAD \ && git reset --hard FETCH_HEAD \
&& git submodule update --init --recursive --depth=1 \ && git submodule update --init --recursive --depth=1 \
&& rm -rf .git \ && rm -rf .git \
&& cmake -G"Ninja Multi-Config" -B out . \ && cmake -G"Ninja Multi-Config" -B out . \
-DCMAKE_C_FLAGS_RELEASE="-O3 -DNDEBUG $HFLAGS" \ -DCMAKE_C_FLAGS_RELEASE="-O3 -DNDEBUG {{ HFLAGS }}" \
-DCMAKE_C_FLAGS_DEBUG="-g $HFLAGS_DEBUG" \ -DCMAKE_C_FLAGS_DEBUG="-g {{ HFLAGS_DEBUG }}" \
-DCMAKE_CXX_FLAGS_RELEASE="-O3 -DNDEBUG $HFLAGS" \ -DCMAKE_CXX_FLAGS_RELEASE="-O3 -DNDEBUG {{ HFLAGS }}" \
-DCMAKE_CXX_FLAGS_DEBUG="-g $HFLAGS_DEBUG" \ -DCMAKE_CXX_FLAGS_DEBUG="-g {{ HFLAGS_DEBUG }}" \
-DTG_OWT_SPECIAL_TARGET=linux \ -DTG_OWT_SPECIAL_TARGET=linux \
-DTG_OWT_LIBJPEG_INCLUDE_PATH=/usr/local/include \ -DTG_OWT_LIBJPEG_INCLUDE_PATH=/usr/local/include \
-DTG_OWT_OPENSSL_INCLUDE_PATH=$OPENSSL_PREFIX/include \ -DTG_OWT_OPENSSL_INCLUDE_PATH={{ OPENSSL_PREFIX }}/include \
-DTG_OWT_OPUS_INCLUDE_PATH=/usr/local/include/opus \ -DTG_OWT_OPUS_INCLUDE_PATH=/usr/local/include/opus \
-DTG_OWT_LIBVPX_INCLUDE_PATH=/usr/local/include \ -DTG_OWT_LIBVPX_INCLUDE_PATH=/usr/local/include \
-DTG_OWT_FFMPEG_INCLUDE_PATH=/usr/local/include -DTG_OWT_FFMPEG_INCLUDE_PATH=/usr/local/include
@ -624,46 +623,50 @@ FROM webrtc AS webrtc_release
RUN cmake --build out --config Release --parallel \ RUN cmake --build out --config Release --parallel \
&& find out -mindepth 1 -maxdepth 1 ! -name Release -exec rm -rf {} \; && find out -mindepth 1 -maxdepth 1 ! -name Release -exec rm -rf {} \;
{%- if DEBUG %}
FROM webrtc AS webrtc_debug FROM webrtc AS webrtc_debug
ARG DEBUG RUN cmake --build out --config Debug --parallel \
RUN [ -z "$DEBUG" ] || (cmake --build out --config Debug --parallel \ && find out -mindepth 1 -maxdepth 1 ! -name Debug -exec rm -rf {} \;
&& find out -mindepth 1 -maxdepth 1 ! -name Debug -exec rm -rf {} \;) {%- endif %}
RUN [ -n "$DEBUG" ] || mkdir -p out/Debug
FROM builder FROM builder
COPY --from=libffi ${LibrariesPath}/libffi-cache / COPY --from=libffi {{ LibrariesPath }}/libffi-cache /
COPY --from=zlib ${LibrariesPath}/zlib-cache / COPY --from=zlib {{ LibrariesPath }}/zlib-cache /
COPY --from=xz ${LibrariesPath}/xz-cache / COPY --from=xz {{ LibrariesPath }}/xz-cache /
COPY --from=libproxy ${LibrariesPath}/libproxy-cache / COPY --from=libproxy {{ LibrariesPath }}/libproxy-cache /
COPY --from=mozjpeg ${LibrariesPath}/mozjpeg-cache / COPY --from=mozjpeg {{ LibrariesPath }}/mozjpeg-cache /
COPY --from=opus ${LibrariesPath}/opus-cache / COPY --from=opus {{ LibrariesPath }}/opus-cache /
COPY --from=libvpx ${LibrariesPath}/libvpx-cache / COPY --from=libvpx {{ LibrariesPath }}/libvpx-cache /
COPY --from=rnnoise ${LibrariesPath}/rnnoise-cache / COPY --from=rnnoise {{ LibrariesPath }}/rnnoise-cache /
COPY --from=xcb ${LibrariesPath}/xcb-cache / COPY --from=xcb {{ LibrariesPath }}/xcb-cache /
COPY --from=xcb-wm ${LibrariesPath}/xcb-wm-cache / COPY --from=xcb-wm {{ LibrariesPath }}/xcb-wm-cache /
COPY --from=xcb-util ${LibrariesPath}/xcb-util-cache / COPY --from=xcb-util {{ LibrariesPath }}/xcb-util-cache /
COPY --from=xcb-image ${LibrariesPath}/xcb-image-cache / COPY --from=xcb-image {{ LibrariesPath }}/xcb-image-cache /
COPY --from=xcb-keysyms ${LibrariesPath}/xcb-keysyms-cache / COPY --from=xcb-keysyms {{ LibrariesPath }}/xcb-keysyms-cache /
COPY --from=xcb-render-util ${LibrariesPath}/xcb-render-util-cache / COPY --from=xcb-render-util {{ LibrariesPath }}/xcb-render-util-cache /
COPY --from=libXext ${LibrariesPath}/libXext-cache / COPY --from=libXext {{ LibrariesPath }}/libXext-cache /
COPY --from=libXfixes ${LibrariesPath}/libXfixes-cache / COPY --from=libXfixes {{ LibrariesPath }}/libXfixes-cache /
COPY --from=libXtst ${LibrariesPath}/libXtst-cache / COPY --from=libXtst {{ LibrariesPath }}/libXtst-cache /
COPY --from=libXrandr ${LibrariesPath}/libXrandr-cache / COPY --from=libXrandr {{ LibrariesPath }}/libXrandr-cache /
COPY --from=libXrender ${LibrariesPath}/libXrender-cache / COPY --from=libXrender {{ LibrariesPath }}/libXrender-cache /
COPY --from=libXdamage ${LibrariesPath}/libXdamage-cache / COPY --from=libXdamage {{ LibrariesPath }}/libXdamage-cache /
COPY --from=libXcomposite ${LibrariesPath}/libXcomposite-cache / COPY --from=libXcomposite {{ LibrariesPath }}/libXcomposite-cache /
COPY --from=wayland ${LibrariesPath}/wayland-cache / COPY --from=wayland {{ LibrariesPath }}/wayland-cache /
COPY --from=ffmpeg ${LibrariesPath}/ffmpeg-cache / COPY --from=ffmpeg {{ LibrariesPath }}/ffmpeg-cache /
COPY --from=openal ${LibrariesPath}/openal-cache / COPY --from=openal {{ LibrariesPath }}/openal-cache /
COPY --from=openssl ${LibrariesPath}/openssl-cache / COPY --from=openssl {{ LibrariesPath }}/openssl-cache /
COPY --from=xkbcommon ${LibrariesPath}/xkbcommon-cache / COPY --from=xkbcommon {{ LibrariesPath }}/xkbcommon-cache /
COPY --from=libsigcplusplus ${LibrariesPath}/libsigcplusplus-cache / COPY --from=libsigcplusplus {{ LibrariesPath }}/libsigcplusplus-cache /
COPY --from=glibmm ${LibrariesPath}/glibmm-cache / COPY --from=glibmm {{ LibrariesPath }}/glibmm-cache /
COPY --from=qt ${LibrariesPath}/qt-cache / COPY --from=qt {{ LibrariesPath }}/qt-cache /
COPY --from=breakpad ${LibrariesPath}/breakpad-cache / COPY --from=breakpad {{ LibrariesPath }}/breakpad-cache /
COPY --from=webrtc ${LibrariesPath}/tg_owt tg_owt COPY --from=webrtc {{ LibrariesPath }}/tg_owt tg_owt
COPY --from=webrtc_release ${LibrariesPath}/tg_owt/out/Release tg_owt/out/Release COPY --from=webrtc_release {{ LibrariesPath }}/tg_owt/out/Release tg_owt/out/Release
COPY --from=webrtc_debug ${LibrariesPath}/tg_owt/out/Debug tg_owt/out/Debug
{%- if DEBUG %}
COPY --from=webrtc_debug {{ LibrariesPath }}/tg_owt/out/Debug tg_owt/out/Debug
{%- endif %}
WORKDIR ../tdesktop WORKDIR ../tdesktop
VOLUME [ "/usr/src/tdesktop" ] VOLUME [ "/usr/src/tdesktop" ]

View File

@ -0,0 +1 @@

View File

@ -0,0 +1,12 @@
#!/usr/bin/env python3
from os import environ
from os.path import dirname
from jinja2 import Environment, FileSystemLoader
def main():
print(Environment(loader=FileSystemLoader(dirname(__file__))).get_template("Dockerfile").render(
DEBUG=bool(len(environ["DEBUG"])) if "DEBUG" in environ else True
))
if __name__ == '__main__':
main()

View File

@ -0,0 +1,74 @@
[[package]]
name = "jinja2"
version = "3.1.2"
description = "A very fast and expressive template engine."
category = "main"
optional = false
python-versions = ">=3.7"
[package.dependencies]
MarkupSafe = ">=2.0"
[package.extras]
i18n = ["Babel (>=2.7)"]
[[package]]
name = "markupsafe"
version = "2.1.1"
description = "Safely add untrusted strings to HTML/XML markup."
category = "main"
optional = false
python-versions = ">=3.7"
[metadata]
lock-version = "1.1"
python-versions = "^3.7"
content-hash = "fdf86553de6f950425c8ca77fe37127c9242c83445ce44b951ee4032ef72ea2f"
[metadata.files]
jinja2 = [
{file = "Jinja2-3.1.2-py3-none-any.whl", hash = "sha256:6088930bfe239f0e6710546ab9c19c9ef35e29792895fed6e6e31a023a182a61"},
{file = "Jinja2-3.1.2.tar.gz", hash = "sha256:31351a702a408a9e7595a8fc6150fc3f43bb6bf7e319770cbc0db9df9437e852"},
]
markupsafe = [
{file = "MarkupSafe-2.1.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:86b1f75c4e7c2ac2ccdaec2b9022845dbb81880ca318bb7a0a01fbf7813e3812"},
{file = "MarkupSafe-2.1.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:f121a1420d4e173a5d96e47e9a0c0dcff965afdf1626d28de1460815f7c4ee7a"},
{file = "MarkupSafe-2.1.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a49907dd8420c5685cfa064a1335b6754b74541bbb3706c259c02ed65b644b3e"},
{file = "MarkupSafe-2.1.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:10c1bfff05d95783da83491be968e8fe789263689c02724e0c691933c52994f5"},
{file = "MarkupSafe-2.1.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b7bd98b796e2b6553da7225aeb61f447f80a1ca64f41d83612e6139ca5213aa4"},
{file = "MarkupSafe-2.1.1-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:b09bf97215625a311f669476f44b8b318b075847b49316d3e28c08e41a7a573f"},
{file = "MarkupSafe-2.1.1-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:694deca8d702d5db21ec83983ce0bb4b26a578e71fbdbd4fdcd387daa90e4d5e"},
{file = "MarkupSafe-2.1.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:efc1913fd2ca4f334418481c7e595c00aad186563bbc1ec76067848c7ca0a933"},
{file = "MarkupSafe-2.1.1-cp310-cp310-win32.whl", hash = "sha256:4a33dea2b688b3190ee12bd7cfa29d39c9ed176bda40bfa11099a3ce5d3a7ac6"},
{file = "MarkupSafe-2.1.1-cp310-cp310-win_amd64.whl", hash = "sha256:dda30ba7e87fbbb7eab1ec9f58678558fd9a6b8b853530e176eabd064da81417"},
{file = "MarkupSafe-2.1.1-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:671cd1187ed5e62818414afe79ed29da836dde67166a9fac6d435873c44fdd02"},
{file = "MarkupSafe-2.1.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3799351e2336dc91ea70b034983ee71cf2f9533cdff7c14c90ea126bfd95d65a"},
{file = "MarkupSafe-2.1.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e72591e9ecd94d7feb70c1cbd7be7b3ebea3f548870aa91e2732960fa4d57a37"},
{file = "MarkupSafe-2.1.1-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6fbf47b5d3728c6aea2abb0589b5d30459e369baa772e0f37a0320185e87c980"},
{file = "MarkupSafe-2.1.1-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:d5ee4f386140395a2c818d149221149c54849dfcfcb9f1debfe07a8b8bd63f9a"},
{file = "MarkupSafe-2.1.1-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:bcb3ed405ed3222f9904899563d6fc492ff75cce56cba05e32eff40e6acbeaa3"},
{file = "MarkupSafe-2.1.1-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:e1c0b87e09fa55a220f058d1d49d3fb8df88fbfab58558f1198e08c1e1de842a"},
{file = "MarkupSafe-2.1.1-cp37-cp37m-win32.whl", hash = "sha256:8dc1c72a69aa7e082593c4a203dcf94ddb74bb5c8a731e4e1eb68d031e8498ff"},
{file = "MarkupSafe-2.1.1-cp37-cp37m-win_amd64.whl", hash = "sha256:97a68e6ada378df82bc9f16b800ab77cbf4b2fada0081794318520138c088e4a"},
{file = "MarkupSafe-2.1.1-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:e8c843bbcda3a2f1e3c2ab25913c80a3c5376cd00c6e8c4a86a89a28c8dc5452"},
{file = "MarkupSafe-2.1.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:0212a68688482dc52b2d45013df70d169f542b7394fc744c02a57374a4207003"},
{file = "MarkupSafe-2.1.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8e576a51ad59e4bfaac456023a78f6b5e6e7651dcd383bcc3e18d06f9b55d6d1"},
{file = "MarkupSafe-2.1.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4b9fe39a2ccc108a4accc2676e77da025ce383c108593d65cc909add5c3bd601"},
{file = "MarkupSafe-2.1.1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:96e37a3dc86e80bf81758c152fe66dbf60ed5eca3d26305edf01892257049925"},
{file = "MarkupSafe-2.1.1-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:6d0072fea50feec76a4c418096652f2c3238eaa014b2f94aeb1d56a66b41403f"},
{file = "MarkupSafe-2.1.1-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:089cf3dbf0cd6c100f02945abeb18484bd1ee57a079aefd52cffd17fba910b88"},
{file = "MarkupSafe-2.1.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:6a074d34ee7a5ce3effbc526b7083ec9731bb3cbf921bbe1d3005d4d2bdb3a63"},
{file = "MarkupSafe-2.1.1-cp38-cp38-win32.whl", hash = "sha256:421be9fbf0ffe9ffd7a378aafebbf6f4602d564d34be190fc19a193232fd12b1"},
{file = "MarkupSafe-2.1.1-cp38-cp38-win_amd64.whl", hash = "sha256:fc7b548b17d238737688817ab67deebb30e8073c95749d55538ed473130ec0c7"},
{file = "MarkupSafe-2.1.1-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:e04e26803c9c3851c931eac40c695602c6295b8d432cbe78609649ad9bd2da8a"},
{file = "MarkupSafe-2.1.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:b87db4360013327109564f0e591bd2a3b318547bcef31b468a92ee504d07ae4f"},
{file = "MarkupSafe-2.1.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:99a2a507ed3ac881b975a2976d59f38c19386d128e7a9a18b7df6fff1fd4c1d6"},
{file = "MarkupSafe-2.1.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:56442863ed2b06d19c37f94d999035e15ee982988920e12a5b4ba29b62ad1f77"},
{file = "MarkupSafe-2.1.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3ce11ee3f23f79dbd06fb3d63e2f6af7b12db1d46932fe7bd8afa259a5996603"},
{file = "MarkupSafe-2.1.1-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:33b74d289bd2f5e527beadcaa3f401e0df0a89927c1559c8566c066fa4248ab7"},
{file = "MarkupSafe-2.1.1-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:43093fb83d8343aac0b1baa75516da6092f58f41200907ef92448ecab8825135"},
{file = "MarkupSafe-2.1.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:8e3dcf21f367459434c18e71b2a9532d96547aef8a871872a5bd69a715c15f96"},
{file = "MarkupSafe-2.1.1-cp39-cp39-win32.whl", hash = "sha256:d4306c36ca495956b6d568d276ac11fdd9c30a36f1b6eb928070dc5360b22e1c"},
{file = "MarkupSafe-2.1.1-cp39-cp39-win_amd64.whl", hash = "sha256:46d00d6cfecdde84d40e572d63735ef81423ad31184100411e6e3388d405e247"},
{file = "MarkupSafe-2.1.1.tar.gz", hash = "sha256:7f91197cc9e48f989d12e4e6fbc46495c446636dfc81b9ccf50bb0ec74b91d4b"},
]

View File

@ -0,0 +1,18 @@
[tool.poetry]
name = "centos_env"
version = "0.1.0"
description = ""
authors = []
[tool.poetry.dependencies]
python = "^3.7"
Jinja2 = "^3.1.2"
[tool.poetry.dev-dependencies]
[tool.poetry.scripts]
gen_dockerfile = "gen_dockerfile:main"
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

View File

@ -10,13 +10,14 @@ You will require **api_id** and **api_hash** to access the Telegram API servers.
### Prepare libraries ### Prepare libraries
Go to the `tdesktop` directory and run Install [poetry](https://python-poetry.org), go to the `tdesktop/Telegram/build/docker/centos_env` directory and run
docker build -t tdesktop:centos_env Telegram/build/docker/centos_env/ poetry install
poetry run gen_dockerfile | docker build -t tdesktop:centos_env -
### Building the project ### Building the project
Make sure that you're still in the `tdesktop` directory and run (using [your **api_id** and **api_hash**](#obtain-your-api-credentials)) Go up to the `tdesktop` directory and run (using [your **api_id** and **api_hash**](#obtain-your-api-credentials))
docker run --rm -it \ docker run --rm -it \
-v $PWD:/usr/src/tdesktop \ -v $PWD:/usr/src/tdesktop \