diff --git a/0001-Remove-LCMS-mutex.patch b/0001-Remove-LCMS-mutex.patch deleted file mode 100644 index 3657b96..0000000 --- a/0001-Remove-LCMS-mutex.patch +++ /dev/null @@ -1,117 +0,0 @@ -From 057cd06c19875bcf8b5d34d41d92a8abdb856b7c Mon Sep 17 00:00:00 2001 -From: Kleis Auke Wolthuizen -Date: Fri, 11 Mar 2022 21:11:24 +0100 -Subject: [PATCH] Remove LCMS mutex (#112) - -* Remove LCMS mutex - -Requires mm2/Little-CMS@a35bacd, which is released in LCMS v2.11. - -* Use a threadsafe alternative of gmtime in LCMS - -Requires mm2/Little-CMS@68ee2ff, which is released in LCMS v2.13. - -LCMS submodule was updated to version 2.13.1 instead. ---- - lib/jxl/enc_color_management.cc | 15 +++++++++++++++ - third_party/CMakeLists.txt | 2 +- - third_party/lcms2.cmake | 14 -------------- - 3 files changed, 16 insertions(+), 15 deletions(-) - -Index: libjxl-0.8.1/lib/jxl/enc_color_management.cc -=================================================================== ---- libjxl-0.8.1.orig/lib/jxl/enc_color_management.cc -+++ libjxl-0.8.1/lib/jxl/enc_color_management.cc -@@ -18,6 +18,7 @@ - #include - #include - #include -+#include - #include - #include - -@@ -308,6 +309,14 @@ int DoColorSpaceTransform(void* t, size_ - // Define to 1 on OS X as a workaround for older LCMS lacking MD5. - #define JXL_CMS_OLD_VERSION 0 - -+// cms functions (even *THR) are not thread-safe, except cmsDoTransform. -+// To ensure all functions are covered without frequent lock-taking nor risk of -+// recursive lock, we lock in the top-level APIs. -+static std::mutex& LcmsMutex() { -+ static std::mutex m; -+ return m; -+} -+ - #if JPEGXL_ENABLE_SKCMS - - JXL_MUST_USE_RESULT CIExy CIExyFromXYZ(const float XYZ[3]) { -@@ -871,6 +880,9 @@ bool ApplyCICP(const uint8_t color_prima - - } // namespace - -+// All functions that call lcms directly (except ColorSpaceTransform::Run) must -+// lock LcmsMutex(). -+ - Status ColorEncoding::SetFieldsFromICC() { - // In case parsing fails, mark the ColorEncoding as invalid. - SetColorSpace(ColorSpace::kUnknown); -@@ -917,6 +929,7 @@ Status ColorEncoding::SetFieldsFromICC() - DetectTransferFunction(profile, this); - #else // JPEGXL_ENABLE_SKCMS - -+ std::lock_guard guard(LcmsMutex()); - const cmsContext context = GetContext(); - - Profile profile; -@@ -984,6 +997,7 @@ void JxlCmsDestroy(void* cms_data) { - if (cms_data == nullptr) return; - JxlCms* t = reinterpret_cast(cms_data); - #if !JPEGXL_ENABLE_SKCMS -+ std::lock_guard guard(LcmsMutex()); - TransformDeleter()(t->lcms_transform); - #endif - delete t; -@@ -1020,6 +1034,7 @@ void* JxlCmsInit(void* init_data, size_t - return nullptr; - } - #else // JPEGXL_ENABLE_SKCMS -+ std::lock_guard guard(LcmsMutex()); - const cmsContext context = GetContext(); - Profile profile_src, profile_dst; - if (!DecodeProfile(context, c_src.ICC(), &profile_src)) { -Index: libjxl-0.8.1/third_party/CMakeLists.txt -=================================================================== ---- libjxl-0.8.1.orig/third_party/CMakeLists.txt -+++ libjxl-0.8.1/third_party/CMakeLists.txt -@@ -111,7 +111,7 @@ if (JPEGXL_ENABLE_SKCMS OR JPEGXL_ENABLE - endif () - if (JPEGXL_ENABLE_VIEWERS OR NOT JPEGXL_ENABLE_SKCMS) - if( NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/lcms/.git" OR JPEGXL_FORCE_SYSTEM_LCMS2 ) -- find_package(LCMS2 2.13) -+ find_package(LCMS2 2.10) - if ( NOT LCMS2_FOUND ) - message(FATAL_ERROR "Please install lcms2 or run git submodule update --init") - endif () -Index: libjxl-0.8.1/third_party/lcms2.cmake -=================================================================== ---- libjxl-0.8.1.orig/third_party/lcms2.cmake -+++ libjxl-0.8.1/third_party/lcms2.cmake -@@ -60,18 +60,4 @@ target_compile_definitions(lcms2 - target_compile_definitions(lcms2 - PUBLIC "-DCMS_NO_REGISTER_KEYWORD=1") - --# Ensure that a thread safe alternative of gmtime is used in LCMS --include(CheckSymbolExists) --check_symbol_exists(gmtime_r "time.h" HAVE_GMTIME_R) --if (HAVE_GMTIME_R) -- target_compile_definitions(lcms2 -- PUBLIC "-DHAVE_GMTIME_R=1") --else() -- check_symbol_exists(gmtime_s "time.h" HAVE_GMTIME_S) -- if (HAVE_GMTIME_S) -- target_compile_definitions(lcms2 -- PUBLIC "-DHAVE_GMTIME_S=1") -- endif() --endif() -- - set_property(TARGET lcms2 PROPERTY POSITION_INDEPENDENT_CODE ON) diff --git a/_multibuild b/_multibuild new file mode 100644 index 0000000..6bf7c9f --- /dev/null +++ b/_multibuild @@ -0,0 +1,3 @@ + + gtk + diff --git a/baselibs.conf b/baselibs.conf index db6ec8d..cbe1690 100644 --- a/baselibs.conf +++ b/baselibs.conf @@ -1 +1 @@ -libjxl0_8 +libjxl0_11 diff --git a/libjxl.changes b/libjxl.changes index b098872..972c8af 100644 --- a/libjxl.changes +++ b/libjxl.changes @@ -1,3 +1,153 @@ +------------------------------------------------------------------- +Wed Jan 22 17:29:34 UTC 2025 - Michael Gorse + +- Remove the gimp plugin. It is for 2.10, and factory now has gimp + 3.0. + +------------------------------------------------------------------- +Wed Jan 22 15:56:09 UTC 2025 - Michael Gorse + +- Always require lcms2 for the gtk build. It is needed when + building plugins, and, if gimp is disabled, it needs to be + specified explicitly. + +------------------------------------------------------------------- +Fri Jan 10 21:34:13 UTC 2025 - Michael Gorse + +- Disable gimp plugin on SLFO. Gimp is currently unavailable there. +- Re-add lcms2 dependency for s390x. It is used instead of skcms + on big-endian architectures. + +------------------------------------------------------------------- +Tue Nov 26 20:55:18 UTC 2024 - Jan Engelhardt + +- Update to release 0.11.1 (boo#1233763 boo#1233785) + * Huffman lookup table size fix [CVE-2024-11403] + * Check height limit in modular trees [CVE-2024-11498] + +------------------------------------------------------------------- +Fri Sep 13 11:48:46 UTC 2024 - Jan Engelhardt + +- Update to release 0.11.0 + * Added Gain Map API: ``JxlGainMapBundle`` struct and API + functions to read and write gain map + ``bundlesJxlGainMapWriteBundle`` and ``JxlGainMapReadBundle`` + as well as handling compressed ICC profiles: + ``JxlICCProfileEncode`` and ``JxlICCProfileDecode``. + * Decoder API: added ``JXL_DEC_BOX_COMPLETE`` event to signal + that the output buffer for the current box has received all + contents. + +------------------------------------------------------------------- +Fri Aug 30 11:16:35 UTC 2024 - Cliff Zhao + +- Update libjxl.spec: + Add compiler condition to fix SLE-15-SP7 ppc64le build env. + (bsc#1229831) + +------------------------------------------------------------------- +Sat Jun 29 03:56:34 UTC 2024 - Jan Engelhardt + +- Update to release 0.10.3 + * fix bug in huffman-rle-gradient (e1) specialized decode path + +------------------------------------------------------------------- +Thu Jun 20 21:01:12 UTC 2024 - Jan Engelhardt + +- Enable cjpegli, djpegli tools +- Add system-jpeg.diff + +------------------------------------------------------------------- +Fri Mar 8 10:49:26 UTC 2024 - Jan Engelhardt + +- Update to release 0.10.2 + * Fix unspecified bugs in (lossless) encoding and streaming mode + +------------------------------------------------------------------- +Wed Feb 28 16:19:26 UTC 2024 - Jan Engelhardt + +- Update to release 0.10.1 + * reduce allocations and fixing speed regressions since 0.9.0 + * resolve some bug in streaming encoding + +------------------------------------------------------------------- +Thu Feb 22 00:12:54 UTC 2024 - Jan Engelhardt + +- Update to release 0.10 + * decoder: added ``JxlDecoderGetBoxSizeContents`` for getting the + size of the content of a box without the headers. + * encoder: implemented new API functions for streaming encoding. + +------------------------------------------------------------------- +Wed Feb 7 12:16:34 UTC 2024 - Jan Engelhardt + +- Update to release 0.9.2 + * Fixed some unspecified bugs in the gdk-pixbuf plugin + +------------------------------------------------------------------- +Wed Jan 3 05:11:31 UTC 2024 - Stefan BrĂ¼ns + +- Remove cjxl/djxl manpages from gtk flavor installation, these + are part of the tools subpackage from the main flavor. + +------------------------------------------------------------------- +Fri Dec 22 15:54:38 UTC 2023 - Jan Engelhardt + +- Update to release 0.9 + * Encoder API: + * Add JxlEncoderSetExtraChannelDistance to adjust the quality + of extra channels (like alpha) separately. + * New API functions for streaming encoding. + * New options for more fine-grained control over metadata + preservation when using JxlEncoderAddJPEGFrame. + * New function JxlEncoderSetUpsamplingMode to change the + upsampling method, e.g. to use nearest-neighbor upsampling + for pixel art. + * New function JxlEncoderDistanceFromQuality for convenience to + calculate a distance given a quality. + * Decoder API: Implemented JxlDecoderSetOutputColorProfile and + JxlDecoderSetCms to enable decoding to desired colorspace. + * Deprecated functions removed from encoder and decoder APIs. + * Command-line tools: + * cjxl can now be used to explicitly add/update/strip + Exif/XMP/JUMBF metadata using the decoder-hints syntax, e.g. + cjxl input.ppm -x exif=input.exif output.jxl + * djxl can now be used to extract Exif/XMP/JUMBF metadata. + +------------------------------------------------------------------- +Thu Sep 21 13:34:05 UTC 2023 - Jan Engelhardt + +- Switch from LCMS to SKCMS: libjxl core can use either, but + plugins can only use SKCMS. Exercising two CMS simultaneously + also is silly. Delete 0001-Remove-LCMS-mutex.patch . + +------------------------------------------------------------------- +Sat Sep 16 06:58:55 UTC 2023 - Atri Bhattacharya + +- Build plugins: + * Add _service file to generate skcms tarball (needed to build + plugins). + * Add skcms tarball as source and copy extracted dir to + ./third_party/ so cmake can find it. + * Split out new packages: + * gdk-pixbuf-loader-jxl: Pixbuf loader for supported apps. + * gimp-plugin-jxl: Plugin to allow gimp to work with JPEG XL + files. + * jxl-thumbnailer: Thumbnailer and mime files to allow + generating thumbnails for JPEG XL files. + +------------------------------------------------------------------- +Wed Jun 14 13:00:09 UTC 2023 - Jan Engelhardt + +- Update to release 0.8.2 + * Fix an integer underflow bug in patch decoding. + +------------------------------------------------------------------- +Fri Jun 9 08:16:39 UTC 2023 - Martin Pluskal + +- Build package in correct phase +- Use macros for ldconfig + ------------------------------------------------------------------- Mon Apr 17 07:36:23 UTC 2023 - Jan Engelhardt diff --git a/libjxl.spec b/libjxl.spec index bc278c1..3f55191 100644 --- a/libjxl.spec +++ b/libjxl.spec @@ -1,7 +1,7 @@ # -# spec file for package libjxl +# spec file for package libjxl-gtk # -# Copyright (c) 2023 SUSE LLC +# Copyright (c) 2024 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,9 +16,15 @@ # +%define lname libjxl0_11 +%if "@BUILD_FLAVOR@" == "gtk" +Name: libjxl-gtk +%bcond_without gtk +%else Name: libjxl -%define lname libjxl0_8 -Version: 0.8.1 +%bcond_with gtk +%endif +Version: 0.11.1 Release: 0 Summary: JPEG XL reference implementation License: BSD-3-Clause @@ -26,18 +32,36 @@ URL: https://jpegxl.info/ #Git-Clone: https://github.com/libjxl/libjxl Source: https://github.com/libjxl/libjxl/archive/refs/tags/v%version.tar.gz Source1: baselibs.conf -Patch0: 0001-Remove-LCMS-mutex.patch +Source2: skcms.tar +Patch1: system-jpeg.diff +BuildRequires: asciidoc BuildRequires: c++_compiler BuildRequires: cmake BuildRequires: pkg-config -BuildRequires: pkgconfig(lcms2) >= 2.10 +%if %{with gtk} +BuildRequires: pkgconfig(gdk-pixbuf-2.0) >= 2.36 +BuildRequires: pkgconfig(lcms2) >= 2.12 +%endif +BuildRequires: giflib-devel >= 5.1 +BuildRequires: pkgconfig(OpenEXR) +%ifarch s390x +BuildRequires: pkgconfig(lcms2) >= 2.12 +%endif +BuildRequires: pkgconfig(libavif) BuildRequires: pkgconfig(libbrotlicommon) BuildRequires: pkgconfig(libbrotlidec) BuildRequires: pkgconfig(libbrotlienc) -BuildRequires: pkgconfig(libhwy) >= 1.0 +BuildRequires: pkgconfig(libhwy) >= 1.0.7 BuildRequires: pkgconfig(libjpeg) BuildRequires: pkgconfig(libpng) +BuildRequires: pkgconfig(libwebp) +%if 0%{?sle_version} == 150700 +BuildRequires: gcc10-c++ +%endif %{?suse_build_hwcaps_libs} +%if %{with gtk} +Provides: bundled(skcms) = 0 +%endif %description JPEG XL is a raster-graphics file format that supports both lossy and @@ -68,44 +92,85 @@ Summary: Command-line utilities to convert from/to JPEG XL %description tools Command-line utilities to convert from/to JPEG XL. -%prep -%setup -q - -%if %{pkg_vcmp liblcms2-2 < 2.13} -# libjxl 0.7.0 requires lcms2 >= 2.13, so if we have an older version -# (as in SLE15/Leap) just reverse the patch that adds that dependency -%patch0 -p1 -%else -# Make sure patch at least applies -%patch0 -p1 -%patch0 -p1 -R +%package -n gdk-pixbuf-loader-jxl +Summary: A gdk-pixbuf loader for JPEG-XL using libjxl +Supplements: (%lname and gdk-pixbuf) +%if %{with gtk} +%gdk_pixbuf_loader_requires %endif +%description -n gdk-pixbuf-loader-jxl +This package provides a libjxl-based gdk-pixbuf loader for JPEG XL files. + +%package -n jxl-thumbnailer +Summary: Generate thumbnails for JPEG XL files +BuildArch: noarch + +%description -n jxl-thumbnailer +This package provides a thumbnailer to render for JPEG XL file thumbnails, +for example, on file-browsers. + +%prep +%autosetup -n libjxl-%version -a2 -p1 +mv skcms third_party/ + %build +%if 0%{?sle_version} == 150700 +export CC=gcc-10 +export CXX=g++-10 +%endif + %cmake -DJPEGXL_FORCE_SYSTEM_HWY=ON -DJPEGXL_FORCE_SYSTEM_BROTLI=ON \ - -DJPEGXL_FORCE_SYSTEM_LCMS2=ON -DBUILD_TESTING=OFF \ - -DJPEGXL_ENABLE_PLUGINS=OFF -DJPEGXL_ENABLE_SKCMS=OFF \ - -DJPEGXL_ENABLE_SJPEG=OFF + -DJPEGXL_FORCE_SYSTEM_LCMS2=OFF -DBUILD_TESTING=OFF \ +%if %{with gtk} + -DJPEGXL_ENABLE_PLUGINS=ON -DJPEGXL_ENABLE_SKCMS=ON \ +%endif + -DJPEGXL_ENABLE_SJPEG=OFF -DJPEGXL_ENABLE_DOXYGEN=OFF \ + -DJPEGXL_ENABLE_JPEGLI=ON +%cmake_build %install %cmake_install -rm -fv %buildroot/%_libdir/*.a +b="%buildroot" +rm -fv "$b/%_libdir"/*.a +%if %{with gtk} +rm -Rf "$b/%_libdir"/libjxl* "$b/%_bindir" "$b/%_includedir" "$b/%_libdir/pkgconfig" "$b/%_mandir" +%endif -%post -n %lname -p /sbin/ldconfig -%postun -n %lname -p /sbin/ldconfig +%ldconfig_scriptlets -n %lname + +%post -n gdk-pixbuf-loader-jxl +%gdk_pixbuf_loader_post + +%postun -n gdk-pixbuf-loader-jxl +%gdk_pixbuf_loader_postun + +%if %{without gtk} %files -n %lname %license LICENSE %_libdir/libjxl*.so.* %files tools -%_bindir/cjpeg_hdr +%_bindir/?jpegli %_bindir/*xl* +%_mandir/man*/*xl* %files devel %_includedir/jxl/ -%_libdir/libjxl.so -%_libdir/libjxl_threads.so +%_libdir/libjxl*.so %_libdir/pkgconfig/*.pc +%else + +%files -n gdk-pixbuf-loader-jxl +%_datadir/mime/packages/* +%_libdir/gdk-pixbuf-2.0/*/loaders/libpixbufloader-jxl.so + +%files -n jxl-thumbnailer +%dir %_datadir/thumbnailers +%_datadir/thumbnailers/*.thumbnailer + +%endif + %changelog diff --git a/skcms.tar b/skcms.tar new file mode 100644 index 0000000..03a9b49 Binary files /dev/null and b/skcms.tar differ diff --git a/system-jpeg.diff b/system-jpeg.diff new file mode 100644 index 0000000..3a2d05b --- /dev/null +++ b/system-jpeg.diff @@ -0,0 +1,29 @@ +From: Jan Engelhardt +Date: 2024-06-20 23:00:14.684111062 +0200 + +There are many legit reasons to depend on bundled software, but this ain't one of them! + +--- + lib/jpegli.cmake | 9 +++------ + 1 file changed, 3 insertions(+), 6 deletions(-) + +Index: libjxl-0.10.2/lib/jpegli.cmake +=================================================================== +--- libjxl-0.10.2.orig/lib/jpegli.cmake ++++ libjxl-0.10.2/lib/jpegli.cmake +@@ -23,12 +23,9 @@ elseif(JPEGLI_LIBJPEG_LIBRARY_SOVERSION + set(JPEG_LIB_VERSION 80) + endif() + +-configure_file( +- ../third_party/libjpeg-turbo/jconfig.h.in include/jpegli/jconfig.h) +-configure_file( +- ../third_party/libjpeg-turbo/jpeglib.h include/jpegli/jpeglib.h COPYONLY) +-configure_file( +- ../third_party/libjpeg-turbo/jmorecfg.h include/jpegli/jmorecfg.h COPYONLY) ++configure_file(/usr/include/jconfig.h include/jpegli/jconfig.h) ++configure_file(/usr/include/jpeglib.h include/jpegli/jpeglib.h COPYONLY) ++configure_file(/usr/include/jmorecfg.h include/jpegli/jmorecfg.h COPYONLY) + + add_library(jpegli-static STATIC EXCLUDE_FROM_ALL "${JPEGXL_INTERNAL_JPEGLI_SOURCES}") + target_compile_options(jpegli-static PRIVATE "${JPEGXL_INTERNAL_FLAGS}") diff --git a/v0.11.1.tar.gz b/v0.11.1.tar.gz new file mode 100644 index 0000000..b641271 --- /dev/null +++ b/v0.11.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1492dfef8dd6c3036446ac3b340005d92ab92f7d48ee3271b5dac1d36945d3d9 +size 1876134 diff --git a/v0.8.1.tar.gz b/v0.8.1.tar.gz deleted file mode 100644 index 0755b1a..0000000 --- a/v0.8.1.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:60f43921ad3209c9e180563025eda0c0f9b1afac51a2927b9ff59fff3950dc56 -size 1611905