public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: media-libs/libyuv/files/, media-libs/libyuv/
@ 2025-03-19  3:03 Yixun Lan
  0 siblings, 0 replies; only message in thread
From: Yixun Lan @ 2025-03-19  3:03 UTC (permalink / raw
  To: gentoo-commits

commit:     d04db36e81fca13db1b2c3fb8575ad589be1a5a4
Author:     NRK <nrk <AT> disroot <DOT> org>
AuthorDate: Fri Mar  7 15:19:01 2025 +0000
Commit:     Yixun Lan <dlan <AT> gentoo <DOT> org>
CommitDate: Wed Mar 19 02:55:18 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d04db36e

media-libs/libyuv: add new package

used by libavif and imlib2

Signed-off-by: NRK <nrk <AT> disroot.org>
Signed-off-by: Yixun Lan <dlan <AT> gentoo.org>

 media-libs/libyuv/Manifest                         |  1 +
 .../libyuv/files/0001-fix-install-dirs.patch       | 42 +++++++++++++++
 .../libyuv/files/0002-disable-static-library.patch | 61 ++++++++++++++++++++++
 .../libyuv/files/0003-disable-test-tools.patch     | 43 +++++++++++++++
 media-libs/libyuv/libyuv-1904.ebuild               | 42 +++++++++++++++
 media-libs/libyuv/libyuv-9999.ebuild               | 42 +++++++++++++++
 media-libs/libyuv/metadata.xml                     | 12 +++++
 7 files changed, 243 insertions(+)

diff --git a/media-libs/libyuv/Manifest b/media-libs/libyuv/Manifest
new file mode 100644
index 000000000000..f0f9e272937b
--- /dev/null
+++ b/media-libs/libyuv/Manifest
@@ -0,0 +1 @@
+DIST libyuv-1904.tar.bz2 462619 BLAKE2B 088da4134a89822202fb38e87295f968936d9cb6fcc4701843f8bf1086ad2422ed26d371623d3eeca01c4ed22bdd5f9c61db5e96f8060e4b99f09771f3d1d65c SHA512 c24f4ce10a7cfa05d6d7f13b004c4721ec92d53a2535fec100683da6a660b2fca7f90d9c2905f9e05b85d6e6473043d209d0ce2519b39af21cfbb1260054d172

diff --git a/media-libs/libyuv/files/0001-fix-install-dirs.patch b/media-libs/libyuv/files/0001-fix-install-dirs.patch
new file mode 100644
index 000000000000..e0419b1c5030
--- /dev/null
+++ b/media-libs/libyuv/files/0001-fix-install-dirs.patch
@@ -0,0 +1,42 @@
+From 7cbd908e3e4f63615c6d1da655eee6968526a229 Mon Sep 17 00:00:00 2001
+From: NRK <nrk@disroot.org>
+Date: Fri, 7 Mar 2025 21:06:23 +0000
+Subject: [PATCH 1/3] fix install dirs
+
+---
+ CMakeLists.txt | 11 ++++++-----
+ 1 file changed, 6 insertions(+), 5 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 5df7685..8c064a7 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -5,8 +5,9 @@
+ include(CheckCSourceCompiles)
+ 
+ project ( YUV C CXX )	# "C" is required even for C++ projects
+-cmake_minimum_required( VERSION 2.8.12 )
++cmake_minimum_required( VERSION 3.2 )
+ option( UNIT_TEST "Built unit tests" OFF )
++include(GNUInstallDirs)
+ 
+ set ( ly_base_dir	${PROJECT_SOURCE_DIR} )
+ set ( ly_src_dir	${ly_base_dir}/source )
+@@ -246,10 +247,10 @@ endif()
+ 
+ 
+ # install the conversion tool, .so, .a, and all the header files
+-install ( TARGETS yuvconvert DESTINATION bin )
+-install ( TARGETS ${ly_lib_static}						DESTINATION lib )
+-install ( TARGETS ${ly_lib_shared} LIBRARY DESTINATION lib RUNTIME DESTINATION bin ARCHIVE DESTINATION lib )
+-install ( DIRECTORY ${PROJECT_SOURCE_DIR}/include/		DESTINATION include )
++install ( TARGETS yuvconvert DESTINATION ${CMAKE_INSTALL_BINDIR} )
++install ( TARGETS ${ly_lib_static}						DESTINATION ${CMAKE_INSTALL_LIBDIR} )
++install ( TARGETS ${ly_lib_shared} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION bin ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} )
++install ( DIRECTORY ${PROJECT_SOURCE_DIR}/include/		DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} )
+ 
+ # create the .deb and .rpm packages using cpack
+ include ( CM_linux_packages.cmake )
+-- 
+2.48.1
+

