Index: head/games/spring/Makefile =================================================================== --- head/games/spring/Makefile (revision 463537) +++ head/games/spring/Makefile (revision 463538) @@ -1,115 +1,113 @@ # Created by: Dmitry Marakasov # $FreeBSD$ PORTNAME= spring PORTVERSION= 98.0 PORTREVISION= 10 CATEGORIES= games MASTER_SITES= SF/springrts/springrts/${PORTNAME}-${PORTVERSION} \ http://springrts.com/dl/ DISTNAME= ${PORTNAME}_${PORTVERSION}_src MAINTAINER= amdmi3@FreeBSD.org COMMENT= Project aiming to create a new and versatile RTS Engine LICENSE= GPLv2 -BROKEN= fails to build with boost 1.66, see bug 224124 - LIB_DEPENDS= libfreetype.so:print/freetype2 \ libboost_thread.so:devel/boost-libs \ libIL.so:graphics/devil \ libogg.so:audio/libogg \ libvorbis.so:audio/libvorbis BUILD_DEPENDS= 7z:archivers/p7zip # XXX: it should be possible to build it on i386, investigate # (currently link fails on undefined reference to __sync_fetch_and_add_8) ONLY_FOR_ARCHS= amd64 ONLY_FOR_ARCHS_REASON= relies on x86 floating-point math and amd64 atomic ops USE_SDL= sdl2 USE_GL= gl glu glew USE_XORG= x11 xcursor USE_LDCONFIG= yes DOS2UNIX_GLOB= *.h *.hpp *.cpp USES= cmake compiler:c++11-lib dos2unix openal:al tar:lzma USES+= desktop-file-utils shared-mime-info CMAKE_ARGS= -DDATADIR:STRING="share/${PORTNAME}" \ -DAI_TYPES:STRING="NATIVE" \ -DDOCDIR:STRING="share/doc/${PORTNAME}" \ -DCREATE_MAN_PAGES:BOOL=false \ -DUSE_TCMALLOC:BOOL=false \ -DUSE_LIBSQUISH:BOOL=false \ -DUNITSYNC_PYTHON_WRAPPER:BOOL=false WRKSRC= ${WRKDIR}/${PORTNAME}_${PORTVERSION} # Do not exctract bundled copies of header files for 3rd-party packages: EXTRACT_AFTER_ARGS=--no-same-owner --no-same-permissions --exclude ${WRKSRC:T}/include # The check-target fails right now: https://springrts.com/mantis/view.php?id=4736 TEST_TARGET= check PORTDOCS= * PORTDATA= * OPTIONS_DEFINE= MANPAGES PR_DOWNLOADER DOCS OPTIONS_DEFAULT=MANPAGES PR_DOWNLOADER OPTIONS_SUB= yes HTMLDOCS_DESC= Build and install HTML documentation PR_DOWNLOADER_DESC= Map and game downloader MANPAGES_CMAKE_ON= -DCREATE_MAN_PAGES:BOOL=true -DMANDIR:STRING="man" MANPAGES_CMAKE_OFF= -DCREATE_MAN_PAGES:BOOL=false MANPAGES_BUILD_DEPENDS= 7z:archivers/p7zip \ asciidoc:textproc/asciidoc \ xsltproc:textproc/libxslt \ ${LOCALBASE}/share/xsl/docbook/manpages/docbook.xsl:textproc/docbook-xsl \ bash:shells/bash MANPAGES_DOCS_ON= -DUSERDOCS_PLAIN:BOOL=true MANPAGES_DOCS_OFF= -DUSERDOCS_PLAIN:BOOL=false CXXFLAGS+= -Wno-deprecated # Too much noise PR_DOWNLOADER_LIB_DEPENDS=libcurl.so:ftp/curl .include .if defined(WITH_SYNC_DEBUG) CFLAGS= # empty CXXFLAGS= # empty CMAKE_ARGS+= -DTRACE_SYNC=true -DSYNCDEBUG=true CMAKE_BUILD_TYPE=DEBUG2 .endif .if ! ${PORT_OPTIONS:MPR_DOWNLOADER} post-extract: @${RM} ${WRKSRC}/tools/pr-downloader/CMakeLists.txt .endif post-patch: @${REINPLACE_CMD} -e 's|-O2||' ${WRKSRC}/CMakeLists.txt @${REINPLACE_CMD} -e 's|/etc/\(spring/datadir\)|${PREFIX}/\1|g' \ ${WRKSRC}/rts/System/FileSystem/DataDirLocater.cpp @${REINPLACE_CMD} -e 's|x1F3F|x0F3F|g' \ ${WRKSRC}/rts/System/Sync/FPUCheck.cpp @${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|g' \ ${WRKSRC}/rts/build/cmake/*.cmake @${REINPLACE_CMD} -e 's|execinfo|/usr/lib/libexecinfo.so|' \ ${WRKSRC}/rts/CMakeLists.txt \ ${WRKSRC}/rts/builds/dedicated/CMakeLists.txt @${REINPLACE_CMD} -e 's|%%PREFIX%%|${PREFIX}|' \ ${WRKSRC}/rts/System/Platform/Misc.cpp @${REINPLACE_CMD} -e 's|/bin/bash|${LOCALBASE}&|' \ ${WRKSRC}/doc/manpages/make_manpages.sh .if ! ${PORT_OPTIONS:MMANPAGES} @${REINPLACE_CMD} -e '/set(CREATE_MAN_PAGES)/ d' \ ${WRKSRC}/doc/CMakeLists.txt .endif pre-build: cd ${WRKSRC} && ${MAKE_CMD} generateVersionFiles .include Index: head/games/spring/files/patch-boost-1.66 =================================================================== --- head/games/spring/files/patch-boost-1.66 (nonexistent) +++ head/games/spring/files/patch-boost-1.66 (revision 463538) @@ -0,0 +1,184 @@ +https://github.com/spring/spring/commit/a61970779994 +https://github.com/spring/spring/commit/f2f84f38e04a +https://github.com/spring/spring/commit/318c003c7273 +https://github.com/spring/spring/commit/5048e2a3446c + +--- rts/Net/AutohostInterface.cpp.orig 2014-10-07 20:09:51 UTC ++++ rts/Net/AutohostInterface.cpp +@@ -116,68 +116,60 @@ std::string AutohostInterface::TryBindSocket( + const std::string& remoteIP, int remotePort, + const std::string& localIP, int localPort) + { +- std::string errorMsg = ""; ++ std::string errorMsg; + + ip::address localAddr; + ip::address remoteAddr; + boost::system::error_code err; ++ + try { + socket.open(ip::udp::v6(), err); // test IP v6 support ++ + const bool supportsIPv6 = !err; + + remoteAddr = netcode::WrapIP(remoteIP, &err); +- if (err) { ++ ++ if (err) + throw std::runtime_error("Failed to parse address " + remoteIP + ": " + err.message()); +- } + +- if (!supportsIPv6 && remoteAddr.is_v6()) { ++ if (!supportsIPv6 && remoteAddr.is_v6()) + throw std::runtime_error("IP v6 not supported, can not use address " + remoteAddr.to_string()); +- } + + if (localIP.empty()) { + // use the "any" address as local "from" + if (remoteAddr.is_v6()) { + localAddr = ip::address_v6::any(); + } else { +- if (supportsIPv6) { +- socket.close(); +- } ++ socket.close(); + socket.open(ip::udp::v4()); ++ + localAddr = ip::address_v4::any(); + } + } else { + localAddr = netcode::WrapIP(localIP, &err); +- if (err) { ++ ++ if (err) + throw std::runtime_error("Failed to parse local IP " + localIP + ": " + err.message()); +- } +- if (localAddr.is_v6() != remoteAddr.is_v6()) { ++ ++ if (localAddr.is_v6() != remoteAddr.is_v6()) + throw std::runtime_error("Local IP " + localAddr.to_string() + " and remote IP " + remoteAddr.to_string() + " are IP v4/v6 mixed"); +- } + } + + socket.bind(ip::udp::endpoint(localAddr, localPort)); +- +- boost::asio::socket_base::non_blocking_io command(true); +- socket.io_control(command); +- +- // A similar, slighly less verbose message is already in GameServer +- //LOG("Connecting (UDP) to IP (v%i) %s Port %i", +- // (remoteAddr.is_v6() ? 6 : 4), remoteAddr.c_str(), remotePort); ++ socket.non_blocking(true); + socket.connect(ip::udp::endpoint(remoteAddr, remotePort)); +- } catch (const std::runtime_error& ex) { // includes also boost::system::system_error, as it inherits from runtime_error ++ } catch (const std::runtime_error& ex) { ++ // also includes asio::system_error, inherits from runtime_error + socket.close(); + errorMsg = ex.what(); +- if (errorMsg.empty()) { ++ ++ if (errorMsg.empty()) + errorMsg = "Unknown problem"; +- } + } + + return errorMsg; + } + +-AutohostInterface::~AutohostInterface() +-{ +-} + + void AutohostInterface::SendStart() + { +--- rts/Net/AutohostInterface.h.orig 2014-10-07 20:09:51 UTC ++++ rts/Net/AutohostInterface.h +@@ -28,7 +28,7 @@ class AutohostInterface (public) + */ + AutohostInterface(const std::string& remoteIP, int remotePort, + const std::string& localIP = "", int localPort = 0); +- virtual ~AutohostInterface(); ++ virtual ~AutohostInterface() {} + + bool IsInitialized() const { return initialized; } + +--- rts/System/FileSystem/Archives/SevenZipArchive.cpp.orig 2014-10-07 20:09:51 UTC ++++ rts/System/FileSystem/Archives/SevenZipArchive.cpp +@@ -3,7 +3,6 @@ + #include "SevenZipArchive.h" + + #include +-#include + #include + #include //memcpy + +@@ -86,7 +85,7 @@ IArchive* CSevenZipArchiveFactory::DoCreateArchive(con + return new CSevenZipArchive(filePath); + } + +-const char* CSevenZipArchive::GetErrorStr(int err) ++static inline const char* GetErrorStr(int err) + { + switch(err) { + case SZ_OK: +@@ -108,6 +107,27 @@ const char* CSevenZipArchive::GetErrorStr(int err) + } + + ++static inline std::string GetSystemErrorStr(WRes wres) ++{ ++#ifdef USE_WINDOWS_FILE ++ LPSTR messageBuffer = nullptr; ++ size_t size = FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, ++ NULL, wres, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPSTR)&messageBuffer, 0, NULL); ++ ++ std::string errorstr(messageBuffer, size); ++ ++ //Free the buffer. ++ LocalFree(messageBuffer); ++#else ++ std::string errorstr(strerror(wres)); ++#endif ++ ++ return errorstr; ++} ++ ++ ++ ++ + CSevenZipArchive::CSevenZipArchive(const std::string& name): + CBufferedArchive(name, false), + blockIndex(0xFFFFFFFF), +@@ -126,9 +146,8 @@ CSevenZipArchive::CSevenZipArchive(const std::string& + + WRes wres = InFile_Open(&archiveStream.file, name.c_str()); + if (wres) { +- boost::system::error_code e(wres, boost::system::get_system_category()); + LOG_L(L_ERROR, "Error opening \"%s\": %s (%i)", +- name.c_str(), e.message().c_str(), e.value()); ++ name.c_str(), GetSystemErrorStr(wres).c_str(), (int) wres); + return; + } + +--- rts/System/FileSystem/Archives/SevenZipArchive.h.orig 2014-10-07 20:09:51 UTC ++++ rts/System/FileSystem/Archives/SevenZipArchive.h +@@ -95,7 +95,6 @@ class CSevenZipArchive : public CBufferedArchive (priv + int packedSize; + }; + int GetFileName(const CSzArEx* db, int i); +- const char* GetErrorStr(int res); + + std::vector fileData; + UInt16 *tempBuf; +--- rts/System/Net/UDPListener.cpp.orig 2014-10-07 20:09:51.000000000 +0000 ++++ rts/System/Net/UDPListener.cpp +@@ -34,8 +34,7 @@ UDPListener::UDPListener(int port, const std::string& + const std::string err = TryBindSocket(port, &socket, ip); + + if (err.empty()) { +- boost::asio::socket_base::non_blocking_io socketCommand(true); +- socket->io_control(socketCommand); ++ socket->non_blocking(true); + + mySocket = socket; + SetAcceptingConnections(true); Property changes on: head/games/spring/files/patch-boost-1.66 ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property