File retroarch.spec of Package retroarch

#
# spec file for package
#
# Copyright © 2014 Csida Michael <krysanto@gmail.com>
# Copyright © 2016 Sergey Kondakov <virtuousfox@gmail.com>
# Copyright © 2017–2019 Markus S. <kamikazow@opensuse.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#

%define realname RetroArch
Summary:        A modular multi-system emulator system
Name:           retroarch
Version:        1.7.9
Release:        0
Group:          Emulators
License:        GPL-3.0-or-later
Url:            http://www.libretro.org
Source0:        https://github.com/libretro/RetroArch/archive/v%{version}.tar.gz#/%{realname}-%{version}.tar.xz
Source9:        %{name}.desktop
BuildRequires:  binutils gcc-c++
BuildRequires:  fdupes
BuildRequires:  pkgconfig
BuildRequires:  pkgconfig(alsa)
BuildRequires:  pkgconfig(freetype2)
BuildRequires:  pkgconfig(gbm)
BuildRequires:  pkgconfig(gl)
BuildRequires:  pkgconfig(jack)
BuildRequires:  pkgconfig(libass)
BuildRequires:  pkgconfig(libudev)
BuildRequires:  pkgconfig(libusb-1.0)
BuildRequires:  pkgconfig(libv4l2)
BuildRequires:  pkgconfig(libxml-2.0)
BuildRequires:  pkgconfig(libpulse)
BuildRequires:  pkgconfig(openal)
BuildRequires:  pkgconfig(Qt5Concurrent)
BuildRequires:  pkgconfig(Qt5Core)
BuildRequires:  pkgconfig(Qt5Gui)
BuildRequires:  pkgconfig(Qt5Network)
BuildRequires:  pkgconfig(Qt5Widgets)
BuildRequires:  pkgconfig(sdl2)
BuildRequires:  pkgconfig(SDL2_gfx)
BuildRequires:  pkgconfig(SDL2_image)
BuildRequires:  pkgconfig(SDL2_mixer)
BuildRequires:  pkgconfig(SDL2_net)
BuildRequires:  pkgconfig(SDL2_ttf)
BuildRequires:  pkgconfig(wayland-egl)
BuildRequires:  pkgconfig(x11)
BuildRequires:  pkgconfig(xinerama)
BuildRequires:  pkgconfig(xkbcommon)
BuildRequires:  pkgconfig(xrandr)
BuildRequires:  pkgconfig(xv)
BuildRequires:  pkgconfig(zlib)
BuildRequires:  python3-devel
BuildRequires:  systemd-devel
BuildRequires:  vulkan-devel
# for now RA wants its own copy of glslang
#BuildRequires:  glslang-devel
BuildRequires:  unzip
%if 0%{?suse_version} > 1500
BuildRequires:  p7zip-full
%else
BuildRequires:  p7zip
%endif

%if 0%{?sle_version} == 150000 && 0%{?is_opensuse}
BuildRequires:  pkgconfig(libavcodec)
BuildRequires:  pkgconfig(libavdevice)
BuildRequires:  pkgconfig(libavformat)
BuildRequires:  pkgconfig(libavutil)
BuildRequires:  pkgconfig(libswscale)
%endif

BuildRoot:  %{_tmppath}/%{name}-%{version}-build

%if 0%{?fedora} > 26
%undefine _debugsource_packages
%endif

%description
RetroArch is a modular multi-system emulator system that is designed to be
fast, lightweight, and portable. It has features few other emulators frontends
have, such as real-time rewinding and game-aware shading.

%prep
%setup -q -n %{realname}-%{version}

%build
# it's an override, don't use it on desktop
#    --enable-opengles \
#    --enable-opengles3 \
# it's not standard configure script
./configure --prefix=%{_prefix} \
    --enable-7zip \
    --enable-alsa \
    --enable-al \
    --enable-dylib \
    --enable-egl \
    --enable-ffmpeg \
    --enable-freetype \
    --enable-jack \
    --enable-kms \
    --enable-libusb \
    --enable-materialui \
    --enable-mmap \
    --enable-networking \
    --enable-networkgamepad \
    --enable-opengl \
    --enable-pulse \
    --enable-qt \
    --enable-sdl2 \
    --enable-ssa \
    --enable-threads \
    --enable-thread_storage \
    --enable-udev \
    --enable-v4l2 \
    --enable-vulkan \
    --enable-wayland \
    --enable-x11 \
    --enable-xinerama\
    --enable-xmb \
    --enable-xvideo \
    --enable-zlib \
%ifarch x86
    --enable-sse \
%endif
    --with-man_dir=%{_mandir}
make %{?jobs:-j%jobs}

%install
%make_install

mkdir -p %{buildroot}%{_datadir}/applications
install -m 644 %{SOURCE9} %{buildroot}%{_datadir}/applications/
%fdupes %{buildroot}

%files
%defattr(-,root,root)
%config(noreplace) %{_sysconfdir}/%{name}.cfg
%dir %{_datadir}/doc/%{name}
%{_bindir}/%{name}
%{_bindir}/%{name}-cg2glsl
%{_datadir}/applications/%{name}.desktop
%{_datadir}/doc/%{name}/README.md
%{_datadir}/doc/%{name}/COPYING
%{_datadir}/pixmaps/%{name}.svg
%{_mandir}/man?/%{name}.?*
%{_mandir}/man?/%{name}-cg2glsl.?*

%changelog