%global optflags %(echo %{optflags} | sed -e 's/-ffat-lto-objects//g' -e 's/-fvar-tracking-assignments//g' -e 's/-Wa,--compress-debug-sections//g' ) %define llvmver llvm17 %define _llvmdir /opt/%{llvmver} Summary: Free implementation of Heroes of the Might and Magic II engine Name: fheroes2 Epoch: 1 Version: 1.1.6 Release: 1 License: GPLv2+ Group: Games/Strategy URL: https://ihhub.github.io/fheroes2 Source0: https://github.com/ihhub/fheroes2/archive/%{version}.tar.gz?/%{name}-%{version}.tar.gz Source1000: %{name}.rpmlintrc Source2: fheroes2.sh Source3: fheroes2.png Source4: fheroes2.desktop Source5: fheroes2.cfg BuildRequires: pkgconfig(freetype2) BuildRequires: pkgconfig(libpng) BuildRequires: pkgconfig(sdl2) BuildRequires: pkgconfig(SDL2_image) BuildRequires: pkgconfig(SDL2_mixer) BuildRequires: pkgconfig(SDL2_net) BuildRequires: pkgconfig(SDL2_ttf) BuildRequires: pkgconfig(zlib) BuildRequires: pkgconfig(dbus-1) BuildRequires: pkgconfig(openssl3.3) BuildRequires: %{llvmver} BuildRequires: cmake >= 3.20 BuildRequires: stdc++-gcc10-devel %description Free implementation of Heroes of the Might and Magic II engine. You need to copy files from data and maps directories from original game into your /usr/share/games/fheroes2/{maps,data} directories respectively. %files %doc changelog.txt LICENSE README.md %{_bindir}/%{name} %{_datadir}/%{name} %{_datadir}/metainfo/%{name}*.xml %{_iconsdir}/hicolor/*/apps/%{name}.png %{_datadir}/pixmaps/%{name}.png %{_datadir}/applications/%{name}.desktop #---------------------------------------------------------------------------- %prep %setup -q %build #export CC=%{_llvmdir}/bin/clang #export CXX=%{_llvmdir}/bin/clang++ #export AR=%{_llvmdir}/bin/llvm-ar #export NM=%{_llvmdir}/bin/llvm-nm export LLD=%{_llvmdir}/bin/lld export READELF=readelf export LDFLAGS="-lstdc++-gcc10" export CXXFLAGS="$CFLAGS" %setup_compile_flags #cmake #clang_gcc_wrapper %cmake \ -DCMAKE_BUILD_TYPE=Release \ -DUSE_SDL_VERSION=SDL2 \ -DENABLE_IMAGE=ON \ -DGET_HOMM2_DEMO=ON \ -DCMAKE_C_COMPILER=%{_llvmdir}/bin/clang \ -DCMAKE_CXX_COMPILER=%{_llvmdir}/bin/clang++ \ -DCMAKE_CXX_FLAGS="-std=c++17" \ -DCMAKE_CXX_FLAGS="-nostdinc++ -I/usr/include/libstdc++-gcc10 -I/usr/include/libstdc++-gcc10/%{_host} -Wc++11-narrowing " \ -DCMAKE_C_FLAGS="-nostdinc++ -I/usr/include/libstdc++-gcc10 -I/usr/include/libstdc++-gcc10/%{_host} -Wc++11-narrowing " \ -DCMAKE_INSTALL_PREFIX=%{buildroot}%{_prefix} %make \ WITH_AI=simple \ WITH_SDL2="ON" CONFIGURE_FHEROES2_DATA="%{_datadir}/%{name}/" %install %makeinstall -C build # No automated install: # 1) Create directory structure #mkdir -p %{buildroot}%{_gamesbindir} mkdir -p %{buildroot}%{_gamesdatadir}/%{name}/{data,maps} mkdir -p %{buildroot}%{_datadir}/applications mkdir -p %{buildroot}%{_datadir}/pixmaps # 2) install what we need where we need it install -pm 644 src/resources/%{name}.png %{buildroot}%{_datadir}/pixmaps/%{name}.png install -pm 644 %{SOURCE4} %{buildroot}%{_datadir}/applications/%{name}.desktop