summaryrefslogtreecommitdiff
path: root/media-libs/gst-plugins-bad/gst-plugins-bad-1.26.11.ebuild
blob: 7497ef427e86848ab7fde0fae6869e652c6d1f2a (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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8
GST_ORG_MODULE="gst-plugins-bad"
inherit gstreamer-meson verify-sig virtualx

DESCRIPTION="Less plugins for GStreamer"
HOMEPAGE="https://gstreamer.freedesktop.org/"
SRC_URI+=" verify-sig? ( https://gstreamer.freedesktop.org/src/${PN}/${P}.tar.xz.asc )"

LICENSE="LGPL-2"
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~loong ~mips ppc ppc64 ~riscv ~sparc x86"

IUSE="X bzip2 +introspection +orc udev vaapi vnc vulkan wayland"
REQUIRED_USE="vulkan? ( || ( X wayland ) )"

# X11 is automagic for now, upstream #709530 - only used by librfb USE=vnc plugin
# Baseline requirement for libva is 1.6, but 1.15 gets more features
RDEPEND="
	!media-plugins/gst-plugins-va
	!media-plugins/gst-transcoder

	>=media-libs/gstreamer-${PV}:${SLOT}[${MULTILIB_USEDEP},introspection?]
	>=media-libs/gst-plugins-base-${PV}:${SLOT}[${MULTILIB_USEDEP},introspection?]
	introspection? ( >=dev-libs/gobject-introspection-1.82.0-r2:= )

	bzip2? ( >=app-arch/bzip2-1.0.6-r4[${MULTILIB_USEDEP}] )
	vnc? ( X? ( x11-libs/libX11[${MULTILIB_USEDEP}] ) )
	vulkan? (
		media-libs/vulkan-loader[${MULTILIB_USEDEP}]
		X? (
			x11-libs/libxcb:=[${MULTILIB_USEDEP}]
			x11-libs/libxkbcommon[${MULTILIB_USEDEP}]
		)
	)
	wayland? (
		>=dev-libs/wayland-1.4.0[${MULTILIB_USEDEP}]
		>=x11-libs/libdrm-2.4.98[${MULTILIB_USEDEP}]
		>=dev-libs/wayland-protocols-1.26
	)

	orc? ( >=dev-lang/orc-0.4.41[${MULTILIB_USEDEP}] )

	vaapi? (
		>=media-libs/libva-1.15:=[${MULTILIB_USEDEP}]
		udev? ( dev-libs/libgudev[${MULTILIB_USEDEP}] )
	)
"
DEPEND="${RDEPEND}"
BDEPEND="
	dev-util/glib-utils
	verify-sig? ( sec-keys/openpgp-keys-tpm )
	wayland? ( dev-util/wayland-scanner )
"

DOCS=( AUTHORS ChangeLog NEWS README.md RELEASE )
VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/tpm.asc

PATCHES=(
	"${FILESDIR}"/gst-plugins-bad-1.26.11-respect-webrtcdsp-disable.patch
	# bug #974283
	"${FILESDIR}"/gst-plugins-bad-1.26.11-GStreamer-SA-2026-0014.patch
	# bug #974284
	"${FILESDIR}"/gst-plugins-bad-1.26.11-GStreamer-SA-2026-0013.patch
	"${FILESDIR}"/gst-plugins-bad-1.26.11-GStreamer-SA-2026-0015.patch
	"${FILESDIR}"/gst-plugins-bad-1.26.11-GStreamer-SA-2026-0017.patch
)

src_prepare() {
	default
	addpredict /dev # Prevent sandbox violations bug #570624
}

multilib_src_configure() {
	GST_PLUGINS_NOAUTO="tinyalsa bz2 hls ipcpipeline lcevcdecoder lcevcencoder librfb shm va vulkan wayland"

	local emesonargs=(
		-Dshm=enabled
		-Dipcpipeline=enabled
		-Dhls=disabled
		-Dlcevcdecoder=disabled # unpackaged dependencies
		-Dlcevcencoder=disabled # requires a dependency with a proprietary license and no public download
		-Dtinyalsa=disabled
		$(meson_feature bzip2 bz2)
		$(meson_feature vaapi va)
		$(meson_feature vulkan)
		$(meson_feature vulkan vulkan-video)
		-Dudev=$(usex udev $(usex vaapi enabled disabled) disabled)
		$(meson_feature vnc librfb)
		-Dx11=$(usex X $(usex vnc enabled disabled) disabled)
		$(meson_feature wayland)
	)

	if use vulkan; then
		local windowing=(
			$(usev X x11)
			$(usev wayland)
		)
		emesonargs+=(
			-Dvulkan-windowing=$(IFS=','; echo "${windowing[*]}")
		)
	fi

	gstreamer_multilib_src_configure
}

multilib_src_test() {
	# Homebrew test skips for meson
	local -a tests
	tests=( $(meson test --list -C "${BUILD_DIR}") )

	local -a _skip_tests=(
		# known flaky test bug #931737
		elements_netsim

		# FIXME
		# gst_harness_new_with_padnames: assertion failed: (element != NULL)
		elements_aesenc
		elements_aesdec
	)

	# Add suites which in this case are PN
	if has_version ">=dev-build/meson-1.10.0"; then
		local -a skip_tests=()
		for skip_test in ${_skip_tests[@]}; do
			skip_tests+=( "${PN}:${skip_test}" )
		done
	else
		local -a skip_tests=( ${_skip_tests[@]} )
	fi
	unset _skip_tests

	for test_index in ${!tests[@]}; do
		if [[ ${skip_tests[@]} =~ ${tests[${test_index}]} ]]; then
			unset tests[${test_index}]
		fi
	done

	# Tests are slower than upstream expects
	local -x CK_DEFAULT_TIMEOUT=300

	# gstreamer_multilib_src_test doesn't pass arguments
	GST_GL_WINDOW=x11 virtx meson_src_test --timeout-multiplier 5 ${tests[@]}
}