mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 06:07:06 +02:00
Replace mozjpeg with jpegli on Linux
This commit is contained in:
parent
78c8d0562b
commit
cb5fdac0da
3 changed files with 26 additions and 58 deletions
|
@ -51,7 +51,7 @@ FROM builder AS patches
|
|||
RUN git init patches \
|
||||
&& cd patches \
|
||||
&& git remote add origin {{ GIT }}/desktop-app/patches.git \
|
||||
&& git fetch --depth=1 origin b8e22ca1511513024b22b5381153163ad3406a8c \
|
||||
&& git fetch --depth=1 origin f81dfc6f7061d7f70c7e952cee9c1c2689f937a2 \
|
||||
&& git reset --hard FETCH_HEAD \
|
||||
&& rm -rf .git
|
||||
|
||||
|
@ -132,19 +132,6 @@ RUN git clone -b 1.0.7 --depth=1 {{ GIT }}/google/highway.git \
|
|||
&& cd .. \
|
||||
&& rm -rf highway
|
||||
|
||||
FROM builder AS mozjpeg
|
||||
RUN git clone -b v4.1.4 --depth=1 {{ GIT }}/mozilla/mozjpeg.git \
|
||||
&& cd mozjpeg \
|
||||
&& cmake -GNinja -B build . \
|
||||
-DCMAKE_BUILD_TYPE=None \
|
||||
-DCMAKE_INSTALL_PREFIX=/usr/local \
|
||||
-DWITH_JPEG8=ON \
|
||||
-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.4 --depth=1 {{ GIT }}/xiph/opus.git \
|
||||
&& cd opus \
|
||||
|
@ -258,20 +245,22 @@ RUN git clone -b v1.17.6 --depth=1 {{ GIT }}/strukturag/libheif.git \
|
|||
&& cd .. \
|
||||
&& rm -rf libheif
|
||||
|
||||
FROM builder AS libjxl
|
||||
FROM patches AS libjxl
|
||||
COPY --link --from=lcms2 {{ LibrariesPath }}/lcms2-cache /
|
||||
COPY --link --from=brotli {{ LibrariesPath }}/brotli-cache /
|
||||
COPY --link --from=highway {{ LibrariesPath }}/highway-cache /
|
||||
|
||||
RUN git clone -b v0.10.2 --depth=1 {{ GIT }}/libjxl/libjxl.git \
|
||||
&& cd libjxl \
|
||||
&& git apply ../patches/libjxl.patch \
|
||||
&& git submodule update --init --recursive --depth=1 third_party/libjpeg-turbo \
|
||||
&& cmake -GNinja -B build . \
|
||||
-DCMAKE_BUILD_TYPE=None \
|
||||
-DBUILD_SHARED_LIBS=OFF \
|
||||
-DBUILD_TESTING=OFF \
|
||||
-DJPEGXL_ENABLE_DEVTOOLS=OFF \
|
||||
-DJPEGXL_ENABLE_TOOLS=OFF \
|
||||
-DJPEGXL_ENABLE_JPEGLI_LIBJPEG=OFF \
|
||||
-DJPEGXL_INSTALL_JPEGLI_LIBJPEG=ON \
|
||||
-DJPEGXL_ENABLE_DOXYGEN=OFF \
|
||||
-DJPEGXL_ENABLE_MANPAGES=OFF \
|
||||
-DJPEGXL_ENABLE_BENCHMARK=OFF \
|
||||
|
@ -281,7 +270,10 @@ RUN git clone -b v0.10.2 --depth=1 {{ GIT }}/libjxl/libjxl.git \
|
|||
-DJPEGXL_ENABLE_OPENEXR=OFF \
|
||||
-DJPEGXL_ENABLE_SKCMS=OFF \
|
||||
&& cmake --build build --parallel \
|
||||
&& DESTDIR="{{ LibrariesPath }}/libjxl-cache" cmake --install build \
|
||||
&& export DESTDIR="{{ LibrariesPath }}/libjxl-cache" \
|
||||
&& cmake --install build \
|
||||
&& cp build/lib/libjpegli-static.a $DESTDIR/usr/local/lib64/libjpeg.a \
|
||||
&& ar rcs $DESTDIR/usr/local/lib64/libjpeg.a build/lib/CMakeFiles/jpegli-libjpeg-obj.dir/jpegli/libjpeg_wrapper.cc.o \
|
||||
&& cd .. \
|
||||
&& rm -rf libjxl
|
||||
|
||||
|
@ -704,7 +696,7 @@ RUN git clone -b 1.78.1 --depth=1 {{ GIT }}/GNOME/gobject-introspection.git \
|
|||
FROM patches AS qt
|
||||
COPY --link --from=zlib {{ LibrariesPath }}/zlib-cache /
|
||||
COPY --link --from=lcms2 {{ LibrariesPath }}/lcms2-cache /
|
||||
COPY --link --from=mozjpeg {{ LibrariesPath }}/mozjpeg-cache /
|
||||
COPY --link --from=libjxl {{ LibrariesPath }}/libjxl-cache /
|
||||
COPY --link --from=xcb {{ LibrariesPath }}/xcb-cache /
|
||||
COPY --link --from=xcb-wm {{ LibrariesPath }}/xcb-wm-cache /
|
||||
COPY --link --from=xcb-util {{ LibrariesPath }}/xcb-util-cache /
|
||||
|
@ -757,9 +749,9 @@ RUN git clone -b v2023.06.01 --depth=1 https://chromium.googlesource.com/breakpa
|
|||
&& rm -rf breakpad
|
||||
|
||||
FROM builder AS webrtc
|
||||
COPY --link --from=mozjpeg {{ LibrariesPath }}/mozjpeg-cache /
|
||||
COPY --link --from=opus {{ LibrariesPath }}/opus-cache /
|
||||
COPY --link --from=libvpx {{ LibrariesPath }}/libvpx-cache /
|
||||
COPY --link --from=libjxl {{ LibrariesPath }}/libjxl-cache /
|
||||
COPY --link --from=ffmpeg {{ LibrariesPath }}/ffmpeg-cache /
|
||||
COPY --link --from=openssl {{ LibrariesPath }}/openssl-cache /
|
||||
COPY --link --from=libXtst {{ LibrariesPath }}/libXtst-cache /
|
||||
|
@ -805,7 +797,6 @@ COPY --link --from=protobuf {{ LibrariesPath }}/protobuf-cache /
|
|||
COPY --link --from=lcms2 {{ LibrariesPath }}/lcms2-cache /
|
||||
COPY --link --from=brotli {{ LibrariesPath }}/brotli-cache /
|
||||
COPY --link --from=highway {{ LibrariesPath }}/highway-cache /
|
||||
COPY --link --from=mozjpeg {{ LibrariesPath }}/mozjpeg-cache /
|
||||
COPY --link --from=opus {{ LibrariesPath }}/opus-cache /
|
||||
COPY --link --from=dav1d {{ LibrariesPath }}/dav1d-cache /
|
||||
COPY --link --from=libde265 {{ LibrariesPath }}/libde265-cache /
|
||||
|
|
2
cmake
2
cmake
|
@ -1 +1 @@
|
|||
Subproject commit 4ec493812d25de1eccfedccc49a23c15d032b118
|
||||
Subproject commit 621b01ec9bd7f953223147daf59ab4c850cb3c40
|
|
@ -131,6 +131,7 @@ parts:
|
|||
cmake-parameters:
|
||||
- -DCMAKE_BUILD_TYPE=Release
|
||||
- -DCMAKE_INSTALL_PREFIX=/usr
|
||||
- -DCMAKE_PREFIX_PATH=$CRAFT_STAGE/usr
|
||||
- -DTDESKTOP_API_ID=611335
|
||||
- -DTDESKTOP_API_HASH=d524b414d21f4d37f08684c1df41ac9c
|
||||
- -DDESKTOP_APP_USE_PACKAGED_LAZY=ON
|
||||
|
@ -153,12 +154,9 @@ parts:
|
|||
override-build: |
|
||||
craftctl default
|
||||
rm -rf "$CRAFT_PART_INSTALL/usr/share/icons"
|
||||
stage:
|
||||
- -./usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/libjpeg.so.8.2.2
|
||||
after:
|
||||
- ffmpeg
|
||||
- libjxl
|
||||
- mozjpeg
|
||||
- openal
|
||||
- protobuf
|
||||
- qt
|
||||
|
@ -168,7 +166,7 @@ parts:
|
|||
patches:
|
||||
source: https://github.com/desktop-app/patches.git
|
||||
source-depth: 1
|
||||
source-commit: b8e22ca1511513024b22b5381153163ad3406a8c
|
||||
source-commit: f81dfc6f7061d7f70c7e952cee9c1c2689f937a2
|
||||
plugin: dump
|
||||
override-pull: |
|
||||
craftctl default
|
||||
|
@ -209,8 +207,6 @@ parts:
|
|||
fi
|
||||
done
|
||||
GTK_PATH=$PWD/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/gtk-3.0 /usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/libgtk-3-0/gtk-query-immodules-3.0 > usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/gtk-3.0/3.0.0/immodules/immodules.cache
|
||||
stage:
|
||||
- -./usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/libjpeg.so.8.2.2
|
||||
after:
|
||||
- telegram
|
||||
|
||||
|
@ -238,10 +234,6 @@ parts:
|
|||
rmdir "$CRAFT_PART_INSTALL/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/blas"
|
||||
mv "$CRAFT_PART_INSTALL/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/lapack/"* "$CRAFT_PART_INSTALL/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR"
|
||||
rmdir "$CRAFT_PART_INSTALL/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/lapack"
|
||||
stage:
|
||||
- -./usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/libjpeg.so.8.2.2
|
||||
after:
|
||||
- mozjpeg
|
||||
|
||||
libjxl:
|
||||
source: https://github.com/libjxl/libjxl.git
|
||||
|
@ -257,7 +249,7 @@ parts:
|
|||
- -DBUILD_TESTING=OFF
|
||||
- -DJPEGXL_ENABLE_DEVTOOLS=OFF
|
||||
- -DJPEGXL_ENABLE_TOOLS=OFF
|
||||
- -DJPEGXL_ENABLE_JPEGLI_LIBJPEG=OFF
|
||||
- -DJPEGXL_INSTALL_JPEGLI_LIBJPEG=ON
|
||||
- -DJPEGXL_ENABLE_DOXYGEN=OFF
|
||||
- -DJPEGXL_ENABLE_MANPAGES=OFF
|
||||
- -DJPEGXL_ENABLE_BENCHMARK=OFF
|
||||
|
@ -266,6 +258,9 @@ parts:
|
|||
- -DJPEGXL_ENABLE_SJPEG=OFF
|
||||
- -DJPEGXL_ENABLE_OPENEXR=OFF
|
||||
- -DJPEGXL_ENABLE_SKCMS=OFF
|
||||
override-pull: |
|
||||
craftctl default
|
||||
git apply $CRAFT_STAGE/patches/libjxl.patch
|
||||
stage:
|
||||
- -./usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/libbrotli*
|
||||
prime:
|
||||
|
@ -275,27 +270,8 @@ parts:
|
|||
- -./usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/*.a
|
||||
- -./usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/*.so
|
||||
- -./usr/share
|
||||
|
||||
mozjpeg:
|
||||
source: https://github.com/mozilla/mozjpeg.git
|
||||
source-depth: 1
|
||||
source-tag: v4.1.4
|
||||
plugin: cmake
|
||||
build-environment:
|
||||
- LDFLAGS: ${LDFLAGS:+$LDFLAGS} -s
|
||||
cmake-generator: Ninja
|
||||
cmake-parameters:
|
||||
- -DCMAKE_BUILD_TYPE=Release
|
||||
- -DCMAKE_INSTALL_PREFIX=/usr
|
||||
- -DENABLE_STATIC=OFF
|
||||
- -DWITH_JPEG8=ON
|
||||
- -DPNG_SUPPORTED=OFF
|
||||
prime:
|
||||
- -./usr/bin
|
||||
- -./usr/include
|
||||
- -./usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/pkgconfig
|
||||
- -./usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/*.so
|
||||
- -./usr/share
|
||||
after:
|
||||
- patches
|
||||
|
||||
openal:
|
||||
source: https://github.com/kcat/openal-soft.git
|
||||
|
@ -458,12 +434,12 @@ parts:
|
|||
-confirm-license \
|
||||
-openssl-linked \
|
||||
-nomake examples \
|
||||
-nomake tests
|
||||
-nomake tests \
|
||||
-- \
|
||||
-DCMAKE_PREFIX_PATH=$CRAFT_STAGE/usr
|
||||
|
||||
cmake --build . -j$CRAFT_PARALLEL_BUILD_COUNT
|
||||
DESTDIR="$CRAFT_PART_INSTALL" cmake --install .
|
||||
stage:
|
||||
- -./usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/libjpeg.so.8.2.2
|
||||
prime:
|
||||
- -./usr/bin
|
||||
- -./usr/doc
|
||||
|
@ -479,7 +455,7 @@ parts:
|
|||
- -./usr/mkspecs
|
||||
- -./usr/modules
|
||||
after:
|
||||
- mozjpeg
|
||||
- libjxl
|
||||
- patches
|
||||
|
||||
rnnoise:
|
||||
|
@ -559,10 +535,11 @@ parts:
|
|||
cmake-parameters:
|
||||
- -DCMAKE_BUILD_TYPE=Release
|
||||
- -DCMAKE_INSTALL_PREFIX=/usr
|
||||
- -DCMAKE_PREFIX_PATH=$CRAFT_STAGE/usr
|
||||
prime:
|
||||
- -./usr/include
|
||||
- -./usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/cmake
|
||||
- -./usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/*.a
|
||||
after:
|
||||
- ffmpeg
|
||||
- mozjpeg
|
||||
- libjxl
|
||||
|
|
Loading…
Add table
Reference in a new issue