diff --git a/Telegram/build/docker/centos_env/Dockerfile b/Telegram/build/docker/centos_env/Dockerfile index e210d41764..83053377f9 100644 --- a/Telegram/build/docker/centos_env/Dockerfile +++ b/Telegram/build/docker/centos_env/Dockerfile @@ -164,6 +164,19 @@ RUN git clone -b 1.0.7 --depth=1 https://github.com/google/highway.git \ && cd .. \ && rm -rf highway +FROM builder AS mozjpeg +RUN git clone -b v4.1.5 --depth=1 https://github.com/mozilla/mozjpeg.git \ + && cd mozjpeg \ + && cmake -B build . \ + -DCMAKE_INSTALL_PREFIX=/usr/local \ + -DENABLE_SHARED=OFF \ + -DWITH_JPEG8=ON \ + -DPNG_SUPPORTED=OFF \ + && cmake --build build --parallel \ + && DESTDIR=/usr/src/mozjpeg-cache cmake --install build \ + && cd .. \ + && rm -rf mozjpeg + FROM builder AS opus RUN git clone -b v1.5.2 --depth=1 https://github.com/xiph/opus.git \ && cd opus \ @@ -296,14 +309,11 @@ COPY --link --from=highway /usr/src/highway-cache / RUN git clone -b v0.11.2 --depth=1 https://github.com/libjxl/libjxl.git \ && cd libjxl \ - && git submodule update --init --recursive --depth=1 third_party/libjpeg-turbo \ - && curl -sSL https://github.com/libjxl/libjxl/commit/ee3955b1553bcc10304d45b85dfef9afa9349d72.patch | sed 's/offset + t/offset + i/' | git apply \ && cmake -B build . \ -DBUILD_SHARED_LIBS=OFF \ -DBUILD_TESTING=OFF \ -DJPEGXL_ENABLE_DEVTOOLS=OFF \ -DJPEGXL_ENABLE_TOOLS=OFF \ - -DJPEGXL_INSTALL_JPEGLI_LIBJPEG=ON \ -DJPEGXL_ENABLE_DOXYGEN=OFF \ -DJPEGXL_ENABLE_MANPAGES=OFF \ -DJPEGXL_ENABLE_BENCHMARK=OFF \ @@ -316,11 +326,6 @@ RUN git clone -b v0.11.2 --depth=1 https://github.com/libjxl/libjxl.git \ && export DESTDIR=/usr/src/jxl-cache \ && cmake --install build \ && sed -i 's/-lstdc++//' $DESTDIR/usr/local/lib64/pkgconfig/libjxl*.pc \ - && rm $DESTDIR/usr/local/lib64/libjpeg.so* \ - && cp build/lib/libjpegli-static.a $DESTDIR/usr/local/lib64/libjpeg.a \ - && mkdir build/hwy \ - && ar --output=build/hwy x /usr/local/lib64/libhwy.a \ - && ar rcs $DESTDIR/usr/local/lib64/libjpeg.a build/lib/CMakeFiles/jpegli-libjpeg-obj.dir/jpegli/libjpeg_wrapper.cc.o build/hwy/* \ && cd .. \ && rm -rf libjxl @@ -726,8 +731,8 @@ RUN git clone -b xkbcommon-1.6.0 --depth=1 https://github.com/xkbcommon/libxkbco FROM patches AS qt COPY --link --from=zlib /usr/src/zlib-cache / COPY --link --from=lcms2 /usr/src/lcms2-cache / +COPY --link --from=mozjpeg /usr/src/mozjpeg-cache / COPY --link --from=webp /usr/src/webp-cache / -COPY --link --from=jxl /usr/src/jxl-cache / COPY --link --from=xcb /usr/src/xcb-cache / COPY --link --from=xcb-wm /usr/src/xcb-wm-cache / COPY --link --from=xcb-util /usr/src/xcb-util-cache / @@ -787,11 +792,11 @@ RUN git clone -b v2024.02.16 --depth=1 https://chromium.googlesource.com/breakpa FROM builder AS webrtc COPY --link --from=zlib /usr/src/zlib-cache / +COPY --link --from=mozjpeg /usr/src/mozjpeg-cache / COPY --link --from=opus /usr/src/opus-cache / COPY --link --from=openh264 /usr/src/openh264-cache / COPY --link --from=dav1d /usr/src/dav1d-cache / COPY --link --from=vpx /usr/src/vpx-cache / -COPY --link --from=jxl /usr/src/jxl-cache / COPY --link --from=ffmpeg /usr/src/ffmpeg-cache / COPY --link --from=openssl /usr/src/openssl-cache / COPY --link --from=xext /usr/src/xext-cache / @@ -851,6 +856,7 @@ COPY --link --from=protobuf /usr/src/protobuf-cache / COPY --link --from=lcms2 /usr/src/lcms2-cache / COPY --link --from=brotli /usr/src/brotli-cache / COPY --link --from=highway /usr/src/highway-cache / +COPY --link --from=mozjpeg /usr/src/mozjpeg-cache / COPY --link --from=opus /usr/src/opus-cache / COPY --link --from=dav1d /usr/src/dav1d-cache / COPY --link --from=openh264 /usr/src/openh264-cache / diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 8ddc923160..90422fd6ef 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -38,7 +38,7 @@ parts: source-type: git parse-info: [usr/share/metainfo/org.telegram.desktop.metainfo.xml] build-environment: - - LDFLAGS: ${LDFLAGS:+$LDFLAGS} -Wl,--push-state,--no-as-needed,-ldav1d,-lhwy,--pop-state -s + - LDFLAGS: ${LDFLAGS:+$LDFLAGS} -Wl,--push-state,--no-as-needed,-ldav1d,--pop-state -s build-packages: - clang - libboost-regex-dev @@ -87,7 +87,7 @@ parts: - ada - avif - ffmpeg - - jpegli + - mozjpeg - openal - protobuf - qt @@ -317,46 +317,18 @@ parts: after: - nv-codec-headers - jpegli: - source: https://github.com/libjxl/libjxl.git + mozjpeg: + source: https://github.com/mozilla/mozjpeg.git source-depth: 1 - source-tag: v0.11.2 + source-tag: v4.1.5 plugin: cmake - build-packages: - - curl - - libhwy-dev cmake-generator: Ninja cmake-parameters: - -DCMAKE_BUILD_TYPE=Release - -DCMAKE_INSTALL_PREFIX=/usr - - -DBUILD_SHARED_LIBS=OFF - - -DBUILD_TESTING=OFF - - -DJPEGXL_ENABLE_DEVTOOLS=OFF - - -DJPEGXL_ENABLE_TOOLS=OFF - - -DJPEGXL_INSTALL_JPEGLI_LIBJPEG=ON - - -DJPEGXL_ENABLE_DOXYGEN=OFF - - -DJPEGXL_ENABLE_MANPAGES=OFF - - -DJPEGXL_ENABLE_BENCHMARK=OFF - - -DJPEGXL_ENABLE_EXAMPLES=OFF - - -DJPEGXL_ENABLE_JNI=OFF - - -DJPEGXL_ENABLE_SJPEG=OFF - - -DJPEGXL_ENABLE_OPENEXR=OFF - - -DJPEGXL_ENABLE_SKCMS=OFF - - -DJPEGXL_FORCE_SYSTEM_BROTLI=ON - - -DJPEGXL_FORCE_SYSTEM_LCMS2=ON - - -DJPEGXL_FORCE_SYSTEM_HWY=ON - override-pull: | - craftctl default - curl -sSL https://github.com/libjxl/libjxl/commit/ee3955b1553bcc10304d45b85dfef9afa9349d72.patch | sed 's/offset + t/offset + i/' | git apply - override-build: | - craftctl default - cp lib/libjpegli-static.a "$CRAFT_PART_INSTALL"/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/libjpeg.a - ar rcs "$CRAFT_PART_INSTALL"/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/libjpeg.a lib/CMakeFiles/jpegli-libjpeg-obj.dir/jpegli/libjpeg_wrapper.cc.o - stage: - - ./usr/include/jconfig.h - - ./usr/include/jmorecfg.h - - ./usr/include/jpeglib.h - - ./usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/libjpeg.a + - -DENABLE_SHARED=OFF + - -DWITH_JPEG8=ON + - -DPNG_SUPPORTED=OFF prime: [-./*] openal: @@ -412,8 +384,6 @@ parts: - qtsvg - qtwayland plugin: cmake - build-environment: - - LDFLAGS: ${LDFLAGS:+$LDFLAGS} -Wl,--push-state,--no-as-needed,-lhwy,--pop-state build-packages: - libssl-dev - libxcb-cursor-dev @@ -448,7 +418,7 @@ parts: cd .. prime: [-./*] after: - - jpegli + - mozjpeg - patches rnnoise: @@ -503,4 +473,4 @@ parts: prime: [-./*] after: - ffmpeg - - jpegli + - mozjpeg