File phonon4qt5-backend-mpv.spec of Package phonon4qt5-backend-mpv

#
# spec file for package phonon4qt5-backend-mpv
#
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via https://bugs.opensuse.org/
#

%if "@BUILD_FLAVOR@" == "qt6"
%define qt6_package 1
%define _phonon4qt6_version 4.9.50
%else
# do we actually need this one?
%define _phonon4qt5_version 4.11
%endif
%if ! 0%{?qt6_package}
Name:           phonon4qt5-backend-mpv
%else
Name:           phonon4qt6-backend-mpv
%endif
Version:        0.1.0
Release:        0
Summary:        Phonon Backend using MPV Player(libmpv)
License:        LGPL-2.1-or-later
Group:          System/GUI/KDE
URL:            https://github.com/OpenProgger/phonon-mpv
Source0:        https://github.com/OpenProgger/phonon-mpv/archive/v%{version}.tar.gz#/phonon-mpv-%{version}.tar.gz
BuildRequires:  cmake >= 3.5
%if ! 0%{?qt6_package}
BuildRequires:  extra-cmake-modules >= 5.90
%else
BuildRequires:  kf6-extra-cmake-modules
%endif
%if ! 0%{?qt6_package}
BuildRequires:  kf5-filesystem
BuildRequires:  libQt5Gui-private-headers-devel
BuildRequires:  pkgconfig
BuildRequires:  pkgconfig(Qt5Gui)
BuildRequires:  pkgconfig(Qt5Widgets)
BuildRequires:  pkgconfig(Qt5X11Extras)
%else
BuildRequires:  pkgconfig(Qt6OpenGLWidgets)
###BuildRequires:  pkgconfig(Qt6Qt6XcbQpaPrivate)
%endif
BuildRequires:  pkgconfig(mpv) >= 1.101.0
%if ! 0%{?qt6_package}
BuildRequires:  pkgconfig(phonon4qt5) >= %{_phonon4qt5_version}
%else
BuildRequires:  pkgconfig(phonon4qt6) >= %{_phonon4qt6_version}
%endif
%if ! 0%{?qt6_package}
Requires:       libphonon4qt5 >= %{_phonon4qt5_version}
Provides:       phonon4qt5-backend = %{version}
%else
Requires:       libphonon4qt6 >= %{_phonon4qt6_version}
Provides:       phonon4qt6-backend = %{version}
%endif

%description
This is a fork of phonon-vlc, rewritten to work with libmpv instead of
libVLC. libmpv supports less features than VLC but they are only
related to memory streams and audio/video dumps. This backend should be
a lightweight alternative to libVLC with less dependencies.

%prep
%autosetup -n phonon-mpv-%{version}

%build
%if ! 0%{?qt6_package}
%cmake_kf5
%cmake_build
%else
%cmake_kf6 \
  -DPHONON_BUILD_QT5=OFF \
  -DPHONON_BUILD_QT6=ON
%kf6_build
%endif

%install
%if ! 0%{?qt6_package}
%kf5_makeinstall
%else
%kf6_install
%endif

%files
%license COPYING.LIB
%doc README.md
%if ! 0%{?qt6_package}
%dir %{_kf5_plugindir}/phonon4qt5_backend
%{_kf5_plugindir}/phonon4qt5_backend/phonon_mpv_qt5.so
%else
%dir %{_kf6_plugindir}/phonon4qt6_backend
%{_kf6_plugindir}/phonon4qt6_backend/phonon_mpv_qt6.so
%endif

%changelog
openSUSE Build Service is sponsored by