Accepting request 991738 from home:gmbr3:Chromium

To be used by libavif

OBS-URL: https://build.opensuse.org/request/show/991738
OBS-URL: https://build.opensuse.org/package/show/multimedia:libs/libyuv?expand=0&rev=1
This commit is contained in:
Takashi Iwai 2022-08-01 07:33:24 +00:00 committed by Git OBS Bridge
commit 123eb53ee0
14 changed files with 323 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.osc

View File

@ -0,0 +1,39 @@
From: Peter Lemenkov <lemenkov@gmail.com>
Date: Mon, 24 Sep 2018 15:08:45 +0200
Subject: [PATCH] Disable static library
Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
diff --git a/CMakeLists.txt b/CMakeLists.txt
index bff03e88..1832ad42 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -11,7 +11,6 @@ SET ( ly_src_dir ${ly_base_dir}/source )
SET ( ly_inc_dir ${ly_base_dir}/include )
SET ( ly_tst_dir ${ly_base_dir}/unit_test )
SET ( ly_lib_name yuv )
-SET ( ly_lib_static ${ly_lib_name} )
SET ( ly_lib_shared ${ly_lib_name}_shared )
FILE ( GLOB_RECURSE ly_source_files ${ly_src_dir}/*.cc )
@@ -22,9 +21,6 @@ LIST ( SORT ly_unittest_sources )
INCLUDE_DIRECTORIES( BEFORE ${ly_inc_dir} )
-# this creates the static library (.a)
-ADD_LIBRARY ( ${ly_lib_static} STATIC ${ly_source_files} )
-
# this creates the shared library (.so)
ADD_LIBRARY ( ${ly_lib_shared} SHARED ${ly_source_files} )
SET_TARGET_PROPERTIES ( ${ly_lib_shared} PROPERTIES OUTPUT_NAME "${ly_lib_name}" )
@@ -82,9 +78,8 @@ if(TEST)
endif()
-# install the conversion tool, .so, .a, and all the header files
+# install the conversion tool, .so, and all the header files
INSTALL ( PROGRAMS ${CMAKE_BINARY_DIR}/yuvconvert DESTINATION bin )
-INSTALL ( TARGETS ${ly_lib_static} DESTINATION lib )
INSTALL ( TARGETS ${ly_lib_shared} LIBRARY DESTINATION lib RUNTIME DESTINATION bin )
INSTALL ( DIRECTORY ${PROJECT_SOURCE_DIR}/include/ DESTINATION include )

View File

@ -0,0 +1,38 @@
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" )
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_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,28 @@
From: Peter Lemenkov <lemenkov@gmail.com>
Date: Fri, 21 Sep 2018 12:47:42 +0200
Subject: [PATCH] Link against shared library
Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
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
# 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} )
INCLUDE ( FindJPEG )
@@ -61,7 +61,7 @@ if(TEST)
endif()
add_executable(libyuv_unittest ${ly_unittest_sources})
- target_link_libraries(libyuv_unittest ${ly_lib_name} ${GTEST_LIBRARY})
+ target_link_libraries(libyuv_unittest ${ly_lib_shared} ${GTEST_LIBRARY})
find_library(PTHREAD_LIBRARY pthread)
if(NOT PTHREAD_LIBRARY STREQUAL "PTHREAD_LIBRARY-NOTFOUND")
target_link_libraries(libyuv_unittest pthread)

View File

@ -0,0 +1,18 @@
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

@ -0,0 +1,19 @@
From: Peter Lemenkov <lemenkov@gmail.com>
Date: Fri, 21 Sep 2018 12:45:55 +0200
Subject: [PATCH] Use a proper so-version
Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ed4948f0..e1f87062 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -30,6 +30,8 @@ ADD_LIBRARY ( ${ly_lib_shared} SHARED ${ly_source_files} )
SET_TARGET_PROPERTIES ( ${ly_lib_shared} PROPERTIES OUTPUT_NAME "${ly_lib_name}" )
SET_TARGET_PROPERTIES ( ${ly_lib_shared} PROPERTIES PREFIX "lib" )
+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} )

View File

@ -0,0 +1,19 @@
From: Peter Lemenkov <lemenkov@gmail.com>
Date: Mon, 24 Sep 2018 15:15:09 +0200
Subject: [PATCH] Use library suffix during installation
Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
diff --git a/CMakeLists.txt b/CMakeLists.txt
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 ( DIRECTORY ${PROJECT_SOURCE_DIR}/include/ DESTINATION include )
# create the .deb and .rpm packages using cpack

15
_service Normal file
View File

@ -0,0 +1,15 @@
<services>
<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">d248929c059ff7629a85333699717d7a677d8d96</param>
<param name="versionformat">%cd+%h</param>
<param name="changesgenerate">enable</param>
</service>
<service name="tar" mode="buildtime"/>
<service name="recompress" mode="buildtime">
<param name="compression">xz</param>
<param name="file">*.tar</param>
</service>
<service name="set_version" mode="manual"/>
</services>

4
_servicedata Normal file
View File

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

View File

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

12
libyuv.changes Normal file
View File

@ -0,0 +1,12 @@
-------------------------------------------------------------------
Fri Jul 29 16:35:26 UTC 2022 - Callum Farmer <gmbr3@opensuse.org>
- Initial packaging version 20220713+d248929c
- Add required patches:
* Use-a-proper-so-version.patch
* Link-against-shared-library.patch
* Disable-static-library.patch
* Don-t-install-conversion-tool.patch
* Use-library-suffix-during-installation.patch
* Link-main-library-against-libjpeg.patch

4
libyuv.obsinfo Normal file
View File

@ -0,0 +1,4 @@
name: libyuv
version: 20220713+d248929c
mtime: 1657710509
commit: d248929c059ff7629a85333699717d7a677d8d96

100
libyuv.spec Normal file
View File

@ -0,0 +1,100 @@
#
# spec file for package libyuv
#
# Copyright (c) 2022 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
Name: libyuv
Version: 20220713+d248929c
Release: 0
Summary: YUV scaling and conversion library
License: BSD-3-Clause
Group: Productivity/Multimedia/Other
URL: https://chromium.googlesource.com/libyuv/libyuv/
Source0: %{name}-%{version}.tar.xz
# from Fedora
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
Patch4: Use-library-suffix-during-installation.patch
Patch5: Link-main-library-against-libjpeg.patch
BuildRequires: gcc-c++
BuildRequires: cmake
BuildRequires: pkgconfig
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.
%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.
%package devel
Summary: Development files for the YUV scaling and conversion library
Group: Development/Libraries/C and C++
Requires: libyuv0 = %{version}
%description devel
This package contains the development files
for the YUV scaling and conversion library
%prep
%autosetup -p1
%build
rversion=`grep --perl-regex --only-matching "(?<=LIBYUV_VERSION )[0-9]+" include/libyuv/version.h`
cat > %{name}.pc << EOF
prefix=%{_prefix}
exec_prefix=${prefix}
libdir=%{_libdir}
includedir=%{_includedir}
Name: %{name}
Description: %{summary}
Version: ${rversion}
Libs: -lyuv
EOF
%cmake
%cmake_build
%install
%cmake_install
install -Dm0644 %{name}.pc %{buildroot}%{_libdir}/pkgconfig/%{name}.pc
%ldconfig_scriptlets -n libyuv0
%files -n libyuv0
%{_libdir}/libyuv.so.*
%files devel
%license LICENSE
%{_libdir}/libyuv.so
%{_includedir}/%{name}
%{_includedir}/%{name}.h
%{_libdir}/pkgconfig/%{name}.pc
%changelog