Have less Docker steps to avoid saving superfluous data

This commit is contained in:
Ilya Fedin 2022-04-17 12:31:08 +04:00 committed by John Preston
parent b6c9a1d655
commit 68f35e98e0

View file

@ -16,18 +16,18 @@ ENV PATH ${QT_PREFIX}/bin:${PATH}
ENV HFLAGS_DEBUG "-fstack-protector-all -fstack-clash-protection -fPIC" ENV HFLAGS_DEBUG "-fstack-protector-all -fstack-clash-protection -fPIC"
ENV HFLAGS "$HFLAGS_DEBUG -D_FORTIFY_SOURCE=2" ENV HFLAGS "$HFLAGS_DEBUG -D_FORTIFY_SOURCE=2"
RUN yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm && yum clean all RUN yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm \
RUN yum -y install https://packages.endpointdev.com/rhel/7/os/x86_64/endpoint-repo.x86_64.rpm && yum clean all && yum -y install https://packages.endpointdev.com/rhel/7/os/x86_64/endpoint-repo.x86_64.rpm \
RUN yum -y install centos-release-scl && yum clean all && yum -y install centos-release-scl \
&& yum -y install git meson ninja-build autoconf automake libtool patch \
RUN yum -y install git meson ninja-build autoconf automake libtool patch \
fontconfig-devel freetype-devel libX11-devel at-spi2-core-devel alsa-lib-devel \ fontconfig-devel freetype-devel libX11-devel at-spi2-core-devel alsa-lib-devel \
pulseaudio-libs-devel mesa-libGL-devel mesa-libEGL-devel mesa-libgbm-devel \ pulseaudio-libs-devel mesa-libGL-devel mesa-libEGL-devel mesa-libgbm-devel \
libdrm-devel gtk3-devel \ libdrm-devel gtk3-devel \
perl-XML-Parser pkgconfig bison yasm file which xorg-x11-util-macros \ perl-XML-Parser pkgconfig bison yasm file which xorg-x11-util-macros \
devtoolset-10-make devtoolset-10-gcc devtoolset-10-gcc-c++ \ devtoolset-10-make devtoolset-10-gcc devtoolset-10-gcc-c++ \
devtoolset-10-binutils llvm-toolset-7.0 llvm-toolset-7.0-clang-devel \ devtoolset-10-binutils llvm-toolset-7.0 llvm-toolset-7.0-clang-devel \
llvm-toolset-7.0-llvm-devel && yum clean all llvm-toolset-7.0-llvm-devel \
&& yum clean all
# Fix a bug with argument naming in CentOS 7 glibc # Fix a bug with argument naming in CentOS 7 glibc
RUN sed -i 's/char \*__block/char */' /usr/include/unistd.h RUN sed -i 's/char \*__block/char */' /usr/include/unistd.h
@ -37,314 +37,274 @@ SHELL [ "bash", "-c", ". /opt/rh/devtoolset-10/enable; exec bash -c \"$@\"", "-s
ENV LibrariesPath /usr/src/Libraries ENV LibrariesPath /usr/src/Libraries
WORKDIR $LibrariesPath WORKDIR $LibrariesPath
RUN mkdir /opt/cmake RUN mkdir /opt/cmake \
RUN 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 \
RUN sh $CMAKE_FILE --prefix=/opt/cmake --skip-license && sh $CMAKE_FILE --prefix=/opt/cmake --skip-license \
RUN ln -s /opt/cmake/bin/cmake /usr/local/bin/cmake && ln -s /opt/cmake/bin/cmake /usr/local/bin/cmake \
RUN rm $CMAKE_FILE && rm $CMAKE_FILE
FROM builder AS patches FROM builder AS patches
RUN git clone $GIT/desktop-app/patches.git && cd patches && git checkout 86187a0437 RUN git clone $GIT/desktop-app/patches.git \
&& cd patches \
&& git checkout 86187a0437 \
&& 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 \
WORKDIR libffi && ./autogen.sh \
RUN ./autogen.sh && ./configure --enable-static --disable-docs \
RUN ./configure --enable-static --disable-docs && make -j$(nproc) \
RUN make -j$(nproc) && make DESTDIR="$LibrariesPath/libffi-cache" install \
RUN make DESTDIR="$LibrariesPath/libffi-cache" install && cd .. \
&& rm -rf libffi
WORKDIR ..
RUN 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 \
WORKDIR zlib && CFLAGS="-O3 $HFLAGS" ./configure --static \
RUN CFLAGS="-O3 $HFLAGS" ./configure --static && make -j$(nproc) \
RUN make -j$(nproc) && make DESTDIR="$LibrariesPath/zlib-cache" install \
RUN make DESTDIR="$LibrariesPath/zlib-cache" install && cd .. \
&& rm -rf zlib
WORKDIR ..
RUN 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 \
WORKDIR xz && CFLAGS="$HFLAGS" cmake -GNinja -B build . -DCMAKE_BUILD_TYPE=Release \
RUN CFLAGS="$HFLAGS" \ && cmake --build build --parallel \
cmake -GNinja -B build . -DCMAKE_BUILD_TYPE=Release && DESTDIR="$LibrariesPath/xz-cache" cmake --install build \
RUN cmake --build build --parallel && cd .. \
RUN DESTDIR="$LibrariesPath/xz-cache" cmake --install build && rm -rf xz
WORKDIR ..
RUN 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 \
WORKDIR libproxy && git apply ../patches/libproxy.patch \
RUN git apply ../patches/libproxy.patch && CFLAGS="$HFLAGS" CXXFLAGS="$HFLAGS" cmake -GNinja -B build . \
RUN 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 \
RUN cmake --build build --parallel && DESTDIR="$LibrariesPath/libproxy-cache" cmake --install build \
RUN DESTDIR="$LibrariesPath/libproxy-cache" cmake --install build && cd .. \
&& rm -rf libproxy
WORKDIR ..
RUN 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 \
WORKDIR mozjpeg && CFLAGS="$HFLAGS" cmake -GNinja -B build . \
RUN 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 \
RUN cmake --build build --parallel && DESTDIR="$LibrariesPath/mozjpeg-cache" cmake --install build \
RUN DESTDIR="$LibrariesPath/mozjpeg-cache" cmake --install build && cd .. \
&& rm -rf mozjpeg
WORKDIR ..
RUN 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 \
WORKDIR opus && ./autogen.sh \
RUN ./autogen.sh && CFLAGS="-g -O2 $HFLAGS" ./configure \
RUN CFLAGS="-g -O2 $HFLAGS" ./configure && make -j$(nproc) \
RUN make -j$(nproc) && make DESTDIR="$LibrariesPath/opus-cache" install \
RUN make DESTDIR="$LibrariesPath/opus-cache" install && cd .. \
&& rm -rf opus
WORKDIR ..
RUN 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 \
WORKDIR libvpx && ./configure \
RUN ./configure \
--disable-examples \ --disable-examples \
--disable-unit-tests \ --disable-unit-tests \
--disable-tools \ --disable-tools \
--disable-docs \ --disable-docs \
--enable-vp8 \ --enable-vp8 \
--enable-vp9 \ --enable-vp9 \
--enable-webm-io --enable-webm-io \
RUN make -j$(nproc) && make -j$(nproc) \
RUN make DESTDIR="$LibrariesPath/libvpx-cache" install && make DESTDIR="$LibrariesPath/libvpx-cache" install \
&& cd .. \
WORKDIR .. && rm -rf libvpx
RUN 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 \
WORKDIR rnnoise && CFLAGS="$HFLAGS" cmake -GNinja -B build . -DCMAKE_BUILD_TYPE=Release \
RUN CFLAGS="$HFLAGS" cmake -GNinja -B build . \ && cmake --build build --parallel \
-DCMAKE_BUILD_TYPE=Release && mkdir -p "$LibrariesPath/rnnoise-cache/usr/local/include" \
&& cp "include/rnnoise.h" "$LibrariesPath/rnnoise-cache/usr/local/include/" \
RUN cmake --build build --parallel && mkdir -p "$LibrariesPath/rnnoise-cache/usr/local/lib" \
RUN mkdir -p "$LibrariesPath/rnnoise-cache/usr/local/include" && cp "build/librnnoise.a" "$LibrariesPath/rnnoise-cache/usr/local/lib/" \
RUN cp "include/rnnoise.h" "$LibrariesPath/rnnoise-cache/usr/local/include/" && cd .. \
RUN mkdir -p "$LibrariesPath/rnnoise-cache/usr/local/lib" && rm -rf rnnoise
RUN cp "build/librnnoise.a" "$LibrariesPath/rnnoise-cache/usr/local/lib/"
WORKDIR ..
RUN 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 \
WORKDIR xcbproto && ./autogen.sh \
RUN ./autogen.sh && make -j$(nproc) \
RUN make -j$(nproc) && make DESTDIR="$LibrariesPath/xcb-proto-cache" install \
RUN make DESTDIR="$LibrariesPath/xcb-proto-cache" install && cd .. \
&& rm -rf xcbproto
WORKDIR ..
RUN 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 \
WORKDIR libxcb && CFLAGS="-g -O2 $HFLAGS" ./autogen.sh --enable-static \
RUN CFLAGS="-g -O2 $HFLAGS" ./autogen.sh --enable-static && make -j$(nproc) \
RUN make -j$(nproc) && make DESTDIR="$LibrariesPath/xcb-cache" install \
RUN make DESTDIR="$LibrariesPath/xcb-cache" install && cd .. \
&& rm -rf libxcb
WORKDIR ..
RUN 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 \
&& ./autogen.sh --enable-static \
WORKDIR libxcb-wm && make -j$(nproc) \
RUN ./autogen.sh --enable-static && make DESTDIR="$LibrariesPath/xcb-wm-cache" install \
RUN make -j$(nproc) && cd .. \
RUN make DESTDIR="$LibrariesPath/xcb-wm-cache" install && 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 \
&& ./autogen.sh --enable-static \
WORKDIR libxcb-util && make -j$(nproc) \
RUN ./autogen.sh --enable-static && make DESTDIR="$LibrariesPath/xcb-util-cache" install \
RUN make -j$(nproc) && cd .. \
RUN make DESTDIR="$LibrariesPath/xcb-util-cache" install && 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 \
WORKDIR libxcb-image && CFLAGS="-g -O2 $HFLAGS" ./autogen.sh --enable-static \
RUN CFLAGS="-g -O2 $HFLAGS" ./autogen.sh --enable-static && make -j$(nproc) \
RUN make -j$(nproc) && make DESTDIR="$LibrariesPath/xcb-image-cache" install \
RUN make DESTDIR="$LibrariesPath/xcb-image-cache" install && cd .. \
&& 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 \
&& CFLAGS="-g -O2 $HFLAGS" ./autogen.sh --enable-static \
WORKDIR libxcb-keysyms && make -j$(nproc) \
RUN CFLAGS="-g -O2 $HFLAGS" ./autogen.sh --enable-static && make DESTDIR="$LibrariesPath/xcb-keysyms-cache" install \
RUN make -j$(nproc) && cd .. \
RUN make DESTDIR="$LibrariesPath/xcb-keysyms-cache" install && 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 \
&& CFLAGS="-g -O2 $HFLAGS" ./autogen.sh --enable-static \
WORKDIR libxcb-render-util && make -j$(nproc) \
RUN CFLAGS="-g -O2 $HFLAGS" ./autogen.sh --enable-static && make DESTDIR="$LibrariesPath/xcb-render-util-cache" install \
RUN make -j$(nproc) && cd .. \
RUN make DESTDIR="$LibrariesPath/xcb-render-util-cache" install && 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 \
WORKDIR libxext && CFLAGS="-g -O2 $HFLAGS" ./autogen.sh --enable-static \
RUN CFLAGS="-g -O2 $HFLAGS" ./autogen.sh --enable-static && make -j$(nproc) \
RUN make -j$(nproc) && make DESTDIR="$LibrariesPath/libXext-cache" install \
RUN make DESTDIR="$LibrariesPath/libXext-cache" install && cd .. \
&& rm -rf libxext
WORKDIR ..
RUN 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 \
WORKDIR libxtst && CFLAGS="-g -O2 $HFLAGS" ./autogen.sh --enable-static \
RUN CFLAGS="-g -O2 $HFLAGS" ./autogen.sh --enable-static && make -j$(nproc) \
RUN make -j$(nproc) && make DESTDIR="$LibrariesPath/libXtst-cache" install \
RUN make DESTDIR="$LibrariesPath/libXtst-cache" install && cd .. \
&& rm -rf libxtst
WORKDIR ..
RUN 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 \
WORKDIR libxfixes && CFLAGS="-g -O2 $HFLAGS" ./autogen.sh --enable-static \
RUN CFLAGS="-g -O2 $HFLAGS" ./autogen.sh --enable-static && make -j$(nproc) \
RUN make -j$(nproc) && make DESTDIR="$LibrariesPath/libXfixes-cache" install \
RUN make DESTDIR="$LibrariesPath/libXfixes-cache" install && cd .. \
&& rm -rf libxfixes
WORKDIR ..
RUN 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 \
WORKDIR libxrandr && CFLAGS="-g -O2 $HFLAGS" ./autogen.sh --enable-static \
RUN CFLAGS="-g -O2 $HFLAGS" ./autogen.sh --enable-static && make -j$(nproc) \
RUN make -j$(nproc) && make DESTDIR="$LibrariesPath/libXrandr-cache" install \
RUN make DESTDIR="$LibrariesPath/libXrandr-cache" install && cd .. \
&& rm -rf libxrandr
WORKDIR ..
RUN 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 \
WORKDIR libxrender && CFLAGS="-g -O2 $HFLAGS" ./autogen.sh --enable-static \
RUN CFLAGS="-g -O2 $HFLAGS" ./autogen.sh --enable-static && make -j$(nproc) \
RUN make -j$(nproc) && make DESTDIR="$LibrariesPath/libXrender-cache" install \
RUN make DESTDIR="$LibrariesPath/libXrender-cache" install && cd .. \
&& rm -rf libxrender
WORKDIR ..
RUN 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 \
WORKDIR libxdamage && CFLAGS="-g -O2 $HFLAGS" ./autogen.sh --enable-static \
RUN CFLAGS="-g -O2 $HFLAGS" ./autogen.sh --enable-static && make -j$(nproc) \
RUN make -j$(nproc) && make DESTDIR="$LibrariesPath/libXdamage-cache" install \
RUN make DESTDIR="$LibrariesPath/libXdamage-cache" install && cd .. \
&& rm -rf libxdamage
WORKDIR ..
RUN 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 \
WORKDIR libxcomposite && CFLAGS="-g -O2 $HFLAGS" ./autogen.sh --enable-static \
RUN CFLAGS="-g -O2 $HFLAGS" ./autogen.sh --enable-static && make -j$(nproc) \
RUN make -j$(nproc) && make DESTDIR="$LibrariesPath/libXcomposite-cache" install \
RUN make DESTDIR="$LibrariesPath/libXcomposite-cache" install && cd .. \
&& rm -rf libxcomposite
WORKDIR ..
RUN 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 \
WORKDIR wayland && meson build \
RUN meson build \
--buildtype=release \ --buildtype=release \
--default-library=both \ --default-library=both \
-Dtests=false \ -Dtests=false \
-Ddocumentation=false \ -Ddocumentation=false \
-Ddtd_validation=false \ -Ddtd_validation=false \
-Dicon_directory=/usr/share/icons -Dicon_directory=/usr/share/icons \
&& meson compile -C build \
RUN meson compile -C build && DESTDIR="$LibrariesPath/wayland-cache" meson install -C build \
RUN DESTDIR="$LibrariesPath/wayland-cache" meson install -C build && cd .. \
&& rm -rf wayland
WORKDIR ..
RUN 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 https://github.com/FFmpeg/nv-codec-headers.git \
RUN 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
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 mkdir ffmpeg RUN git init ffmpeg \
WORKDIR ffmpeg && cd ffmpeg \
RUN git init && git remote add origin $GIT/FFmpeg/FFmpeg.git \
RUN git remote add origin $GIT/FFmpeg/FFmpeg.git && git fetch --depth=1 origin cc33e73618a981de7fd96385ecb34719de031f16 \
RUN git fetch --depth=1 origin cc33e73618a981de7fd96385ecb34719de031f16 && git reset --hard FETCH_HEAD \
RUN git reset --hard FETCH_HEAD && ./configure \
RUN ./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 \
@ -452,58 +412,48 @@ RUN ./configure \
--enable-demuxer=ogg \ --enable-demuxer=ogg \
--enable-demuxer=wav \ --enable-demuxer=wav \
--enable-muxer=ogg \ --enable-muxer=ogg \
--enable-muxer=opus --enable-muxer=opus \
&& make -j$(nproc) \
RUN make -j$(nproc) && make DESTDIR="$LibrariesPath/ffmpeg-cache" install \
RUN make DESTDIR="$LibrariesPath/ffmpeg-cache" install && cd .. \
&& rm -rf ffmpeg
WORKDIR ..
RUN rm -rf ffmpeg
FROM builder AS openal FROM builder AS openal
ADD https://api.github.com/repos/telegramdesktop/openal-soft/git/refs/heads/fix_pulse_default openal-soft-version.json ADD https://api.github.com/repos/telegramdesktop/openal-soft/git/refs/heads/fix_pulse_default openal-soft-version.json
RUN git clone -b fix_pulse_default --depth=1 $GIT/telegramdesktop/openal-soft.git RUN git clone -b fix_pulse_default --depth=1 $GIT/telegramdesktop/openal-soft.git \
&& cd openal-soft \
WORKDIR openal-soft && CFLAGS="$HFLAGS" CXXFLAGS="$HFLAGS" cmake -GNinja -B build . \
RUN 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_TESTS=OFF \ -DALSOFT_TESTS=OFF \
-DALSOFT_UTILS=OFF \ -DALSOFT_UTILS=OFF \
-DALSOFT_CONFIG=OFF -DALSOFT_CONFIG=OFF \
&& cmake --build build --parallel \
RUN cmake --build build --parallel && DESTDIR="$LibrariesPath/openal-cache" cmake --install build \
RUN DESTDIR="$LibrariesPath/openal-cache" cmake --install build && cd .. \
&& rm -rf openal-soft
WORKDIR ..
RUN rm -rf openal
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 \ RUN git clone -b OpenSSL_${OPENSSL_VER}-stable --depth=1 $GIT/openssl/openssl.git $opensslDir \
$GIT/openssl/openssl.git $opensslDir && cd $opensslDir \
&& ./config \
WORKDIR ${opensslDir}
RUN ./config \
--prefix="$OPENSSL_PREFIX" \ --prefix="$OPENSSL_PREFIX" \
--openssldir=/etc/ssl \ --openssldir=/etc/ssl \
no-tests \ no-tests \
no-dso no-dso \
&& make -j$(nproc) \
RUN make -j$(nproc) && make DESTDIR="$LibrariesPath/openssl-cache" install_sw \
RUN make DESTDIR="$LibrariesPath/openssl-cache" install_sw && cd .. \
&& rm -rf $opensslDir
WORKDIR ..
RUN 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 \
WORKDIR libxkbcommon && meson build \
RUN meson build \
--buildtype=release \ --buildtype=release \
--default-library=both \ --default-library=both \
-Denable-docs=false \ -Denable-docs=false \
@ -511,65 +461,58 @@ RUN meson build \
-Denable-xkbregistry=false \ -Denable-xkbregistry=false \
-Dxkb-config-root=/usr/share/X11/xkb \ -Dxkb-config-root=/usr/share/X11/xkb \
-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 \
RUN meson compile -C build && DESTDIR="$LibrariesPath/xkbcommon-cache" meson install -C build \
RUN DESTDIR="$LibrariesPath/xkbcommon-cache" meson install -C build && cd .. \
&& rm -rf libxkbcommon
WORKDIR ..
RUN 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 \
WORKDIR mm-common && NOCONFIGURE=1 ./autogen.sh \
RUN NOCONFIGURE=1 ./autogen.sh && ./configure --enable-network \
RUN ./configure --enable-network && make -j$(nproc) \
RUN make -j$(nproc) && make DESTDIR="$LibrariesPath/mm-common-cache" install \
RUN make DESTDIR="$LibrariesPath/mm-common-cache" install && cd .. \
&& rm -rf mm-common
WORKDIR ..
RUN 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 \
WORKDIR libsigcplusplus && export ACLOCAL_PATH="/usr/local/share/aclocal" \
ENV ACLOCAL_PATH="/usr/local/share/aclocal" && NOCONFIGURE=1 ./autogen.sh \
RUN NOCONFIGURE=1 ./autogen.sh && CFLAGS="-g -O2 $HFLAGS" CXXFLAGS="-g -O2 $HFLAGS" ./configure \
RUN CFLAGS="-g -O2 $HFLAGS" CXXFLAGS="-g -O2 $HFLAGS" ./configure --enable-maintainer-mode --enable-static --disable-documentation --enable-maintainer-mode \
RUN make -j$(nproc) --enable-static \
RUN make DESTDIR="$LibrariesPath/libsigcplusplus-cache" install --disable-documentation \
&& make -j$(nproc) \
WORKDIR .. && make DESTDIR="$LibrariesPath/libsigcplusplus-cache" install \
RUN rm -rf libsigcplusplus && cd .. \
&& 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 \
WORKDIR glibmm && git apply ../patches/glibmm.patch \
RUN git apply ../patches/glibmm.patch && export ACLOCAL_PATH="/usr/local/share/aclocal" \
ENV ACLOCAL_PATH="/usr/local/share/aclocal" && NOCONFIGURE=1 ./autogen.sh \
RUN NOCONFIGURE=1 ./autogen.sh && CC="gcc -flto $HFLAGS" CXX="g++ -flto $HFLAGS" AR=gcc-ar RANLIB=gcc-ranlib ./configure \
RUN 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) \
RUN make -j$(nproc) && make DESTDIR="$LibrariesPath/glibmm-cache" install \
RUN make DESTDIR="$LibrariesPath/glibmm-cache" install && cd .. \
&& rm -rf glibmm
WORKDIR ..
RUN 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 /
@ -584,15 +527,13 @@ 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 /
RUN git clone -b ${QT_TAG} --depth=1 git://code.qt.io/qt/qt5.git qt_${QT} RUN git clone -b ${QT_TAG} --depth=1 git://code.qt.io/qt/qt5.git qt_${QT} \
WORKDIR qt_${QT} && cd qt_${QT} \
RUN perl init-repository --module-subset=qtbase,qtwayland,qtimageformats,qtsvg,qt5compat && perl init-repository --module-subset=qtbase,qtwayland,qtimageformats,qtsvg,qt5compat \
&& cd qtbase \
WORKDIR qtbase && find ../../patches/qtbase_${QT} -type f -print0 | sort -z | xargs -r0 git apply \
RUN find ../../patches/qtbase_${QT} -type f -print0 | sort -z | xargs -r0 git apply && cd .. \
WORKDIR .. && ./configure -prefix "$QT_PREFIX" \
RUN ./configure -prefix "$QT_PREFIX" \
-release \ -release \
-force-debug-info \ -force-debug-info \
-opensource \ -opensource \
@ -609,35 +550,28 @@ RUN ./configure -prefix "$QT_PREFIX" \
-dbus-runtime \ -dbus-runtime \
-openssl-linked \ -openssl-linked \
-nomake examples \ -nomake examples \
-nomake tests -nomake tests \
&& cmake --build . --parallel \
RUN cmake --build . --parallel && DESTDIR="$LibrariesPath/qt-cache" cmake --install . \
RUN DESTDIR="$LibrariesPath/qt-cache" cmake --install . && cd .. \
&& rm -rf qt_${QT}
WORKDIR ..
RUN 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 \
&& cd breakpad \
WORKDIR breakpad && git checkout dfcb7b6799 \
RUN git checkout dfcb7b6799 && git apply ../patches/breakpad.diff \
RUN git apply ../patches/breakpad.diff && git clone https://chromium.googlesource.com/linux-syscall-support.git src/third_party/lss \
RUN git clone https://chromium.googlesource.com/linux-syscall-support.git src/third_party/lss && cd src/third_party/lss \
&& git checkout e1e7b0ad8e \
WORKDIR src/third_party/lss && cd ../../.. \
RUN git checkout e1e7b0ad8e && ./configure \
&& make -j$(nproc) \
WORKDIR ../../.. && make DESTDIR="${LibrariesPath}/breakpad-cache" install \
RUN ./configure && cd .. \
RUN make -j$(nproc) && rm -rf breakpad
RUN make DESTDIR="${LibrariesPath}/breakpad-cache" install
WORKDIR ..
RUN 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 /
@ -646,21 +580,17 @@ COPY --from=openssl ${LibrariesPath}/openssl-cache /
COPY --from=libXtst ${LibrariesPath}/libXtst-cache / COPY --from=libXtst ${LibrariesPath}/libXtst-cache /
# Shallow clone on a specific commit. # Shallow clone on a specific commit.
RUN mkdir tg_owt RUN git init tg_owt \
WORKDIR tg_owt && cd tg_owt \
RUN git init && git remote add origin $GIT/desktop-app/tg_owt.git \
RUN git remote add origin $GIT/desktop-app/tg_owt.git && git fetch --depth=1 origin 63a934db1ed212ebf8aaaa20f0010dd7b0d7b396 \
RUN git fetch --depth=1 origin 63a934db1ed212ebf8aaaa20f0010dd7b0d7b396 && git reset --hard FETCH_HEAD \
RUN git reset --hard FETCH_HEAD && git submodule update --init --recursive \
RUN git submodule init && rm -rf .git \
RUN git submodule update && cd src/third_party/pipewire \
&& meson build -Dspa-plugins=disabled \
WORKDIR src/third_party/pipewire && cd ../../.. \
RUN meson build -Dspa-plugins=disabled && cmake -G"Ninja Multi-Config" -B out . \
WORKDIR ../../..
RUN 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" \
@ -672,14 +602,17 @@ RUN cmake -G"Ninja Multi-Config" -B out . \
-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
RUN cmake --build out --config Release --parallel WORKDIR tg_owt
RUN cmake --build out --config Debug --parallel
RUN find out -mindepth 1 -maxdepth 1 ! -name Release ! -name Debug -exec rm -rf {} \; FROM webrtc AS webrtc_release
RUN rm -rf .git RUN cmake --build out --config Release --parallel \
&& find out -mindepth 1 -maxdepth 1 ! -name Release -exec rm -rf {} \;
FROM webrtc AS webrtc_debug
RUN cmake --build out --config Debug --parallel \
&& find out -mindepth 1 -maxdepth 1 ! -name Debug -exec rm -rf {} \;
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 /
@ -711,6 +644,8 @@ 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_debug ${LibrariesPath}/tg_owt/out/Debug tg_owt/out/Debug
WORKDIR ../tdesktop WORKDIR ../tdesktop
VOLUME [ "/usr/src/tdesktop" ] VOLUME [ "/usr/src/tdesktop" ]