File openmsx.spec of Package openmsx

#
# spec file for package openmsx
#
# Copyright (c) 2023 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/
#


Name:           openmsx
Version:        20.0
Release:        0
Summary:        MSX Emulator
License:        GPL-2.0-or-later
Group:          System/Emulators/Other
URL:            https://openmsx.org/
Source:         %{name}-%{version}.tar.gz
Patch0:         %{name}-set-install-location.patch
BuildRequires:  SDL2-devel
BuildRequires:  alsa-devel
BuildRequires:  freetype2-devel
BuildRequires:  glew-devel
BuildRequires:  libSDL2_ttf-devel
BuildRequires:  libogg-devel
BuildRequires:  libpng-devel
BuildRequires:  libtheora-devel
BuildRequires:  libvorbis-devel
BuildRequires:  python3
BuildRequires:  tcl-devel
BuildRequires:  xorg-x11-Mesa-devel
# compilation fails with gcc7
%if 0%{?sle_version} >= 150400 && 0%{?sle_version} < 160000 && 0%{?is_opensuse}
BuildRequires:  gcc11
BuildRequires:  gcc11-c++
%else
BuildRequires:  gcc
BuildRequires:  gcc-c++
%endif

%description
The open source MSX emulator that tries to achieve near-perfect emulation by using a novel emulation model.

Comes with the open-source C-BIOS ROM image. ROMs from real machines can be downloaded at the MSX Archive:

http://www.msxarchive.nl/pub/msx/emulator/system_roms/openMSX/

%prep
%setup -q
%patch -P0 -p1

%build
%if 0%{?sle_version} >= 150400 && 0%{?sle_version} < 160000 && 0%{?is_opensuse}
export CC="gcc-11"
export CXX="g++-11"
%endif
CFLAGS="%{optflags}" CXXFLAGS="%{optflags}" ./configure
CFLAGS="%{optflags}" CXXFLAGS="%{optflags}" make %{?_smp_mflags}

%install
make install INSTALL_BASE=%{buildroot}%{_prefix}/lib/openMSX
install -d -m 755 %{buildroot}%{_bindir}
ln -sf ../lib/openMSX/bin/openmsx %{buildroot}%{_bindir}/openmsx

%files
%license doc/GPL.txt
%doc README
%{_bindir}/openmsx
%{_prefix}/lib/openMSX

%changelog
openSUSE Build Service is sponsored by