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 "$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://packages.endpointdev.com/rhel/7/os/x86_64/endpoint-repo.x86_64.rpm && yum clean all
RUN yum -y install centos-release-scl && yum clean all
RUN yum -y install git meson ninja-build autoconf automake libtool patch \
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 centos-release-scl \
&& yum -y install git meson ninja-build autoconf automake libtool patch \
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 \
libdrm-devel gtk3-devel \
perl-XML-Parser pkgconfig bison yasm file which xorg-x11-util-macros \
devtoolset-10-make devtoolset-10-gcc devtoolset-10-gcc-c++ \
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
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
WORKDIR $LibrariesPath
RUN mkdir /opt/cmake
RUN curl -sSLo $CMAKE_FILE $GIT/Kitware/CMake/releases/download/v$CMAKE_VER/$CMAKE_FILE
RUN sh $CMAKE_FILE --prefix=/opt/cmake --skip-license
RUN ln -s /opt/cmake/bin/cmake /usr/local/bin/cmake
RUN rm $CMAKE_FILE
RUN mkdir /opt/cmake \
&& curl -sSLo $CMAKE_FILE $GIT/Kitware/CMake/releases/download/v$CMAKE_VER/$CMAKE_FILE \
&& sh $CMAKE_FILE --prefix=/opt/cmake --skip-license \
&& ln -s /opt/cmake/bin/cmake /usr/local/bin/cmake \
&& rm $CMAKE_FILE
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
RUN git clone -b v3.4.2 --depth=1 $GIT/libffi/libffi.git
WORKDIR libffi
RUN ./autogen.sh
RUN ./configure --enable-static --disable-docs
RUN make -j$(nproc)
RUN make DESTDIR="$LibrariesPath/libffi-cache" install
WORKDIR ..
RUN rm -rf libffi
RUN git clone -b v3.4.2 --depth=1 $GIT/libffi/libffi.git \
&& cd libffi \
&& ./autogen.sh \
&& ./configure --enable-static --disable-docs \
&& make -j$(nproc) \
&& make DESTDIR="$LibrariesPath/libffi-cache" install \
&& cd .. \
&& rm -rf libffi
FROM builder AS zlib
RUN git clone -b v1.2.11 --depth=1 $GIT/madler/zlib.git
WORKDIR zlib
RUN CFLAGS="-O3 $HFLAGS" ./configure --static
RUN make -j$(nproc)
RUN make DESTDIR="$LibrariesPath/zlib-cache" install
WORKDIR ..
RUN rm -rf zlib
RUN git clone -b v1.2.11 --depth=1 $GIT/madler/zlib.git \
&& cd zlib \
&& CFLAGS="-O3 $HFLAGS" ./configure --static \
&& make -j$(nproc) \
&& make DESTDIR="$LibrariesPath/zlib-cache" install \
&& cd .. \
&& rm -rf zlib
FROM builder AS xz
RUN git clone -b v5.2.5 https://git.tukaani.org/xz.git
WORKDIR xz
RUN CFLAGS="$HFLAGS" \
cmake -GNinja -B build . -DCMAKE_BUILD_TYPE=Release
RUN cmake --build build --parallel
RUN DESTDIR="$LibrariesPath/xz-cache" cmake --install build
WORKDIR ..
RUN rm -rf xz
RUN git clone -b v5.2.5 https://git.tukaani.org/xz.git \
&& cd xz \
&& CFLAGS="$HFLAGS" cmake -GNinja -B build . -DCMAKE_BUILD_TYPE=Release \
&& cmake --build build --parallel \
&& DESTDIR="$LibrariesPath/xz-cache" cmake --install build \
&& cd .. \
&& rm -rf xz
FROM patches AS libproxy
RUN git clone -b 0.4.17 --depth=1 $GIT/libproxy/libproxy.git
WORKDIR libproxy
RUN git apply ../patches/libproxy.patch
RUN CFLAGS="$HFLAGS" CXXFLAGS="$HFLAGS" cmake -GNinja -B build . \
RUN git clone -b 0.4.17 --depth=1 $GIT/libproxy/libproxy.git \
&& cd libproxy \
&& git apply ../patches/libproxy.patch \
&& CFLAGS="$HFLAGS" CXXFLAGS="$HFLAGS" cmake -GNinja -B build . \
-DCMAKE_BUILD_TYPE=Release \
-DWITH_DBUS=OFF \
-DWITH_NM=OFF \
-DWITH_NMold=OFF
RUN cmake --build build --parallel
RUN DESTDIR="$LibrariesPath/libproxy-cache" cmake --install build
WORKDIR ..
RUN rm -rf libproxy
-DWITH_NMold=OFF \
&& cmake --build build --parallel \
&& DESTDIR="$LibrariesPath/libproxy-cache" cmake --install build \
&& cd .. \
&& rm -rf libproxy
FROM builder AS mozjpeg
RUN git clone -b v4.0.3 --depth=1 $GIT/mozilla/mozjpeg.git
WORKDIR mozjpeg
RUN CFLAGS="$HFLAGS" cmake -GNinja -B build . \
RUN git clone -b v4.0.3 --depth=1 $GIT/mozilla/mozjpeg.git \
&& cd mozjpeg \
&& CFLAGS="$HFLAGS" cmake -GNinja -B build . \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr/local \
-DWITH_JPEG8=ON \
-DPNG_SUPPORTED=OFF
RUN cmake --build build --parallel
RUN DESTDIR="$LibrariesPath/mozjpeg-cache" cmake --install build
WORKDIR ..
RUN rm -rf mozjpeg
-DPNG_SUPPORTED=OFF \
&& cmake --build build --parallel \
&& DESTDIR="$LibrariesPath/mozjpeg-cache" cmake --install build \
&& cd .. \
&& rm -rf mozjpeg
FROM builder AS opus
RUN git clone -b v1.3.1 --depth=1 $GIT/xiph/opus.git
WORKDIR opus
RUN ./autogen.sh
RUN CFLAGS="-g -O2 $HFLAGS" ./configure
RUN make -j$(nproc)
RUN make DESTDIR="$LibrariesPath/opus-cache" install
WORKDIR ..
RUN rm -rf opus
RUN git clone -b v1.3.1 --depth=1 $GIT/xiph/opus.git \
&& cd opus \
&& ./autogen.sh \
&& CFLAGS="-g -O2 $HFLAGS" ./configure \
&& make -j$(nproc) \
&& make DESTDIR="$LibrariesPath/opus-cache" install \
&& cd .. \
&& rm -rf opus
FROM builder AS libvpx
RUN git clone -b v1.11.0 --depth=1 $GIT/webmproject/libvpx.git
WORKDIR libvpx
RUN ./configure \
RUN git clone -b v1.11.0 --depth=1 $GIT/webmproject/libvpx.git \
&& cd libvpx \
&& ./configure \
--disable-examples \
--disable-unit-tests \
--disable-tools \
--disable-docs \
--enable-vp8 \
--enable-vp9 \
--enable-webm-io
RUN make -j$(nproc)
RUN make DESTDIR="$LibrariesPath/libvpx-cache" install
WORKDIR ..
RUN rm -rf libvpx
--enable-webm-io \
&& make -j$(nproc) \
&& make DESTDIR="$LibrariesPath/libvpx-cache" install \
&& cd .. \
&& rm -rf libvpx
FROM builder AS rnnoise
RUN git clone -b master --depth=1 $GIT/desktop-app/rnnoise
WORKDIR rnnoise
RUN CFLAGS="$HFLAGS" cmake -GNinja -B build . \
-DCMAKE_BUILD_TYPE=Release
RUN cmake --build build --parallel
RUN mkdir -p "$LibrariesPath/rnnoise-cache/usr/local/include"
RUN cp "include/rnnoise.h" "$LibrariesPath/rnnoise-cache/usr/local/include/"
RUN mkdir -p "$LibrariesPath/rnnoise-cache/usr/local/lib"
RUN cp "build/librnnoise.a" "$LibrariesPath/rnnoise-cache/usr/local/lib/"
WORKDIR ..
RUN rm -rf rnnoise
RUN git clone -b master --depth=1 $GIT/desktop-app/rnnoise \
&& cd rnnoise \
&& CFLAGS="$HFLAGS" cmake -GNinja -B build . -DCMAKE_BUILD_TYPE=Release \
&& cmake --build build --parallel \
&& mkdir -p "$LibrariesPath/rnnoise-cache/usr/local/include" \
&& cp "include/rnnoise.h" "$LibrariesPath/rnnoise-cache/usr/local/include/" \
&& mkdir -p "$LibrariesPath/rnnoise-cache/usr/local/lib" \
&& cp "build/librnnoise.a" "$LibrariesPath/rnnoise-cache/usr/local/lib/" \
&& cd .. \
&& rm -rf rnnoise
FROM builder AS xcb-proto
RUN git clone -b xcb-proto-1.14.1 --depth=1 $GIT_FREEDESKTOP/xcbproto.git
WORKDIR xcbproto
RUN ./autogen.sh
RUN make -j$(nproc)
RUN make DESTDIR="$LibrariesPath/xcb-proto-cache" install
WORKDIR ..
RUN rm -rf xcbproto
RUN git clone -b xcb-proto-1.14.1 --depth=1 $GIT_FREEDESKTOP/xcbproto.git \
&& cd xcbproto \
&& ./autogen.sh \
&& make -j$(nproc) \
&& make DESTDIR="$LibrariesPath/xcb-proto-cache" install \
&& cd .. \
&& rm -rf xcbproto
FROM builder AS xcb
COPY --from=xcb-proto ${LibrariesPath}/xcb-proto-cache /
RUN git clone -b libxcb-1.14 --depth=1 $GIT_FREEDESKTOP/libxcb.git
WORKDIR libxcb
RUN CFLAGS="-g -O2 $HFLAGS" ./autogen.sh --enable-static
RUN make -j$(nproc)
RUN make DESTDIR="$LibrariesPath/xcb-cache" install
WORKDIR ..
RUN rm -rf libxcb
RUN git clone -b libxcb-1.14 --depth=1 $GIT_FREEDESKTOP/libxcb.git \
&& cd libxcb \
&& CFLAGS="-g -O2 $HFLAGS" ./autogen.sh --enable-static \
&& make -j$(nproc) \
&& make DESTDIR="$LibrariesPath/xcb-cache" install \
&& cd .. \
&& rm -rf libxcb
FROM builder AS xcb-wm
RUN git clone -b 0.4.1 --depth=1 --recursive $GIT_FREEDESKTOP/libxcb-wm.git
WORKDIR libxcb-wm
RUN ./autogen.sh --enable-static
RUN make -j$(nproc)
RUN make DESTDIR="$LibrariesPath/xcb-wm-cache" install
RUN git clone -b 0.4.1 --depth=1 --recursive $GIT_FREEDESKTOP/libxcb-wm.git \
&& cd libxcb-wm \
&& ./autogen.sh --enable-static \
&& make -j$(nproc) \
&& make DESTDIR="$LibrariesPath/xcb-wm-cache" install \
&& cd .. \
&& rm -rf libxcb-wm
FROM builder AS xcb-util
RUN git clone -b 0.4.0 --depth=1 --recursive $GIT_FREEDESKTOP/libxcb-util.git
WORKDIR libxcb-util
RUN ./autogen.sh --enable-static
RUN make -j$(nproc)
RUN make DESTDIR="$LibrariesPath/xcb-util-cache" install
RUN git clone -b 0.4.0 --depth=1 --recursive $GIT_FREEDESKTOP/libxcb-util.git \
&& cd libxcb-util \
&& ./autogen.sh --enable-static \
&& make -j$(nproc) \
&& make DESTDIR="$LibrariesPath/xcb-util-cache" install \
&& cd .. \
&& rm -rf libxcb-util
FROM builder AS xcb-image
COPY --from=xcb-util ${LibrariesPath}/xcb-util-cache /
RUN git clone -b 0.4.0 --depth=1 --recursive $GIT_FREEDESKTOP/libxcb-image.git
WORKDIR libxcb-image
RUN CFLAGS="-g -O2 $HFLAGS" ./autogen.sh --enable-static
RUN make -j$(nproc)
RUN make DESTDIR="$LibrariesPath/xcb-image-cache" install
RUN git clone -b 0.4.0 --depth=1 --recursive $GIT_FREEDESKTOP/libxcb-image.git \
&& cd libxcb-image \
&& CFLAGS="-g -O2 $HFLAGS" ./autogen.sh --enable-static \
&& make -j$(nproc) \
&& make DESTDIR="$LibrariesPath/xcb-image-cache" install \
&& cd .. \
&& rm -rf libxcb-image
FROM builder AS xcb-keysyms
RUN git clone -b 0.4.0 --depth=1 --recursive $GIT_FREEDESKTOP/libxcb-keysyms.git
WORKDIR libxcb-keysyms
RUN CFLAGS="-g -O2 $HFLAGS" ./autogen.sh --enable-static
RUN make -j$(nproc)
RUN make DESTDIR="$LibrariesPath/xcb-keysyms-cache" install
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 \
&& make -j$(nproc) \
&& make DESTDIR="$LibrariesPath/xcb-keysyms-cache" install \
&& cd .. \
&& rm -rf libxcb-keysyms
FROM builder AS xcb-render-util
RUN git clone -b 0.3.9 --depth=1 --recursive $GIT_FREEDESKTOP/libxcb-render-util.git
WORKDIR libxcb-render-util
RUN CFLAGS="-g -O2 $HFLAGS" ./autogen.sh --enable-static
RUN make -j$(nproc)
RUN make DESTDIR="$LibrariesPath/xcb-render-util-cache" install
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 \
&& make -j$(nproc) \
&& make DESTDIR="$LibrariesPath/xcb-render-util-cache" install \
&& cd .. \
&& rm -rf libxcb-render-util
FROM builder AS libXext
RUN git clone -b libXext-1.3.4 --depth=1 $GIT_FREEDESKTOP/libxext.git
WORKDIR libxext
RUN CFLAGS="-g -O2 $HFLAGS" ./autogen.sh --enable-static
RUN make -j$(nproc)
RUN make DESTDIR="$LibrariesPath/libXext-cache" install
WORKDIR ..
RUN rm -rf libxext
RUN git clone -b libXext-1.3.4 --depth=1 $GIT_FREEDESKTOP/libxext.git \
&& cd libxext \
&& CFLAGS="-g -O2 $HFLAGS" ./autogen.sh --enable-static \
&& make -j$(nproc) \
&& make DESTDIR="$LibrariesPath/libXext-cache" install \
&& cd .. \
&& rm -rf libxext
FROM builder AS libXtst
RUN git clone -b libXtst-1.2.3 --depth=1 $GIT_FREEDESKTOP/libxtst.git
WORKDIR libxtst
RUN CFLAGS="-g -O2 $HFLAGS" ./autogen.sh --enable-static
RUN make -j$(nproc)
RUN make DESTDIR="$LibrariesPath/libXtst-cache" install
WORKDIR ..
RUN rm -rf libxtst
RUN git clone -b libXtst-1.2.3 --depth=1 $GIT_FREEDESKTOP/libxtst.git \
&& cd libxtst \
&& CFLAGS="-g -O2 $HFLAGS" ./autogen.sh --enable-static \
&& make -j$(nproc) \
&& make DESTDIR="$LibrariesPath/libXtst-cache" install \
&& cd .. \
&& rm -rf libxtst
FROM builder AS libXfixes
RUN git clone -b libXfixes-5.0.3 --depth=1 $GIT_FREEDESKTOP/libxfixes.git
WORKDIR libxfixes
RUN CFLAGS="-g -O2 $HFLAGS" ./autogen.sh --enable-static
RUN make -j$(nproc)
RUN make DESTDIR="$LibrariesPath/libXfixes-cache" install
WORKDIR ..
RUN rm -rf libxfixes
RUN git clone -b libXfixes-5.0.3 --depth=1 $GIT_FREEDESKTOP/libxfixes.git \
&& cd libxfixes \
&& CFLAGS="-g -O2 $HFLAGS" ./autogen.sh --enable-static \
&& make -j$(nproc) \
&& make DESTDIR="$LibrariesPath/libXfixes-cache" install \
&& cd .. \
&& rm -rf libxfixes
FROM builder AS libXrandr
RUN git clone -b libXrandr-1.5.2 --depth=1 $GIT_FREEDESKTOP/libxrandr.git
WORKDIR libxrandr
RUN CFLAGS="-g -O2 $HFLAGS" ./autogen.sh --enable-static
RUN make -j$(nproc)
RUN make DESTDIR="$LibrariesPath/libXrandr-cache" install
WORKDIR ..
RUN rm -rf libxrandr
RUN git clone -b libXrandr-1.5.2 --depth=1 $GIT_FREEDESKTOP/libxrandr.git \
&& cd libxrandr \
&& CFLAGS="-g -O2 $HFLAGS" ./autogen.sh --enable-static \
&& make -j$(nproc) \
&& make DESTDIR="$LibrariesPath/libXrandr-cache" install \
&& cd .. \
&& rm -rf libxrandr
FROM builder AS libXrender
RUN git clone -b libXrender-0.9.10 --depth=1 $GIT_FREEDESKTOP/libxrender.git
WORKDIR libxrender
RUN CFLAGS="-g -O2 $HFLAGS" ./autogen.sh --enable-static
RUN make -j$(nproc)
RUN make DESTDIR="$LibrariesPath/libXrender-cache" install
WORKDIR ..
RUN rm -rf libxrender
RUN git clone -b libXrender-0.9.10 --depth=1 $GIT_FREEDESKTOP/libxrender.git \
&& cd libxrender \
&& CFLAGS="-g -O2 $HFLAGS" ./autogen.sh --enable-static \
&& make -j$(nproc) \
&& make DESTDIR="$LibrariesPath/libXrender-cache" install \
&& cd .. \
&& rm -rf libxrender
FROM builder AS libXdamage
RUN git clone -b libXdamage-1.1.5 --depth=1 $GIT_FREEDESKTOP/libxdamage.git
WORKDIR libxdamage
RUN CFLAGS="-g -O2 $HFLAGS" ./autogen.sh --enable-static
RUN make -j$(nproc)
RUN make DESTDIR="$LibrariesPath/libXdamage-cache" install
WORKDIR ..
RUN rm -rf libxdamage
RUN git clone -b libXdamage-1.1.5 --depth=1 $GIT_FREEDESKTOP/libxdamage.git \
&& cd libxdamage \
&& CFLAGS="-g -O2 $HFLAGS" ./autogen.sh --enable-static \
&& make -j$(nproc) \
&& make DESTDIR="$LibrariesPath/libXdamage-cache" install \
&& cd .. \
&& rm -rf libxdamage
FROM builder AS libXcomposite
RUN git clone -b libXcomposite-0.4.5 --depth=1 $GIT_FREEDESKTOP/libxcomposite.git
WORKDIR libxcomposite
RUN CFLAGS="-g -O2 $HFLAGS" ./autogen.sh --enable-static
RUN make -j$(nproc)
RUN make DESTDIR="$LibrariesPath/libXcomposite-cache" install
WORKDIR ..
RUN rm -rf libxcomposite
RUN git clone -b libXcomposite-0.4.5 --depth=1 $GIT_FREEDESKTOP/libxcomposite.git \
&& cd libxcomposite \
&& CFLAGS="-g -O2 $HFLAGS" ./autogen.sh --enable-static \
&& make -j$(nproc) \
&& make DESTDIR="$LibrariesPath/libXcomposite-cache" install \
&& cd .. \
&& rm -rf libxcomposite
FROM builder AS wayland
COPY --from=libffi ${LibrariesPath}/libffi-cache /
RUN git clone -b 1.20.0 --depth=1 $GIT_FREEDESKTOP/wayland.git
WORKDIR wayland
RUN meson build \
RUN git clone -b 1.20.0 --depth=1 $GIT_FREEDESKTOP/wayland.git \
&& cd wayland \
&& meson build \
--buildtype=release \
--default-library=both \
-Dtests=false \
-Ddocumentation=false \
-Ddtd_validation=false \
-Dicon_directory=/usr/share/icons
RUN meson compile -C build
RUN DESTDIR="$LibrariesPath/wayland-cache" meson install -C build
WORKDIR ..
RUN rm -rf wayland
-Dicon_directory=/usr/share/icons \
&& meson compile -C build \
&& DESTDIR="$LibrariesPath/wayland-cache" meson install -C build \
&& cd .. \
&& rm -rf wayland
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 DESTDIR="$LibrariesPath/nv-codec-headers-cache" make -C nv-codec-headers install
RUN git clone -b n11.1.5.1 --depth=1 https://github.com/FFmpeg/nv-codec-headers.git \
&& DESTDIR="$LibrariesPath/nv-codec-headers-cache" make -C nv-codec-headers install \
&& rm -rf nv-codec-headers
FROM builder AS ffmpeg
COPY --from=opus ${LibrariesPath}/opus-cache /
COPY --from=libvpx ${LibrariesPath}/libvpx-cache /
COPY --from=nv-codec-headers ${LibrariesPath}/nv-codec-headers-cache /
RUN mkdir ffmpeg
WORKDIR ffmpeg
RUN git init
RUN git remote add origin $GIT/FFmpeg/FFmpeg.git
RUN git fetch --depth=1 origin cc33e73618a981de7fd96385ecb34719de031f16
RUN git reset --hard FETCH_HEAD
RUN ./configure \
RUN git init ffmpeg \
&& cd ffmpeg \
&& git remote add origin $GIT/FFmpeg/FFmpeg.git \
&& git fetch --depth=1 origin cc33e73618a981de7fd96385ecb34719de031f16 \
&& git reset --hard FETCH_HEAD \
&& ./configure \
--extra-cflags="-DCONFIG_SAFE_BITSTREAM_READER=1 $HFLAGS" \
--extra-cxxflags="-DCONFIG_SAFE_BITSTREAM_READER=1 $HFLAGS" \
--disable-debug \
@ -452,58 +412,48 @@ RUN ./configure \
--enable-demuxer=ogg \
--enable-demuxer=wav \
--enable-muxer=ogg \
--enable-muxer=opus
RUN make -j$(nproc)
RUN make DESTDIR="$LibrariesPath/ffmpeg-cache" install
WORKDIR ..
RUN rm -rf ffmpeg
--enable-muxer=opus \
&& make -j$(nproc) \
&& make DESTDIR="$LibrariesPath/ffmpeg-cache" install \
&& cd .. \
&& rm -rf ffmpeg
FROM builder AS openal
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
WORKDIR openal-soft
RUN CFLAGS="$HFLAGS" CXXFLAGS="$HFLAGS" cmake -GNinja -B build . \
RUN git clone -b fix_pulse_default --depth=1 $GIT/telegramdesktop/openal-soft.git \
&& cd openal-soft \
&& CFLAGS="$HFLAGS" CXXFLAGS="$HFLAGS" cmake -GNinja -B build . \
-DCMAKE_BUILD_TYPE=Release \
-DLIBTYPE:STRING=STATIC \
-DALSOFT_EXAMPLES=OFF \
-DALSOFT_TESTS=OFF \
-DALSOFT_UTILS=OFF \
-DALSOFT_CONFIG=OFF
RUN cmake --build build --parallel
RUN DESTDIR="$LibrariesPath/openal-cache" cmake --install build
WORKDIR ..
RUN rm -rf openal
-DALSOFT_CONFIG=OFF \
&& cmake --build build --parallel \
&& DESTDIR="$LibrariesPath/openal-cache" cmake --install build \
&& cd .. \
&& rm -rf openal-soft
FROM builder AS openssl
ENV opensslDir openssl_${OPENSSL_VER}
RUN git clone -b OpenSSL_${OPENSSL_VER}-stable --depth=1 \
$GIT/openssl/openssl.git $opensslDir
WORKDIR ${opensslDir}
RUN ./config \
RUN git clone -b OpenSSL_${OPENSSL_VER}-stable --depth=1 $GIT/openssl/openssl.git $opensslDir \
&& cd $opensslDir \
&& ./config \
--prefix="$OPENSSL_PREFIX" \
--openssldir=/etc/ssl \
no-tests \
no-dso
RUN make -j$(nproc)
RUN make DESTDIR="$LibrariesPath/openssl-cache" install_sw
WORKDIR ..
RUN rm -rf $opensslDir
no-dso \
&& make -j$(nproc) \
&& make DESTDIR="$LibrariesPath/openssl-cache" install_sw \
&& cd .. \
&& rm -rf $opensslDir
FROM builder AS xkbcommon
COPY --from=xcb ${LibrariesPath}/xcb-cache /
RUN git clone -b xkbcommon-1.3.1 --depth=1 $GIT/xkbcommon/libxkbcommon.git
WORKDIR libxkbcommon
RUN meson build \
RUN git clone -b xkbcommon-1.3.1 --depth=1 $GIT/xkbcommon/libxkbcommon.git \
&& cd libxkbcommon \
&& meson build \
--buildtype=release \
--default-library=both \
-Denable-docs=false \
@ -511,65 +461,58 @@ RUN meson build \
-Denable-xkbregistry=false \
-Dxkb-config-root=/usr/share/X11/xkb \
-Dxkb-config-extra-path=/etc/xkb \
-Dx-locale-root=/usr/share/X11/locale
RUN meson compile -C build
RUN DESTDIR="$LibrariesPath/xkbcommon-cache" meson install -C build
WORKDIR ..
RUN rm -rf libxkbcommon
-Dx-locale-root=/usr/share/X11/locale \
&& meson compile -C build \
&& DESTDIR="$LibrariesPath/xkbcommon-cache" meson install -C build \
&& cd .. \
&& rm -rf libxkbcommon
FROM builder AS mm-common
RUN git clone -b 1.0.3 --depth=1 $GIT/GNOME/mm-common.git
WORKDIR mm-common
RUN NOCONFIGURE=1 ./autogen.sh
RUN ./configure --enable-network
RUN make -j$(nproc)
RUN make DESTDIR="$LibrariesPath/mm-common-cache" install
WORKDIR ..
RUN rm -rf mm-common
RUN git clone -b 1.0.3 --depth=1 $GIT/GNOME/mm-common.git \
&& cd mm-common \
&& NOCONFIGURE=1 ./autogen.sh \
&& ./configure --enable-network \
&& make -j$(nproc) \
&& make DESTDIR="$LibrariesPath/mm-common-cache" install \
&& cd .. \
&& rm -rf mm-common
FROM builder AS libsigcplusplus
COPY --from=mm-common ${LibrariesPath}/mm-common-cache /
RUN git clone -b 2.10.7 --depth=1 $GIT/libsigcplusplus/libsigcplusplus.git
WORKDIR libsigcplusplus
ENV ACLOCAL_PATH="/usr/local/share/aclocal"
RUN NOCONFIGURE=1 ./autogen.sh
RUN CFLAGS="-g -O2 $HFLAGS" CXXFLAGS="-g -O2 $HFLAGS" ./configure --enable-maintainer-mode --enable-static --disable-documentation
RUN make -j$(nproc)
RUN make DESTDIR="$LibrariesPath/libsigcplusplus-cache" install
WORKDIR ..
RUN rm -rf libsigcplusplus
RUN git clone -b 2.10.7 --depth=1 $GIT/libsigcplusplus/libsigcplusplus.git \
&& cd libsigcplusplus \
&& export ACLOCAL_PATH="/usr/local/share/aclocal" \
&& NOCONFIGURE=1 ./autogen.sh \
&& CFLAGS="-g -O2 $HFLAGS" CXXFLAGS="-g -O2 $HFLAGS" ./configure \
--enable-maintainer-mode \
--enable-static \
--disable-documentation \
&& make -j$(nproc) \
&& make DESTDIR="$LibrariesPath/libsigcplusplus-cache" install \
&& cd .. \
&& rm -rf libsigcplusplus
FROM patches AS glibmm
COPY --from=mm-common ${LibrariesPath}/mm-common-cache /
COPY --from=libsigcplusplus ${LibrariesPath}/libsigcplusplus-cache /
# equals to glib version of Ubuntu 14.04
RUN git clone -b 2.40.0 --depth=1 $GIT/GNOME/glibmm.git
WORKDIR glibmm
RUN git apply ../patches/glibmm.patch
ENV ACLOCAL_PATH="/usr/local/share/aclocal"
RUN NOCONFIGURE=1 ./autogen.sh
RUN CC="gcc -flto $HFLAGS" CXX="g++ -flto $HFLAGS" AR=gcc-ar RANLIB=gcc-ranlib ./configure \
RUN git clone -b 2.40.0 --depth=1 $GIT/GNOME/glibmm.git \
&& cd glibmm \
&& git apply ../patches/glibmm.patch \
&& export ACLOCAL_PATH="/usr/local/share/aclocal" \
&& NOCONFIGURE=1 ./autogen.sh \
&& CC="gcc -flto $HFLAGS" CXX="g++ -flto $HFLAGS" AR=gcc-ar RANLIB=gcc-ranlib ./configure \
--enable-maintainer-mode \
--enable-static \
--disable-documentation
RUN make -j$(nproc)
RUN make DESTDIR="$LibrariesPath/glibmm-cache" install
WORKDIR ..
RUN rm -rf glibmm
--disable-documentation \
&& make -j$(nproc) \
&& make DESTDIR="$LibrariesPath/glibmm-cache" install \
&& cd .. \
&& rm -rf glibmm
FROM patches AS qt
COPY --from=libffi ${LibrariesPath}/libffi-cache /
COPY --from=zlib ${LibrariesPath}/zlib-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=xkbcommon ${LibrariesPath}/xkbcommon-cache /
RUN git clone -b ${QT_TAG} --depth=1 git://code.qt.io/qt/qt5.git qt_${QT}
WORKDIR qt_${QT}
RUN perl init-repository --module-subset=qtbase,qtwayland,qtimageformats,qtsvg,qt5compat
WORKDIR qtbase
RUN find ../../patches/qtbase_${QT} -type f -print0 | sort -z | xargs -r0 git apply
WORKDIR ..
RUN ./configure -prefix "$QT_PREFIX" \
RUN git clone -b ${QT_TAG} --depth=1 git://code.qt.io/qt/qt5.git qt_${QT} \
&& cd qt_${QT} \
&& perl init-repository --module-subset=qtbase,qtwayland,qtimageformats,qtsvg,qt5compat \
&& cd qtbase \
&& find ../../patches/qtbase_${QT} -type f -print0 | sort -z | xargs -r0 git apply \
&& cd .. \
&& ./configure -prefix "$QT_PREFIX" \
-release \
-force-debug-info \
-opensource \
@ -609,35 +550,28 @@ RUN ./configure -prefix "$QT_PREFIX" \
-dbus-runtime \
-openssl-linked \
-nomake examples \
-nomake tests
RUN cmake --build . --parallel
RUN DESTDIR="$LibrariesPath/qt-cache" cmake --install .
WORKDIR ..
RUN rm -rf qt_${QT}
-nomake tests \
&& cmake --build . --parallel \
&& DESTDIR="$LibrariesPath/qt-cache" cmake --install . \
&& cd .. \
&& rm -rf qt_${QT}
FROM patches AS breakpad
RUN git clone https://chromium.googlesource.com/breakpad/breakpad.git
WORKDIR breakpad
RUN git checkout dfcb7b6799
RUN git apply ../patches/breakpad.diff
RUN git clone https://chromium.googlesource.com/linux-syscall-support.git src/third_party/lss
WORKDIR src/third_party/lss
RUN git checkout e1e7b0ad8e
WORKDIR ../../..
RUN ./configure
RUN make -j$(nproc)
RUN make DESTDIR="${LibrariesPath}/breakpad-cache" install
WORKDIR ..
RUN rm -rf breakpad
RUN git clone https://chromium.googlesource.com/breakpad/breakpad.git \
&& cd breakpad \
&& git checkout dfcb7b6799 \
&& git apply ../patches/breakpad.diff \
&& git clone https://chromium.googlesource.com/linux-syscall-support.git src/third_party/lss \
&& cd src/third_party/lss \
&& git checkout e1e7b0ad8e \
&& cd ../../.. \
&& ./configure \
&& make -j$(nproc) \
&& make DESTDIR="${LibrariesPath}/breakpad-cache" install \
&& cd .. \
&& rm -rf breakpad
FROM builder AS webrtc
COPY --from=mozjpeg ${LibrariesPath}/mozjpeg-cache /
COPY --from=opus ${LibrariesPath}/opus-cache /
COPY --from=libvpx ${LibrariesPath}/libvpx-cache /
@ -646,21 +580,17 @@ COPY --from=openssl ${LibrariesPath}/openssl-cache /
COPY --from=libXtst ${LibrariesPath}/libXtst-cache /
# Shallow clone on a specific commit.
RUN mkdir tg_owt
WORKDIR tg_owt
RUN git init
RUN git remote add origin $GIT/desktop-app/tg_owt.git
RUN git fetch --depth=1 origin 63a934db1ed212ebf8aaaa20f0010dd7b0d7b396
RUN git reset --hard FETCH_HEAD
RUN git submodule init
RUN git submodule update
WORKDIR src/third_party/pipewire
RUN meson build -Dspa-plugins=disabled
WORKDIR ../../..
RUN cmake -G"Ninja Multi-Config" -B out . \
RUN git init tg_owt \
&& cd tg_owt \
&& git remote add origin $GIT/desktop-app/tg_owt.git \
&& git fetch --depth=1 origin 63a934db1ed212ebf8aaaa20f0010dd7b0d7b396 \
&& git reset --hard FETCH_HEAD \
&& git submodule update --init --recursive \
&& rm -rf .git \
&& cd src/third_party/pipewire \
&& meson build -Dspa-plugins=disabled \
&& cd ../../.. \
&& cmake -G"Ninja Multi-Config" -B out . \
-DCMAKE_C_FLAGS_RELEASE="-O3 -DNDEBUG $HFLAGS" \
-DCMAKE_C_FLAGS_DEBUG="-g $HFLAGS_DEBUG" \
-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_FFMPEG_INCLUDE_PATH=/usr/local/include
RUN cmake --build out --config Release --parallel
RUN cmake --build out --config Debug --parallel
WORKDIR tg_owt
RUN find out -mindepth 1 -maxdepth 1 ! -name Release ! -name Debug -exec rm -rf {} \;
RUN rm -rf .git
FROM webrtc AS webrtc_release
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
COPY --from=libffi ${LibrariesPath}/libffi-cache /
COPY --from=zlib ${LibrariesPath}/zlib-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=breakpad ${LibrariesPath}/breakpad-cache /
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
VOLUME [ "/usr/src/tdesktop" ]