summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'media-libs/oneVPL-cpu')
-rw-r--r--media-libs/oneVPL-cpu/Manifest1
-rw-r--r--media-libs/oneVPL-cpu/files/oneVPL-cpu-2022.2.5-respect-user-flags.patch13
-rw-r--r--media-libs/oneVPL-cpu/files/oneVPL-cpu-2022.2.5-use-system-libs.patch49
-rw-r--r--media-libs/oneVPL-cpu/metadata.xml18
-rw-r--r--media-libs/oneVPL-cpu/oneVPL-cpu-2023.2.0.ebuild57
5 files changed, 138 insertions, 0 deletions
diff --git a/media-libs/oneVPL-cpu/Manifest b/media-libs/oneVPL-cpu/Manifest
new file mode 100644
index 000000000000..0179b5977a6a
--- /dev/null
+++ b/media-libs/oneVPL-cpu/Manifest
@@ -0,0 +1 @@
+DIST oneVPL-cpu-2023.2.0.tar.gz 10140311 BLAKE2B eacd9bdc30939c7701453b6cff051de0fddf810792cd6f2db027342f7756fa289ddb2571fab920c87fa51b09241cbf65fd13cbcd3840080ba15917a90dd0e992 SHA512 1b2755e384c3cfb88e2046d02f4414a51485cbc6fa4ce9c9aa9b48c0eb21a96e49d21640bc259dc8b9dafa76afa4d1619c6660e0d1757fcd2625a27e46553328
diff --git a/media-libs/oneVPL-cpu/files/oneVPL-cpu-2022.2.5-respect-user-flags.patch b/media-libs/oneVPL-cpu/files/oneVPL-cpu-2022.2.5-respect-user-flags.patch
new file mode 100644
index 000000000000..59aad21af7f3
--- /dev/null
+++ b/media-libs/oneVPL-cpu/files/oneVPL-cpu-2022.2.5-respect-user-flags.patch
@@ -0,0 +1,13 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 981574e..7bdf346 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -72,8 +72,6 @@ set(CMAKE_POSITION_INDEPENDENT_CODE true)
+ # Keep executable bits on shared objects when installing regardless of distro
+ set(CMAKE_INSTALL_SO_NO_EXE 0)
+
+-include(cmake/CompileOptions.cmake)
+-
+ if(NOT BUILD_GPL_X264)
+ if(CMAKE_SIZEOF_VOID_P EQUAL 8)
+ set(BUILD_OPENH264 ON)
diff --git a/media-libs/oneVPL-cpu/files/oneVPL-cpu-2022.2.5-use-system-libs.patch b/media-libs/oneVPL-cpu/files/oneVPL-cpu-2022.2.5-use-system-libs.patch
new file mode 100644
index 000000000000..aa9363a65e83
--- /dev/null
+++ b/media-libs/oneVPL-cpu/files/oneVPL-cpu-2022.2.5-use-system-libs.patch
@@ -0,0 +1,49 @@
+diff --git a/cpu/ext/ffmpeg-codecs/CMakeLists.txt b/cpu/ext/ffmpeg-codecs/CMakeLists.txt
+index 7bde28b..c8067c4 100644
+--- a/cpu/ext/ffmpeg-codecs/CMakeLists.txt
++++ b/cpu/ext/ffmpeg-codecs/CMakeLists.txt
+@@ -38,9 +38,9 @@ endif()
+
+ # Set basic FFmpeg and codec libs
+ if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "8")
+- set(SVTHEVCENC_LIB ${VPL_DEP_DIR}/lib/libSvtHevcEnc.a)
+- set(SVTAV1ENC_LIB ${VPL_DEP_DIR}/lib/libSvtAv1Enc.a)
+- set(DAV1D_LIB ${VPL_DEP_DIR}/lib/libdav1d.a)
++ set(SVTHEVCENC_LIB ${VPL_DEP_DIR}/lib64/libSvtHevcEnc.so)
++ set(SVTAV1ENC_LIB ${VPL_DEP_DIR}/lib64/libSvtAv1Enc.so)
++ set(DAV1D_LIB ${VPL_DEP_DIR}/lib64/libdav1d.so)
+
+ if(NOT EXISTS ${SVTHEVCENC_LIB}
+ OR NOT EXISTS ${SVTAV1ENC_LIB}
+@@ -49,10 +49,10 @@ if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "8")
+ endif()
+ endif()
+
+-set(AVCODEC_LIB ${VPL_DEP_DIR}/lib/libavcodec.a)
+-set(AVUTIL_LIB ${VPL_DEP_DIR}/lib/libavutil.a)
+-set(AVFILTER_LIB ${VPL_DEP_DIR}/lib/libavfilter.a)
+-set(SWSCALE_LIB ${VPL_DEP_DIR}/lib/libswscale.a)
++set(AVCODEC_LIB ${VPL_DEP_DIR}/lib64/libavcodec.so)
++set(AVUTIL_LIB ${VPL_DEP_DIR}/lib64/libavutil.so)
++set(AVFILTER_LIB ${VPL_DEP_DIR}/lib64/libavfilter.so)
++set(SWSCALE_LIB ${VPL_DEP_DIR}/lib64/libswscale.so)
+
+ if(NOT EXISTS ${AVCODEC_LIB}
+ OR NOT EXISTS ${AVUTIL_LIB}
+@@ -135,14 +135,14 @@ endif()
+
+ # Set AVC encoder lib name
+ if(BUILD_GPL_X264)
+- set(H264_ENC_LIB ${VPL_DEP_DIR}/lib/libx264.a)
++ set(H264_ENC_LIB ${VPL_DEP_DIR}/lib64/libx264.so)
+ if(NOT EXISTS ${H264_ENC_LIB})
+ message(FATAL_ERROR "Could not find x264 libraries")
+ else()
+ message(STATUS "Building with GPL x264 for AVC implementation")
+ endif()
+ elseif(BUILD_OPENH264)
+- set(H264_ENC_LIB ${VPL_DEP_DIR}/lib/libopenh264.a)
++ set(H264_ENC_LIB ${VPL_DEP_DIR}/lib64/libopenh264.so)
+ if(NOT EXISTS ${H264_ENC_LIB})
+ message(FATAL_ERROR "Could not find openh264 libraries")
+ else()
diff --git a/media-libs/oneVPL-cpu/metadata.xml b/media-libs/oneVPL-cpu/metadata.xml
new file mode 100644
index 000000000000..d738daf38bf1
--- /dev/null
+++ b/media-libs/oneVPL-cpu/metadata.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>media-video@gentoo.org</email>
+ </maintainer>
+ <maintainer type="person">
+ <email>andrewammerlaan@gentoo.org</email>
+ <name>Andrew Ammerlaan</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">oneapi-src/oneVPL-cpu</remote-id>
+ </upstream>
+ <use>
+ <flag name="experimental">Enable experimental API</flag>
+ <flag name="openh264">Use <pkg>media-libs/openh264</pkg> instead of <pkg>media-libs/x264</pkg></flag>
+ </use>
+</pkgmetadata>
diff --git a/media-libs/oneVPL-cpu/oneVPL-cpu-2023.2.0.ebuild b/media-libs/oneVPL-cpu/oneVPL-cpu-2023.2.0.ebuild
new file mode 100644
index 000000000000..4af580c27324
--- /dev/null
+++ b/media-libs/oneVPL-cpu/oneVPL-cpu-2023.2.0.ebuild
@@ -0,0 +1,57 @@
+# Copyright 2022-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake
+
+DESCRIPTION="oneAPI Video Processing Library CPU implementation"
+HOMEPAGE="https://github.com/oneapi-src/oneVPL-cpu"
+SRC_URI="https://github.com/oneapi-src/oneVPL-cpu/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="MIT x264? ( GPL-2 )"
+SLOT="0"
+KEYWORDS="~amd64"
+
+IUSE="experimental openh264 test +x264"
+REQUIRED_USE="^^ ( openh264 x264 )"
+# RESTRICT="!test? ( test )"
+# Tests fail
+RESTRICT="test"
+
+BDEPEND="virtual/pkgconfig"
+DEPEND="
+ media-libs/dav1d
+ media-libs/libvpl[experimental(-)?]
+ media-libs/svt-av1
+ media-libs/svt-hevc
+ media-video/ffmpeg
+ x264? ( media-libs/x264 )
+ openh264? ( media-libs/openh264 )
+"
+RDEPEND="${DEPEND}"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-2022.2.5-use-system-libs.patch"
+ "${FILESDIR}/${PN}-2022.2.5-respect-user-flags.patch"
+)
+
+src_configure() {
+ # Use system libraries
+ export VPL_BUILD_DEPENDENCIES="${ESYSROOT}/usr"
+ local mycmakeargs=(
+ -DUSE_EXPERIMENTAL_API="$(usex experimental)"
+ -DBUILD_OPENH264="$(usex openh264)"
+ -DBUILD_TESTS="$(usex test)"
+ -DBUILD_GPL_X264="$(usex x264)"
+ # Use FHS instead
+ -DUSE_ONEAPI_INSTALL_LAYOUT=NO
+ )
+ cmake_src_configure
+}
+
+src_install() {
+ cmake_src_install
+ # Remove these license files
+ rm -r "${ED}/usr/share/oneVPL-cpu/licensing" || die
+}