- added boost patch (fixes build with boost 1.70; it reverts changes from boost-1...
authorJakub Bogusz <qboosh@pld-linux.org>
Fri, 10 May 2019 17:01:34 +0000 (19:01 +0200)
committerJakub Bogusz <qboosh@pld-linux.org>
Fri, 10 May 2019 17:01:34 +0000 (19:01 +0200)
vcmi-boost.patch [new file with mode: 0644]
vcmi.spec

diff --git a/vcmi-boost.patch b/vcmi-boost.patch
new file mode 100644 (file)
index 0000000..765b44a
--- /dev/null
@@ -0,0 +1,221 @@
+--- vcmi-0.99/lib/serializer/Connection.h.orig 2019-05-09 18:28:47.786130450 +0200
++++ vcmi-0.99/lib/serializer/Connection.h      2019-05-09 20:37:32.790815761 +0200
+@@ -14,37 +14,20 @@
+ #include "BinaryDeserializer.h"
+ #include "BinarySerializer.h"
++#include <boost/asio/basic_stream_socket.hpp>
++#include <boost/asio/basic_socket_acceptor.hpp>
++#include <boost/asio/io_service.hpp>
++#include <boost/asio/ip/tcp.hpp>
++
+ struct CPack;
+ namespace boost
+ {
+-      namespace asio
+-      {
+-              namespace ip
+-              {
+-                      class tcp;
+-              }
+-
+-#if BOOST_VERSION >= 106600  // Boost version >= 1.66
+-              class io_context;
+-              typedef io_context io_service;
+-#else
+-              class io_service;
+-#endif
+-
+-              template <typename Protocol> class stream_socket_service;
+-              template <typename Protocol,typename StreamSocketService>
+-              class basic_stream_socket;
+-
+-              template <typename Protocol> class socket_acceptor_service;
+-              template <typename Protocol,typename SocketAcceptorService>
+-              class basic_socket_acceptor;
+-      }
+       class mutex;
+ }
+-typedef boost::asio::basic_stream_socket < boost::asio::ip::tcp , boost::asio::stream_socket_service<boost::asio::ip::tcp>  > TSocket;
+-typedef boost::asio::basic_socket_acceptor<boost::asio::ip::tcp, boost::asio::socket_acceptor_service<boost::asio::ip::tcp> > TAcceptor;
++typedef boost::asio::basic_stream_socket<boost::asio::ip::tcp> TSocket;
++typedef boost::asio::basic_socket_acceptor<boost::asio::ip::tcp> TAcceptor;
+ /// Main class for network communication
+ /// Allows establishing connection and bidirectional read-write
+--- vcmi-0.99/lib/serializer/Connection.cpp.orig       2016-11-01 19:26:09.000000000 +0100
++++ vcmi-0.99/lib/serializer/Connection.cpp    2019-05-10 15:40:32.325291811 +0200
+@@ -5,9 +5,6 @@
+ #include "../mapping/CMap.h"
+ #include "../CGameState.h"
+-#if BOOST_VERSION >= 106600
+-#define BOOST_ASIO_ENABLE_OLD_SERVICES
+-#endif
+ #include <boost/asio.hpp>
+ /*
+@@ -120,7 +117,7 @@
+       throw std::runtime_error("Can't establish connection :(");
+ }
+ CConnection::CConnection(TSocket * Socket, std::string Name )
+-      :iser(this), oser(this), socket(Socket),io_service(&Socket->get_io_service()), name(Name)//, send(this), rec(this)
++      :iser(this), oser(this), socket(Socket),io_service(&Socket->get_executor().context()), name(Name)//, send(this), rec(this)
+ {
+       init();
+ }
+--- vcmi-0.99/lib/CBattleCallback.cpp.orig     2016-11-01 19:26:09.000000000 +0100
++++ vcmi-0.99/lib/CBattleCallback.cpp  2019-05-10 16:07:53.901237054 +0200
+@@ -499,7 +499,7 @@
+       else if(defender->owner != battleGetOwner(defender))\r
+               return true;//mind controlled unit is attackable for both sides\r
+       else\r
+-              return (battleGetOwner(attacker) == battleGetOwner(defender)) == positivness;\r
++              return (battleGetOwner(attacker) == battleGetOwner(defender)) == bool(positivness);\r
+ }\r
\r
+ si8 CBattleInfoCallback::battleHasWallPenalty( const CStack * stack, BattleHex destHex ) const\r
+@@ -1357,9 +1357,9 @@
\r
+       std::vector<DistStack> stackPairs;\r
\r
+-      std::vector<const CStack *> possibleStacks = battleGetStacksIf([=](const CStack * s)\r
++      std::vector<const CStack *> possibleStacks = battleGetStacksIf([=](const CStack * s) -> bool\r
+       {\r
+-              return s->isValidTarget(false) && s != closest && (boost::logic::indeterminate(attackerOwned) || s->attackerOwned == attackerOwned);\r
++              return s->isValidTarget(false) && s != closest && (boost::logic::indeterminate(attackerOwned) || s->attackerOwned == bool(attackerOwned));\r
+       });\r
\r
+       for(const CStack * st : possibleStacks)\r
+--- vcmi-0.99/client/windows/CAdvmapInterface.cpp.orig 2016-11-01 19:26:09.000000000 +0100
++++ vcmi-0.99/client/windows/CAdvmapInterface.cpp      2019-05-10 16:27:02.158039352 +0200
+@@ -781,7 +781,7 @@
+       if(boost::logic::indeterminate(hasPath))\r
+               hasPath = LOCPLINT->paths[h].nodes.size() ? true : false;\r
\r
+-      moveHero->block(!hasPath || (h->movement == 0));\r
++      moveHero->block(!bool(hasPath) || (h->movement == 0));\r
+ }\r
\r
+ void CAdvMapInt::updateSpellbook(const CGHeroInstance *h)\r
+--- vcmi-0.99/server/CVCMIServer.h.orig        2019-05-09 18:28:47.786130450 +0200
++++ vcmi-0.99/server/CVCMIServer.h     2019-05-10 17:00:46.894142311 +0200
+@@ -12,40 +12,19 @@
+  *\r
+  */\r
\r
++#include <boost/asio/basic_stream_socket.hpp>\r
++#include <boost/asio/basic_socket_acceptor.hpp>\r
++#include <boost/asio/io_service.hpp>\r
++#include <boost/asio/ip/tcp.hpp>\r
++\r
+ class CMapInfo;\r
\r
+ class CConnection;\r
+ struct CPackForSelectionScreen;\r
+ class CGameHandler;\r
\r
+-namespace boost\r
+-{\r
+-      namespace asio\r
+-      {\r
+-              namespace ip\r
+-              {\r
+-                      class tcp;\r
+-              }\r
+-\r
+-#if BOOST_VERSION >= 106600  // Boost version >= 1.66
+-              class io_context;
+-              typedef io_context io_service;
+-#else
+-              class io_service;
+-#endif\r
+-\r
+-              template <typename Protocol> class stream_socket_service;\r
+-              template <typename Protocol,typename StreamSocketService>\r
+-              class basic_stream_socket;\r
+-\r
+-              template <typename Protocol> class socket_acceptor_service;\r
+-              template <typename Protocol,typename SocketAcceptorService>\r
+-              class basic_socket_acceptor;\r
+-      }\r
+-};\r
+-\r
+-typedef boost::asio::basic_socket_acceptor<boost::asio::ip::tcp, boost::asio::socket_acceptor_service<boost::asio::ip::tcp> > TAcceptor;\r
+-typedef boost::asio::basic_stream_socket < boost::asio::ip::tcp , boost::asio::stream_socket_service<boost::asio::ip::tcp>  > TSocket;\r
++typedef boost::asio::basic_socket_acceptor<boost::asio::ip::tcp> TAcceptor;\r
++typedef boost::asio::basic_stream_socket<boost::asio::ip::tcp> TSocket;\r
\r
+ class CVCMIServer\r
+ {\r
+--- vcmi-0.99/server/CVCMIServer.cpp.orig      2019-05-10 18:15:18.709042066 +0200
++++ vcmi-0.99/server/CVCMIServer.cpp   2019-05-10 18:17:35.062864054 +0200
+@@ -1,8 +1,5 @@
+ #include "StdInc.h"\r
\r
+-#if BOOST_VERSION >= 106600
+-#define BOOST_ASIO_ENABLE_OLD_SERVICES
+-#endif\r
+ #include <boost/asio.hpp>\r
\r
+ #include "../lib/filesystem/Filesystem.h"\r
+@@ -168,8 +165,8 @@
\r
+                       if(acceptor)\r
+                       {\r
+-                              acceptor->get_io_service().reset();\r
+-                              acceptor->get_io_service().poll();\r
++                              static_cast<boost::asio::io_context&>(acceptor->get_executor().context()).reset();\r
++                              static_cast<boost::asio::io_context&>(acceptor->get_executor().context()).poll();\r
+                       }\r
+               } //frees lock\r
\r
+@@ -230,7 +227,7 @@
+       assert(!upcomingConnection);\r
+       assert(acceptor);\r
\r
+-      upcomingConnection = new TSocket(acceptor->get_io_service());\r
++      upcomingConnection = new TSocket(acceptor->get_executor());\r
+       acceptor->async_accept(*upcomingConnection, std::bind(&CPregameServer::connectionAccepted, this, _1));\r
+ }\r
\r
+@@ -415,7 +412,7 @@
\r
+       boost::system::error_code error;\r
+       logNetwork->info("Listening for connections at port %d", acceptor->local_endpoint().port());\r
+-      auto s = new boost::asio::ip::tcp::socket(acceptor->get_io_service());\r
++      auto s = new boost::asio::ip::tcp::socket(acceptor->get_executor());\r
+       boost::thread acc(std::bind(vaccept,acceptor,s,&error));\r
+ #ifndef VCMI_ANDROID\r
+       sr->setToTrueAndNotify();\r
+@@ -483,7 +480,7 @@
+               }\r
+               else\r
+               {\r
+-                      auto s = new boost::asio::ip::tcp::socket(acceptor->get_io_service());\r
++                      auto s = new boost::asio::ip::tcp::socket(acceptor->get_executor());\r
+                       acceptor->accept(*s,error);\r
+                       if(error) //retry\r
+                       {\r
+--- vcmi-0.99/AI/VCAI/AIUtility.h.orig 2016-11-01 19:26:09.000000000 +0100
++++ vcmi-0.99/AI/VCAI/AIUtility.h      2019-05-10 17:37:38.490708060 +0200
+@@ -167,5 +167,5 @@
+ public:\r
+       CDistanceSorter(const CGHeroInstance * hero): hero(hero) {}\r
\r
+-      bool operator ()(const CGObjectInstance *lhs, const CGObjectInstance *rhs);\r
++      bool operator ()(const CGObjectInstance *lhs, const CGObjectInstance *rhs) const;\r
+ };\r
+--- vcmi-0.99/AI/VCAI/AIUtility.cpp.orig       2016-11-01 19:26:09.000000000 +0100
++++ vcmi-0.99/AI/VCAI/AIUtility.cpp    2019-05-10 17:39:23.702884397 +0200
+@@ -179,7 +179,7 @@
+       return oss.str();\r
+ }\r
\r
+-bool CDistanceSorter::operator ()(const CGObjectInstance *lhs, const CGObjectInstance *rhs)\r
++bool CDistanceSorter::operator ()(const CGObjectInstance *lhs, const CGObjectInstance *rhs) const\r
+ {\r
+       const CGPathNode *ln = ai->myCb->getPathsInfo(hero)->getPathInfo(lhs->visitablePos()),\r
+                        *rn = ai->myCb->getPathsInfo(hero)->getPathInfo(rhs->visitablePos());\r
index ac684711ac6c4a5fc17c87e7b1ec0ef6afa6759e..8002192a72d088557c2541eb657394959c15e362 100644 (file)
--- a/vcmi.spec
+++ b/vcmi.spec
@@ -1,7 +1,8 @@
-Summary:       Heroes 3: WoG recreated
+Summary:       "Heroes 3: WoG recreated
+Summary(pl.UTF-8):     Gra "Heroes 3: WoG" stworzona od nowa
 Name:          vcmi
 Version:       0.99
-Release:       0.1
+Release:       1
 License:       GPL v2+
 Group:         X11/Applications/Games
 Source0:       https://github.com/vcmi/vcmi/archive/%{version}/%{name}-%{version}.tar.gz
@@ -9,39 +10,49 @@ Source0:     https://github.com/vcmi/vcmi/archive/%{version}/%{name}-%{version}.tar.
 Source1:       http://download.vcmi.eu/core.zip
 # Source1-md5: 5cf75d588cc53b93aceb809a6068ae37
 Patch0:                boost-1.66.patch
+Patch1:                %{name}-boost.patch
 URL:           http://www.vcmi.eu/
-BuildRequires: Qt5Network-devel
-BuildRequires: qt5-build
-BuildRequires: Qt5Widgets-devel
-BuildRequires: SDL2-devel
-BuildRequires: SDL2_image-devel
-BuildRequires: SDL2_mixer-devel
-BuildRequires: SDL2_ttf-devel
-BuildRequires: boost-devel
-BuildRequires: cmake >= 2.8.5
+BuildRequires: Qt5Network-devel >= 5
+BuildRequires: Qt5Widgets-devel >= 5
+BuildRequires: SDL2-devel >= 2
+BuildRequires: SDL2_image-devel >= 2
+BuildRequires: SDL2_mixer-devel >= 2
+BuildRequires: SDL2_ttf-devel >= 2
+BuildRequires: boost-devel >= 1.50
+BuildRequires: cmake >= 2.8.12
+# avformat, swscale
 BuildRequires: ffmpeg-devel
-BuildRequires: zlib-devel
 BuildRequires: libstdc++-devel
+BuildRequires: minizip-devel
+BuildRequires: qt5-build >= 5
+BuildRequires: zlib-devel
 Suggests:      smpeg-libs
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %define                specflags       -fpermissive
 
 # symbols defined in binaries and main library
-%define        skip_post_check_so      vcmi/Scripting/libvcmiERM.so.0.0.0
+%define                skip_post_check_so      vcmi/Scripting/libvcmiERM.so.0.0.0
 
 %description
-H3 engine rewrie (not another mod) with new possibilities.
+H3 engine rewrite (not another mod) with new possibilities.
+
+%description -l pl.UTF-8
+Napisany od nowa silnik H3 (nie kolejna modyfikacja) z nowymi
+możliwościami.
 
 %prep
 %setup -q
 %patch0 -p1
+%patch1 -p1
 
 %build
 install -d build
 cd build
-%cmake \
-       ..
+%cmake .. \
+       -DENABLE_ERM=ON
+# -DENABLE_EDITOR=ON breaks build
+
 %{__make}
 
 %install
@@ -53,12 +64,15 @@ install -d $RPM_BUILD_ROOT%{_datadir}/%{name} \
 %{__make} -C build install \
        DESTDIR=$RPM_BUILD_ROOT
 
+# not packaged
+%{__rm} -r $RPM_BUILD_ROOT{%{_libdir}/libfuzzylite-static.a,%{_includedir}/fl}
+
 install client/icons/vcmiclient.xpm $RPM_BUILD_ROOT%{_pixmapsdir}/vcmiclient.xpm
 install client/icons/vcmiclient.64x64.png $RPM_BUILD_ROOT%{_iconsdir}/hicolor/64x64/apps/vcmiclient.png
 install client/icons/vcmiclient.48x48.png $RPM_BUILD_ROOT%{_iconsdir}/hicolor/48x48/apps/vcmiclient.png
 install client/icons/vcmiclient.32x32.png $RPM_BUILD_ROOT%{_iconsdir}/hicolor/32x32/apps/vcmiclient.png
 
-echo A | %{__unzip} %{SOURCE1} -d $RPM_BUILD_ROOT%{_datadir}/%{name}
+%{__unzip} -o %{SOURCE1} -d $RPM_BUILD_ROOT%{_datadir}/%{name}
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -66,13 +80,17 @@ rm -rf $RPM_BUILD_ROOT
 %files
 %defattr(644,root,root,755)
 %doc AUTHORS ChangeLog README.md
-%attr(755,root,root) %{_bindir}/%{name}*
-%attr(755,root,root) %{_libdir}/%{name}/lib%{name}*.so
+%attr(755,root,root) %{_bindir}/vcmibuilder
+%attr(755,root,root) %{_bindir}/vcmiclient
+%attr(755,root,root) %{_bindir}/vcmilauncher
+%attr(755,root,root) %{_bindir}/vcmiserver
 %dir %{_libdir}/%{name}
+%attr(755,root,root) %{_libdir}/%{name}/libvcmi.so
+%attr(755,root,root) %{_libdir}/%{name}/libvcmiERM.so
 %dir %{_libdir}/%{name}/AI
 %attr(755,root,root) %{_libdir}/%{name}/AI/lib*.so
 %{_datadir}/%{name}
-%{_desktopdir}/%{name}client.desktop
+%{_desktopdir}/vcmiclient.desktop
 %{_desktopdir}/vcmilauncher.desktop
-%{_pixmapsdir}/%{name}client.xpm
-%{_iconsdir}/hicolor/*x*/apps/%{name}client.png
+%{_pixmapsdir}/vcmiclient.xpm
+%{_iconsdir}/hicolor/*x*/apps/vcmiclient.png
This page took 0.0764 seconds and 4 git commands to generate.