[neon/backports-jammy/libjxl-jammy/Neon/release] debian: d/patches: Transition to hwy config cmake files

Mathieu Malaterre null at kde.org
Mon Feb 6 00:28:54 GMT 2023


Git commit d5e9a5f19ead9dd70756fc0451a3309eee1cee08 by Mathieu Malaterre.
Committed on 02/02/2023 at 07:36.
Pushed by carlosdem into branch 'Neon/release'.

d/patches: Transition to hwy config cmake files

M  +1    -1    debian/control
M  +1    -1    debian/control.in
A  +137  -0    debian/patches/hwy.patch
M  +1    -0    debian/patches/series

https://invent.kde.org/neon/backports-jammy/libjxl-jammy/commit/d5e9a5f19ead9dd70756fc0451a3309eee1cee08

diff --git a/debian/control b/debian/control
index ca93aea..218a844 100644
--- a/debian/control
+++ b/debian/control
@@ -17,7 +17,7 @@ Build-Depends: asciidoc-base,
                libgmock-dev <!nocheck>,
                libgoogle-perftools-dev [amd64 arm64 armel armhf i386 mips64el mipsel ppc64el s390x kfreebsd-amd64 kfreebsd-i386 powerpc ppc64 riscv64],
                libgtest-dev <!nocheck>,
-               libhwy-dev (>= 1.0.2),
+               libhwy-dev (>= 1.0.3),
                libjpeg-dev,
                libjxl-testdata (>= 0.0~git20221128.81c7e52) <!nocheck>,
                liblcms-dev | liblcms2-dev (>= 2.13),
diff --git a/debian/control.in b/debian/control.in
index 3d70bda..a121828 100644
--- a/debian/control.in
+++ b/debian/control.in
@@ -17,7 +17,7 @@ Build-Depends: asciidoc-base,
                libgmock-dev <!nocheck>,
                libgoogle-perftools-dev [@TCMALLOC_ARCHS@],
                libgtest-dev <!nocheck>,
-               libhwy-dev (>= 1.0.2),
+               libhwy-dev (>= 1.0.3),
                libjpeg-dev,
                libjxl-testdata (>= 0.0~git20221128.81c7e52) <!nocheck>,
                liblcms-dev | liblcms2-dev (>= 2.13),
