File mupen64plus.spec of Package mupen64plus

#
# spec file for package mupen64plus
#
# Copyright (c) 2020 SUSE LLC
# Copyright (c) 2013 Guido Berhoerster <gber@opensuse.org>.
#
# 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/
#


Name:           mupen64plus
Version:        2.5.9
Release:        0
Summary:        Plugin-Based Nintendo 64 Emulator
License:        GPL-2.0-or-later
Group:          System/Emulators/Other
URL:            https://www.mupen64plus.org
Source:         https://github.com/mupen64plus/mupen64plus-core/releases/download/%{version}/mupen64plus-bundle-src-%{version}.tar.gz
Source100:      %{name}-rpmlintrc
# PATCH-FIX-OPENSUSE mupen64plus-fix-cflags.patch gber@opensuse.org -- Fix the Makefiles not to hardcode optimizations
Patch0:         mupen64plus-fix-cflags.patch
# PATCH-FIX-OPENSUSE mupen64plus-use-system-font.patch gber@opensuse.org -- Use system DejaVu font rather than an inlined copy of it
Patch1:         mupen64plus-use-system-font.patch
# PATCH-FIX-OPENSUSE mupen64plus-binutils-2_29.patch adrian.glaubitz@suse.com -- Override broken binutils version check
Patch2:         mupen64plus-binutils-2_29.patch
# PATCH-FIX-UPSTREAM kkaempf@suse.de - don't declare globals in includes
Patch3:         don-t-put-globals-in-include-files.patch
BuildRequires:  binutils-devel
BuildRequires:  hicolor-icon-theme
BuildRequires:  gcc-c++
BuildRequires:  nasm
BuildRequires:  libboost_filesystem-devel
BuildRequires:  libboost_system-devel
BuildRequires:  lirc-devel
BuildRequires:  pkgconfig
BuildRequires:  pkgconfig(freetype2)
BuildRequires:  pkgconfig(libpng)
BuildRequires:  pkgconfig(samplerate)
BuildRequires:  pkgconfig(sdl2)
BuildRequires:  pkgconfig(zlib)

%description
Mupen64Plus is a plugin-based N64 emulator which is capable of accurately
playing many games. It includes four MIPS R4300 CPU emulators, with dynamic
recompilers for 32-bit x86 and 64-bit amd64 systems.  It supports plugins for
audio, graphical rendering (RDP), the signal co-processor (RSP), and input.

%package -n libmupen64plus2
Summary:        Shared Library Interface to the Mupen64plus Nintendo 64 Emulator
Group:          System/Emulators/Other
Requires:       dejavu

%description -n libmupen64plus2
Mupen64Plus is a plugin-based N64 emulator which is capable of accurately
playing many games. It includes four MIPS R4300 CPU emulators, with dynamic
recompilers for 32-bit x86 and 64-bit amd64 systems.  It supports plugins for
audio, graphical rendering (RDP), the signal co-processor (RSP), and input.

This package contains the shared library interface for Mupen64plus frontends.

%package -n libmupen64plus-devel
Summary:        Include Files for Mupen64plus Development
Group:          Development/Libraries/C and C++
Requires:       libmupen64plus2 = %{version}

%description -n libmupen64plus-devel
This package contains all necessary include files to develop frontends against
the Mupen64plus shared library interface.

%package ui-console
Summary:        Command Line Frontend for the Mupen64plus Nintendo 64 Emulator
Group:          System/Emulators/Other
Requires:       libmupen64plus2
Requires:       mupen64plus-plugin-audio
Requires:       mupen64plus-plugin-input
Requires:       mupen64plus-plugin-rsp
Requires:       mupen64plus-plugin-video

%description ui-console
Mupen64Plus is a plugin-based N64 emulator which is capable of accurately
playing many games.

This package contains a command line frontend.

%package plugin-audio-sdl
Summary:        SDL Audio Plugin for the Mupen64plus Nintendo 64 Emulator
Group:          System/Emulators/Other
Provides:       mupen64plus-plugin-audio

%description plugin-audio-sdl
This package contains the SDL audio plugin for the Mupen64plus Nintendo 64
Emulator.

%package plugin-input-sdl
Summary:        SDL Input Plugin for the Mupen64plus Nintendo 64 Emulator
Group:          System/Emulators/Other
Provides:       mupen64plus-plugin-input

%description plugin-input-sdl
This package contains the SDL input plugin for the Mupen64plus Nintendo 64
Emulator. It has LIRC Infrared remote control interface and Rumble Pak support.

%package plugin-rsp-hle
Summary:        RSP High-Level Emulation Plugin For the Mupen64plus Nintendo 64 Emulator
Group:          System/Emulators/Other
Provides:       mupen64plus-plugin-rsp

