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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
|
# -*- Mode: Python -*- vi:si:et:sw=4:sts=4:ts=4:syntax=python
from custom import GStreamer
from cerbero.utils import messages as m
class Recipe(recipe.Recipe):
name = 'gst-plugins-rs'
version = '0.9.10'
stype = SourceType.GIT
remotes = {'origin': 'https://gitlab.freedesktop.org/gstreamer/%(name)s.git'}
if GStreamer.tagged_for_release:
commit = f'gstreamer-{GStreamer.version}'
else:
commit = 'origin/0.9'
# Each plugin uses one or more of these licenses.
licenses = [{
License.Apachev2: ['LICENSE-APACHE'],
License.MIT: ['LICENSE-MIT'],
License.LGPLv2_1Plus: None,
}]
btype = BuildType.CARGO_C
cargoc_packages = [
'audiofx',
'aws',
'cdg',
'claxon',
'closedcaption',
'dav1d',
'fallbackswitch',
'ffv1',
'fmp4',
'gif',
'hlssink3',
'hsv',
'json',
'livesync',
'lewton',
'mp4',
'ndi',
'onvif',
'rav1e',
'regex',
'reqwest',
'raptorq',
'png',
'rtp',
'textahead',
'textwrap',
'threadshare',
'togglerecord',
'tracers',
'uriplaylistbin',
'videofx',
'webrtc',
'webrtchttp',
]
# See "static plugins" bullet point in phase 2 at
# https://gitlab.freedesktop.org/gstreamer/cerbero/-/issues/381
library_type = LibraryType.SHARED
# Needed for openssl
use_system_libs = True
deps = ['gstreamer-1.0', 'gst-plugins-base-1.0', 'pango', 'cairo',
'gst-plugins-bad-1.0', 'dav1d']
files_plugins_core = [
'lib/gstreamer-1.0/libgstfallbackswitch%(mext)s',
'lib/gstreamer-1.0/libgstlivesync%(mext)s',
'lib/gstreamer-1.0/libgstthreadshare%(mext)s',
'lib/gstreamer-1.0/libgsttogglerecord%(mext)s',
'lib/gstreamer-1.0/libgstrstracers%(mext)s',
]
files_plugins_net = [
'lib/gstreamer-1.0/libgstaws%(mext)s',
'lib/gstreamer-1.0/libgsthlssink3%(mext)s',
'lib/gstreamer-1.0/libgstndi%(mext)s',
'lib/gstreamer-1.0/libgstrsonvif%(mext)s',
'lib/gstreamer-1.0/libgstraptorq%(mext)s',
'lib/gstreamer-1.0/libgstrsrtp%(mext)s',
'lib/gstreamer-1.0/libgstreqwest%(mext)s',
'lib/gstreamer-1.0/libgstwebrtchttp%(mext)s',
'lib/gstreamer-1.0/libgstrswebrtc%(mext)s',
]
files_plugins_effects = [
'lib/gstreamer-1.0/libgstrsaudiofx%(mext)s',
'lib/gstreamer-1.0/libgstrsvideofx%(mext)s',
]
files_plugins_codecs = [
'lib/gstreamer-1.0/libgstcdg%(mext)s',
'lib/gstreamer-1.0/libgstclaxon%(mext)s',
'lib/gstreamer-1.0/libgstdav1d%(mext)s',
'lib/gstreamer-1.0/libgstrsclosedcaption%(mext)s',
'lib/gstreamer-1.0/libgstffv1%(mext)s',
'lib/gstreamer-1.0/libgstfmp4%(mext)s',
'lib/gstreamer-1.0/libgstmp4%(mext)s',
'lib/gstreamer-1.0/libgstgif%(mext)s',
'lib/gstreamer-1.0/libgsthsv%(mext)s',
'lib/gstreamer-1.0/libgstlewton%(mext)s',
'lib/gstreamer-1.0/libgstrav1e%(mext)s',
'lib/gstreamer-1.0/libgstjson%(mext)s',
'lib/gstreamer-1.0/libgstrspng%(mext)s',
'lib/gstreamer-1.0/libgstregex%(mext)s',
'lib/gstreamer-1.0/libgsttextwrap%(mext)s',
'lib/gstreamer-1.0/libgsttextahead%(mext)s',
]
files_plugins_playback = [
'lib/gstreamer-1.0/libgsturiplaylistbin%(mext)s',
]
def prepare(self):
if self.config.target_platform != Platform.LINUX or self.config.cross_compiling():
self.deps.append('openssl')
self.cargoc_packages = [f'gst-plugin-{pkg}' for pkg in self.cargoc_packages]
# Build with Cerbero's latest glib version as minimum version
self.cargo_features += ['glib/v2_74', 'gio/v2_74']
# Enable assembly optimizations via nasm
self.cargo_features.append('gst-plugin-rav1e/asm')
# Build with the current GStreamer version as minimum version
components = ('', '-app', '-audio', '-base', '-check', '-net', '-pbutils',
'-plugin-tracers', '-rtp', '-sdp', '-utils', '-video', '-webrtc')
for each in components:
self.cargo_features.append(f'gst{each}/v1_22')
self.cargo_features.append('gst-plugin-webrtc/gst1_22')
async def configure(self):
# Check that the Cargo.toml version matches the recipe version
toml_version = self.get_cargo_toml_version()
if toml_version != self.version:
msg = f'{self.name} version {self.version} doesn\'t match Cargo.toml version {toml_version}'
if GStreamer.tagged_for_release:
raise FatalError(msg)
else:
m.warning(msg)
await super().configure()
def post_install(self):
# Cargo-C currently can't install pc files into custom dirs, so we need
# to move these plugin pkgconfig files to the right place.
for f in self.files_list_by_category(self.DEVEL_CAT):
if not f.endswith('.pc') or not 'gstreamer-1.0' in f:
continue
name = os.path.basename(f)
src = os.path.join(self.config.prefix, 'lib', 'pkgconfig', name)
dst = os.path.join(self.config.prefix, f)
os.replace(src, dst)
# Cargo-C names MinGW DLLs as foo.dll instead of libfoo.dll
# https://github.com/lu-zero/cargo-c/issues/280
if not self.using_msvc():
for f in self.dist_files_list():
if not f.endswith('.dll'):
continue
name = os.path.basename(f)
d = os.path.dirname(f)
src = os.path.join(self.config.prefix, d, f'{name[3:]}')
dst = os.path.join(self.config.prefix, f)
os.replace(src, dst)
# .dll.a also needs renaming
os.replace(src + '.a', dst + '.a')
super().post_install()
|