diff --git a/media-libs/libyuv/files/0002-disable-static-library.patch b/media-libs/libyuv/files/0002-disable-static-library.patch
new file mode 100644
index 000000000000..427e463c52ea
--- /dev/null
+++ b/media-libs/libyuv/files/0002-disable-static-library.patch
@@ -0,0 +1,61 @@
+From f69772741e89fca8d3b98629bc79469e2d55864c Mon Sep 17 00:00:00 2001
+From: NRK <nrk@disroot.org>
+Date: Fri, 7 Mar 2025 21:06:56 +0000
+Subject: [PATCH 2/3] disable static library
+
+---
+ CMakeLists.txt | 11 +++--------
+ 1 file changed, 3 insertions(+), 8 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 8c064a7..d21c6cb 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -14,7 +14,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 )
+ 
+ # We cannot use GLOB here since we want to be able to separate out files that
+@@ -174,9 +173,6 @@ if(LOONGARCH64)
+   endif()
+ endif()
+ 
+-# this creates the static library (.a)
+-add_library( ${ly_lib_static} STATIC ${ly_lib_parts})
+-
+ # this creates the shared library (.so)
+ add_library( ${ly_lib_shared} SHARED ${ly_lib_parts})
+ set_target_properties( ${ly_lib_shared} PROPERTIES OUTPUT_NAME "${ly_lib_name}" )
+@@ -187,15 +183,15 @@ endif()
+ 
+ # this creates the cpuid tool
+ add_executable      ( cpuid ${ly_base_dir}/util/cpuid.c )
+-target_link_libraries  ( cpuid ${ly_lib_static} )
++target_link_libraries  ( cpuid ${ly_lib_shared} )
+ 
+ # 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} )
+ 
+ # 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 ${ly_lib_shared} )
+ 
+ find_package ( JPEG )
+ if (JPEG_FOUND)
+@@ -248,7 +244,6 @@ endif()
+ 
+ # install the conversion tool, .so, .a, and all the header files
+ install ( TARGETS yuvconvert DESTINATION ${CMAKE_INSTALL_BINDIR} )
+-install ( TARGETS ${ly_lib_static}						DESTINATION ${CMAKE_INSTALL_LIBDIR} )
+ install ( TARGETS ${ly_lib_shared} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION bin ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} )
+ install ( DIRECTORY ${PROJECT_SOURCE_DIR}/include/		DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} )
+ 
+-- 
+2.48.1
+

diff --git a/media-libs/libyuv/files/0003-disable-test-tools.patch b/media-libs/libyuv/files/0003-disable-test-tools.patch
new file mode 100644
index 000000000000..d22860be8224
--- /dev/null
+++ b/media-libs/libyuv/files/0003-disable-test-tools.patch
@@ -0,0 +1,43 @@
+From c84dbf12267cf873b4d1ab2f49ad627d05cc45ff Mon Sep 17 00:00:00 2001
+From: NRK <nrk@disroot.org>
+Date: Fri, 7 Mar 2025 21:07:20 +0000
+Subject: [PATCH 3/3] disable test tools
+
+---
+ CMakeLists.txt | 13 -------------
+ 1 file changed, 13 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index d21c6cb..b2fa08a 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -181,18 +181,6 @@ if(WIN32)
+   set_target_properties( ${ly_lib_shared} PROPERTIES IMPORT_PREFIX "lib" )
+ endif()
+ 
+-# this creates the cpuid tool
+-add_executable      ( cpuid ${ly_base_dir}/util/cpuid.c )
+-target_link_libraries  ( cpuid ${ly_lib_shared} )
+-
+-# this creates the conversion tool
+-add_executable			( yuvconvert ${ly_base_dir}/util/yuvconvert.cc )
+-target_link_libraries	( yuvconvert ${ly_lib_shared} )
+-
+-# this creates the yuvconstants tool
+-add_executable      ( yuvconstants ${ly_base_dir}/util/yuvconstants.c )
+-target_link_libraries  ( yuvconstants ${ly_lib_shared} )
+-
+ find_package ( JPEG )
+ if (JPEG_FOUND)
+   include_directories( ${JPEG_INCLUDE_DIR} )
+@@ -243,7 +231,6 @@ endif()
+ 
+ 
+ # install the conversion tool, .so, .a, and all the header files
+-install ( TARGETS yuvconvert DESTINATION ${CMAKE_INSTALL_BINDIR} )
+ install ( TARGETS ${ly_lib_shared} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION bin ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} )
+ install ( DIRECTORY ${PROJECT_SOURCE_DIR}/include/		DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} )
+ 
+-- 
+2.48.1
+

