File dolphin-emu.spec of Package game-dolphin-emu

%define debug_package %{nil}

# openSUSE Leap 42.x defaults to GCC 4
%if 0%{?suse_version} == 1315
%define _cxx g++-7
BuildRequires:    gcc7 gcc7-c++
%define _cxx g++
BuildRequires:    gcc gcc-c++

%global Source           %(ls %{_sourcedir} | grep .xz)
%global gitrev           0a7395bfba
%global commit_timestamp %(echo %{Source} | cut -c 19-28)

Name:       dolphin-emu
Summary:    Dolphin Emulator
Version:    5.0.0
Release:    %{?gitrev}.%{?dist}
Group:      System/Emulators/Other
License:    GPL-2.0
Source0:    %{name}-%{version}.%{commit_timestamp}.%{gitrev}.tar.xz
Patch0:     GCC8_workaround.patch
#git clone
#BuildArch:  x86_64 armv7l aarch64

# Package names verified with, CentOS, Fedora and openSUSE.
# Should the packages in your distro be named differently,
# see
# All other distros should work as well as Dolphin bundles
# its dependencies for static linking.

BuildRequires:  desktop-file-utils
BuildRequires:  cmake >= 2.8
BuildRequires:  gcc-c++
BuildRequires:  gtk2-devel
BuildRequires:  pkgconfig(alsa)
BuildRequires:  pkgconfig(ao)
BuildRequires:  pkgconfig(bluez)
BuildRequires:  pkgconfig(libpulse)
BuildRequires:  pkgconfig(xrandr)
BuildRequires:  pkgconfig(zlib)

%if 0%{?fedora} || 0%{?rhel_version} || 0%{?centos_version}
#BuildRequires:  systemd-devel
BuildRequires:  libusb-devel
BuildRequires:  lzo-devel
BuildRequires:  miniupnpc-devel
BuildRequires:  openal-soft-devel
BuildRequires:  mbedtls-devel
BuildRequires:  SDL2-devel
BuildRequires:  SFML-devel
BuildRequires:  SOIL-devel
BuildRequires:  soundtouch-devel
BuildRequires:  systemd-devel
BuildRequires:  libevdev-devel
BuildRequires:	libSM-devel
BuildRequires:	mesa-libGL-devel
BuildRequires:	qt5-devel
#BuildRequires:  ffmpeg ffmpeg-libs ffmpeg-devel

%if 0%{?suse_version}
BuildRequires:  libminiupnpc-devel
BuildRequires:  libSOIL-devel
BuildRequires:  sfml2-devel
BuildRequires:  wxWidgets-3_0-devel
BuildRequires:  update-desktop-files
BuildRequires:  pkgconfig(libavcodec)
BuildRequires:  pkgconfig(libavformat)
BuildRequires:  pkgconfig(libavutil)
BuildRequires:  pkgconfig(libswscale)

Dolphin is an emulator for two Nintendo video game consoles, GameCube and the Wii.
It allows PC gamers to enjoy games for these two consoles in full HD with several
enhancements such as compatibility with all PC controllers, turbo speed,
networked multiplayer, and more.
Most games run perfectly or with minor bugs.

# ------------------------------------------------------

%package lang
Summary:        Translations for Dolphin Emulator
BuildArch:      noarch

%description lang
Translations into various languages for Dolphin Emulator

%files lang

# ------------------------------------------------------

%setup -q -n %{name}-%{version}.%{commit_timestamp}.%{gitrev}
#%patch0 -p1

export CCFLAGS='%{optflags}'

# CMake options:
# - ENABLE_ALSA: ALSA sound back-end (on by default, crashes Qt port)
# - ENABLE_ANALYTICS: Analytics on (turn off for forks)
# - ENABLE_QT: Qt GUI (on by default)
# - DOLPHIN_WC_REVISION: Set vesion number for About window
# - DOLPHIN_WC_BRANCH: Set branch name for About window (usually set to "master")
# - USE_DISCORD_PRESENCE: Enables Discord Rich Presence, show the current game on Discord

cmake \
      -DCMAKE_CXX_COMPILER=%{_cxx} \
      -DENABLE_QT=ON \
      -DDOLPHIN_WC_DESCRIBE=%{version} \
      -DDOLPHIN_WC_REVISION=%{_revision} \
      -DDOLPHIN_WC_BRANCH=master \
      -DCMAKE_BUILD_TYPE=Release \
      -DCMAKE_INSTALL_PREFIX=%{_prefix} \
#make %{?_smp_mflags}

export CCFLAGS='%{optflags}'
make %{?_smp_mflags} install DESTDIR="%{?buildroot}"

# Delete static libraries
find %{buildroot} -name '*.a' -delete
# Delete development files
rm -rf %{buildroot}%{_includedir}/

%if 0%{?suse_version}
# Replace desktop file category 'Game;Emulator;' with 'System;Emulator;'
# under openSUSE or else build fails.
%suse_update_desktop_file -c %name Dolphin 'GameCube and Wii emulator' %{name} %{name} 'System;Emulator;'

%doc license.txt

rm -rf %{buildroot}

* Thu Nov 26 2015 Muhammad Shaban <> - 5.0.0-e1fe2db
- update

* Wed Nov 05 2014 Muhammad Shaban <> - 4.0.2-0515ab8
- update

* Wed Oct 29 2014 Muhammad Shaban <> - 4.0.2-089e32b
- initial build