diff --git a/games/glest/Makefile b/games/glest/Makefile index d5182cc6aae2..619ba4af7c60 100644 --- a/games/glest/Makefile +++ b/games/glest/Makefile @@ -1,79 +1,80 @@ PORTNAME= glest PORTVERSION= 3.2.2 PORTREVISION= 15 CATEGORIES= games MASTER_SITES= SF/${PORTNAME}/${PORTNAME}%20source/${PORTVERSION} DISTNAME= ${PORTNAME}_source_${PORTVERSION} DIST_SUBDIR= ${PORTNAME} MAINTAINER= ports@FreeBSD.org COMMENT= Free 3D real-time customizable strategy game WWW= https://www.glest.org/ +LICENSE= GPLv2 +LICENSE_FILE= ${WRKSRC}/docs/code_license.txt + +BUILD_DEPENDS= jam:devel/jam LIB_DEPENDS= libxerces-c.so:textproc/xerces-c3 \ libvorbis.so:audio/libvorbis \ libogg.so:audio/libogg -BUILD_DEPENDS= jam:devel/jam RUN_DEPENDS= ${LOCALBASE}/${DATADIR_REL}/servers.ini:games/glest-data USES= autoreconf:build compiler:c++11-lang dos2unix gl localbase \ lua:51 openal:al,alut pkgconfig sdl xorg zip -USE_SDL= sdl USE_GL= gl glu +USE_SDL= sdl USE_XORG= x11 + GNU_CONFIGURE= yes CONFIGURE_SCRIPT= mk/linux/configure + LDFLAGS_i386= -Wl,-znotext -SUB_FILES= glest-wrapper pkg-message -JAM_CMD= ${LOCALBASE}/bin/jam -q -a -dx +EXTRACT_AFTER_ARGS= -d ${WRKDIR}/${DISTNAME} +SUB_FILES= glest-wrapper pkg-message OPTIONS_DEFINE= DOCS EDITOR OPTIONS_SUB= yes -EDITOR_DESC= Build map editor -EXTRACT_AFTER_ARGS= -d ${WRKDIR}/${DISTNAME} +EDITOR_DESC= Build map editor -.include +EDITOR_USE= WX=3.0+ +EDITOR_VARS= WX_CONF_ARGS=relative,HAVE_EDITOR=true -.if ${PORT_OPTIONS:MEDITOR} -USE_WX= 2.6+ -WX_CONF_ARGS= relative -HAVE_EDITOR= true -.endif +JAM_CMD= ${LOCALBASE}/bin/jam -q -a -dx pre-extract: @${MKDIR} ${WRKDIR}/${DISTNAME} post-patch: @${REINPLACE_CMD} \ -e 's|PTHREAD_LIBS="-l[$$]flag"|PTHREAD_LIBS="-lpthread"|g' \ -e 's|pthreads library -l[$$]flag|pthreads library -lpthread|g' \ -e 's|include/lua5.1|include/lua51|g' \ -e 's|-llua5.1|-llua-5.1|g' \ ${WRKSRC}/mk/linux/configure.ac \ ${WRKSRC}/mk/linux/mk/autoconf/* - @${FIND} ${WRKDIR} -type f -name '*.bak' -o -name '*.orig' | \ - ${XARGS} ${RM} + #@${FIND} ${WRKDIR} -type f -name '*.bak' -o -name '*.orig' | \ + # ${XARGS} ${RM} pre-configure: @(cd ${WRKSRC}/mk/linux && ${SH} autogen.sh && \ ${REINPLACE_CMD} -e 's|-llua5.1|-llua-5.1|g' -e 's|.lng||g' \ ${WRKSRC}/${CONFIGURE_SCRIPT} ${WRKSRC}/mk/linux/glest.ini) do-build: @(cd ${WRKSRC} && ${JAM_CMD}) do-install: @${MKDIR} ${STAGEDIR}${DOCSDIR} ${STAGEDIR}${DATADIR} ${INSTALL_DATA} ${WRKSRC}/docs/code_license.txt \ ${STAGEDIR}${DOCSDIR}/code_license.txt ${INSTALL_PROGRAM} ${WRKSRC}/glest ${STAGEDIR}${DATADIR} ${INSTALL_DATA} ${WRKSRC}/mk/linux/glest.ini ${STAGEDIR}${DATADIR} ${INSTALL_SCRIPT} ${WRKDIR}/glest-wrapper \ ${STAGEDIR}${PREFIX}/bin/${PORTNAME} do-install-EDITOR-on: ${INSTALL_PROGRAM} ${WRKSRC}/glest_editor ${STAGEDIR}${PREFIX}/bin/ .include diff --git a/games/glest/files/patch-source-shared_lib-include-graphics-math_util.h b/games/glest/files/patch-source-shared_lib-include-graphics-math_util.h index 24e6656e88ea..0bebf4582f6e 100644 --- a/games/glest/files/patch-source-shared_lib-include-graphics-math_util.h +++ b/games/glest/files/patch-source-shared_lib-include-graphics-math_util.h @@ -1,19 +1,19 @@ ---- ./source/shared_lib/include/graphics/math_util.h.bak 2014-08-10 15:21:32.000000000 -0400 -+++ ./source/shared_lib/include/graphics/math_util.h 2014-08-10 15:23:08.000000000 -0400 -@@ -23,6 +23,16 @@ +--- source/shared_lib/include/graphics/math_util.h.orig 2022-12-31 03:15:04 UTC ++++ source/shared_lib/include/graphics/math_util.h +@@ -23,6 +23,16 @@ const float sqrt2= 1.41421356f; const float zero= 1e-6f; const float infinity= 1e6f; +template +inline T max(const T& a, const T& b) { + return (b > a) ? b : a; +} + +template +inline T min(const T& a, const T& b) { + return (b < a) ? b : a; +} + // ===================================================== // class Rect // ===================================================== diff --git a/games/glest/files/patch-xerces-c3 b/games/glest/files/patch-xerces-c3 index 2d4562e85376..be78d9eef7aa 100644 --- a/games/glest/files/patch-xerces-c3 +++ b/games/glest/files/patch-xerces-c3 @@ -1,48 +1,48 @@ ---- source/shared_lib/sources/xml/xml_parser.cpp.orig 2014-02-24 15:26:00.412992000 +0100 -+++ source/shared_lib/sources/xml/xml_parser.cpp 2014-02-24 15:28:23.623987237 +0100 -@@ -87,10 +87,17 @@ +--- source/shared_lib/sources/xml/xml_parser.cpp.orig 2022-12-31 03:15:04 UTC ++++ source/shared_lib/sources/xml/xml_parser.cpp +@@ -87,10 +87,17 @@ XmlNode *XmlIo::load(const string &path){ try{ ErrorHandler errorHandler; - DOMBuilder *parser= (static_cast(implementation))->createDOMBuilder(DOMImplementationLS::MODE_SYNCHRONOUS, 0); - parser->setErrorHandler(&errorHandler); - parser->setFeature(XMLUni::fgXercesSchemaFullChecking, true); - parser->setFeature(XMLUni::fgDOMValidation, true); +#if XERCES_VERSION_MAJOR < 3 + DOMBuilder *parser= (static_cast(implementation))->createDOMBuilder(DOMImplementationLS::MODE_SYNCHRONOUS, 0); + parser->setErrorHandler(&errorHandler); + parser->setFeature(XMLUni::fgXercesSchemaFullChecking, true); + parser->setFeature(XMLUni::fgDOMValidation, true); +#else + DOMLSParser *parser = (static_cast(implementation))->createLSParser(DOMImplementationLS::MODE_SYNCHRONOUS, 0); + DOMConfiguration *config = parser->getDomConfig(); + config->setParameter(XMLUni::fgXercesSchemaFullChecking, true); + config->setParameter(XMLUni::fgDOMValidate, true); +#endif DOMDocument *document= parser->parseURI(path.c_str()); if(document==NULL){ -@@ -119,9 +126,20 @@ +@@ -119,9 +126,20 @@ void XmlIo::save(const string &path, const XmlNode *no } LocalFileFormatTarget file(path.c_str()); - DOMWriter* writer = implementation->createDOMWriter(); - writer->setFeature(XMLUni::fgDOMWRTFormatPrettyPrint, true); - writer->writeNode(&file, *document); +#if XERCES_VERSION_MAJOR < 3 + DOMWriter* writer = implementation->createDOMWriter(); + writer->setFeature(XMLUni::fgDOMWRTFormatPrettyPrint, true); + writer->writeNode(&file, *document); +#else + DOMLSSerializer *serializer = implementation->createLSSerializer(); + DOMLSOutput* output=implementation->createLSOutput(); + DOMConfiguration* config=serializer->getDomConfig(); + config->setParameter(XMLUni::fgDOMWRTFormatPrettyPrint,true); + output->setByteStream(&file); + serializer->write(document,output); + output->release(); + serializer->release(); +#endif document->release(); } catch(const DOMException &e){