Accepting request 1088432 from multimedia:libs

- Trim redundancies and compact descriptions.
- 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

OBS-URL: https://build.opensuse.org/request/show/1088432
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libyuv?expand=0&rev=6
This commit is contained in:
Dominique Leuenberger 2023-05-23 12:53:35 +00:00 committed by Git OBS Bridge
commit 8e80d7f7e0
14 changed files with 174 additions and 92 deletions

View File

@ -1,38 +0,0 @@
From: Peter Lemenkov <lemenkov@gmail.com>
Date: Mon, 24 Sep 2018 15:10:16 +0200
Subject: [PATCH] Don't install conversion tool
Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
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

View File

@ -0,0 +1,20 @@
From: Boyuan Yang <byang@debian.org>
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 )

View File

@ -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()

View File

@ -1,18 +0,0 @@
From: Peter Lemenkov <lemenkov@gmail.com>
Date: Wed, 17 Apr 2019 12:39:42 +0300
Subject: [PATCH] Link main library against libjpeg
Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
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()

View File

@ -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

View File

@ -2,7 +2,7 @@
<service name="obs_scm" mode="manual">
<param name="scm">git</param>
<param name="url">https://chromium.googlesource.com/libyuv/libyuv.git</param>
<param name="revision">f9fda6e7d819c07a684ba6bc97cbf0e257bbcb37</param>
<param name="revision">a37799344d29dc8e4d3fb00ced5f07e5ce8bf1b9</param>
<param name="versionformat">%cd+%h</param>
<param name="changesgenerate">enable</param>
</service>

View File

@ -1,4 +1,4 @@
<servicedata>
<service name="tar_scm">
<param name="url">https://chromium.googlesource.com/libyuv/libyuv.git</param>
<param name="changesrevision">f9fda6e7d819c07a684ba6bc97cbf0e257bbcb37</param></service></servicedata>
<param name="changesrevision">a37799344d29dc8e4d3fb00ced5f07e5ce8bf1b9</param></service></servicedata>

View File

@ -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} )

View File

@ -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) \

BIN
libyuv-20220920+f9fda6e.obscpio (Stored with Git LFS)

Binary file not shown.

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:d7f06963c93e460d1d4f46d356df98aff8773a645fc4d9c81f65f5f35667183c
size 5628429

View File

@ -1,3 +1,33 @@
-------------------------------------------------------------------
Mon May 22 13:35:51 UTC 2023 - Jan Engelhardt <jengelh@inai.de>
- Trim redundancies and compact descriptions.
-------------------------------------------------------------------
Sun May 21 13:13:13 UTC 2023 - Bruno Pitrus <brunopitrus@hotmail.com>
- 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

View File

@ -1,4 +1,4 @@
name: libyuv
version: 20220920+f9fda6e
mtime: 1663715273
commit: f9fda6e7d819c07a684ba6bc97cbf0e257bbcb37
version: 20230517+a377993
mtime: 1684283004
commit: a37799344d29dc8e4d3fb00ced5f07e5ce8bf1b9

View File

@ -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