File edisonengine.spec of Package edisonengine

#
# spec file for package edisonengine
#
# Copyright (c) 2022 SUSE LLC
# Copyright (c) 2021-2022, Martin Hauke <mardnh@gmx.de>
#
# 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/
#


%define _cimg_version 2.9.9
%define _pybind11_version 2.9.0
%define _gsl_lite_version 0.40.0
%define _glm_version 0.9.9.8
#
Name:           edisonengine
Version:        1.4.1
Release:        0
Summary:        A Tomb Raider 1 game engine
License:        Apache-2.0 AND LGPL-3.0-only AND OFL-1.0 AND BSD-3-Clause
Group:          Amusements/Games/Action/Arcade
#Git-Clone:     https://github.com/stohrendorf/EdisonEngine.git
URL:            https://github.com/stohrendorf/EdisonEngine
Source:         EdisonEngine-%{version}.tar.xz
# SECTION 3rd-party sources
Source1:        https://github.com/dtschump/CImg/archive/v.%{_cimg_version}.tar.gz#/CImg-v.%{_cimg_version}.tar.gz
Source2:        https://github.com/pybind/pybind11/archive/v%{_pybind11_version}.tar.gz#/pybind11-v%{_pybind11_version}.tar.gz
Source3:        https://github.com/gsl-lite/gsl-lite/archive/refs/tags/v%{_gsl_lite_version}.tar.gz#/gsl-lite-v%{_gsl_lite_version}.tar.gz
Source4:        https://github.com/g-truc/glm/archive/refs/tags/%{_glm_version}.tar.gz#/glm-%{_glm_version}.tar.gz
# /SECTION
BuildRequires:  cmake >= 3.16
BuildRequires:  ffmpeg-devel
BuildRequires:  gcc-c++
BuildRequires:  gcc-c++
BuildRequires:  libboost_atomic-devel
BuildRequires:  libboost_chrono-devel
BuildRequires:  libboost_filesystem-devel
BuildRequires:  libboost_locale-devel
BuildRequires:  libboost_log-devel
BuildRequires:  libboost_program_options-devel
BuildRequires:  libboost_regex-devel
BuildRequires:  libboost_stacktrace-devel
BuildRequires:  libboost_system-devel
BuildRequires:  libboost_test-devel
BuildRequires:  libboost_thread-devel
BuildRequires:  pkgconfig
BuildRequires:  update-desktop-files
BuildRequires:  utfcpp-devel
BuildRequires:  pkgconfig(Qt5Core)
BuildRequires:  pkgconfig(Qt5Gui)
BuildRequires:  pkgconfig(Qt5Network)
BuildRequires:  pkgconfig(Qt5Widgets)
BuildRequires:  pkgconfig(freetype2)
BuildRequires:  pkgconfig(gl)
BuildRequires:  pkgconfig(glfw3)
BuildRequires:  pkgconfig(libarchive)
BuildRequires:  pkgconfig(libavcodec)
BuildRequires:  pkgconfig(libavformat)
BuildRequires:  pkgconfig(libavutil)
BuildRequires:  pkgconfig(openal)
%if 0%{?sle_version} >= 150200 && 0%{?sle_version} < 160000 && 0%{?is_opensuse}
BuildRequires:  gcc9
BuildRequires:  gcc9-c++
%else
BuildRequires:  gcc-c++
%endif
# SECTION 3rd-party BuildRequires
BuildRequires:  git-core
BuildRequires:  python3-devel
BuildRequires:  pkgconfig(libpng)
BuildRequires:  pkgconfig(zlib)
# /SECTION
Provides:       bundled(glm) = %{_glm_version}
Provides:       bundled(cimg) = %{_cimg_version}
Provides:       bundled(gsl-lite) = %{_gsl_lite_version}
Provides:       bundled(pybind11) = %{_pybind11_version}

%description
An open-source Tomb Raider 1 engine.

NOTE:
To play Tomb Raider with edisonengine you need the original game files.
Game data must be placed in ~/.local/share/edisonengine/data/tr1/

%prep
%setup -q -n EdisonEngine-%{version}
cp -v %{SOURCE1} %{SOURCE2} %{SOURCE3} %{SOURCE4} ./3rdparty/

%build
%if 0%{?sle_version} >= 150200 && 0%{?sle_version} < 160000 && 0%{?is_opensuse}
export CC="gcc-9"
export CXX="g++-9"
%endif
%cmake -DBUILD_SHARED_LIBS=OFF
%cmake_build

%install
%cmake_install

%files
%license "share/Apache License.txt" LICENSE share/OFL.txt
%doc README.md
%{_bindir}/edisonengine
%{_datadir}/edisonengine
%{_datadir}/applications/%{name}.desktop
%{_datadir}/pixmaps/%{name}.png

%changelog
openSUSE Build Service is sponsored by