diff --git a/media-libs/libyuv/libyuv-1904.ebuild b/media-libs/libyuv/libyuv-1904.ebuild
new file mode 100644
index 000000000000..b4210853ab36
--- /dev/null
+++ b/media-libs/libyuv/libyuv-1904.ebuild
@@ -0,0 +1,42 @@
+# Copyright 2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake
+
+DESCRIPTION="Open source project that includes YUV scaling and conversion functionality."
+HOMEPAGE="https://chromium.googlesource.com/libyuv/libyuv"
+
+if [[ ${PV} == "9999" ]] ; then
+	EGIT_REPO_URI="https://chromium.googlesource.com/libyuv/libyuv.git"
+	inherit git-r3
+else
+	# to diff against upstream (apparently not stable):
+	# https://chromium.googlesource.com/libyuv/libyuv.git/+archive/${commit}.tar.gz
+	MYTAG="0.0.1904.20250204"
+	SRC_URI="https://salsa.debian.org/debian/libyuv/-/archive/upstream/${MYTAG}/libyuv-upstream-${MYTAG}.tar.bz2 -> ${P}.tar.bz2"
+	S="${WORKDIR}/libyuv-upstream-${MYTAG}"
+	KEYWORDS="~amd64"
+fi
+
+LICENSE="BSD"
+SLOT="0/${PV}"
+# TODO(NRK): enable tests
+RESTRICT="test"
+
+RDEPEND=">=media-libs/libjpeg-turbo-3.0.0"
+BDEPEND="${RDEPEND}"
+
+PATCHES=(
+	"${FILESDIR}/0001-fix-install-dirs.patch"
+	"${FILESDIR}/0002-disable-static-library.patch"
+	"${FILESDIR}/0003-disable-test-tools.patch"
+)
+
+src_configure() {
+	mycmakeargs=(
+		-DUNIT_TEST=OFF
+	)
+	cmake_src_configure
+}

diff --git a/media-libs/libyuv/libyuv-9999.ebuild b/media-libs/libyuv/libyuv-9999.ebuild
new file mode 100644
index 000000000000..b4210853ab36
--- /dev/null
+++ b/media-libs/libyuv/libyuv-9999.ebuild
@@ -0,0 +1,42 @@
+# Copyright 2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake
+
+DESCRIPTION="Open source project that includes YUV scaling and conversion functionality."
+HOMEPAGE="https://chromium.googlesource.com/libyuv/libyuv"
+
+if [[ ${PV} == "9999" ]] ; then
+	EGIT_REPO_URI="https://chromium.googlesource.com/libyuv/libyuv.git"
+	inherit git-r3
+else
+	# to diff against upstream (apparently not stable):
+	# https://chromium.googlesource.com/libyuv/libyuv.git/+archive/${commit}.tar.gz
+	MYTAG="0.0.1904.20250204"
+	SRC_URI="https://salsa.debian.org/debian/libyuv/-/archive/upstream/${MYTAG}/libyuv-upstream-${MYTAG}.tar.bz2 -> ${P}.tar.bz2"
+	S="${WORKDIR}/libyuv-upstream-${MYTAG}"
+	KEYWORDS="~amd64"
+fi
+
+LICENSE="BSD"
+SLOT="0/${PV}"
+# TODO(NRK): enable tests
+RESTRICT="test"
+
+RDEPEND=">=media-libs/libjpeg-turbo-3.0.0"
+BDEPEND="${RDEPEND}"
+
+PATCHES=(
+	"${FILESDIR}/0001-fix-install-dirs.patch"
+	"${FILESDIR}/0002-disable-static-library.patch"
+	"${FILESDIR}/0003-disable-test-tools.patch"
+)
+
+src_configure() {
+	mycmakeargs=(
+		-DUNIT_TEST=OFF
+	)
+	cmake_src_configure
+}

diff --git a/media-libs/libyuv/metadata.xml b/media-libs/libyuv/metadata.xml
new file mode 100644
index 000000000000..e11cf2251bd6
--- /dev/null
+++ b/media-libs/libyuv/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+	<maintainer type="person" proxied="yes">
+		<email>nrk@disroot.org</email>
+		<name>NRK</name>
+	</maintainer>
+	<maintainer type="project" proxied="proxy">
+		<email>proxy-maint@gentoo.org</email>
+		<name>Proxy Maintainers</name>
+	</maintainer>
+</pkgmetadata>


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2025-03-19  3:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-19  3:03 [gentoo-commits] repo/gentoo:master commit in: media-libs/libyuv/files/, media-libs/libyuv/ Yixun Lan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox