Skip to content

Commit 5e9ef96

Browse files
committed
Revert "Replace mozjpeg with jpegli on Linux"
This reverts commit cb5fdac.
1 parent d36f7d5 commit 5e9ef96

2 files changed

Lines changed: 26 additions & 50 deletions

File tree

Telegram/build/docker/centos_env/Dockerfile

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,19 @@ RUN git clone -b 1.0.7 --depth=1 https://github.com/google/highway.git \
164164
&& cd .. \
165165
&& rm -rf highway
166166

167+
FROM builder AS mozjpeg
168+
RUN git clone -b v4.1.5 --depth=1 https://github.com/mozilla/mozjpeg.git \
169+
&& cd mozjpeg \
170+
&& cmake -B build . \
171+
-DCMAKE_INSTALL_PREFIX=/usr/local \
172+
-DENABLE_SHARED=OFF \
173+
-DWITH_JPEG8=ON \
174+
-DPNG_SUPPORTED=OFF \
175+
&& cmake --build build --parallel \
176+
&& DESTDIR=/usr/src/mozjpeg-cache cmake --install build \
177+
&& cd .. \
178+
&& rm -rf mozjpeg
179+
167180
FROM builder AS opus
168181
RUN git clone -b v1.5.2 --depth=1 https://github.com/xiph/opus.git \
169182
&& cd opus \
@@ -296,14 +309,12 @@ COPY --link --from=highway /usr/src/highway-cache /
296309

297310
RUN git clone -b v0.11.2 --depth=1 https://github.com/libjxl/libjxl.git \
298311
&& cd libjxl \
299-
&& git submodule update --init --recursive --depth=1 third_party/libjpeg-turbo \
300-
&& curl -sSL https://github.com/libjxl/libjxl/commit/ee3955b1553bcc10304d45b85dfef9afa9349d72.patch | sed 's/offset + t/offset + i/' | git apply \
301312
&& cmake -B build . \
302313
-DBUILD_SHARED_LIBS=OFF \
303314
-DBUILD_TESTING=OFF \
304315
-DJPEGXL_ENABLE_DEVTOOLS=OFF \
305316
-DJPEGXL_ENABLE_TOOLS=OFF \
306-
-DJPEGXL_INSTALL_JPEGLI_LIBJPEG=ON \
317+
-DJPEGXL_ENABLE_JPEGLI_LIBJPEG=OFF \
307318
-DJPEGXL_ENABLE_DOXYGEN=OFF \
308319
-DJPEGXL_ENABLE_MANPAGES=OFF \
309320
-DJPEGXL_ENABLE_BENCHMARK=OFF \
@@ -316,11 +327,6 @@ RUN git clone -b v0.11.2 --depth=1 https://github.com/libjxl/libjxl.git \
316327
&& export DESTDIR=/usr/src/jxl-cache \
317328
&& cmake --install build \
318329
&& sed -i 's/-lstdc++//' $DESTDIR/usr/local/lib64/pkgconfig/libjxl*.pc \
319-
&& rm $DESTDIR/usr/local/lib64/libjpeg.so* \
320-
&& cp build/lib/libjpegli-static.a $DESTDIR/usr/local/lib64/libjpeg.a \
321-
&& mkdir build/hwy \
322-
&& ar --output=build/hwy x /usr/local/lib64/libhwy.a \
323-
&& ar rcs $DESTDIR/usr/local/lib64/libjpeg.a build/lib/CMakeFiles/jpegli-libjpeg-obj.dir/jpegli/libjpeg_wrapper.cc.o build/hwy/* \
324330
&& cd .. \
325331
&& rm -rf libjxl
326332

@@ -726,8 +732,8 @@ RUN git clone -b xkbcommon-1.6.0 --depth=1 https://github.com/xkbcommon/libxkbco
726732
FROM patches AS qt
727733
COPY --link --from=zlib /usr/src/zlib-cache /
728734
COPY --link --from=lcms2 /usr/src/lcms2-cache /
735+
COPY --link --from=mozjpeg /usr/src/mozjpeg-cache /
729736
COPY --link --from=webp /usr/src/webp-cache /
730-
COPY --link --from=jxl /usr/src/jxl-cache /
731737
COPY --link --from=xcb /usr/src/xcb-cache /
732738
COPY --link --from=xcb-wm /usr/src/xcb-wm-cache /
733739
COPY --link --from=xcb-util /usr/src/xcb-util-cache /
@@ -787,11 +793,11 @@ RUN git clone -b v2024.02.16 --depth=1 https://chromium.googlesource.com/breakpa
787793

788794
FROM builder AS webrtc
789795
COPY --link --from=zlib /usr/src/zlib-cache /
796+
COPY --link --from=mozjpeg /usr/src/mozjpeg-cache /
790797
COPY --link --from=opus /usr/src/opus-cache /
791798
COPY --link --from=openh264 /usr/src/openh264-cache /
792799
COPY --link --from=dav1d /usr/src/dav1d-cache /
793800
COPY --link --from=vpx /usr/src/vpx-cache /
794-
COPY --link --from=jxl /usr/src/jxl-cache /
795801
COPY --link --from=ffmpeg /usr/src/ffmpeg-cache /
796802
COPY --link --from=openssl /usr/src/openssl-cache /
797803
COPY --link --from=xext /usr/src/xext-cache /
@@ -851,6 +857,7 @@ COPY --link --from=protobuf /usr/src/protobuf-cache /
851857
COPY --link --from=lcms2 /usr/src/lcms2-cache /
852858
COPY --link --from=brotli /usr/src/brotli-cache /
853859
COPY --link --from=highway /usr/src/highway-cache /
860+
COPY --link --from=mozjpeg /usr/src/mozjpeg-cache /
854861
COPY --link --from=opus /usr/src/opus-cache /
855862
COPY --link --from=dav1d /usr/src/dav1d-cache /
856863
COPY --link --from=openh264 /usr/src/openh264-cache /

snap/snapcraft.yaml

Lines changed: 9 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ parts:
3838
source-type: git
3939
parse-info: [usr/share/metainfo/org.telegram.desktop.metainfo.xml]
4040
build-environment:
41-
- LDFLAGS: ${LDFLAGS:+$LDFLAGS} -Wl,--push-state,--no-as-needed,-ldav1d,-lhwy,--pop-state -s
41+
- LDFLAGS: ${LDFLAGS:+$LDFLAGS} -Wl,--push-state,--no-as-needed,-ldav1d,--pop-state -s
4242
build-packages:
4343
- clang
4444
- libboost-regex-dev
@@ -87,7 +87,7 @@ parts:
8787
- ada
8888
- avif
8989
- ffmpeg
90-
- jpegli
90+
- mozjpeg
9191
- openal
9292
- protobuf
9393
- qt
@@ -317,46 +317,17 @@ parts:
317317
after:
318318
- nv-codec-headers
319319

320-
jpegli:
321-
source: https://github.com/libjxl/libjxl.git
320+
mozjpeg:
321+
source: https://github.com/mozilla/mozjpeg.git
322322
source-depth: 1
323-
source-tag: v0.11.2
323+
source-tag: v4.1.5
324324
plugin: cmake
325-
build-packages:
326-
- curl
327-
- libhwy-dev
328325
cmake-generator: Ninja
329326
cmake-parameters:
330327
- -DCMAKE_BUILD_TYPE=Release
331328
- -DCMAKE_INSTALL_PREFIX=/usr
332-
- -DBUILD_SHARED_LIBS=OFF
333-
- -DBUILD_TESTING=OFF
334-
- -DJPEGXL_ENABLE_DEVTOOLS=OFF
335-
- -DJPEGXL_ENABLE_TOOLS=OFF
336-
- -DJPEGXL_INSTALL_JPEGLI_LIBJPEG=ON
337-
- -DJPEGXL_ENABLE_DOXYGEN=OFF
338-
- -DJPEGXL_ENABLE_MANPAGES=OFF
339-
- -DJPEGXL_ENABLE_BENCHMARK=OFF
340-
- -DJPEGXL_ENABLE_EXAMPLES=OFF
341-
- -DJPEGXL_ENABLE_JNI=OFF
342-
- -DJPEGXL_ENABLE_SJPEG=OFF
343-
- -DJPEGXL_ENABLE_OPENEXR=OFF
344-
- -DJPEGXL_ENABLE_SKCMS=OFF
345-
- -DJPEGXL_FORCE_SYSTEM_BROTLI=ON
346-
- -DJPEGXL_FORCE_SYSTEM_LCMS2=ON
347-
- -DJPEGXL_FORCE_SYSTEM_HWY=ON
348-
override-pull: |
349-
craftctl default
350-
curl -sSL https://github.com/libjxl/libjxl/commit/ee3955b1553bcc10304d45b85dfef9afa9349d72.patch | sed 's/offset + t/offset + i/' | git apply
351-
override-build: |
352-
craftctl default
353-
cp lib/libjpegli-static.a "$CRAFT_PART_INSTALL"/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/libjpeg.a
354-
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
355-
stage:
356-
- ./usr/include/jconfig.h
357-
- ./usr/include/jmorecfg.h
358-
- ./usr/include/jpeglib.h
359-
- ./usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/libjpeg.a
329+
- -DWITH_JPEG8=ON
330+
- -DPNG_SUPPORTED=OFF
360331
prime: [-./*]
361332

362333
openal:
@@ -412,8 +383,6 @@ parts:
412383
- qtsvg
413384
- qtwayland
414385
plugin: cmake
415-
build-environment:
416-
- LDFLAGS: ${LDFLAGS:+$LDFLAGS} -Wl,--push-state,--no-as-needed,-lhwy,--pop-state
417386
build-packages:
418387
- libssl-dev
419388
- libxcb-cursor-dev
@@ -448,7 +417,7 @@ parts:
448417
cd ..
449418
prime: [-./*]
450419
after:
451-
- jpegli
420+
- mozjpeg
452421
- patches
453422

454423
rnnoise:
@@ -503,4 +472,4 @@ parts:
503472
prime: [-./*]
504473
after:
505474
- ffmpeg
506-
- jpegli
475+
- mozjpeg

0 commit comments

Comments
 (0)