%description plugin-rsp-hle
This package contains the RSP High-Level emulation plugin for the Mupen64plus
Nintendo 64 Emulator.

%package plugin-video-rice
Summary:        Rice Video Plugin for the Mupen64plus Nintendo 64 Emulator
Group:          System/Emulators/Other
Provides:       mupen64plus-plugin-video

%description plugin-video-rice
This package contains the Rice Video Plugin for the Mupen64plus Nintendo 64
Emulator. It provides a high-level graphics emulation with support for
high-resolution texture support.

%package plugin-video-glide64mk2
Summary:        Glide64mk2 Video Plugin for the Mupen64plus Nintendo 64 Emulator
Group:          System/Emulators/Other
Provides:       mupen64plus-plugin-video

%description plugin-video-glide64mk2
This package contains the Glide64mk2 Video Plugin for the Mupen64plus
Nintendo 64 Emulator which provides high-level graphics emulation.

%prep
%setup -q -n %{name}-bundle-src-%{version}
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1

%build
%make_build -C source/mupen64plus-core/projects/unix all \
    OPTFLAGS="%{optflags}" \
%ifnarch x86_64
    NO_ASM=1 \
%endif
    PIC=1 \
    PREFIX=%{_prefix} \
    SHAREDIR=%{_datadir}/mupen64plus2 \
    LIBDIR=%{_libdir} \
    LIRC=1 \
    V=1
# Leads to undefined symbols
#    DEBUGGER=1 \
%make_build -C source/mupen64plus-ui-console/projects/unix all \
    OPTFLAGS="%{optflags}" \
    PIC=1 \
    PIE=1 \
    PREFIX=%{_prefix} \
    LIBDIR=%{_libdir} \
    SHAREDIR=%{_datadir}/mupen64plus2 \
    COREDIR=%{_libdir}/ \
    PLUGINDIR=%{_libdir}/mupen64plus2 \
    V=1
%make_build -C source/mupen64plus-audio-sdl/projects/unix all \
    OPTFLAGS="%{optflags}" \
    PIC=1 \
    PREFIX=%{_prefix} \
    LIBDIR=%{_libdir} \
    PLUGINDIR=%{_libdir}/mupen64plus2 \
    V=1
%make_build -C source/mupen64plus-input-sdl/projects/unix all \
    OPTFLAGS="%{optflags}" \
    PIC=1 \
    PREFIX=%{_prefix} \
    LIBDIR=%{_libdir} \
    SHAREDIR=%{_datadir}/mupen64plus2 \
    PLUGINDIR=%{_libdir}/mupen64plus2 \
    V=1
%make_build -C source/mupen64plus-rsp-hle/projects/unix all \
    OPTFLAGS="%{optflags}" \
    PIC=1 \
    PREFIX=%{_prefix} \
    LIBDIR=%{_libdir} \
    PLUGINDIR=%{_libdir}/mupen64plus2 \
    V=1
%make_build -C source/mupen64plus-video-rice/projects/unix all \
%ifnarch x86_64
    OPTFLAGS="%{optflags}" \
    NO_ASM=1 \
%else
    OPTFLAGS="%{optflags} -msse" \
%endif
    PREFIX=%{_prefix} \
    LIBDIR=%{_libdir} \
    SHAREDIR=%{_datadir}/mupen64plus2 \
    PLUGINDIR=%{_libdir}/mupen64plus2 \
    PIC=1 \
    V=1
%make_build -C source/mupen64plus-video-glide64mk2/projects/unix all \
%ifnarch x86_64
    OPTFLAGS="%{optflags} -DNOSSE" \
    NO_ASM=1 \
%else
    OPTFLAGS="%{optflags} -mmmx -msse" \
%endif
    PREFIX=%{_prefix} \
    LIBDIR=%{_libdir} \
    SHAREDIR=%{_datadir}/mupen64plus2 \
    PLUGINDIR=%{_libdir}/mupen64plus2 \
    PIC=1 \
    V=1

%install
# mupen64plus-core still builds from the install target
make -C source/mupen64plus-core/projects/unix install \
    OPTFLAGS="%{optflags}" \
%ifnarch x86_64
    NO_ASM=1 \
%endif
    DESTDIR=%{buildroot} \
    PREFIX=%{_prefix} \
    SHAREDIR=%{_datadir}/mupen64plus2 \
    LIBDIR=%{_libdir} \
    LIRC=1 \
    INSTALL_STRIP_FLAG= \
    V=1
