summaryrefslogtreecommitdiff
path: root/media-libs
diff options
context:
space:
mode:
Diffstat (limited to 'media-libs')
-rw-r--r--media-libs/Manifest.gzbin68442 -> 68427 bytes
-rw-r--r--media-libs/harfbuzz/Manifest4
-rw-r--r--media-libs/harfbuzz/harfbuzz-8.0.0.ebuild103
-rw-r--r--media-libs/harfbuzz/harfbuzz-9999.ebuild11
-rw-r--r--media-libs/libjxl/Manifest3
-rw-r--r--media-libs/libjxl/files/libjxl-0.8.2-backport-pr2596.patch50
-rw-r--r--media-libs/libjxl/files/libjxl-0.8.2-backport-pr2617.patch60
-rw-r--r--media-libs/libjxl/libjxl-0.8.2-r1.ebuild86
8 files changed, 311 insertions, 6 deletions
diff --git a/media-libs/Manifest.gz b/media-libs/Manifest.gz
index 6cb29de7ac63..1df938ef76e7 100644
--- a/media-libs/Manifest.gz
+++ b/media-libs/Manifest.gz
Binary files differ
diff --git a/media-libs/harfbuzz/Manifest b/media-libs/harfbuzz/Manifest
index 7311bb4a614f..ef1fbd63cd0f 100644
--- a/media-libs/harfbuzz/Manifest
+++ b/media-libs/harfbuzz/Manifest
@@ -1,4 +1,6 @@
DIST harfbuzz-7.3.0.tar.xz 18867940 BLAKE2B 7b1f6fb0c4c7483ff7a7c27f613b8579af30a304432e1a4e157aec4344449aed93e68443df1f2bc741be6780a6b2214d54804e2df9a20d83c8256b5f98c7fcda SHA512 e1fb484e4117cedc72bd473ee91b2f6143533fb467ec9a64361f0c7ffd8b5a44ad2ea42daa948a2d5d85297ace4b640fcd24a8291b0d75a1d4ee468c629febe9
+DIST harfbuzz-8.0.0.tar.xz 18793316 BLAKE2B b37ef67734af2b0e0f4587fc5e43b3046d669d4fac50c0f2bf9710a9e84384b9a22141999299476d715ce148b33236a42aa0f5d250114f0aef3074f6c401170b SHA512 8f4b72ec5f4fca56162e6d6fd6c60aa68958861ca5683e34a9ed96dd09d203253d5dbbfb2987b161fabda9b3abf61120e928a4dd6e9e9e6b6842294cfdf08402
EBUILD harfbuzz-7.3.0.ebuild 2689 BLAKE2B 0d5961de148f670843dba116990fb1f55efa4c9fc99fb4f228b56daa6e3c336f6d26fb962d5de975e8b3c8520acb46c5db9b16b026b25452cfa5f480a0aa1647 SHA512 44be08a204dd2beaa976f92b22b71f2317bbba0d8277ad48c2047fc02bdb1287a19836b2a04ae88986ec4fb47591cfef834e89ef10b8a8c3caf7fb827c8222f4
-EBUILD harfbuzz-9999.ebuild 2693 BLAKE2B fa32dfc0003611520f53169e449b028ba1f69ee0f10789520581bc11022d0ef50939f6f1061591feabbf690a9ac722a7c4528fad5bf53355918d9e1dc0f19139 SHA512 f015fc592861cb7b97186dbfae17e00b49aae67348534daa64ec370dffa2649876597f0a7421f41cd5f106780c1218110919b6ee1c2c1471a89fbbb7221ea56b
+EBUILD harfbuzz-8.0.0.ebuild 2713 BLAKE2B b72f5d07a27e84e98af56ff704a766cd1d19df6984eaf008255e88a9c413c6a3d4a2c0e977f2a522e80e2a064849843a30ad16e34bf07e1b64c5b5dee054374f SHA512 c176dd6d8c448ad34375e5991212896c33ab53c0eb6c983112e99e9f4d79e64fa6ac6c2ae9d51d11089d2c887235f847561dd0f873b206e51b1a1ebad99b1c25
+EBUILD harfbuzz-9999.ebuild 2713 BLAKE2B b72f5d07a27e84e98af56ff704a766cd1d19df6984eaf008255e88a9c413c6a3d4a2c0e977f2a522e80e2a064849843a30ad16e34bf07e1b64c5b5dee054374f SHA512 c176dd6d8c448ad34375e5991212896c33ab53c0eb6c983112e99e9f4d79e64fa6ac6c2ae9d51d11089d2c887235f847561dd0f873b206e51b1a1ebad99b1c25
MISC metadata.xml 649 BLAKE2B a03eb9e2b09fab01af900957a9f5d0a43836a77ce770bc2327bc8da299139d1175b59cc413d0a02d74d4fc4169ff3c9180a5c1cf8d6ff570b054bbceb55e89ba SHA512 94c0c007157e240abc17056e2efe877770ee0267bf9d710fdbac796110f4507d2bc628c3b22f74652a9c568e7c60fa513e680aeeb8895831aafede268c14be70
diff --git a/media-libs/harfbuzz/harfbuzz-8.0.0.ebuild b/media-libs/harfbuzz/harfbuzz-8.0.0.ebuild
new file mode 100644
index 000000000000..c114ab1668f9
--- /dev/null
+++ b/media-libs/harfbuzz/harfbuzz-8.0.0.ebuild
@@ -0,0 +1,103 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{10..12} )
+
+inherit flag-o-matic meson-multilib python-any-r1 xdg-utils
+
+DESCRIPTION="An OpenType text shaping engine"
+HOMEPAGE="https://www.freedesktop.org/wiki/Software/HarfBuzz"
+
+if [[ ${PV} == 9999 ]] ; then
+ EGIT_REPO_URI="https://github.com/harfbuzz/harfbuzz.git"
+ inherit git-r3
+else
+ SRC_URI="https://github.com/harfbuzz/harfbuzz/releases/download/${PV}/${P}.tar.xz"
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x64-solaris"
+fi
+
+LICENSE="Old-MIT ISC icu"
+# 0.9.18 introduced the harfbuzz-icu split; bug #472416
+# 3.0.0 dropped some unstable APIs; bug #813705
+# 6.0.0 changed libharfbuzz-subset.so ABI
+SLOT="0/6.0.0"
+
+IUSE="+cairo debug doc experimental +glib +graphite icu +introspection test +truetype"
+RESTRICT="!test? ( test )"
+REQUIRED_USE="introspection? ( glib )"
+
+RDEPEND="
+ cairo? ( x11-libs/cairo:=[${MULTILIB_USEDEP}] )
+ glib? ( >=dev-libs/glib-2.38:2[${MULTILIB_USEDEP}] )
+ graphite? ( >=media-gfx/graphite2-1.2.1:=[${MULTILIB_USEDEP}] )
+ icu? ( >=dev-libs/icu-51.2-r1:=[${MULTILIB_USEDEP}] )
+ introspection? ( >=dev-libs/gobject-introspection-1.34:= )
+ truetype? ( >=media-libs/freetype-2.5.0.1:2=[${MULTILIB_USEDEP}] )
+"
+DEPEND="${RDEPEND}
+ >=dev-libs/gobject-introspection-common-1.34
+"
+BDEPEND="
+ ${PYTHON_DEPS}
+ virtual/pkgconfig
+ doc? ( dev-util/gtk-doc )
+ introspection? ( dev-util/glib-utils )
+"
+
+src_prepare() {
+ default
+
+ xdg_environment_reset
+
+ # bug #726120
+ sed -i \
+ -e '/tests\/macos\.tests/d' \
+ test/shape/data/in-house/Makefile.sources \
+ || die
+
+ # bug #790359
+ filter-flags -fexceptions -fthreadsafe-statics
+
+ if ! use debug ; then
+ append-cppflags -DHB_NDEBUG
+ fi
+
+ # bug #762415
+ local pyscript
+ for pyscript in $(find -type f -name "*.py") ; do
+ python_fix_shebang -q "${pyscript}"
+ done
+}
+
+multilib_src_configure() {
+ # harfbuzz-gobject only used for introspection, bug #535852
+ local emesonargs=(
+ -Dcoretext=disabled
+ -Dchafa=disabled
+ -Dwasm=disabled
+
+ $(meson_feature cairo)
+ $(meson_feature glib)
+ $(meson_feature graphite graphite2)
+ $(meson_feature icu)
+ $(meson_feature introspection gobject)
+ $(meson_feature test tests)
+ $(meson_feature truetype freetype)
+
+ $(meson_native_use_feature doc docs)
+ $(meson_native_use_feature introspection)
+ # Breaks building tests..
+ #$(meson_native_use_feature utilities)
+
+ $(meson_use experimental experimental_api)
+ )
+
+ meson_src_configure
+}
+
+multilib_src_test() {
+ # harfbuzz:src / check-static-inits times out on hppa
+ meson_src_test --timeout-multiplier 5
+}
diff --git a/media-libs/harfbuzz/harfbuzz-9999.ebuild b/media-libs/harfbuzz/harfbuzz-9999.ebuild
index 1528b814b2d3..c114ab1668f9 100644
--- a/media-libs/harfbuzz/harfbuzz-9999.ebuild
+++ b/media-libs/harfbuzz/harfbuzz-9999.ebuild
@@ -3,19 +3,19 @@
EAPI=8
-PYTHON_COMPAT=( python3_{9..11} )
+PYTHON_COMPAT=( python3_{10..12} )
inherit flag-o-matic meson-multilib python-any-r1 xdg-utils
DESCRIPTION="An OpenType text shaping engine"
HOMEPAGE="https://www.freedesktop.org/wiki/Software/HarfBuzz"
-if [[ ${PV} = 9999 ]] ; then
+if [[ ${PV} == 9999 ]] ; then
EGIT_REPO_URI="https://github.com/harfbuzz/harfbuzz.git"
inherit git-r3
else
SRC_URI="https://github.com/harfbuzz/harfbuzz/releases/download/${PV}/${P}.tar.xz"
- KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x64-solaris"
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x64-solaris"
fi
LICENSE="Old-MIT ISC icu"
@@ -74,8 +74,9 @@ src_prepare() {
multilib_src_configure() {
# harfbuzz-gobject only used for introspection, bug #535852
local emesonargs=(
- -Dcoretext="disabled"
- -Dchafa="disabled"
+ -Dcoretext=disabled
+ -Dchafa=disabled
+ -Dwasm=disabled
$(meson_feature cairo)
$(meson_feature glib)
diff --git a/media-libs/libjxl/Manifest b/media-libs/libjxl/Manifest
index e1c13deb60de..dbe9f6b40a8d 100644
--- a/media-libs/libjxl/Manifest
+++ b/media-libs/libjxl/Manifest
@@ -1,3 +1,5 @@
+AUX libjxl-0.8.2-backport-pr2596.patch 2017 BLAKE2B 3155febe7e02fc34dfdf692821028e16f97272f751176ef22126151e8edf18e2c7d9da88d9bc8334cd4737d36037a5a04eb7360a41fde39605db62942c52e62c SHA512 4f8cd6f2a70077b8e52b084a4c76f5a029e3e13e578d28bb2d9d3470ae89fa6867d541bacd079bd55b76eb17a1c2f3d845715fc0d4c9e2a199618d8a6871d1a1
+AUX libjxl-0.8.2-backport-pr2617.patch 2853 BLAKE2B edeafa5bfa85f9868d98f4ee38be2dd4a5d747517e6aec59688d5314f1b6ede74bc3d20a11d08e3e2e2e87e8da987730a8a8cafcecce69369fdfa7bcb8ef2828 SHA512 ad8ddbe50d23895a3127d11bf36832ad1a1762e9b54bacc5f4d881accb5c81801618254b9b56afc4b145a7fb19bab8ca739974ff3bcb498e7db812d3a6cf004d
DIST libjxl-0.7.0.tar.gz 1505917 BLAKE2B fd60e8fb1d7082deaaaf413395ac09e6096bb164ac1b2765a836e0bd3b96a8ac604c2e7631dd17d3eb1d9421c9460de13cede63c5786a5b0689cb858d7f5ec59 SHA512 c73039606acf7b2cbc331c6787af5167d711fd1af22bc616e1f478c531b087da82c98f2cb7e88c4d1f8bcfdc4e053ae0dc99cc9a811545b7f9658041489ed04b
DIST libjxl-0.7.0_pre20220825.tar.gz 1505499 BLAKE2B 67b1f33112c85c8ccf1187cc44441f1afd6b5f11139f5b066092abe3dd2304e7ff8a8179fb1ef2a08982d2700ac757113019580c99abf37b3d701310f70861bf SHA512 13132dbe93d1b55cf878653803b01547b77152687aedd8ea07c162562f78965f74b5d96b82a434d2982962ad817096253a9447743e620cc72af0f1906a284b1d
DIST libjxl-0.8.0.tar.gz 1611824 BLAKE2B e16fb51c7938be22754cad70ccab1e0e965b218993aa2fe9646b6b8958887b2e868bdc9631a9d3ff5c24ca1b02f9e262c4d531238d78a7d80f23ed5911a95b1e SHA512 ef472ddc5e277f3d41491c2acc03ed0152ec3ea87efb9e3320cfd830ceb383728658318444b06a3e9f8662bc11c0014675966572ce33f49c8e5cb13c5ed48de1
@@ -8,6 +10,7 @@ EBUILD libjxl-0.7.0.ebuild 1749 BLAKE2B 6a5e9c06203a8cd0aa98b67f733d6ed75257f580
EBUILD libjxl-0.7.0_pre20220825.ebuild 1837 BLAKE2B 904e32dfd030184606f0b9fdc04e9a49315390ccf98cdb0e03fd457d95ad38f622a3808681c9caf541ed032d3d4f780c1b8c097169730d7042063b742ad0ccab SHA512 7ec4d6c0ccfe235cfd69752f4ab60fa640dfd2bd6a2e237ebba49675c6a7392a00f199f3c8ec719ca7c8b593ce166db04fb35c50b7b50fceaf4daded459288cc
EBUILD libjxl-0.8.0.ebuild 1754 BLAKE2B 51baf198642196eed58caa82547aadacf1f9a151f6980fba23c8e7364cd981cfdbefd03115d09994691f18517e601b878ec194cf54fed5ca6ef142bd5bdc32ea SHA512 a2642409fd28ff4b135a86b7690a6e5155c42822dabb24ee9f8b798cb5bd05bbd420afdf352fbe434aa3fd5cccedd3a0f0b97126296b28a98474c796b1616c5f
EBUILD libjxl-0.8.1.ebuild 1759 BLAKE2B 0ae0152c7f2fccaa93861dc411df6afd01bc48b0cd6eaa0a2c4c8e830a7fae7df031c68d61b028c4983affd4398b4406f15227b3e7c1b002cfcbfb7a9615f300 SHA512 4490713fd3a15442d941fcb87c219076f2cdaa98e4d32d7e39973a4593bafdaa7ed67b438dea0ef8fba3fde8431627180361e7a9c36c73582ed0aaa83a93878d
+EBUILD libjxl-0.8.2-r1.ebuild 2368 BLAKE2B 1fd68dec4b71193b881df2313a2c137e43922de3a22dbb8068b376aa82ca3f275002a1c68394bf69722c6d5877ebec97a5fee4e6b24e5737cb5d71cc9de7a419 SHA512 52b160466f89ce2900ce71b3c0dbad7ba81d854e987fd6b022d1e7282056ae2425f820edbbaae0149088f9d194da8ac47a3e4e38c47ef3a802f3c2d175b3970c
EBUILD libjxl-0.8.2.ebuild 2258 BLAKE2B 23c950208cd627e272eea5be81dd19cdaa00ad25e840ee66343704a8a223df41f3ddf875bd9aca770b7209f14e6fd56afa847c9e7715e7de755fa2dc941418c2 SHA512 48ffa3ec4bd273336b484c0d477672131a0410747c4fe72ede2a022ea46c842794f4635a2f85104e2996b7b587bf72e51ac7b50acc63748a05044a9748dfb4f5
EBUILD libjxl-9999.ebuild 2073 BLAKE2B 5b2766de4d8773903779c6d93b103c49eecb1aac4c3808d84427f21bdc5d00cbacb9f653aca2590e32a91b414538a178eca8f81038d252ff496c6b54c01fcc0a SHA512 cdd2c93f50841e378534d9b7bb8793e3491e41c6e7ed3cdae5f656a3a96abd243046d0738591e1e3a5b7d1822d89cd31e26f391ea545548b49a5ce8c0a66bab9
MISC metadata.xml 750 BLAKE2B d8bb075dd5e1e50d69380d7d6a54efe23fcf82fa16126d46767075b4fb718f3dde77c013e25aafb12dd42dda9cc702c76839172706100bf77a5bf3ac23b84932 SHA512 cc19188dd77ba5e5a752d151ac0e64e1bc2e61283d4ba90607f8d5d3e3945a430c869141f6f504c1551daee2d65990306200862a99b86aa2ada7048e833c2b5a
diff --git a/media-libs/libjxl/files/libjxl-0.8.2-backport-pr2596.patch b/media-libs/libjxl/files/libjxl-0.8.2-backport-pr2596.patch
new file mode 100644
index 000000000000..43448a01c473
--- /dev/null
+++ b/media-libs/libjxl/files/libjxl-0.8.2-backport-pr2596.patch
@@ -0,0 +1,50 @@
+https://bugs.gentoo.org/908939
+https://github.com/libjxl/libjxl/issues/2433
+https://github.com/libjxl/libjxl/pull/2596
+
+From 6a5cd1ff847e7b18ba8b87fcc11ada17dccb0692 Mon Sep 17 00:00:00 2001
+From: Sami Boukortt <sboukortt@google.com>
+Date: Thu, 22 Jun 2023 12:26:25 +0200
+Subject: [PATCH] Make sure to read the rendering intent before the CICP tag
+
+The code that reads the CICP tag exits the function if it succeeds, but
+it should not skip reading the rendering intent, so make sure to have
+already done it by that point.
+---
+ lib/jxl/enc_color_management.cc | 16 ++++++++--------
+ 1 file changed, 8 insertions(+), 8 deletions(-)
+
+diff --git a/lib/jxl/enc_color_management.cc b/lib/jxl/enc_color_management.cc
+index 752e3e02c0..2b519d152e 100644
+--- a/lib/jxl/enc_color_management.cc
++++ b/lib/jxl/enc_color_management.cc
+@@ -982,6 +982,14 @@ Status ColorEncoding::SetFieldsFromICC() {
+ Profile profile;
+ JXL_RETURN_IF_ERROR(DecodeProfile(context, icc_, &profile));
+
++ const cmsUInt32Number rendering_intent32 =
++ cmsGetHeaderRenderingIntent(profile.get());
++ if (rendering_intent32 > 3) {
++ return JXL_FAILURE("Invalid rendering intent %u\n", rendering_intent32);
++ }
++ // ICC and RenderingIntent have the same values (0..3).
++ rendering_intent = static_cast<RenderingIntent>(rendering_intent32);
++
+ static constexpr size_t kCICPSize = 12;
+ static constexpr auto kCICPSignature =
+ static_cast<cmsTagSignature>(0x63696370);
+@@ -993,14 +1001,6 @@ Status ColorEncoding::SetFieldsFromICC() {
+ return true;
+ }
+
+- const cmsUInt32Number rendering_intent32 =
+- cmsGetHeaderRenderingIntent(profile.get());
+- if (rendering_intent32 > 3) {
+- return JXL_FAILURE("Invalid rendering intent %u\n", rendering_intent32);
+- }
+- // ICC and RenderingIntent have the same values (0..3).
+- rendering_intent = static_cast<RenderingIntent>(rendering_intent32);
+-
+ SetColorSpace(ColorSpaceFromProfile(profile));
+ if (cmsGetColorSpace(profile.get()) == cmsSigCmykData) {
+ cmyk_ = true;
diff --git a/media-libs/libjxl/files/libjxl-0.8.2-backport-pr2617.patch b/media-libs/libjxl/files/libjxl-0.8.2-backport-pr2617.patch
new file mode 100644
index 000000000000..af9345867473
--- /dev/null
+++ b/media-libs/libjxl/files/libjxl-0.8.2-backport-pr2617.patch
@@ -0,0 +1,60 @@
+https://bugs.gentoo.org/908939
+https://github.com/libjxl/libjxl/issues/2433
+https://github.com/libjxl/libjxl/pull/2617
+
+From d9637bd803bf9fadc00aa01cea7becfff1e00e1f Mon Sep 17 00:00:00 2001
+From: Sami Boukortt <sboukortt@google.com>
+Date: Mon, 26 Jun 2023 15:06:17 +0200
+Subject: [PATCH] Fix decode_test with lcms2
+
+Co-authored-by: Zoltan Szabadka <szabadka@google.com>
+Co-authored-by: Luca Versari <veluca@google.com>
+---
+ lib/jxl/decode_test.cc | 17 +++++++++++------
+ 1 file changed, 11 insertions(+), 6 deletions(-)
+
+diff --git a/lib/jxl/decode_test.cc b/lib/jxl/decode_test.cc
+index 44ead99ec6..bbb7bda39c 100644
+--- a/lib/jxl/decode_test.cc
++++ b/lib/jxl/decode_test.cc
+@@ -3734,13 +3734,18 @@ void AnalyzeCodestream(const jxl::PaddedBytes& data,
+ jxl::Span<const uint8_t>(codestream.data(), codestream.size()));
+ ASSERT_EQ(br.ReadFixedBits<16>(), 0x0AFF);
+ jxl::CodecMetadata metadata;
+- EXPECT_TRUE(ReadSizeHeader(&br, &metadata.size));
+- EXPECT_TRUE(ReadImageMetadata(&br, &metadata.m));
++ ASSERT_TRUE(ReadSizeHeader(&br, &metadata.size));
++ ASSERT_TRUE(ReadImageMetadata(&br, &metadata.m));
+ streampos->basic_info =
+ add_offset(br.TotalBitsConsumed() / jxl::kBitsPerByte);
+ metadata.transform_data.nonserialized_xyb_encoded = metadata.m.xyb_encoded;
+- EXPECT_TRUE(jxl::Bundle::Read(&br, &metadata.transform_data));
+- EXPECT_TRUE(br.JumpToByteBoundary());
++ ASSERT_TRUE(jxl::Bundle::Read(&br, &metadata.transform_data));
++ if (metadata.m.color_encoding.WantICC()) {
++ jxl::PaddedBytes icc;
++ ASSERT_TRUE(jxl::ReadICC(&br, &icc));
++ ASSERT_TRUE(metadata.m.color_encoding.SetICCRaw(std::move(icc)));
++ }
++ ASSERT_TRUE(br.JumpToByteBoundary());
+ bool has_preview = metadata.m.have_preview;
+ while (br.TotalBitsConsumed() < br.TotalBytes() * jxl::kBitsPerByte) {
+ FramePositions p;
+@@ -3750,7 +3755,7 @@ void AnalyzeCodestream(const jxl::PaddedBytes& data,
+ frame_header.nonserialized_is_preview = true;
+ has_preview = false;
+ }
+- EXPECT_TRUE(ReadFrameHeader(&br, &frame_header));
++ ASSERT_TRUE(ReadFrameHeader(&br, &frame_header));
+ p.header_end =
+ add_offset(jxl::DivCeil(br.TotalBitsConsumed(), jxl::kBitsPerByte));
+ jxl::FrameDimensions frame_dim = frame_header.ToFrameDimensions();
+@@ -3760,7 +3765,7 @@ void AnalyzeCodestream(const jxl::PaddedBytes& data,
+ frame_header.passes.num_passes, /*has_ac_global=*/true);
+ std::vector<uint64_t> section_offsets;
+ std::vector<uint32_t> section_sizes;
+- EXPECT_TRUE(ReadGroupOffsets(toc_entries, &br, &section_offsets,
++ ASSERT_TRUE(ReadGroupOffsets(toc_entries, &br, &section_offsets,
+ &section_sizes, &groups_total_size));
+ EXPECT_EQ(br.TotalBitsConsumed() % jxl::kBitsPerByte, 0);
+ size_t sections_start = br.TotalBitsConsumed() / jxl::kBitsPerByte;
diff --git a/media-libs/libjxl/libjxl-0.8.2-r1.ebuild b/media-libs/libjxl/libjxl-0.8.2-r1.ebuild
new file mode 100644
index 000000000000..06d0fd0c3225
--- /dev/null
+++ b/media-libs/libjxl/libjxl-0.8.2-r1.ebuild
@@ -0,0 +1,86 @@
+# Copyright 2021-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake-multilib flag-o-matic
+
+# This changes frequently. Please check the testdata submodule when bumping.
+TESTDATA_COMMIT="d6168ffb9e1cc24007e64b65dd84d822ad1fc759"
+DESCRIPTION="JPEG XL image format reference implementation"
+HOMEPAGE="https://github.com/libjxl/libjxl"
+SRC_URI="https://github.com/libjxl/libjxl/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz
+ test? ( https://github.com/libjxl/testdata/archive/${TESTDATA_COMMIT}.tar.gz
+ -> ${PN}-testdata-${TESTDATA_COMMIT}.tar.gz )"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~ppc ~ppc64 ~riscv ~sparc ~x86"
+IUSE="openexr test"
+RESTRICT="!test? ( test )"
+
+DEPEND="app-arch/brotli:=[${MULTILIB_USEDEP}]
+ >=dev-cpp/highway-1.0.0[${MULTILIB_USEDEP}]
+ media-libs/giflib:=[${MULTILIB_USEDEP}]
+ >=media-libs/lcms-2.13:2[${MULTILIB_USEDEP}]
+ media-libs/libjpeg-turbo:=[${MULTILIB_USEDEP}]
+ media-libs/libpng:=[${MULTILIB_USEDEP}]
+ >=x11-misc/shared-mime-info-2.2
+ openexr? ( media-libs/openexr:= )
+ test? ( dev-cpp/gtest )
+"
+RDEPEND="${DEPEND}"
+PATCHES=(
+ "${FILESDIR}/${PN}-0.8.2-backport-pr2596.patch"
+ "${FILESDIR}/${PN}-0.8.2-backport-pr2617.patch"
+)
+
+multilib_src_configure() {
+ filter-lto
+
+ local mycmakeargs=(
+ -DJPEGXL_ENABLE_BENCHMARK=OFF
+ -DJPEGXL_ENABLE_COVERAGE=OFF
+ -DJPEGXL_ENABLE_FUZZERS=OFF
+ -DJPEGXL_ENABLE_SJPEG=OFF
+ -DJPEGXL_WARNINGS_AS_ERRORS=OFF
+
+ -DJPEGXL_ENABLE_SKCMS=OFF
+ -DJPEGXL_ENABLE_VIEWERS=OFF
+ -DJPEGXL_ENABLE_PLUGINS=OFF
+ -DJPEGXL_FORCE_SYSTEM_BROTLI=ON
+ -DJPEGXL_FORCE_SYSTEM_GTEST=ON
+ -DJPEGXL_FORCE_SYSTEM_HWY=ON
+ -DJPEGXL_FORCE_SYSTEM_LCMS2=ON
+ -DJPEGXL_ENABLE_DOXYGEN=OFF
+ -DJPEGXL_ENABLE_MANPAGES=OFF
+ -DJPEGXL_ENABLE_JNI=OFF
+ -DJPEGXL_ENABLE_JPEGLI_LIBJPEG=OFF
+ -DJPEGXL_ENABLE_TCMALLOC=OFF
+ -DJPEGXL_ENABLE_EXAMPLES=OFF
+ )
+
+ if multilib_is_native_abi; then
+ mycmakeargs+=(
+ -DJPEGXL_ENABLE_TOOLS=ON
+ -DJPEGXL_ENABLE_OPENEXR=$(usex openexr)
+ -DBUILD_TESTING=$(usex test ON OFF)
+ )
+ use test &&
+ mycmakeargs+=( -DJPEGXL_TEST_DATA_PATH="${WORKDIR}/testdata-${TESTDATA_COMMIT}" )
+ else
+ mycmakeargs+=(
+ -DJPEGXL_ENABLE_TOOLS=OFF
+ -DJPEGXL_ENABLE_OPENEXR=OFF
+ -DBUILD_TESTING=OFF
+ )
+ fi
+
+ cmake_src_configure
+}
+
+multilib_src_install() {
+ cmake_src_install
+
+ find "${ED}" -name '*.a' -delete || die
+}