File obs-studio.spec of Package obs-studio (Revision 8b78f79777b524bb6476b2e1e8d216a6)

Currently displaying revision 8b78f79777b524bb6476b2e1e8d216a6 , Show latest

270
 
1
2
# Chromium Embedded Framework
3
%ifarch x86_64
4
%bcond_with cef
5
%define cef_binary cef_binary_5060_linux64
6
%else
7
%bcond_with cef
8
%endif
9
10
%bcond_without websockets
11
%bcond_with    split_obs_x264
12
13
# 31.0.0~beta1 wants at least 6.1 lets just use 7 straight away
14
# zypper info --provides $(zypper se -t package -s ffmpeg-7 | awk -F '|' '/devel/ {print $2}') | grep pkgconfig | perl -p -e 's|^\s+pkgconfig\(([^\)]+)\) = (\S+)|%%global minimum_$1_version $2|g'
15
%global minimum_libavcodec_version 61.19.100
16
%global minimum_libavdevice_version 61.3.100
17
%global minimum_libavfilter_version 10.4.100
18
%global minimum_libavformat_version 61.7.100
19
%global minimum_libavutil_version 59.39.100
20
%global minimum_libpostproc_version 58.3.100
21
%global minimum_libswresample_version 5.3.100
22
%global minimum_libswscale_version 8.3.100
23
24
%if 0%{?suse_version} && 0%{?suse_version} < 1600
25
%global force_gcc_version 13
26
%global python_version 311
27
%else
28
%global python_version 3
29
%endif
30
31
%if 0%{?suse_version} > 1500
32
%bcond_without nvenc
33
%else
34
%bcond_with    nvenc
35
%endif
36
37
Name:           obs-studio
38
Version:        31.0.1
39
Release:        0
40
Summary:        A recording/broadcasting program
41
Group:          Productivity/Multimedia/Video/Editors and Convertors
42
License:        GPL-2.0
43
URL:            https://obsproject.com/
44
# we fetch the tarball with a source service, because some subprojects are
45
# not included in the offical tarball (e.g. obs-browser)
46
Source:         %{name}-%{version}.tar.xz
47
%if %{with cef}
48
Source17:       %{cef_binary}.tar.bz2
49
%endif
50
Patch1:         0001-Prefix-modinfo-with-sbin-since-not-in-normal-path.patch
51
Patch2:         libx264-optional.patch
52
Patch3:         ffmpeg-x11-linking.patch
53
BuildRequires:  update-desktop-files
54
BuildRequires:  cmake >= 2.8.12
55
BuildRequires:  pkgconfig(fdk-aac)
56
BuildRequires:  fdupes
57
BuildRequires:  fontconfig-devel
58
BuildRequires:  freetype2-devel
59
BuildRequires:  gcc%{?force_gcc_version}
60
BuildRequires:  gcc%{?force_gcc_version}-c++
61
BuildRequires:  hicolor-icon-theme
62
BuildRequires:  libXcomposite-devel
63
BuildRequires:  libXinerama-devel
64
BuildRequires:  libXrandr-devel
65
BuildRequires:  libcurl-devel
66
BuildRequires:  libjansson-devel
67
BuildRequires:  pciutils-devel
68
BuildRequires:  pipewire-devel
69
BuildRequires:  libpulse-devel
70
BuildRequires:  cmake(Qt6Core)
71
BuildRequires:  cmake(Qt6Svg)
72
BuildRequires:  qt6-base-private-devel
73
BuildRequires:  libudev-devel
74
BuildRequires:  libv4l-devel
75
%if %{without split_obs_x264}
76
BuildRequires:  libx264-devel
77
%endif
78
BuildRequires:  mbedtls-devel
79
BuildRequires:  pipewire-devel
80
BuildRequires:  pkgconfig
81
BuildRequires:  pkgconfig(alsa)
82
BuildRequires:  pkgconfig(jack)
83
BuildRequires:  pkgconfig(libavcodec)  >= %{minimum_libavcodec_version}
84
BuildRequires:  pkgconfig(libavdevice) >= %{minimum_libavdevice_version}
85
BuildRequires:  pkgconfig(libavfilter) >= %{minimum_libavfilter_version}
86
BuildRequires:  pkgconfig(libavformat) >= %{minimum_libavformat_version}
87
BuildRequires:  pkgconfig(libavutil)   >= %{minimum_libavutil_version}
88
%ifarch %{ix86} x86_64
89
# comment out until resolved: nothing provides pkgconfig(libmfx)
90
# BuildRequires:  pkgconfig(libmfx)
91
%endif
92
BuildRequires:  pkgconfig(librist)
93
BuildRequires:  pkgconfig(libswresample) >= %{minimum_libswresample_version}
94
BuildRequires:  pkgconfig(libswscale)    >= %{minimum_libswscale_version}
95
BuildRequires:  pkgconfig(libva)
96
BuildRequires:  pkgconfig(lua)
97
BuildRequires:  pkgconfig(luajit)
98
BuildRequires:  pkgconfig(srt) >= 1.4
99
BuildRequires:  pkgconfig(uuid)
100
BuildRequires:  pkgconfig(rnnoise)
101
%if %{with nvenc}
102
BuildRequires:  pkgconfig(ffnvcodec) >= 12.1.14.0
103
%endif
104
BuildRequires:  pkgconfig(vpl)
105
BuildRequires:  libdatachannel-devel
106
BuildRequires:  pkgconfig(nlohmann_json) >= 3
107
%if %{with websockets}
108
BuildRequires:  pkgconfig(websocketpp) >= 0.8.0
109
BuildRequires:  pkgconfig(asio) >= 1.12.1
110
BuildRequires:  pkgconfig(qrcodegencpp)
111
%endif
112
BuildRequires:  python%{python_version}-devel >= 3.8
113
%if 0%{?suse_version} != 1315 || 0%{?is_opensuse}
114
BuildRequires:  speexdsp-devel
115
%endif
116
BuildRequires:  sndio-devel
117
BuildRequires:  swig
118
BuildRequires:  uthash-devel
119
BuildRequires:  vlc-devel
120
%if %{with cef}
121
BuildRequires:  mozilla-nss
122
BuildRequires:  mozilla-nspr
123
%endif
124
# these deps couldn't be tracked
125
Requires:       librist4
126
Requires:       libsrt1_5
127
Requires:       libspeexdsp1
128
Recommends:     qt6-wayland
129
ExclusiveArch:  x86_64 aarch64
130
131
Recommends:     obs-studio-x264
132
133
# these are plugins, built as libs and as such should not be mixed up with their originals
134
%global __provides_exclude_from ^(%{_libdir}/obs-plugins/.*\\.so.*|%{_libdir}/obs-scripting/.*\\.so.*)$
135
%global __requires_exclude libcef\\.so
136
137
%description
138
Open Broadcaster Software is free and open source software for video recording and live streaming.
139
140
%if %{with split_obs_x264}
141
%package x264
142
Summary:        libx264 support for obs-studio
143
#
144
Requires:       obs-studio = %{version}-%{release}
145
%description x264
146
Open Broadcaster Software is free and open source software for video recording and live streaming.
147
148
This package holds the obs-x264 plugin for obs-studio
149
%endif
150
151
%package devel
152
Summary:        A recording/broadcasting program - Development Files
153
Group:          Development/Multimedia
154
Requires:       %{name} = %{version}
155
156
%description devel
157
Open Broadcaster Software is free and open source software for video recording and live streaming.
158
159
%prep
160
%autosetup -p1
161
%if %{with cef}
162
tar xvf %{SOURCE17} -C %{_builddir}
163
%endif
164
165
%build
166
%if 0%{?force_gcc_version}
167
export CC="gcc-%{?force_gcc_version}"
168
export CXX="g++-%{?force_gcc_version}"
169
%endif
170
171
mkdir -p build && cd build
172
# does not like cmake macro as it fails to link in math.h (-lma
173
# the compile flags must be relaxed in order to compile obs-studio successfully
174
export CFLAGS="%{optflags} -Wno-error=type-limits -Wno-error=unused-variable -Wno-error=deprecated-declarations -Wno-error=return-type -Wno-error=unused-but-set-variable -Wno-error=pointer-sign -Wno-error=reorder -Wno-error=switch -Wno-error=catch-value="
175
export CXXFLAGS="%{optflags} -Wno-error=type-limits -Wno-error=unused-variable -Wno-error=deprecated-declarations -Wno-error=return-type -Wno-error=unused-but-set-variable -Wno-error=pointer-sign -Wno-error=reorder -Wno-error=switch -Wno-error=catch-value="
176
177
cmake \
178
  -DCMAKE_CXX_STANDARD=17 \