diff --git a/debian/patches/hwy.patch b/debian/patches/hwy.patch
new file mode 100644
index 0000000..4305e0f
--- /dev/null
+++ b/debian/patches/hwy.patch
@@ -0,0 +1,137 @@
+Description: Transition to hwy config.cmake
+Author: Mathieu Malaterre <malat at debian.org>
+Forwarded: no
+Last-Update: 2023-02-01
+
+Index: libjxl/third_party/CMakeLists.txt
+===================================================================
+--- libjxl.orig/third_party/CMakeLists.txt
++++ libjxl/third_party/CMakeLists.txt
+@@ -30,7 +30,7 @@ if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/
+   configure_file("${CMAKE_CURRENT_SOURCE_DIR}/highway/LICENSE"
+                  ${PROJECT_BINARY_DIR}/LICENSE.highway COPYONLY)
+ else()
+-  find_package(HWY 0.15.0)
++  find_package(HWY 1.0.0)
+   if (NOT HWY_FOUND)
+     message(FATAL_ERROR
+         "Highway library (hwy) not found. Install libhwy-dev or download it "
+Index: libjxl/lib/jxl.cmake
+===================================================================
+--- libjxl.orig/lib/jxl.cmake
++++ libjxl/lib/jxl.cmake
+@@ -408,7 +408,7 @@ set_property(TARGET jxl_dec-obj PROPERTY
+ target_include_directories(jxl_dec-obj PUBLIC
+   "$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}>"
+   "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
+-  "$<BUILD_INTERFACE:$<TARGET_PROPERTY:hwy,INTERFACE_INCLUDE_DIRECTORIES>>"
++  "$<BUILD_INTERFACE:$<TARGET_PROPERTY:hwy::hwy,INTERFACE_INCLUDE_DIRECTORIES>>"
+   "$<BUILD_INTERFACE:$<TARGET_PROPERTY:brotlicommon-static,INTERFACE_INCLUDE_DIRECTORIES>>"
+ )
+ target_compile_definitions(jxl_dec-obj PUBLIC
+@@ -426,7 +426,7 @@ set_property(TARGET jxl_enc-obj PROPERTY
+ target_include_directories(jxl_enc-obj PUBLIC
+   ${PROJECT_SOURCE_DIR}
+   ${CMAKE_CURRENT_SOURCE_DIR}/include
+-  $<TARGET_PROPERTY:hwy,INTERFACE_INCLUDE_DIRECTORIES>
++  $<TARGET_PROPERTY:hwy::hwy,INTERFACE_INCLUDE_DIRECTORIES>
+   $<TARGET_PROPERTY:brotlicommon-static,INTERFACE_INCLUDE_DIRECTORIES>
+ )
+ target_compile_definitions(jxl_enc-obj PUBLIC
+Index: libjxl/lib/jxl_extras.cmake
+===================================================================
+--- libjxl.orig/lib/jxl_extras.cmake
++++ libjxl/lib/jxl_extras.cmake
+@@ -77,7 +77,7 @@ target_include_directories(jxl_extras_co
+   ${PROJECT_SOURCE_DIR}
+   ${CMAKE_CURRENT_SOURCE_DIR}/include
+   ${CMAKE_CURRENT_BINARY_DIR}/include
+-  $<TARGET_PROPERTY:hwy,INTERFACE_INCLUDE_DIRECTORIES>
++  $<TARGET_PROPERTY:hwy::hwy,INTERFACE_INCLUDE_DIRECTORIES>
+ )
+ set(JXL_EXTRAS_CODEC_INTERNAL_LIBRARIES)
+ set(JXL_EXTRAS_CODEC_PUBLIC_COMPILE_DEFINITIONS)
+Index: libjxl/CMakeLists.txt
+===================================================================
+--- libjxl.orig/CMakeLists.txt
++++ libjxl/CMakeLists.txt
+@@ -22,6 +22,8 @@ if(POLICY CMP0083)
+ endif()
+ 
+ project(LIBJXL LANGUAGES C CXX)
++# Make sure HWY variable are at top-level:
++find_package(HWY 1.0.0 REQUIRED)
+ 
+ include(CheckCXXSourceCompiles)
+ check_cxx_source_compiles(
+Index: libjxl/cmake/FindHWY.cmake
+===================================================================
+--- libjxl.orig/cmake/FindHWY.cmake
++++ /dev/null
+@@ -1,66 +0,0 @@
+-# 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.
+-
+-find_package(PkgConfig QUIET)
+-if (PkgConfig_FOUND)
+-  pkg_check_modules(PC_HWY QUIET libhwy)
+-  set(HWY_VERSION ${PC_HWY_VERSION})
+-endif ()
+-
+-find_path(HWY_INCLUDE_DIR
+-  NAMES hwy/highway.h
+-  HINTS ${PC_HWY_INCLUDEDIR} ${PC_HWY_INCLUDE_DIRS}
+-)
+-
+-find_library(HWY_LIBRARY
+-  NAMES ${HWY_NAMES} hwy
+-  HINTS ${PC_HWY_LIBDIR} ${PC_HWY_LIBRARY_DIRS}
+-)
+-
+-if (HWY_INCLUDE_DIR AND NOT HWY_VERSION)
+-  if (EXISTS "${HWY_INCLUDE_DIR}/hwy/highway.h")
+-    file(READ "${HWY_INCLUDE_DIR}/hwy/highway.h" HWY_VERSION_CONTENT)
+-
+-    string(REGEX MATCH "#define HWY_MAJOR +([0-9]+)" _dummy "${HWY_VERSION_CONTENT}")
+-    set(HWY_VERSION_MAJOR "${CMAKE_MATCH_1}")
+-
+-    string(REGEX MATCH "#define +HWY_MINOR +([0-9]+)" _dummy "${HWY_VERSION_CONTENT}")
+-    set(HWY_VERSION_MINOR "${CMAKE_MATCH_1}")
+-
+-    string(REGEX MATCH "#define +HWY_PATCH +([0-9]+)" _dummy "${HWY_VERSION_CONTENT}")
+-    set(HWY_VERSION_PATCH "${CMAKE_MATCH_1}")
+-
+-    set(HWY_VERSION "${HWY_VERSION_MAJOR}.${HWY_VERSION_MINOR}.${HWY_VERSION_PATCH}")
+-  endif ()
+-endif ()
+-
+-include(FindPackageHandleStandardArgs)
+-find_package_handle_standard_args(HWY
+-  FOUND_VAR HWY_FOUND
+-  REQUIRED_VARS HWY_LIBRARY HWY_INCLUDE_DIR
+-  VERSION_VAR HWY_VERSION
+-)
+-
+-if (HWY_LIBRARY AND NOT TARGET hwy)
+-  add_library(hwy INTERFACE IMPORTED GLOBAL)
+-
+-  if(CMAKE_VERSION VERSION_LESS "3.13.5")
+-    set_property(TARGET hwy PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${HWY_INCLUDE_DIR})
+-    target_link_libraries(hwy INTERFACE ${HWY_LIBRARY})
+-    set_property(TARGET hwy PROPERTY INTERFACE_COMPILE_OPTIONS ${PC_HWY_CFLAGS_OTHER})
+-  else()
+-    target_include_directories(hwy INTERFACE ${HWY_INCLUDE_DIR})
+-    target_link_libraries(hwy INTERFACE ${HWY_LIBRARY})
+-    target_link_options(hwy INTERFACE ${PC_HWY_LDFLAGS_OTHER})
+-    target_compile_options(hwy INTERFACE ${PC_HWY_CFLAGS_OTHER})
+-  endif()
+-endif()
+-
+-mark_as_advanced(HWY_INCLUDE_DIR HWY_LIBRARY)
+-
+-if (HWY_FOUND)
+-    set(HWY_LIBRARIES ${HWY_LIBRARY})
+-    set(HWY_INCLUDE_DIRS ${HWY_INCLUDE_DIR})
+-endif ()
diff --git a/debian/patches/series b/debian/patches/series
index 8b33905..8dbdbae 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -4,3 +4,4 @@ roundtriplargefast.patch
 de08116d14db785431f3efb651dcf2af15bbb682.patch
 1a36db0bf452a2232f0a15d7d8edb542e8196401.patch
 manpages.patch
+hwy.patch



More information about the Neon-commits mailing list