From adb45f710bbbbcf8af351c7deec0c3bfae302c2a442033c1293afd0dfb50ddca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Thu, 20 Feb 2025 09:48:47 +0100 Subject: [PATCH] Sync from SUSE:SLFO:Main libyuv revision 5c821714ce95bdffd36c5b8fe58dc7a2 --- Don-t-install-conversion-tool.patch | 38 ------------ Install-missing-yuvconstants-binary.patch | 20 +++++++ Link-against-shared-library.patch | 11 +++- Link-main-library-against-libjpeg.patch | 18 ------ Use-library-suffix-during-installation.patch | 10 ++-- _service | 2 +- _servicedata | 2 +- cmake-minimum-required.patch | 18 ++++++ convert_test-little-endian.patch | 44 ++++++++++++++ libyuv-20220920+f9fda6e.obscpio | 3 - libyuv-20230517+a377993.obscpio | 3 + libyuv.changes | 30 ++++++++++ libyuv.obsinfo | 6 +- libyuv.spec | 61 +++++++++++++------- 14 files changed, 174 insertions(+), 92 deletions(-) delete mode 100644 Don-t-install-conversion-tool.patch create mode 100644 Install-missing-yuvconstants-binary.patch delete mode 100644 Link-main-library-against-libjpeg.patch create mode 100644 cmake-minimum-required.patch create mode 100644 convert_test-little-endian.patch delete mode 100644 libyuv-20220920+f9fda6e.obscpio create mode 100644 libyuv-20230517+a377993.obscpio diff --git a/Don-t-install-conversion-tool.patch b/Don-t-install-conversion-tool.patch deleted file mode 100644 index b32c02c..0000000 --- a/Don-t-install-conversion-tool.patch +++ /dev/null @@ -1,38 +0,0 @@ -From: Peter Lemenkov -Date: Mon, 24 Sep 2018 15:10:16 +0200 -Subject: [PATCH] Don't install conversion tool - -Signed-off-by: Peter Lemenkov - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 1832ad42..854aea7f 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -28,15 +28,9 @@ SET_TARGET_PROPERTIES ( ${ly_lib_shared} PROPERTIES PREFIX "lib" ) - INCLUDE ( CM_linux_packages.cmake ) - SET_TARGET_PROPERTIES ( ${ly_lib_shared} PROPERTIES VERSION ${YUV_VERSION} SOVERSION ${YUV_VER_MAJOR} ) - --# this creates the conversion tool --ADD_EXECUTABLE ( yuvconvert ${ly_base_dir}/util/yuvconvert.cc ) --TARGET_LINK_LIBRARIES ( yuvconvert ${ly_lib_shared} ) -- -- - INCLUDE ( FindJPEG ) - if (JPEG_FOUND) - include_directories( ${JPEG_INCLUDE_DIR} ) -- target_link_libraries( yuvconvert ${JPEG_LIBRARY} ) - add_definitions( -DHAVE_JPEG ) - endif() - -@@ -78,9 +72,8 @@ if(TEST) - endif() - - --# install the conversion tool, .so, and all the header files --INSTALL ( PROGRAMS ${CMAKE_BINARY_DIR}/yuvconvert DESTINATION bin ) --INSTALL ( TARGETS ${ly_lib_shared} LIBRARY DESTINATION lib RUNTIME DESTINATION bin ) -+# install .so, and all the header files -+INSTALL ( TARGETS ${ly_lib_shared} LIBRARY DESTINATION lib ) - INSTALL ( DIRECTORY ${PROJECT_SOURCE_DIR}/include/ DESTINATION include ) - - # create the .deb and .rpm packages using cpack diff --git a/Install-missing-yuvconstants-binary.patch b/Install-missing-yuvconstants-binary.patch new file mode 100644 index 0000000..d62b23e --- /dev/null +++ b/Install-missing-yuvconstants-binary.patch @@ -0,0 +1,20 @@ +From: Boyuan Yang +Date: Tue, 18 Oct 2022 16:09:09 -0400 +Subject: CMakeLists.txt: Install missing yuvconstants binary + +--- + CMakeLists.txt | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index f9a7d74..346b729 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -97,6 +97,7 @@ endif() + + # install the conversion tool, .so, and all the header files + INSTALL ( PROGRAMS ${CMAKE_BINARY_DIR}/yuvconvert DESTINATION bin ) ++INSTALL ( PROGRAMS ${CMAKE_BINARY_DIR}/yuvconstants DESTINATION bin ) + INSTALL ( TARGETS ${ly_lib_shared} LIBRARY DESTINATION lib RUNTIME DESTINATION bin ) + INSTALL ( DIRECTORY ${PROJECT_SOURCE_DIR}/include/ DESTINATION include ) + diff --git a/Link-against-shared-library.patch b/Link-against-shared-library.patch index 96782d0..9016124 100644 --- a/Link-against-shared-library.patch +++ b/Link-against-shared-library.patch @@ -8,15 +8,20 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt index e1f87062..bff03e88 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -34,7 +34,7 @@ SET_TARGET_PROPERTIES ( ${ly_lib_shared} PROPERTIES VERSION "0.0.0" SOVERSION 0 +@@ -34,11 +34,11 @@ SET_TARGET_PROPERTIES ( ${ly_lib_shared} PROPERTIES VERSION "0.0.0" SOVERSION 0 # this creates the conversion tool ADD_EXECUTABLE ( yuvconvert ${ly_base_dir}/util/yuvconvert.cc ) -TARGET_LINK_LIBRARIES ( yuvconvert ${ly_lib_static} ) -+TARGET_LINK_LIBRARIES ( yuvconvert ${ly_lib_shared} ) ++TARGET_LINK_LIBRARIES ( yuvconvert PRIVATE ${ly_lib_shared} ) + # this creates the yuvconstants tool + ADD_EXECUTABLE ( yuvconstants ${ly_base_dir}/util/yuvconstants.c ) +-TARGET_LINK_LIBRARIES ( yuvconstants ${ly_lib_static} ) ++TARGET_LINK_LIBRARIES ( yuvconstants PRIVATE ${ly_lib_shared} -lm ) - INCLUDE ( FindJPEG ) + find_package ( JPEG ) + if (JPEG_FOUND) @@ -61,7 +61,7 @@ if(TEST) endif() diff --git a/Link-main-library-against-libjpeg.patch b/Link-main-library-against-libjpeg.patch deleted file mode 100644 index 47f0a56..0000000 --- a/Link-main-library-against-libjpeg.patch +++ /dev/null @@ -1,18 +0,0 @@ -From: Peter Lemenkov -Date: Wed, 17 Apr 2019 12:39:42 +0300 -Subject: [PATCH] Link main library against libjpeg - -Signed-off-by: Peter Lemenkov - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index eb12ab4f..856cc975 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -31,6 +31,7 @@ SET_TARGET_PROPERTIES ( ${ly_lib_shared} PROPERTIES VERSION "0.0.0" SOVERSION 0 - INCLUDE ( FindJPEG ) - if (JPEG_FOUND) - include_directories( ${JPEG_INCLUDE_DIR} ) -+ target_link_libraries( ${ly_lib_shared} ${JPEG_LIBRARY} ) - add_definitions( -DHAVE_JPEG ) - endif() - diff --git a/Use-library-suffix-during-installation.patch b/Use-library-suffix-during-installation.patch index 2da9775..68c72c1 100644 --- a/Use-library-suffix-during-installation.patch +++ b/Use-library-suffix-during-installation.patch @@ -9,11 +9,11 @@ index 854aea7f..eb12ab4f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -73,7 +73,7 @@ endif() - - - # install .so, and all the header files --INSTALL ( TARGETS ${ly_lib_shared} LIBRARY DESTINATION lib ) -+INSTALL ( TARGETS ${ly_lib_shared} LIBRARY DESTINATION lib${LIB_SUFFIX} ) + # install the conversion tool, .so, and all the header files + INSTALL ( PROGRAMS ${CMAKE_BINARY_DIR}/yuvconvert DESTINATION bin ) + INSTALL ( PROGRAMS ${CMAKE_BINARY_DIR}/yuvconstants DESTINATION bin ) +-INSTALL ( TARGETS ${ly_lib_shared} LIBRARY DESTINATION lib RUNTIME DESTINATION bin ) ++INSTALL ( TARGETS ${ly_lib_shared} LIBRARY DESTINATION lib${LIB_SUFFIX} RUNTIME DESTINATION bin ) INSTALL ( DIRECTORY ${PROJECT_SOURCE_DIR}/include/ DESTINATION include ) # create the .deb and .rpm packages using cpack diff --git a/_service b/_service index e69a5fa..976a138 100644 --- a/_service +++ b/_service @@ -2,7 +2,7 @@ git https://chromium.googlesource.com/libyuv/libyuv.git - f9fda6e7d819c07a684ba6bc97cbf0e257bbcb37 + a37799344d29dc8e4d3fb00ced5f07e5ce8bf1b9 %cd+%h enable diff --git a/_servicedata b/_servicedata index 856d8d7..ca3846d 100644 --- a/_servicedata +++ b/_servicedata @@ -1,4 +1,4 @@ https://chromium.googlesource.com/libyuv/libyuv.git - f9fda6e7d819c07a684ba6bc97cbf0e257bbcb37 \ No newline at end of file + a37799344d29dc8e4d3fb00ced5f07e5ce8bf1b9 \ No newline at end of file diff --git a/cmake-minimum-required.patch b/cmake-minimum-required.patch new file mode 100644 index 0000000..6476ae7 --- /dev/null +++ b/cmake-minimum-required.patch @@ -0,0 +1,18 @@ +Old cmake versions had bugs when linking executables +(namely incorrectly adding -rdynamic on commandline) +This adds runtime bloat and is bad packaging practice. +Cmake defaults to this buggy behaviour for compatibility reasons +if the script claims it is written for an old version. + +--- libyuv-20230517+a377993/CMakeLists.txt.old 2023-05-17 02:23:24.000000000 +0200 ++++ libyuv-20230517+a377993/CMakeLists.txt 2023-05-21 00:13:39.072391800 +0200 +@@ -2,8 +2,8 @@ + # Originally created for "roxlu build system" to compile libyuv on windows + # Run with -DTEST=ON to build unit tests + ++CMAKE_MINIMUM_REQUIRED( VERSION 3.7.1 ) + PROJECT ( YUV C CXX ) # "C" is required even for C++ projects +-CMAKE_MINIMUM_REQUIRED( VERSION 2.8.12 ) + OPTION( UNIT_TEST "Built unit tests" OFF ) + + SET ( ly_base_dir ${PROJECT_SOURCE_DIR} ) diff --git a/convert_test-little-endian.patch b/convert_test-little-endian.patch new file mode 100644 index 0000000..f811d12 --- /dev/null +++ b/convert_test-little-endian.patch @@ -0,0 +1,44 @@ +Correctly check for endianness and disable two additional tests that assume endianness + +--- libyuv-20230517+a377993/unit_test/convert_test.cc.old 2023-05-17 00:23:24.000000000 +0000 ++++ libyuv-20230517+a377993/unit_test/convert_test.cc 2023-05-21 13:08:30.803014700 +0000 +@@ -33,7 +33,7 @@ + + // Some functions fail on big endian. Enable these tests on all cpus except + // PowerPC, but they are not optimized so disabled by default. +-#if !defined(DISABLE_SLOW_TESTS) && !defined(__powerpc__) ++#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ + #define LITTLE_ENDIAN_ONLY_TEST 1 + #endif + #if !defined(DISABLE_SLOW_TESTS) || defined(__x86_64__) || defined(__i386__) +@@ -2989,6 +2989,7 @@ static const uint8_t kNoDither4x4[16] = + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }; + ++#ifdef LITTLE_ENDIAN_ONLY_TEST + TEST_F(LibYUVConvertTest, TestNoDither) { + align_buffer_page_end(src_argb, benchmark_width_ * benchmark_height_ * 4); + align_buffer_page_end(dst_rgb565, benchmark_width_ * benchmark_height_ * 2); +@@ -3010,12 +3011,14 @@ TEST_F(LibYUVConvertTest, TestNoDither) + free_aligned_buffer_page_end(dst_rgb565); + free_aligned_buffer_page_end(dst_rgb565dither); + } ++#endif + + // Ordered 4x4 dither for 888 to 565. Values from 0 to 7. + static const uint8_t kDither565_4x4[16] = { + 0, 4, 1, 5, 6, 2, 7, 3, 1, 5, 0, 4, 7, 3, 6, 2, + }; + ++#ifdef LITTLE_ENDIAN_ONLY_TEST + TEST_F(LibYUVConvertTest, TestDither) { + align_buffer_page_end(src_argb, benchmark_width_ * benchmark_height_ * 4); + align_buffer_page_end(dst_rgb565, benchmark_width_ * benchmark_height_ * 2); +@@ -3048,6 +3051,7 @@ TEST_F(LibYUVConvertTest, TestDither) { + free_aligned_buffer_page_end(dst_argb); + free_aligned_buffer_page_end(dst_argbdither); + } ++#endif + + #define TESTPLANARTOBID(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, BPP_B, ALIGN, \ + YALIGN, W1280, N, NEG, OFF, FMT_C, BPP_C) \ diff --git a/libyuv-20220920+f9fda6e.obscpio b/libyuv-20220920+f9fda6e.obscpio deleted file mode 100644 index 52c0622..0000000 --- a/libyuv-20220920+f9fda6e.obscpio +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ad6c8c237cc55401724e44de2464fcee7bf2c69bf04a1e76a22ad095c4f0c670 -size 5390861 diff --git a/libyuv-20230517+a377993.obscpio b/libyuv-20230517+a377993.obscpio new file mode 100644 index 0000000..b56ceae --- /dev/null +++ b/libyuv-20230517+a377993.obscpio @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d7f06963c93e460d1d4f46d356df98aff8773a645fc4d9c81f65f5f35667183c +size 5628429 diff --git a/libyuv.changes b/libyuv.changes index beb49f6..6112882 100644 --- a/libyuv.changes +++ b/libyuv.changes @@ -1,3 +1,33 @@ +------------------------------------------------------------------- +Mon May 22 13:35:51 UTC 2023 - Jan Engelhardt + +- Trim redundancies and compact descriptions. + +------------------------------------------------------------------- +Sun May 21 13:13:13 UTC 2023 - Bruno Pitrus + +- Update to snapshot 20230517+a377993: + * ARGBToI420Alpha function to convert ARGB to I420 with Alpha + * Enable I{422,444}AlphaToARGBRow_RVV & ARGBAttentuateRow_RVV + * Bump version and apply clang format + * Enable ARGBToYMatrixRow_RVV/RGBAToYMatrixRow_RVV/RGBToYMatrixRow_RVV + * Enable RVV if qemu is detected + * Add ARGBToRAWRow_RVV, ARGBToRGB24Row_RVV, RGB24ToARGBRow_RVV + * YUY2ToNV12 using YUY2ToY and YUY2ToNVUV + * Remove old cipd clobber gclient hook. + * Roll chromium_revision 004bde16df..28dca358ed (1051775:1052960) + * Roll chromium_revision 7d683aeda8..004bde16df (1050091:1051775) + * [code-health] Migrate presubmit to python3 + * Enable unlimited data for YUV to RGB + * Roll chromium_revision 829c6df33d..7d683aeda8 (945687:1050098th +- Add libyuv-tools package +- Run test suite in %check +- drop Don-t-install-conversion-tool.patch +- add Install-missing-yuvconstants-binary.patch +- add cmake-minimum-required.patch +- drop Link-main-library-against-libjpeg.patch applied upstream +- add convert_test-little-endian.patch + ------------------------------------------------------------------- Thu Oct 27 14:35:19 UTC 2022 - gmbr3@opensuse.org diff --git a/libyuv.obsinfo b/libyuv.obsinfo index 859a6b7..aeee00f 100644 --- a/libyuv.obsinfo +++ b/libyuv.obsinfo @@ -1,4 +1,4 @@ name: libyuv -version: 20220920+f9fda6e -mtime: 1663715273 -commit: f9fda6e7d819c07a684ba6bc97cbf0e257bbcb37 +version: 20230517+a377993 +mtime: 1684283004 +commit: a37799344d29dc8e4d3fb00ced5f07e5ce8bf1b9 diff --git a/libyuv.spec b/libyuv.spec index dd7015f..fa71f65 100644 --- a/libyuv.spec +++ b/libyuv.spec @@ -1,7 +1,7 @@ # # spec file for package libyuv # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,11 +17,11 @@ Name: libyuv -Version: 20220920+f9fda6e +Version: 20230517+a377993 Release: 0 Summary: YUV scaling and conversion library License: BSD-3-Clause -Group: Productivity/Multimedia/Other +Group: Productivity/Graphics/Other URL: https://chromium.googlesource.com/libyuv/libyuv/ Source0: %{name}-%{version}.tar.xz Source99: baselibs.conf @@ -29,39 +29,47 @@ Source99: baselibs.conf Patch0: Use-a-proper-so-version.patch Patch1: Link-against-shared-library.patch Patch2: Disable-static-library.patch -Patch3: Don-t-install-conversion-tool.patch +Patch3: Install-missing-yuvconstants-binary.patch Patch4: Use-library-suffix-during-installation.patch -Patch5: Link-main-library-against-libjpeg.patch +Patch5: cmake-minimum-required.patch +Patch6: convert_test-little-endian.patch BuildRequires: cmake BuildRequires: gcc-c++ BuildRequires: pkgconfig +BuildRequires: pkgconfig(gtest) BuildRequires: pkgconfig(libjpeg) %description -libyuv is an open source project that includes YUV scaling and conversion functionality. -- Scale YUV to prepare content for compression, with point, bilinear or box filter. -- Convert to YUV from webcam formats for compression. -- Convert to RGB formats for rendering/effects. -- Rotate by 90/180/270 degrees to adjust for mobile devices in portrait mode. -- Optimized for SSSE3/AVX2 on x86/x64. -- Optimized for Neon on Arm. -- Optimized for MSA on Mips. +libyuv is a project for YUV image scaling and conversion. It can +convert between RGB and YUV, scale images with point/bilinear/box +filter, rotate by 90/180/270°, and offers SSE/NEON/MSA acceleration. %package -n libyuv0 Summary: YUV scaling and conversion library Group: System/Libraries %description -n libyuv0 -libyuv is an open source project that includes YUV scaling and conversion functionality. +libyuv is a project for YUV image scaling and conversion. %package devel Summary: Development files for the YUV scaling and conversion library Group: Development/Libraries/C and C++ -Requires: libyuv0 = %{version} +Requires: libyuv0%{_isa} = %{version} %description devel This package contains the development files -for the YUV scaling and conversion library +for the YUV scaling and conversion library. + +%package tools +Summary: Command line utilities from libyuv +Group: Productivity/Graphics/Other + +%description tools +libyuv is a project for YUV image scaling and conversion. It can +convert between RGB and YUV, scale images with point/bilinear/box +filter, rotate by 90/180/270°, and offers SSE/NEON/MSA acceleration. + +This package contains the yuvconvert and yuvconstants commandline programs. %prep %autosetup -p1 @@ -74,21 +82,30 @@ exec_prefix=\${prefix} includedir=%{_includedir} libdir=%{_libdir} -Name: %{name} +Name: %{name} Description: %{summary} -Version: ${rversion} +Version: ${rversion} Libs: -lyuv EOF -%cmake +# Compile all unit tests, not only the default set. +export CFLAGS="%{optflags} -DENABLE_ROW_TESTS -DENABLE_FULL_TESTS" +export CXXFLAGS="$CFLAGS" + +OUR_CMAKE_FLAGS=' -DCMAKE_SKIP_RPATH:BOOL=ON ' #do not put bogus runpath in installed executables +OUR_CMAKE_FLAGS+=' -DUNIT_TEST:BOOL=ON ' +%cmake $OUR_CMAKE_FLAGS %cmake_build %install %cmake_install -install -Dm0644 %{name}.pc %{buildroot}%{_libdir}/pkgconfig/%{name}.pc +install -pDm0644 %{name}.pc %{buildroot}%{_libdir}/pkgconfig/%{name}.pc %ldconfig_scriptlets -n libyuv0 +%check +LD_LIBRARY_PATH=$PWD/build ./build/libyuv_unittest + %files -n libyuv0 %{_libdir}/libyuv.so.* @@ -99,4 +116,8 @@ install -Dm0644 %{name}.pc %{buildroot}%{_libdir}/pkgconfig/%{name}.pc %{_includedir}/%{name}.h %{_libdir}/pkgconfig/%{name}.pc +%files tools +%{_bindir}/yuvconvert +%{_bindir}/yuvconstants + %changelog