179
  -DCMAKE_INSTALL_PREFIX=/usr \
180
  -DCMAKE_C_FLAGS:STRING="$CFLAGS" \
181
  -DCMAKE_CXX_FLAGS:STRING="$CXXFLAGS" \
182
  -DUNIX_STRUCTURE=1 \
183
%if "%{_lib}" == "lib64"
184
  -DOBS_MULTIARCH_SUFFIX=64 \
185
%endif
186
  -DOBS_VERSION_OVERRIDE="$(echo "%{version}" | grep -oE "^[^+]+")" \
187
  -DENABLE_AJA=OFF \
188
%if %{with nvenc}
189
  -DENABLE_NVENC=ON \
190
%else
191
  -DENABLE_NVENC=OFF \
192
%endif
193
%if 0%{?sle_version} > 150000 && 0%{?sle_version} < 150500 && 0%{?is_opensuse}
194
  -DENABLE_PIPEWIRE=OFF \
195
%endif
196
  -DENABLE_JACK=ON \
197
  -DENABLE_LIBFDK=ON \
198
  -DENABLE_SNDIO=ON \
199
%if %{with websockets}
200
  -DENABLE_WEBSOCKET=ON \
201
%else
202
  -DENABLE_WEBSOCKET=OFF \
203
%endif
204
%if %{with cef}
205
  -DBUILD_BROWSER=ON \
