%global forgeurl https://github.com/npwoods/bletchmame
Name: bletchmame
Version: 2.9
Release: %autorelease
Summary: MAME emulator frontend
License: GPLv3
URL: https://www.bletchmame.org
Source0: %{forgeurl}/archive/v%{version}/%{name}-%{version}.tar.gz
Source1: README.fedora
# Use the distribution MAME by default
Patch0: bletchmame-default-paths.patch
# PR#219: tests: do not segfault on failure
Patch1: %{forgeurl}/pull/219.patch#/bletchmame-tests-do-not-segfault-on-failure.patch
# Temporarily disable due to missing dependencies
# https://bugzilla.redhat.com/show_bug.cgi?id=2016829
ExcludeArch: s390x
BuildRequires: gcc-c++
BuildRequires: cmake
BuildRequires: desktop-file-utils
BuildRequires: expat-devel
BuildRequires: libappstream-glib
BuildRequires: libxkbcommon-devel
BuildRequires: observable-devel
BuildRequires: python3
BuildRequires: qt6-qttools-devel
BuildRequires: qt6-qtbase-devel
BuildRequires: qt6-qt5compat-devel
BuildRequires: quazip-qt6-devel
BuildRequires: sed
BuildRequires: zlib-devel
Recommends: mame
Recommends: mame-data-software-lists
%description
BletchMAME is a new experimental front end for MAME. Unlike existing front ends
(which function as launchers, keeping MAME's internal UI), BletchMAME replaces
the internal MAME UI with a more conventional point and click GUI to provide a
friendlier experience in a number of areas (such as profiles, input
configuration and a number of others). While BletchMAME is intended to support
all machines supported by MAME, it should be particularly suitable to computer
emulation.
%prep
%autosetup -p1
cp -p %{SOURCE1} .
# remove bundled libraries
rm -r lib/*
ln -s %{_includedir}/observable lib/observable
# Set build version
cat > src/buildversion.gen.cpp <<EOF
const char buildVersion[] = "$(echo "v%{version}" | python3 version.py)";
const char buildRevision[] = "%{commit}";
const char buildDateTime[] = "$(date -Ins)";
EOF
%build
# Disable libraries as they're only for internal use and not meant to be
# installed
%cmake \
-DUSE_SHARED_LIBS=ON \
-DBUILD_SHARED_LIBS=OFF \
-DBUILD_STATIC_LIBS=OFF \
-DHAS_BUILDVERSION_GEN_CPP=1
%cmake_build
%install
%cmake_install
mkdir -p %{buildroot}%{_datadir}/%{name}
cp -pr plugins %{buildroot}%{_datadir}/%{name}
desktop-file-install --dir=%{buildroot}%{_datadir}/applications %{name}.desktop
install -Dpm0644 -t %{buildroot}%{_metainfodir} %{name}.metainfo.xml
appstream-util validate-relax --nonet \
%{buildroot}%{_metainfodir}/%{name}.metainfo.xml
%check
%ctest
%files
%license LICENSE.rtf
%doc README.md README.fedora
%{_bindir}/BletchMAME
%{_datadir}/%{name}
%{_datadir}/applications/%{name}.desktop
%{_metainfodir}/%{name}.metainfo.xml
%changelog
%autochangelog