diff --git a/fheroes2.spec b/fheroes2.spec index f884258..5fec970 100644 --- a/fheroes2.spec +++ b/fheroes2.spec @@ -24,17 +24,24 @@ BuildRequires: pkgconfig(SDL2_net) BuildRequires: pkgconfig(SDL2_ttf) BuildRequires: pkgconfig(zlib) BuildRequires: clang +BuildRequires: llvm 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 +%files +#-f %{name}.lang %doc changelog.txt LICENSE README.md -%{_gamesbindir}/* -%{_gamesdatadir}/%{name} +%{_bindir}/%{name} +%{_datadir}/%{name} +%{_datadir}/metainfo/%{name}.appdata.xml +%{_iconsdir}/hicolor/*/apps/%{name}.png +#{_gamesbindir}/* +#{_gamesdatadir}/%{name} %{_datadir}/pixmaps/%{name}.png %{_datadir}/applications/%{name}.desktop @@ -44,30 +51,58 @@ into your /usr/share/games/fheroes2/{maps,data} directories respectively. %setup -q %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 #cmake %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 \ WITH_AI=simple \ - WITH_SDL2="ON" \ - CONFIGURE_FHEROES2_DATA="%{_gamesdatadir}/%{name}/" + 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}%{_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 755 src/dist/%{name} %{buildroot}%{_gamesbindir}/%{name}.bin -install -pm 755 %{SOURCE2} %{buildroot}%{_gamesbindir}/%{name} +#install -pm 755 build/%{name} %{buildroot}%{_gamesbindir}/%{name}.bin +#install -pm 755 %{SOURCE2} %{buildroot}%{_gamesbindir}/%{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 %{SOURCE5} %{buildroot}%{_gamesdatadir}/%{name}/ +#install -pm 644 %{SOURCE5} %{buildroot}%{_gamesdatadir}/%{name}/ + +#find_lang %{name}