206
  -DCEF_ROOT_DIR="%{_builddir}/%{cef_binary}" \
207
%else
208
  -DBUILD_BROWSER=OFF \
209
%endif
210
  ..
211
212
%cmake_build
213
214
%install
215
%cmake_install
216
%suse_update_desktop_file com.obsproject.Studio
217
%fdupes %{buildroot}%{_datadir}/obs/
218
219
%post
220
/sbin/ldconfig
221
%icon_theme_cache_postun
222
223
%postun
224
/sbin/ldconfig
225
%icon_theme_cache_postun
226
227
%files
228
%{_bindir}/obs
229
%{_bindir}/obs-ffmpeg-mux
230
%if %{with nvenc}
231
%{_bindir}/obs-nvenc-test
232
%endif
233
# Upstream forces libs dir regardless of arch and building plugins is encumbered
234
# by moving them to the proper directory.
235
%{_libdir}/obs-plugins/
236
%if %{with split_obs_x264}
237
%exclude %{_libdir}/obs-plugins/obs-x264.so
238
%endif
239
%{_libdir}/libobs.so.*
240
%{_libdir}/libobs-frontend-api.so.*
241
%{_libdir}/libobs-opengl.so.*
242
%{_libdir}/libobs-scripting.so.*
243
%{_libdir}/obs-scripting/
244
%dir %{_datadir}/metainfo
245
%{_datadir}/metainfo/com.obsproject.Studio.metainfo.xml
246
%{_datadir}/applications/com.obsproject.Studio.desktop
247
%{_datadir}/icons/hicolor
248
%{_datadir}/obs/
249
%if %{with split_obs_x264}
250
%exclude %{_datadir}/obs/obs-x264/
251
%endif
252
253
%if %{with split_obs_x264}
254
%files x264
255
%{_libdir}/obs-plugins/obs-x264.so
256
%{_datadir}/obs/obs-x264/
257
%endif
258
259
%files devel
260
%{_libdir}/libobs.so
261
%{_libdir}/libobs-frontend-api.so
262
%{_libdir}/libobs-opengl.so
263
%{_libdir}/libobs-scripting.so
264
%{_libdir}/cmake
265
%{_libdir}/pkgconfig/libobs.pc
266
%{_includedir}/obs
267
%{_libdir}/pkgconfig/obs-frontend-api.pc
268
269
%changelog
270