# Leads to undefined symbols
#    DEBUGGER=1 \
(
    cd %{buildroot}%{_libdir}
    ln -s libmupen64plus.so.2.0.0 libmupen64plus.so
)
make -C source/mupen64plus-ui-console/projects/unix install \
    DESTDIR=%{buildroot} \
    PREFIX=%{_prefix} \
    LIBDIR=%{_libdir} \
    SHAREDIR=%{_datadir}/mupen64plus2 \
    COREDIR=%{_libdir}/ \
    PLUGINDIR=%{_libdir}/mupen64plus2 \
    INSTALL_STRIP_FLAG= \
    V=1
rm %{buildroot}%{_datadir}/mupen64plus2/font.ttf
make -C source/mupen64plus-audio-sdl/projects/unix install \
    DESTDIR=%{buildroot} \
    PREFIX=%{_prefix} \
    LIBDIR=%{_libdir} \
    PLUGINDIR=%{_libdir}/mupen64plus2 \
    INSTALL_STRIP_FLAG= \
    V=1
make -C source/mupen64plus-input-sdl/projects/unix install \
    DESTDIR=%{buildroot} \
    PREFIX=%{_prefix} \
    LIBDIR=%{_libdir} \
    SHAREDIR=%{_datadir}/mupen64plus2 \
    PLUGINDIR=%{_libdir}/mupen64plus2 \
    INSTALL_STRIP_FLAG= \
    V=1
make -C source/mupen64plus-rsp-hle/projects/unix install \
    DESTDIR=%{buildroot} \
    PREFIX=%{_prefix} \
    LIBDIR=%{_libdir} \
    PLUGINDIR=%{_libdir}/mupen64plus2 \
    INSTALL_STRIP_FLAG= \
    V=1
make -C source/mupen64plus-video-rice/projects/unix install \
    DESTDIR=%{buildroot} \
    PREFIX=%{_prefix} \
    LIBDIR=%{_libdir} \
    SHAREDIR=%{_datadir}/mupen64plus2 \
    PLUGINDIR=%{_libdir}/mupen64plus2 \
    INSTALL_STRIP_FLAG= \
    V=1
make -C source/mupen64plus-video-glide64mk2/projects/unix install \
    DESTDIR=%{buildroot} \
    PREFIX=%{_prefix} \
    LIBDIR=%{_libdir} \
    SHAREDIR=%{_datadir}/mupen64plus2 \
    PLUGINDIR=%{_libdir}/mupen64plus2 \
    INSTALL_STRIP_FLAG= \
    V=1
chmod -R 0755 %{buildroot}%{_libdir}

%post -n libmupen64plus2 -p /sbin/ldconfig
%postun -n libmupen64plus2 -p /sbin/ldconfig

%files -n libmupen64plus2
%doc source/mupen64plus-core/{LICENSES,README,RELEASE}
%dir %{_datadir}/mupen64plus2
%dir %{_libdir}/mupen64plus2
%{_libdir}/libmupen64plus.so.*
%{_datadir}/mupen64plus2/mupencheat.txt
%{_datadir}/mupen64plus2/mupen64plus.ini

%files -n libmupen64plus-devel
%{_includedir}/mupen64plus
%{_libdir}/libmupen64plus.so

%files ui-console
%doc source/mupen64plus-ui-console/{LICENSES,README,RELEASE}
%{_mandir}/man6/mupen64plus.6*
%{_bindir}/mupen64plus
%{_datadir}//applications/mupen64plus.desktop
%{_datadir}/icons/hicolor/48x48/apps/mupen64plus.png
%{_datadir}/icons/hicolor/scalable/apps/mupen64plus.svg

%files plugin-audio-sdl
%doc source/mupen64plus-audio-sdl/{LICENSES,RELEASE}
%{_libdir}/mupen64plus2/mupen64plus-audio-sdl.so

%files plugin-input-sdl
%doc source/mupen64plus-input-sdl/{AUTHORS,COPYING,LICENSES,README.md,RELEASE}
%{_datadir}/mupen64plus2/InputAutoCfg.ini
%{_libdir}/mupen64plus2/mupen64plus-input-sdl.so

%files plugin-rsp-hle
%doc source/mupen64plus-rsp-hle/{LICENSES,RELEASE}
%{_libdir}/mupen64plus2/mupen64plus-rsp-hle.so

%files plugin-video-rice
%doc source/mupen64plus-video-rice/{LICENSES,README,RELEASE}
%{_datadir}/mupen64plus2/RiceVideoLinux.ini
%{_libdir}/mupen64plus2/mupen64plus-video-rice.so

%files plugin-video-glide64mk2
%doc source/mupen64plus-video-glide64mk2/doc/{fxt1-license,gpl-license}
%{_datadir}/mupen64plus2/Glide64mk2.ini
%{_libdir}/mupen64plus2/mupen64plus-video-glide64mk2.so

%changelog
openSUSE Build Service is sponsored by