This commit is contained in:
Sergey Zhemoytel 2022-12-22 10:13:00 +03:00
parent 0c12eed7c9
commit a61d069058

View file

@ -24,17 +24,24 @@ BuildRequires: pkgconfig(SDL2_net)
BuildRequires: pkgconfig(SDL2_ttf) BuildRequires: pkgconfig(SDL2_ttf)
BuildRequires: pkgconfig(zlib) BuildRequires: pkgconfig(zlib)
BuildRequires: clang BuildRequires: clang
BuildRequires: llvm
BuildRequires: cmake >= 3.20 BuildRequires: cmake >= 3.20
BuildRequires: stdc++-gcc10-devel
%description %description
Free implementation of Heroes of the Might and Magic II engine. Free implementation of Heroes of the Might and Magic II engine.
You need to copy files from data and maps directories from original game You need to copy files from data and maps directories from original game
into your /usr/share/games/fheroes2/{maps,data} directories respectively. into your /usr/share/games/fheroes2/{maps,data} directories respectively.
%files %files
#-f %{name}.lang
%doc changelog.txt LICENSE README.md %doc changelog.txt LICENSE README.md
%{_gamesbindir}/* %{_bindir}/%{name}
%{_gamesdatadir}/%{name} %{_datadir}/%{name}
%{_datadir}/metainfo/%{name}.appdata.xml
%{_iconsdir}/hicolor/*/apps/%{name}.png
#{_gamesbindir}/*
#{_gamesdatadir}/%{name}
%{_datadir}/pixmaps/%{name}.png %{_datadir}/pixmaps/%{name}.png
%{_datadir}/applications/%{name}.desktop %{_datadir}/applications/%{name}.desktop
@ -44,30 +51,58 @@ into your /usr/share/games/fheroes2/{maps,data} directories respectively.
%setup -q %setup -q
%build %build
export CC=clang
export CXX=clang++
export AR=llvm-ar
export NM=llvm-nm
export READELF=readelf
export LDFLAGS="-lstdc++-gcc10"
export CXXFLAGS="$CFLAGS"
%setup_compile_flags %setup_compile_flags
#cmake #cmake
%clang_gcc_wrapper %clang_gcc_wrapper
%cmake %cmake \
-DCMAKE_BUILD_TYPE=Release \
-DUSE_SDL_VERSION=SDL2 \
-DENABLE_IMAGE=ON \
-DGET_HOMM2_DEMO=ON \
-DCMAKE_C_COMPILER=clang \
-DCMAKE_CXX_COMPILER=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 \ %make \
WITH_AI=simple \ WITH_AI=simple \
WITH_SDL2="ON" \ WITH_SDL2="ON"
CONFIGURE_FHEROES2_DATA="%{_gamesdatadir}/%{name}/" CONFIGURE_FHEROES2_DATA="%{_datadir}/%{name}/"
%install %install
%makeinstall -C build
# No automated install: # No automated install:
# 1) Create directory structure # 1) Create directory structure
mkdir -p %{buildroot}%{_gamesbindir} #mkdir -p %{buildroot}%{_gamesbindir}
mkdir -p %{buildroot}%{_gamesdatadir}/%{name}/{data,maps} mkdir -p %{buildroot}%{_gamesdatadir}/%{name}/{data,maps}
mkdir -p %{buildroot}%{_datadir}/applications mkdir -p %{buildroot}%{_datadir}/applications
mkdir -p %{buildroot}%{_datadir}/pixmaps mkdir -p %{buildroot}%{_datadir}/pixmaps
# 2) install what we need where we need it # 2) install what we need where we need it
install -pm 755 src/dist/%{name} %{buildroot}%{_gamesbindir}/%{name}.bin #install -pm 755 build/%{name} %{buildroot}%{_gamesbindir}/%{name}.bin
install -pm 755 %{SOURCE2} %{buildroot}%{_gamesbindir}/%{name} #install -pm 755 %{SOURCE2} %{buildroot}%{_gamesbindir}/%{name}
#install -pm 644 %{name}.key %{buildroot}%{_gamesdatadir}/%{name}/ #install -pm 644 %{name}.key %{buildroot}%{_gamesdatadir}/%{name}/
install -pm 644 %{SOURCE3} %{buildroot}%{_datadir}/pixmaps/%{name}.png install -pm 644 src/resources/%{name}.png %{buildroot}%{_datadir}/pixmaps/%{name}.png
install -pm 644 %{SOURCE4} %{buildroot}%{_datadir}/applications/%{name}.desktop install -pm 644 %{SOURCE4} %{buildroot}%{_datadir}/applications/%{name}.desktop
install -pm 644 %{SOURCE5} %{buildroot}%{_gamesdatadir}/%{name}/ #install -pm 644 %{SOURCE5} %{buildroot}%{_gamesdatadir}/%{name}/
#find_lang %{name}