diff options
Diffstat (limited to 'media-libs/libjxl')
-rw-r--r-- | media-libs/libjxl/Manifest | 3 | ||||
-rw-r--r-- | media-libs/libjxl/files/libjxl-0.8.2-backport-pr2596.patch | 50 | ||||
-rw-r--r-- | media-libs/libjxl/files/libjxl-0.8.2-backport-pr2617.patch | 60 | ||||
-rw-r--r-- | media-libs/libjxl/libjxl-0.8.2-r1.ebuild | 86 |
4 files changed, 199 insertions, 0 deletions
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, §ion_offsets, ++ ASSERT_TRUE(ReadGroupOffsets(toc_entries, &br, §ion_offsets, + §ion_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 +} |