File obs-studio.spec of Package obs-studio (Revision 113)

Currently displaying revision 113 , Show latest

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