summaryrefslogtreecommitdiff
blob: a669bf8ca480fabe575e1ab658ba208af41f1496 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# Copyright 2022-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit cmake-multilib optfeature

DESCRIPTION="oneAPI Video Processing Library, dispatcher, tools, and examples"
HOMEPAGE="https://github.com/intel/libvpl/"
SRC_URI="https://github.com/intel/libvpl//archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"
S="${WORKDIR}/libvpl-${PV}"

LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64"

IUSE="dri drm examples experimental tools test vaapi wayland X"
RESTRICT="!test? ( test )"

REQUIRED_USE="
	dri? ( X drm )
	X? ( vaapi )
	wayland? ( drm )
"

RDEPEND="
	x11-libs/libpciaccess[${MULTILIB_USEDEP}]
	vaapi? ( media-libs/libva[X?,wayland?,drm(+)?,${MULTILIB_USEDEP}] )
	drm? ( x11-libs/libdrm[${MULTILIB_USEDEP}] )
	wayland? (
		dev-libs/wayland[${MULTILIB_USEDEP}]
	)
	X? (
		x11-libs/libX11[${MULTILIB_USEDEP}]
		x11-libs/libxcb[${MULTILIB_USEDEP}]
	)
"
DEPEND="${RDEPEND}
	wayland? (
		dev-libs/wayland-protocols
	)
"
BDEPEND="virtual/pkgconfig"

multilib_src_configure() {
	local mycmakeargs=(
		-DBUILD_SHARED_LIBS=ON
		-DBUILD_DISPATCHER=ON
		# Headers, cmake and pkgconfig files
		-DBUILD_DEV=ON
		-DBUILD_EXAMPLES="$(usex examples)"
		-DINSTALL_EXAMPLE_CODE="$(usex examples)"
		-DBUILD_PREVIEW="$(usex experimental)"
		-DBUILD_DISPATCHER_ONEVPL_EXPERIMENTAL="$(usex experimental)"
		# Fails to build with experimental tools off if tools on
		-DBUILD_TOOLS_ONEVPL_EXPERIMENTAL="$(multilib_native_usex tools)"
		-DBUILD_TESTS="$(usex test)"
		# Tools fails to compile for 32 bit
		-DBUILD_TOOLS="$(multilib_native_usex tools)"
		-DENABLE_WAYLAND="$(usex wayland)"
		-DENABLE_X11="$(usex X)"
		-DENABLE_DRI3="$(usex dri)"
		-DENABLE_VA="$(usex vaapi)"
		-DENABLE_DRM="$(usex drm)"
		-DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr"
		-DCMAKE_INSTALL_SYSCONFDIR="${EPREFIX}/etc"
	)
	cmake_src_configure
}

multilib_src_install() {
	cmake_src_install
	# Remove these license files
	rm -r "${ED}/usr/share/vpl/licensing" || die
}

pkg_postinst() {
	optfeature_header "This package provides only the dispatcher, to use it install one or more implementations"
	optfeature "CPUs" media-libs/oneVPL-cpu
	optfeature "Intel GPUs newer then, and including, Intel Xe" media-libs/oneVPL-intel-gpu
	optfeature "Intel GPUs older then Intel Xe" media-libs/intel-mediasdk
}