From 123eb53ee0f51e249b51039d1bd1a44ddeb52cdaea0b9722e443cccd4c0aa2b3 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Mon, 1 Aug 2022 07:33:24 +0000 Subject: [PATCH] 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 --- .gitattributes | 23 +++++ .gitignore | 1 + Disable-static-library.patch | 39 ++++++++ Don-t-install-conversion-tool.patch | 38 +++++++ Link-against-shared-library.patch | 28 ++++++ Link-main-library-against-libjpeg.patch | 18 ++++ Use-a-proper-so-version.patch | 19 ++++ Use-library-suffix-during-installation.patch | 19 ++++ _service | 15 +++ _servicedata | 4 + libyuv-20220713+d248929c.obscpio | 3 + libyuv.changes | 12 +++ libyuv.obsinfo | 4 + libyuv.spec | 100 +++++++++++++++++++ 14 files changed, 323 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 Disable-static-library.patch create mode 100644 Don-t-install-conversion-tool.patch create mode 100644 Link-against-shared-library.patch create mode 100644 Link-main-library-against-libjpeg.patch create mode 100644 Use-a-proper-so-version.patch create mode 100644 Use-library-suffix-during-installation.patch create mode 100644 _service create mode 100644 _servicedata create mode 100644 libyuv-20220713+d248929c.obscpio create mode 100644 libyuv.changes create mode 100644 libyuv.obsinfo create mode 100644 libyuv.spec diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -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 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/Disable-static-library.patch b/Disable-static-library.patch new file mode 100644 index 0000000..10bd4be --- /dev/null +++ b/Disable-static-library.patch @@ -0,0 +1,39 @@ +From: Peter Lemenkov +Date: Mon, 24 Sep 2018 15:08:45 +0200 +Subject: [PATCH] Disable static library + +Signed-off-by: Peter Lemenkov + +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 ) + diff --git a/Don-t-install-conversion-tool.patch b/Don-t-install-conversion-tool.patch new file mode 100644 index 0000000..b93e0bb --- /dev/null +++ b/Don-t-install-conversion-tool.patch @@ -0,0 +1,38 @@ +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" ) + + 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 diff --git a/Link-against-shared-library.patch b/Link-against-shared-library.patch new file mode 100644 index 0000000..96782d0 --- /dev/null +++ b/Link-against-shared-library.patch @@ -0,0 +1,28 @@ +From: Peter Lemenkov +Date: Fri, 21 Sep 2018 12:47:42 +0200 +Subject: [PATCH] Link against shared library + +Signed-off-by: Peter Lemenkov + +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) diff --git a/Link-main-library-against-libjpeg.patch b/Link-main-library-against-libjpeg.patch new file mode 100644 index 0000000..47f0a56 --- /dev/null +++ b/Link-main-library-against-libjpeg.patch @@ -0,0 +1,18 @@ +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-a-proper-so-version.patch b/Use-a-proper-so-version.patch new file mode 100644 index 0000000..1f9d8ef --- /dev/null +++ b/Use-a-proper-so-version.patch @@ -0,0 +1,19 @@ +From: Peter Lemenkov +Date: Fri, 21 Sep 2018 12:45:55 +0200 +Subject: [PATCH] Use a proper so-version + +Signed-off-by: Peter Lemenkov + +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} ) diff --git a/Use-library-suffix-during-installation.patch b/Use-library-suffix-during-installation.patch new file mode 100644 index 0000000..2da9775 --- /dev/null +++ b/Use-library-suffix-during-installation.patch @@ -0,0 +1,19 @@ +From: Peter Lemenkov +Date: Mon, 24 Sep 2018 15:15:09 +0200 +Subject: [PATCH] Use library suffix during installation + +Signed-off-by: Peter Lemenkov + +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 diff --git a/_service b/_service new file mode 100644 index 0000000..dae4472 --- /dev/null +++ b/_service @@ -0,0 +1,15 @@ + + + git + https://chromium.googlesource.com/libyuv/libyuv.git + d248929c059ff7629a85333699717d7a677d8d96 + %cd+%h + enable + + + + xz + *.tar + + + diff --git a/_servicedata b/_servicedata new file mode 100644 index 0000000..f6bcad0 --- /dev/null +++ b/_servicedata @@ -0,0 +1,4 @@ + + + https://chromium.googlesource.com/libyuv/libyuv.git + d248929c059ff7629a85333699717d7a677d8d96 \ No newline at end of file diff --git a/libyuv-20220713+d248929c.obscpio b/libyuv-20220713+d248929c.obscpio new file mode 100644 index 0000000..87f9bd7 --- /dev/null +++ b/libyuv-20220713+d248929c.obscpio @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b2a59b42a5415a3a6c3cecf6b3bb1f62b66c9c71515067e5850088168d23513f +size 5293069 diff --git a/libyuv.changes b/libyuv.changes new file mode 100644 index 0000000..bdc9fe8 --- /dev/null +++ b/libyuv.changes @@ -0,0 +1,12 @@ +------------------------------------------------------------------- +Fri Jul 29 16:35:26 UTC 2022 - Callum Farmer + +- 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 + diff --git a/libyuv.obsinfo b/libyuv.obsinfo new file mode 100644 index 0000000..e19f972 --- /dev/null +++ b/libyuv.obsinfo @@ -0,0 +1,4 @@ +name: libyuv +version: 20220713+d248929c +mtime: 1657710509 +commit: d248929c059ff7629a85333699717d7a677d8d96 diff --git a/libyuv.spec b/libyuv.spec new file mode 100644 index 0000000..187faf6 --- /dev/null +++ b/libyuv.spec @@ -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