File scummvm.spec of Package scummvm

# spec file for package scummvm
# 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

%bcond_with faad
%bcond_without libmpeg2
%bcond_without mad
Name:           scummvm
Version:        2.7.1
Release:        0
Summary:        Interpreter for several adventure games
License:        GPL-3.0-or-later
Group:          Amusements/Games/Other
BuildRequires:  desktop-file-utils
BuildRequires:  discord-rpc-devel
BuildRequires:  gcc-c++
BuildRequires:  hicolor-icon-theme
%if 0%{?suse_version} > 1500
BuildRequires:  libieee1284-devel
BuildRequires:  libjpeg-devel
BuildRequires:  pkgconfig
BuildRequires:  pkgconfig(alsa) >= 0.9
BuildRequires:  pkgconfig(flac) >= 1.0.1
BuildRequires:  pkgconfig(fluidsynth)
BuildRequires:  pkgconfig(freetype2)
BuildRequires:  pkgconfig(libpng) >= 1.2.8
BuildRequires:  pkgconfig(ogg)
BuildRequires:  pkgconfig(theoradec) >= 1.0
BuildRequires:  pkgconfig(vorbis)
BuildRequires:  pkgconfig(vorbisfile)
BuildRequires:  pkgconfig(zlib)
Suggests:       %{name}-extra
Suggests:       %{name}-tools
%if %{with faad}
BuildRequires:  libfaad-devel
%if %{with mad}
BuildRequires:  pkgconfig(mad)
%if %{with libmpeg2}
BuildRequires:  pkgconfig(libmpeg2) >= 0.4.0
%ifarch %{ix86}
BuildRequires:  nasm
BuildRequires:  fdupes
BuildRequires:  fribidi-devel
BuildRequires:  giflib-devel
BuildRequires:  glew-devel
BuildRequires:  liba52-devel
BuildRequires:  libcurl-devel
BuildRequires:  libspeechd-devel
BuildRequires:  pkgconfig(SDL2_net)

ScummVM is an interpreter that will play graphic adventure games written for
LucasArts' SCUMM virtual machine (such as Day of the Tentacle and
Monkey Island), Sierra's AGI adventures (such as early King's Quest and
Space Quest games), Adventure Soft's Simon the Sorcerer 1, 2 and Feeble Files,
Revolution Software's Beneath a Steel Sky and Broken Sword 1, 2 and 2.5,
Interactive Binary Illusions' Flight of the Amazon Queen,
Coktel Vision's Gobliiins, Wyrmkeep's Inherit the Earth, Westwood's
Legend of Kyrandia, and various others.

%package extra
Summary:        Extra engines for ScummVM
Group:          Amusements/Games/Other
Requires:       %{name} = %{version}

%description extra
lastexpress and toltecs engines for ScummVM.
These engines are in a worse state, but allow to play extra games.

%setup -q

# build the endianness test without optimization otherwise gcc is too smart
# and optimize everything away, making the test fail
sed -i '/tmp_endianness_check.cpp/ s/$CXXFLAGS/$CXXFLAGS -fno-lto -O0/' configure
#allow to use liba52 from svn
sed -i '/a52_init/s@(0)@()@' configure
sed -i '/a52_init/s@(0)@()@' audio/decoders/ac3.cpp

# scummvm relies on -gsplit-dwarf which is incompatible with -flto
%define _lto_cflags %{nil}

# No rpm configure because scummvm's configure isn't a real configure and thus
# doesn't understand some of the options %%configure passes.
CXXFLAGS="%{optflags}" ; export CXXFLAGS ; \
./configure --prefix=%{_prefix} \
            --bindir=%{_bindir} \
            --datarootdir=%{_datadir} \
            --mandir=%{_mandir} \
            --libdir=%{_libdir} \
            --docdir=%{_docdir}/%{name} \
            --enable-verbose-build \
            --enable-plugins \
            --enable-engine-dynamic=lastexpress \
            --enable-engine-dynamic=wintermute \

# Subengines are not included even as dynamic since I don't want to touch the main engines
make %{?_smp_mflags}

rm %{buildroot}%{_docdir}/%{name}/COPYING*
%fdupes %{buildroot}%{_datadir}/scummvm

%license COPYING*
%attr(0755,-,-) %{_bindir}/scummvm

%files extra

openSUSE Build Service is sponsored by