File bomi.spec of Package bomi

# spec file for package bomi
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
# 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

Name:           bomi
Version:        0.9.11
Release:        0
Summary:        Powerful and easy-to-use multimedia player
# MPL.txt is for libchardet which is in a separate package.
License:        GPL-2.0+ and BSD-3-Clause
Group:          Productivity/Multimedia/Sound/Players
ExclusiveArch:  x86_64
# PATCH-FIX-UPSTREAM bomi-compilation-fix.patch -- Fix bomi compilation.
Patch0:         %{name}-compilation-fix.patch
# PATCH-FIX-UPSTREAM bomi-mpv-ffmpeg-3.0.patch -- Fix MPV build with FFmpeg 3.0.
Patch1:         %{name}-mpv-fix-ffmpeg-3.0.patch
Patch2:         bomi-builddate.patch
BuildRequires:  fdupes
BuildRequires:  hicolor-icon-theme
BuildRequires:  libqt5-linguist
BuildRequires:  pkgconfig
# waf is written in Python 2.x.
BuildRequires:  python
BuildRequires:  update-desktop-files
BuildRequires:  pkgconfig(Qt5Core) >= 5.2
BuildRequires:  pkgconfig(Qt5DBus) >= 5.2
BuildRequires:  pkgconfig(Qt5Gui) >= 5.2
BuildRequires:  pkgconfig(Qt5Network) >= 5.2
BuildRequires:  pkgconfig(Qt5Quick) >= 5.2
BuildRequires:  pkgconfig(Qt5Sql) >= 5.2
BuildRequires:  pkgconfig(Qt5Svg) >= 5.2
BuildRequires:  pkgconfig(Qt5Widgets) >= 5.2
BuildRequires:  pkgconfig(Qt5X11Extras) >= 5.2
BuildRequires:  pkgconfig(Qt5Xml) >= 5.2
BuildRequires:  pkgconfig(alsa)
BuildRequires:  pkgconfig(bzip2)
BuildRequires:  pkgconfig(chardet)
BuildRequires:  pkgconfig(dvdnav)
BuildRequires:  pkgconfig(dvdread)
BuildRequires:  pkgconfig(glib-2.0)
BuildRequires:  pkgconfig(gobject-2.0)
BuildRequires:  pkgconfig(jack)
BuildRequires:  pkgconfig(libass) >= 0.12.1
BuildRequires:  pkgconfig(libavcodec) = 57.107.100
BuildRequires:  pkgconfig(libavfilter) = 6.107.100
BuildRequires:  pkgconfig(libavformat) = 57.83.100
BuildRequires:  pkgconfig(libavutil) = 55.78.100
BuildRequires:  pkgconfig(libbluray)
BuildRequires:  pkgconfig(libcdio)
BuildRequires:  pkgconfig(libcdio_cdda)
BuildRequires:  pkgconfig(libcdio_paranoia)
BuildRequires:  pkgconfig(libpulse)
BuildRequires:  pkgconfig(libswresample) = 2.9.100
BuildRequires:  pkgconfig(libswscale) = 4.8.100
BuildRequires:  pkgconfig(libsystemd)
BuildRequires:  pkgconfig(libva)
BuildRequires:  pkgconfig(libva-glx)
BuildRequires:  pkgconfig(libva-x11)
BuildRequires:  pkgconfig(smbclient)
BuildRequires:  pkgconfig(vdpau)
BuildRequires:  pkgconfig(x11)
BuildRequires:  pkgconfig(xcb)
BuildRequires:  pkgconfig(xcb-icccm)
BuildRequires:  pkgconfig(xcb-randr)
BuildRequires:  pkgconfig(xcb-screensaver)
BuildRequires:  pkgconfig(xcb-xtest)
Requires:       libqt5-qtquickcontrols
# Streaming support for Dailymotion, YouTube, etc.
Recommends:     youtube-dl
%if 0%{?suse_version} > 1320
BuildRequires:  gcc-c++
%if 0%{?suse_version} == 1315
# SLE12SP5Backports
BuildRequires:  gcc8-c++

bomi is a themable Qt-based multimedia player based on the MPV
video backend which is aimed for easy usage but also provides
various powerful features and convenience functions.

%autosetup -p1

CFLAGS='%{optflags} -Wno-deprecated-declarations'
CXXFLAGS='%{optflags} -Wno-deprecated-declarations'
test -x "$(type -p gcc)"   && CC="$_"
test -x "$(type -p gcc-5)" && CC="$_"
test -x "$(type -p gcc-6)" && CC="$_"
test -x "$(type -p gcc-7)" && CC="$_"
test -x "$(type -p gcc-8)" && CC="$_"
test -x "$(type -p gcc-9)" && CC="$_"
mkdir dummy
pushd $_
tee <<_EOF_
SOURCES       = main.cpp 
QT += svg
TEMPLATE = app  
target.path += %{_libexecdir}/%{name}/bin
INSTALLS += target
tee main.cpp <<_EOF_
#include <QtSvg>
int main(void)
	QSvgGenerator svg;
	return 0;
readelf -Wa svg_dummy | grep NEED
./configure \
  --release                             \
  --cc=${CC}                            \
  %{?jobs:--parallel=%{jobs}}           \
  --prefix=%{_prefix}                   \

pushd dummy
make \
	STRIP=true \
	INSTALL_ROOT='%{buildroot}' \
%fdupes %{buildroot}%{_datadir}



%doc CHANGES.txt CREDITS.txt
%license COPYING.txt GPL.txt
%dir %{_datadir}/solid/
%dir %{_datadir}/solid/actions/