File obs-v4l2sink.spec of Package obs-v4l2sink

%define obs_studio_version 24.0.0

Name:           obs-v4l2sink
Version:        0.1.0
Release:        0
Summary:        OBS studio output plugin for Video4Linux2 device
Group:          Productivity/Multimedia/Video/Editors and Convertors
License:        GPL-2.0
URL:            https://github.com/CatxFish/obs-v4l2sink
Source:         %{name}-%{version}.tar.xz
Source1:        obs-studio-%{obs_studio_version}.tar.xz
Patch0:         obs-v4l2sink.patch
Patch1:         close-return-void.diff
BuildRequires:  cmake
BuildRequires:  gcc
BuildRequires:  gcc-c++
BuildRequires:  libqt5-qtbase-devel
BuildRequires:  obs-studio-devel
Recommends:     v4l2loopback-kmp
Recommends:     v4l2loopback-utils
ExclusiveArch:  i586 x86_64

%description
An OBS Studio plugin that provides output capabilities to a Video4Linux2 device.
It is basically a Linux version of obs-virtual-cam, but only contains the video
sink part. You can use it with v4l2loopback to achieve cross-program video
transfer between OBS Studio and third party software supporting Video4Linux2,
e.g. to present an OBS session in proprietary browser-based conferencing systems
by selecting the OBS session as a webcam.

%prep
%autosetup -p1 -a 1

%build
%cmake \
%if "%{_lib}" == "lib64"
  -DOBS_MULTIARCH_SUFFIX=64 \
%endif
  -DLIBOBS_INCLUDE_DIR="../obs-studio-%{obs_studio_version}/libobs"

%install
%cmake_install

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%files
%{_datadir}/obs
%{_libdir}/obs-plugins

%changelog