From 26eea7a59bb1d98adfcb0250c445f4bb123cdae9 Mon Sep 17 00:00:00 2001 From: Jesus Solis Date: Mon, 6 Jul 2026 23:51:13 -0500 Subject: [PATCH] external: add libjxl libjxl is a library for encoding and decoding JPEG XL images Downloaded from https://github.com/libjxl/libjxl/archive/refs/tags/v0.11.2.tar.gz Change-Id: Ibb498f96b3576be603ee9a1c3c494d2ac99c403a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207085 Tested-by: Jenkins Reviewed-by: Xisco Fauli --- Makefile.fetch | 1 + RepositoryExternal.mk | 42 +++++++ config_host.mk.in | 3 + configure.ac | 15 +++ download.lst | 5 + external/Module_external.mk | 1 + external/libjxl/Makefile | 7 ++ external/libjxl/Module_libjxl.mk | 17 +++ external/libjxl/README | 19 +++ external/libjxl/StaticLibrary_libjxl.mk | 109 ++++++++++++++++++ external/libjxl/UnpackedTarball_libjxl.mk | 33 ++++++ external/libjxl/jxl_cms_export.h | 43 +++++++ external/libjxl/jxl_export.h | 43 +++++++ external/libjxl/jxl_threads_export.h | 43 +++++++ external/libjxl/version.h | 44 +++++++ .../libjxl/windows-compile-directives.patch.0 | 81 +++++++++++++ readlicense_oo/license/license.xml | 30 +++++ solenv/clang-format/excludelist | 4 + 18 files changed, 540 insertions(+) create mode 100644 external/libjxl/Makefile create mode 100644 external/libjxl/Module_libjxl.mk create mode 100644 external/libjxl/README create mode 100644 external/libjxl/StaticLibrary_libjxl.mk create mode 100644 external/libjxl/UnpackedTarball_libjxl.mk create mode 100644 external/libjxl/jxl_cms_export.h create mode 100644 external/libjxl/jxl_export.h create mode 100644 external/libjxl/jxl_threads_export.h create mode 100644 external/libjxl/version.h create mode 100644 external/libjxl/windows-compile-directives.patch.0 diff --git a/Makefile.fetch b/Makefile.fetch index ef5f836a184d..04d38de2172c 100644 --- a/Makefile.fetch +++ b/Makefile.fetch @@ -162,6 +162,7 @@ $(WORKDIR)/download: $(BUILDDIR)/config_$(gb_Side).mk $(SRCDIR)/download.lst $(S $(call fetch_Optional,LIBEXTTEXTCAT,LIBEXTTEXTCAT_TARBALL) \ $(call fetch_Optional,LIBFFI,LIBFFI_TARBALL) \ $(call fetch_Optional,LIBGPGERROR,LIBGPGERROR_TARBALL) \ + $(call fetch_Optional,LIBJXL,LIBJXL_TARBALL) \ $(call fetch_Optional,LIBLANGTAG,LANGTAGREG_TARBALL) \ $(call fetch_Optional,LIBLANGTAG,LIBLANGTAG_TARBALL) \ $(call fetch_Optional,LIBNUMBERTEXT,LIBNUMBERTEXT_TARBALL) \ diff --git a/RepositoryExternal.mk b/RepositoryExternal.mk index e3d15abe7f76..fa7288206da6 100644 --- a/RepositoryExternal.mk +++ b/RepositoryExternal.mk @@ -584,6 +584,48 @@ endef endif # SYSTEM_LIBJPEG +ifneq ($(SYSTEM_LIBJXL),) + +define gb_LinkTarget__use_libjxl +$(call gb_LinkTarget_set_include,$(1),\ + $$(INCLUDE) \ + $(LIBJXL_CFLAGS) \ +) +$(call gb_LinkTarget_add_libs,$(1),$(LIBJXL_LIBS)) + +endef + +gb_ExternalProject__use_libjxl := + +else # !SYSTEM_LIBJXL + +define gb_LinkTarget__use_libjxl +$(call gb_LinkTarget_add_defs,$(1),\ + -DJXL_INTERNAL_LIBRARY_BUILD \ + -DJXL_THREADS_INTERNAL_LIBRARY_BUILD \ + -Djxl_cms_EXPORTS \ +) + +$(call gb_LinkTarget_set_include,$(1),\ + -I$(gb_UnpackedTarball_workdir)/libjxl/lib/include \ + $$(INCLUDE) \ +) +$(call gb_LinkTarget_use_static_libraries,$(1),libjxl) +$(call gb_LinkTarget_use_externals,$(1),\ + highway \ + brotli \ + lcms2 \ +) + +endef + +define gb_ExternalProject__use_libjxl +$(call gb_ExternalProject_use_static_libraries,$(1),libjxl) + +endef + +endif # SYSTEM_LIBJXL + ifneq ($(SYSTEM_MYTHES),) define gb_LinkTarget__use_mythes diff --git a/config_host.mk.in b/config_host.mk.in index 3f52596779bc..370c8a7a0247 100644 --- a/config_host.mk.in +++ b/config_host.mk.in @@ -422,6 +422,8 @@ export LIBFONTS_JAR=@LIBFONTS_JAR@ export LIBFORMULA_JAR=@LIBFORMULA_JAR@ export LIBJPEG_CFLAGS=$(gb_SPACE)@LIBJPEG_CFLAGS@ export LIBJPEG_LIBS=$(gb_SPACE)@LIBJPEG_LIBS@ +export LIBJXL_CFLAGS=$(gb_SPACE)@LIBJXL_CFLAGS@ +export LIBJXL_LIBS=$(gb_SPACE)@LIBJXL_LIBS@ export LIBLANGTAG_CFLAGS=$(gb_SPACE)@LIBLANGTAG_CFLAGS@ export LIBLANGTAG_LIBS=$(gb_SPACE)@LIBLANGTAG_LIBS@ export LIBLAYOUT_JAR=@LIBLAYOUT_JAR@ @@ -702,6 +704,7 @@ SYSTEM_LIBEOT=@SYSTEM_LIBEOT@ SYSTEM_LIBEXTTEXTCAT=@SYSTEM_LIBEXTTEXTCAT@ SYSTEM_LIBEXTTEXTCAT_DATA=@SYSTEM_LIBEXTTEXTCAT_DATA@ SYSTEM_LIBFIXMATH=@SYSTEM_LIBFIXMATH@ +SYSTEM_LIBJXL=@SYSTEM_LIBJXL@ SYSTEM_LIBLANGTAG=@SYSTEM_LIBLANGTAG@ SYSTEM_LIBNUMBERTEXT=@SYSTEM_LIBNUMBERTEXT@ SYSTEM_LIBNUMBERTEXT_DATA=@SYSTEM_LIBNUMBERTEXT_DATA@ diff --git a/configure.ac b/configure.ac index b166c0ebdb41..4405f3b328e4 100644 --- a/configure.ac +++ b/configure.ac @@ -2603,6 +2603,11 @@ AC_ARG_WITH(system-expat, [Use expat already on system.]),, [with_system_expat="$with_system_libs"]) +AC_ARG_WITH(system-libjxl, + AS_HELP_STRING([--with-system-libjxl], + [Use libjxl already on system.]),, + [with_system_libjxl="$with_system_libs"]) + AC_ARG_WITH(system-libxml, AS_HELP_STRING([--with-system-libxml], [Use libxml/libxslt already on system.]),, @@ -15037,6 +15042,16 @@ fi AC_SUBST(ENABLE_MSVC_ANALYZE) dnl =================================================================== +dnl Test whether to build libjxl or rely on the system version +dnl highway and brotli libraries are only built with internal libjxl +dnl =================================================================== + +if test "$with_system_libjxl" != "yes"; then + BUILD_TYPE="$BUILD_TYPE HIGHWAY BROTLI" +fi + +libo_CHECK_SYSTEM_MODULE([libjxl],[LIBJXL],[libjxl]) + dnl Test whether to use liblangtag dnl =================================================================== SYSTEM_LIBLANGTAG= diff --git a/download.lst b/download.lst index fcf48754f180..6f843a26786d 100644 --- a/download.lst +++ b/download.lst @@ -405,6 +405,11 @@ LIBGPGERROR_TARBALL := libgpg-error-1.61.tar.bz2 # three static lines # so that git cherry-pick # will not run into conflicts +LIBJXL_SHA256SUM := ab38928f7f6248e2a98cc184956021acb927b16a0dee71b4d260dc040a4320ea +LIBJXL_TARBALL := libjxl-0.11.2.tar.gz +# three static lines +# so that git cherry-pick +# will not run into conflicts LIBLANGTAG_SHA256SUM := a96975b79ddd8fef6d9295c083fe3f1afa1a8898a57235d4069255ade44e5cf2 LIBLANGTAG_TARBALL := liblangtag-0.6.8.tar.bz2 # three static lines diff --git a/external/Module_external.mk b/external/Module_external.mk index 911728ab380b..c94454a96707 100644 --- a/external/Module_external.mk +++ b/external/Module_external.mk @@ -61,6 +61,7 @@ $(eval $(call gb_Module_add_moduledirs,external,\ $(call gb_Helper_optional,LIBEXTTEXTCAT,libexttextcat) \ $(call gb_Helper_optional,LIBFFI,libffi) \ $(call gb_Helper_optional,LIBGPGERROR,libgpg-error) \ + $(call gb_Helper_optional,LIBJXL,libjxl) \ $(call gb_Helper_optional,LIBLANGTAG,liblangtag) \ $(call gb_Helper_optional,LIBNUMBERTEXT,libnumbertext) \ $(call gb_Helper_optional,LIBPNG,libpng) \ diff --git a/external/libjxl/Makefile b/external/libjxl/Makefile new file mode 100644 index 000000000000..e4968cf85fb6 --- /dev/null +++ b/external/libjxl/Makefile @@ -0,0 +1,7 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- + +module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST)))) + +include $(module_directory)/../../solenv/gbuild/partial_build.mk + +# vim: set noet sw=4 ts=4: diff --git a/external/libjxl/Module_libjxl.mk b/external/libjxl/Module_libjxl.mk new file mode 100644 index 000000000000..a20f2199ee02 --- /dev/null +++ b/external/libjxl/Module_libjxl.mk @@ -0,0 +1,17 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +$(eval $(call gb_Module_Module,libjxl)) + +$(eval $(call gb_Module_add_targets,libjxl,\ + StaticLibrary_libjxl \ + UnpackedTarball_libjxl \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/external/libjxl/README b/external/libjxl/README new file mode 100644 index 000000000000..be8a7d7acfcf --- /dev/null +++ b/external/libjxl/README @@ -0,0 +1,19 @@ +libjxl is a library for encoding and decoding JPEG XL images, from +[https://github.com/libjxl/libjxl]. + +How to update the extra headers: +================================ + +The extra header files (jxl_cms_export.h, jxl_export.h, jxl_threads_export.h, +version.h) can be generated with: + +(cd workdir/UnpackedTarball/libjxl/ && cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF) + +If new header files are generated in this way, they will be placed in +workdir/UnpackedTarball/libjxl/lib/include/jxl/. + +There are more detailed build instructions in +workdir/UnpackedTarball/libjxl/BUILDING.md (for Linux) and +workdir/UnpackedTarball/libjxl/developing_in_windows_vcpkg.md (for Windows). (A +full build isn't necessary to generate the headers, only the first cmake +command without --build.) diff --git a/external/libjxl/StaticLibrary_libjxl.mk b/external/libjxl/StaticLibrary_libjxl.mk new file mode 100644 index 000000000000..9ed4975fd9a3 --- /dev/null +++ b/external/libjxl/StaticLibrary_libjxl.mk @@ -0,0 +1,109 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +$(eval $(call gb_StaticLibrary_StaticLibrary,libjxl)) + +$(eval $(call gb_StaticLibrary_use_unpacked,libjxl,libjxl)) + +$(eval $(call gb_StaticLibrary_use_externals,libjxl,\ + brotli \ + highway \ + lcms2 \ +)) + +$(eval $(call gb_StaticLibrary_set_warnings_disabled,libjxl)) + +$(eval $(call gb_StaticLibrary_set_include,libjxl,\ + -I$(WORKDIR)/UnpackedTarball/libjxl \ + -I$(WORKDIR)/UnpackedTarball/libjxl/lib/include \ + $$(INCLUDE) \ +)) + +$(eval $(call gb_StaticLibrary_add_defs,libjxl,\ + -DJPEGXL_ENABLE_TRANSCODE_JPEG=OFF \ + -DJXL_INTERNAL_LIBRARY_BUILD \ + -DJXL_THREADS_INTERNAL_LIBRARY_BUILD \ + -Djxl_cms_EXPORTS \ +)) + +$(eval $(call gb_StaticLibrary_set_generated_cxx_suffix,libjxl,cc)) + +$(eval $(call gb_StaticLibrary_add_generated_exception_objects,libjxl,\ + UnpackedTarball/libjxl/lib/jxl/decode \ + UnpackedTarball/libjxl/lib/jxl/encode \ + UnpackedTarball/libjxl/lib/threads/resizable_parallel_runner \ + UnpackedTarball/libjxl/lib/jxl/memory_manager_internal \ + UnpackedTarball/libjxl/lib/jxl/headers \ + UnpackedTarball/libjxl/lib/jxl/icc_codec \ + UnpackedTarball/libjxl/lib/jxl/dec_xyb \ + UnpackedTarball/libjxl/lib/jxl/dec_frame \ + UnpackedTarball/libjxl/lib/jxl/box_content_decoder \ + UnpackedTarball/libjxl/lib/jxl/color_encoding_internal \ + UnpackedTarball/libjxl/lib/jxl/fields \ + UnpackedTarball/libjxl/lib/jxl/image_metadata \ + UnpackedTarball/libjxl/lib/jxl/frame_header \ + UnpackedTarball/libjxl/lib/jxl/quant_weights \ + UnpackedTarball/libjxl/lib/jxl/quantizer \ + UnpackedTarball/libjxl/lib/jxl/icc_codec_common \ + UnpackedTarball/libjxl/lib/jxl/loop_filter \ + UnpackedTarball/libjxl/lib/jxl/dec_modular \ + UnpackedTarball/libjxl/lib/jxl/modular/modular_image \ + UnpackedTarball/libjxl/lib/jxl/image \ + UnpackedTarball/libjxl/lib/jxl/render_pipeline/render_pipeline \ + UnpackedTarball/libjxl/lib/jxl/modular/transform/transform \ + UnpackedTarball/libjxl/lib/jxl/modular/transform/palette \ + UnpackedTarball/libjxl/lib/jxl/modular/transform/squeeze \ + UnpackedTarball/libjxl/lib/jxl/dec_patch_dictionary \ + UnpackedTarball/libjxl/lib/jxl/dec_cache \ + UnpackedTarball/libjxl/lib/jxl/render_pipeline/stage_write \ + UnpackedTarball/libjxl/lib/jxl/render_pipeline/stage_from_linear \ + UnpackedTarball/libjxl/lib/jxl/blending \ + UnpackedTarball/libjxl/lib/jxl/alpha \ + UnpackedTarball/libjxl/lib/jxl/render_pipeline/stage_tone_mapping \ + UnpackedTarball/libjxl/lib/jxl/image_bundle \ + UnpackedTarball/libjxl/lib/jxl/render_pipeline/stage_epf \ + UnpackedTarball/libjxl/lib/jxl/render_pipeline/stage_to_linear \ + UnpackedTarball/libjxl/lib/jxl/render_pipeline/stage_spot \ + UnpackedTarball/libjxl/lib/jxl/render_pipeline/stage_cms \ + UnpackedTarball/libjxl/lib/jxl/render_pipeline/stage_blending \ + UnpackedTarball/libjxl/lib/jxl/render_pipeline/stage_xyb \ + UnpackedTarball/libjxl/lib/jxl/render_pipeline/stage_ycbcr \ + UnpackedTarball/libjxl/lib/jxl/render_pipeline/stage_noise \ + UnpackedTarball/libjxl/lib/jxl/render_pipeline/stage_splines \ + UnpackedTarball/libjxl/lib/jxl/splines \ + UnpackedTarball/libjxl/lib/jxl/passes_state \ + UnpackedTarball/libjxl/lib/jxl/chroma_from_luma \ + UnpackedTarball/libjxl/lib/jxl/render_pipeline/stage_upsampling \ + UnpackedTarball/libjxl/lib/jxl/dec_ans \ + UnpackedTarball/libjxl/lib/jxl/dec_huffman \ + UnpackedTarball/libjxl/lib/jxl/dec_context_map \ + UnpackedTarball/libjxl/lib/jxl/huffman_table \ + UnpackedTarball/libjxl/lib/jxl/dec_noise \ + UnpackedTarball/libjxl/lib/jxl/modular/encoding/encoding \ + UnpackedTarball/libjxl/lib/jxl/simd_util \ + UnpackedTarball/libjxl/lib/jxl/opsin_params \ + UnpackedTarball/libjxl/lib/jxl/entropy_coder \ + UnpackedTarball/libjxl/lib/jxl/toc \ + UnpackedTarball/libjxl/lib/jxl/compressed_dc \ + UnpackedTarball/libjxl/lib/jxl/coeff_order \ + UnpackedTarball/libjxl/lib/jxl/dec_group \ + UnpackedTarball/libjxl/lib/jxl/modular/encoding/dec_ma \ + UnpackedTarball/libjxl/lib/jxl/epf \ + UnpackedTarball/libjxl/lib/jxl/render_pipeline/low_memory_render_pipeline \ + UnpackedTarball/libjxl/lib/jxl/render_pipeline/simple_render_pipeline \ + UnpackedTarball/libjxl/lib/jxl/modular/transform/rct \ + UnpackedTarball/libjxl/lib/jxl/render_pipeline/stage_chroma_upsampling \ + UnpackedTarball/libjxl/lib/jxl/render_pipeline/stage_gaborish \ + UnpackedTarball/libjxl/lib/jxl/render_pipeline/stage_patches \ + UnpackedTarball/libjxl/lib/jxl/ac_strategy \ + UnpackedTarball/libjxl/lib/jxl/dec_group_border \ + UnpackedTarball/libjxl/lib/jxl/ans_common \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/external/libjxl/UnpackedTarball_libjxl.mk b/external/libjxl/UnpackedTarball_libjxl.mk new file mode 100644 index 000000000000..88b69da0b4b3 --- /dev/null +++ b/external/libjxl/UnpackedTarball_libjxl.mk @@ -0,0 +1,33 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +$(eval $(call gb_UnpackedTarball_UnpackedTarball,libjxl)) + +$(eval $(call gb_UnpackedTarball_set_tarball,libjxl,$(LIBJXL_TARBALL))) + +# Exclude tools/benchmark/metrics subdirectory containing symlinks that tar +# in the Windows build cannot handle +$(eval $(call gb_UnpackedTarball_set_exclude_pattern,libjxl,\ + */tools/benchmark/metrics \ +)) + +$(eval $(call gb_UnpackedTarball_add_files,libjxl,lib/include/jxl,\ + external/libjxl/jxl_cms_export.h \ + external/libjxl/jxl_export.h \ + external/libjxl/jxl_threads_export.h \ + external/libjxl/version.h \ +)) + +ifeq ($(OS),WNT) +$(eval $(call gb_UnpackedTarball_add_patches,libjxl,\ + external/libjxl/windows-compile-directives.patch.0 \ +)) +endif + +# vim: set noet sw=4 ts=4: diff --git a/external/libjxl/jxl_cms_export.h b/external/libjxl/jxl_cms_export.h new file mode 100644 index 000000000000..3e28f0522679 --- /dev/null +++ b/external/libjxl/jxl_cms_export.h @@ -0,0 +1,43 @@ + +#ifndef JXL_CMS_EXPORT_H +#define JXL_CMS_EXPORT_H + +#ifdef JXL_CMS_STATIC_DEFINE +# define JXL_CMS_EXPORT +# define JXL_CMS_NO_EXPORT +#else +# ifndef JXL_CMS_EXPORT +# ifdef jxl_cms_EXPORTS + /* We are building this library */ +# define JXL_CMS_EXPORT __attribute__((visibility("default"))) +# else + /* We are using this library */ +# define JXL_CMS_EXPORT __attribute__((visibility("default"))) +# endif +# endif + +# ifndef JXL_CMS_NO_EXPORT +# define JXL_CMS_NO_EXPORT __attribute__((visibility("hidden"))) +# endif +#endif + +#ifndef JXL_CMS_DEPRECATED +# define JXL_CMS_DEPRECATED __attribute__ ((__deprecated__)) +#endif + +#ifndef JXL_CMS_DEPRECATED_EXPORT +# define JXL_CMS_DEPRECATED_EXPORT JXL_CMS_EXPORT JXL_CMS_DEPRECATED +#endif + +#ifndef JXL_CMS_DEPRECATED_NO_EXPORT +# define JXL_CMS_DEPRECATED_NO_EXPORT JXL_CMS_NO_EXPORT JXL_CMS_DEPRECATED +#endif + +/* NOLINTNEXTLINE(readability-avoid-unconditional-preprocessor-if) */ +#if 0 /* DEFINE_NO_DEPRECATED */ +# ifndef JXL_CMS_NO_DEPRECATED +# define JXL_CMS_NO_DEPRECATED +# endif +#endif + +#endif /* JXL_CMS_EXPORT_H */ diff --git a/external/libjxl/jxl_export.h b/external/libjxl/jxl_export.h new file mode 100644 index 000000000000..3489ab6816c4 --- /dev/null +++ b/external/libjxl/jxl_export.h @@ -0,0 +1,43 @@ + +#ifndef JXL_EXPORT_H +#define JXL_EXPORT_H + +#ifdef JXL_STATIC_DEFINE +# define JXL_EXPORT +# define JXL_NO_EXPORT +#else +# ifndef JXL_EXPORT +# ifdef JXL_INTERNAL_LIBRARY_BUILD + /* We are building this library */ +# define JXL_EXPORT __attribute__((visibility("default"))) +# else + /* We are using this library */ +# define JXL_EXPORT __attribute__((visibility("default"))) +# endif +# endif + +# ifndef JXL_NO_EXPORT +# define JXL_NO_EXPORT __attribute__((visibility("hidden"))) +# endif +#endif + +#ifndef JXL_DEPRECATED +# define JXL_DEPRECATED __attribute__ ((__deprecated__)) +#endif + +#ifndef JXL_DEPRECATED_EXPORT +# define JXL_DEPRECATED_EXPORT JXL_EXPORT JXL_DEPRECATED +#endif + +#ifndef JXL_DEPRECATED_NO_EXPORT +# define JXL_DEPRECATED_NO_EXPORT JXL_NO_EXPORT JXL_DEPRECATED +#endif + +/* NOLINTNEXTLINE(readability-avoid-unconditional-preprocessor-if) */ +#if 0 /* DEFINE_NO_DEPRECATED */ +# ifndef JXL_NO_DEPRECATED +# define JXL_NO_DEPRECATED +# endif +#endif + +#endif /* JXL_EXPORT_H */ diff --git a/external/libjxl/jxl_threads_export.h b/external/libjxl/jxl_threads_export.h new file mode 100644 index 000000000000..62a56e2846d0 --- /dev/null +++ b/external/libjxl/jxl_threads_export.h @@ -0,0 +1,43 @@ + +#ifndef JXL_THREADS_EXPORT_H +#define JXL_THREADS_EXPORT_H + +#ifdef JXL_THREADS_STATIC_DEFINE +# define JXL_THREADS_EXPORT +# define JXL_THREADS_NO_EXPORT +#else +# ifndef JXL_THREADS_EXPORT +# ifdef JXL_THREADS_INTERNAL_LIBRARY_BUILD + /* We are building this library */ +# define JXL_THREADS_EXPORT __attribute__((visibility("default"))) +# else + /* We are using this library */ +# define JXL_THREADS_EXPORT __attribute__((visibility("default"))) +# endif +# endif + +# ifndef JXL_THREADS_NO_EXPORT +# define JXL_THREADS_NO_EXPORT __attribute__((visibility("hidden"))) +# endif +#endif + +#ifndef JXL_THREADS_DEPRECATED +# define JXL_THREADS_DEPRECATED __attribute__ ((__deprecated__)) +#endif + +#ifndef JXL_THREADS_DEPRECATED_EXPORT +# define JXL_THREADS_DEPRECATED_EXPORT JXL_THREADS_EXPORT JXL_THREADS_DEPRECATED +#endif + +#ifndef JXL_THREADS_DEPRECATED_NO_EXPORT +# define JXL_THREADS_DEPRECATED_NO_EXPORT JXL_THREADS_NO_EXPORT JXL_THREADS_DEPRECATED +#endif + +/* NOLINTNEXTLINE(readability-avoid-unconditional-preprocessor-if) */ +#if 0 /* DEFINE_NO_DEPRECATED */ +# ifndef JXL_THREADS_NO_DEPRECATED +# define JXL_THREADS_NO_DEPRECATED +# endif +#endif + +#endif /* JXL_THREADS_EXPORT_H */ diff --git a/external/libjxl/version.h b/external/libjxl/version.h new file mode 100644 index 000000000000..6689bd1f60f3 --- /dev/null +++ b/external/libjxl/version.h @@ -0,0 +1,44 @@ +/* Copyright (c) the JPEG XL Project Authors. All rights reserved. + * + * Use of this source code is governed by a BSD-style + * license that can be found in the LICENSE file. + */ + +/** @addtogroup libjxl_common + * @{ + * @file version.h + * @brief libjxl version information + */ + +#ifndef JXL_VERSION_H_ +#define JXL_VERSION_H_ + +#if defined(JPEGXL_MAJOR_VERSION) || defined(JPEGXL_MINOR_VERSION) || \ + defined(JPEGXL_PATCH_VERSION) +#error JPEGXL_VERSION is already defined +#endif + +#define JPEGXL_MAJOR_VERSION 0 ///< JPEG XL Major version +#define JPEGXL_MINOR_VERSION 11 ///< JPEG XL Minor version +#define JPEGXL_PATCH_VERSION 2 ///< JPEG XL Patch version + +/** Can be used to conditionally compile code for a specific JXL version + * @param[maj] major version + * @param[min] minor version + * + * @code + * #if JPEGXL_NUMERIC_VERSION < JPEGXL_COMPUTE_NUMERIC_VERSION(0,8,0) + * // use old/deprecated api + * #else + * // use current api + * #endif + * @endcode + */ +#define JPEGXL_COMPUTE_NUMERIC_VERSION(major,minor,patch) (((major)<<24) | ((minor)<<16) | ((patch)<<8) | 0) + +/* Numeric representation of the version */ +#define JPEGXL_NUMERIC_VERSION JPEGXL_COMPUTE_NUMERIC_VERSION(JPEGXL_MAJOR_VERSION, JPEGXL_MINOR_VERSION, JPEGXL_PATCH_VERSION) + +#endif /* JXL_VERSION_H_ */ + +/** @}*/ diff --git a/external/libjxl/windows-compile-directives.patch.0 b/external/libjxl/windows-compile-directives.patch.0 new file mode 100644 index 000000000000..9f7d640cc145 --- /dev/null +++ b/external/libjxl/windows-compile-directives.patch.0 @@ -0,0 +1,81 @@ +--- lib/include/jxl/jxl_cms_export.h 2026-08-21 18:50:38.834365872 +0200 ++++ lib/include/jxl/jxl_cms_export.h 2026-08-21 18:50:38.834365872 +0200 +@@ -9,20 +9,20 @@ + # ifndef JXL_CMS_EXPORT + # ifdef jxl_cms_EXPORTS + /* We are building this library */ +-# define JXL_CMS_EXPORT __attribute__((visibility("default"))) ++# define JXL_CMS_EXPORT __declspec(dllexport) + # else + /* We are using this library */ +-# define JXL_CMS_EXPORT __attribute__((visibility("default"))) ++# define JXL_CMS_EXPORT __declspec(dllimport) + # endif + # endif + + # ifndef JXL_CMS_NO_EXPORT +-# define JXL_CMS_NO_EXPORT __attribute__((visibility("hidden"))) ++# define JXL_CMS_NO_EXPORT + # endif + #endif + + #ifndef JXL_CMS_DEPRECATED +-# define JXL_CMS_DEPRECATED __attribute__ ((__deprecated__)) ++# define JXL_CMS_DEPRECATED __declspec(deprecated) + #endif + + #ifndef JXL_CMS_DEPRECATED_EXPORT +--- lib/include/jxl/jxl_export.h 2026-08-21 18:50:38.834365872 +0200 ++++ lib/include/jxl/jxl_export.h 2026-08-21 18:50:38.834365872 +0200 +@@ -9,20 +9,20 @@ + # ifndef JXL_EXPORT + # ifdef JXL_INTERNAL_LIBRARY_BUILD + /* We are building this library */ +-# define JXL_EXPORT __attribute__((visibility("default"))) ++# define JXL_EXPORT __declspec(dllexport) + # else + /* We are using this library */ +-# define JXL_EXPORT __attribute__((visibility("default"))) ++# define JXL_EXPORT __declspec(dllimport) + # endif + # endif + + # ifndef JXL_NO_EXPORT +-# define JXL_NO_EXPORT __attribute__((visibility("hidden"))) ++# define JXL_NO_EXPORT + # endif + #endif + + #ifndef JXL_DEPRECATED +-# define JXL_DEPRECATED __attribute__ ((__deprecated__)) ++# define JXL_DEPRECATED __declspec(deprecated) + #endif + + #ifndef JXL_DEPRECATED_EXPORT +--- lib/include/jxl/jxl_threads_export.h 2026-08-21 18:50:38.834365872 +0200 ++++ lib/include/jxl/jxl_threads_export.h 2026-08-21 18:50:38.834365872 +0200 +@@ -9,20 +9,20 @@ + # ifndef JXL_THREADS_EXPORT + # ifdef JXL_THREADS_INTERNAL_LIBRARY_BUILD + /* We are building this library */ +-# define JXL_THREADS_EXPORT __attribute__((visibility("default"))) ++# define JXL_THREADS_EXPORT __declspec(dllexport) + # else + /* We are using this library */ +-# define JXL_THREADS_EXPORT __attribute__((visibility("default"))) ++# define JXL_THREADS_EXPORT __declspec(dllimport) + # endif + # endif + + # ifndef JXL_THREADS_NO_EXPORT +-# define JXL_THREADS_NO_EXPORT __attribute__((visibility("hidden"))) ++# define JXL_THREADS_NO_EXPORT + # endif + #endif + + #ifndef JXL_THREADS_DEPRECATED +-# define JXL_THREADS_DEPRECATED __attribute__ ((__deprecated__)) ++# define JXL_THREADS_DEPRECATED __declspec(deprecated) + #endif + + #ifndef JXL_THREADS_DEPRECATED_EXPORT diff --git a/readlicense_oo/license/license.xml b/readlicense_oo/license/license.xml index 549eedb092cc..b69871464dd7 100644 --- a/readlicense_oo/license/license.xml +++ b/readlicense_oo/license/license.xml @@ -1174,6 +1174,36 @@
  • This notice may not be removed or altered from any source distribution.
  • +
    +

    libjxl

    +

    The following software may be included in this product: libjxl. libjxl + is licensed under the BSD 3-Clause License.

    +

    BSD 3-Clause License

    +

    Copyright (c) the JPEG XL Project Authors.

    +

    All rights reserved.

    +

    Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met:

    +
      +
    1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer.
    2. +
    3. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution.
    4. +
    5. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission.
    6. +
    +

    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

    +

    liblangtag

    The following software may be included in this product: liblangtag. Use of any of this software is governed diff --git a/solenv/clang-format/excludelist b/solenv/clang-format/excludelist index a7a2557cc48a..cdde184cad5b 100644 --- a/solenv/clang-format/excludelist +++ b/solenv/clang-format/excludelist @@ -3626,6 +3626,10 @@ external/fontconfig/configs/wnt_fontconfig_fcstdint.h external/libjpeg-turbo/jconfig.h external/libjpeg-turbo/jconfigint.h external/libjpeg-turbo/jversion.h +external/libjxl/jxl_cms_export.h +external/libjxl/jxl_export.h +external/libjxl/jxl_threads_export.h +external/libjxl/version.h external/mariadb-connector-c/configs/linux_my_config.h external/mariadb-connector-c/configs/mac_my_config.h external/mariadb-connector-c/configs/mariadb_version.h