12,15c13,19
< LICENSE=	gpl3
< 
< LIB_DEPENDS=	boost_thread:${PORTSDIR}/devel/boost-python-libs \
< 		freetype:${PORTSDIR}/print/freetype2
---
> LICENSE=	gpl2 gpl3
> LICENSE_COMB=	dual
> LICENSE_FILE=	${WRKSRC}/COPYING
> 
> BUILD_DEPENDS=	${LOCALBASE}/lib/X11/fonts/junicode/Junicode.ttf:${PORTSDIR}/x11-fonts/junicode
> LIB_DEPENDS=	libboost_thread.so:${PORTSDIR}/devel/boost-libs \
> 		libpng15.so:${PORTSDIR}/graphics/png
19,36c23,24
< USE_GMAKE=	yes
< MAKE_JOBS_SAFE=	yes
< USE_BZIP2=	yes
< USE_LUA=	5.1
< USE_AUTOTOOLS=	aclocal autoheader automake autoconf
< ACLOCAL_ARGS=	-Im4
< AUTOMAKE_ARGS=	--add-missing --copy
< CONFIGURE_ENV=	PKG_CONFIG="${PKG_CONFIG}"
< CONFIGURE_ARGS=	--localstatedir=/var \
< 		--with-boost=${LOCALBASE} \
< 		--with-icondir=${PREFIX}/share/pixmaps \
< 		--with-libiconv-prefix=${LOCALBASE} \
< 		--with-libintl-prefix=${LOCALBASE} \
< 		--with-localedir=${PREFIX}/share/locale
< PKG_CONFIG?=	${LOCALBASE}/bin/pkg-config
< 
< MANLANG=	"" cs de en_GB es et fi fr gl hu id it ja lt pl pt_BR sk \
< 		sr sr@ijekavian sr@ijekavianlatin sr@latin tr zh_CN zh_TW
---
> USES=		cmake desktop-file-utils pkgconfig tar:bzip2
> CMAKE_ARGS=	-DMANDIR="man"
43,55c31,32
< OPTIONS=	BWMON	 "Enable bandwidth monitoring for server" Off \
< 		CAMPAIGN "Enable campaign server"	On \
< 		EDITOR	 "Enable map editor"		On \
< 		FRIBIDI	 "Enable bidirectional support"	On \
< 		LOWMEM	 "Reduce memory usage (disables animations)" Off \
< 		NOTIFY	 "Enable desktop notifications"	On \
< 		POOLALLOC "Use wesnoth own memory allocator" Off \
< 		PYTHON	 "Enable python developer tools" On \
< 		RAWSOCKETS "Use raw receiving sockets in multiplayer" Off \
< 		SERVER	 "Enable server"		On \
< 		TESTS	 "Enable unit tests"		Off \
< 		TINYGUI	 "Enable tiny gui (down to 320x200)" Off \
< 		TOOLS	 "Enable extra tools for artists and translators" On
---
> OPTIONS_DEFINE=	ANA CAMPAIGN FRIBIDI LOWMEM NOTIFY OPENMP POOLALLOC PYTHON \
> 		RAWSOCKETS SERVER TESTS TOOLS DOCS
57c34
< .include <bsd.port.pre.mk>
---
> OPTIONS_DEFAULT=	CAMPAIGN FRIBIDI NOTIFY SERVER TOOLS
59,61c36,47
< .if defined(WITH_DEBUG)
< CONFIGURE_ARGS+=	--enable-debug
< .endif
---
> ANA_DESC=	Asynchronous Network API (WIP)
> CAMPAIGN_DESC=	Campaign server
> FRIBIDI_DESC=	Bidirectional support
> LOWMEM_DESC=	Reduce memory usage (disables animations)
> NOTIFY_DESC=	Desktop notifications
> OPENMP_DESC=	OpenMP support
> POOLALLOC_DESC=	Use wesnoth own memory allocator
> PYTHON_DESC=	Python developer tools
> RAWSOCKETS_DESC=	Use raw receiving sockets in multiplayer
> SERVER_DESC=	Server
> TESTS_DESC=	Unit tests
> TOOLS_DESC=	Extra tools for artists and translators
63,65c49
< .if defined(WITH_PROFILE)
< CONFIGURE_ARGS+=	--enable-profile
< .endif
---
> .include <bsd.mport.options.mk>
68,69c52,53
< .if !defined(WITH_STRICT)
< CONFIGURE_ARGS+=	--disable-strict-compilation
---
> .if empty(PORT_OPTIONS:MSTRICT)
> CMAKE_ARGS+=	-DENABLE_STRICT_COMPILATION=off
72,73c56,57
< .if defined(WITHOUT_BWMON)
< CONFIGURE_ARGS+=	--disable-bandwidth-monitor
---
> .if ${PORT_OPTIONS:MANA}
> CMAKE_ARGS+=	-DUSE_ANA_NETWORK=on
75c59
< CONFIGURE_ARGS+=	--enable-bandwidth-monitor
---
> CMAKE_ARGS+=	-DUSE_ANA_NETWORK=off
78,80c62,64
< .if defined(WITHOUT_CAMPAIGN)
< CONFIGURE_ARGS+=	--disable-campaign-server
< PLIST_SUB+=		CAMPAIGN="@comment "
---
> .if ${PORT_OPTIONS:MCAMPAIGN}
> CMAKE_ARGS+=	-DENABLE_CAMPAIGN_SERVER=on
> PLIST_SUB+=	CAMPAIGN=""
82,83c66,67
< CONFIGURE_ARGS+=	--enable-campaign-server
< PLIST_SUB+=		CAMPAIGN=""
---
> CMAKE_ARGS+=	-DENABLE_CAMPAIGN_SERVER=off
> PLIST_SUB+=	CAMPAIGN="@comment "
86,88c70,72
< .if defined(WITHOUT_EDITOR)
< CONFIGURE_ARGS+=	--disable-editor
< PLIST_SUB+=		EDITOR="@comment "
---
> .if ${PORT_OPTIONS:MFRIBIDI}
> CMAKE_ARGS+=	-DENABLE_FRIBIDI=on
> LIB_DEPENDS+=	libfribidi.so:${PORTSDIR}/converters/fribidi
90,91c74
< CONFIGURE_ARGS+=	--enable-editor
< PLIST_SUB+=		EDITOR=""
---
> CMAKE_ARGS+=	-DENABLE_FRIBIDI=off
94,95c77,78
< .if defined(WITHOUT_FRIBIDI)
< CONFIGURE_ARGS+=	--without-fribidi
---
> .if ${PORT_OPTIONS:MLOWMEM}
> CMAKE_ARGS+=	-DENABLE_LOW_MEM=on
97,98c80
< CONFIGURE_ARGS+=	--with-fribidi
< LIB_DEPENDS+=		fribidi.3:${PORTSDIR}/converters/fribidi
---
> CMAKE_ARGS+=	-DENABLE_LOW_MEM=off
101,102c83,85
< .if defined(WITHOUT_LOWMEM)
< CONFIGURE_ARGS+=	--disable-lowmem
---
> .if ${PORT_OPTIONS:MNOTIFY}
> CMAKE_ARGS+=	-DENABLE_NOTIFICATIONS=on
> LIB_DEPENDS+=	libdbus-1.so:${PORTSDIR}/devel/dbus
104c87
< CONFIGURE_ARGS+=	--enable-lowmem
---
> CMAKE_ARGS+=	-DENABLE_NOTIFICATIONS=off
107,111c90,98
< .if defined(WITHOUT_NOTIFY)
< CONFIGURE_ARGS+=	--disable-notifications
< .else
< CONFIGURE_ARGS+=	--enable-notifications --enable-dbus
< LIB_DEPENDS+=		dbus-1.3:${PORTSDIR}/devel/dbus
---
> .if ${PORT_OPTIONS:MNLS}
> CMAKE_ARGS+=	-DENABLE_NLS=on -DLOCALEDIR=${PREFIX}/share/locale
> USES+=		gettext
> MANLANG=	"" cs de en_GB es et fi fr gl hu id it lt pl ru sk \
> 		sr sr@ijekavian sr@ijekavianlatin sr@latin vi zh_CN zh_TW
> .if ${PORT_OPTIONS:MSERVER}
> _MANPAGES+=	${PREFIX}/man/ja/man6/wesnothd.6 \
> 		${PREFIX}/man/pt_BR/man6/wesnothd.6 \
> 		${PREFIX}/man/tr/man6/wesnothd.6
113,116c100
< 
< .if defined(WITHOUT_NLS)
< CONFIGURE_ARGS+=	--disable-nls
< PLIST_SUB+=		NLS="@comment "
---
> PLIST_SUB+=	NLS=""
118,120c102,103
< USE_GETTEXT=		yes
< CONFIGURE_ARGS+=	--enable-nls
< PLIST_SUB+=		NLS=""
---
> CMAKE_ARGS+=	-DENABLE_NLS=off
> PLIST_SUB+=	NLS="@comment "
123,124c106,107
< .if defined(WITHOUT_POOLALLOC)
< CONFIGURE_ARGS+=	--disable-pool-alloc
---
> .if ${PORT_OPTIONS:MOPENMP}
> CMAKE_ARGS+=	-DENABLE_OMP=on
126c109
< CONFIGURE_ARGS+=	--enable-pool-alloc
---
> CMAKE_ARGS+=	-DENABLE_OMP=off
129,131c112,114
< .if defined(WITHOUT_PYTHON)
< CONFIGURE_ARGS+=	--disable-python-install
< PLIST_SUB+=		PYTHON="@comment "
---
> .if ${PORT_OPTIONS:MPOOLALLOC}
> CMAKE_ARGS+=	-DENABLE_POOL_ALLOC=on
> BROKEN=		does not build with pool alloc
133,138c116
< USE_PYTHON=		yes
< CONFIGURE_ENV+=		PYTHON_PREFIX=${PREFIX} \
< 			PYTHON_VERSION=${PYTHON_VERSION:S/python//}
< CONFIGURE_ARGS+=	--enable-python-install
< PLIST_SUB+=		PYTHON=""
< EXTENSIONS+=		python
---
> CMAKE_ARGS+=	-DENABLE_POOL_ALLOC=off
141,142c119,125
< .if defined(WITHOUT_RAWSOCKETS)
< CONFIGURE_ARGS+=	--disable-raw-sockets
---
> .if ${PORT_OPTIONS:MPYTHON}
> BROKEN=		cmake build doesn't support installing python tools
> USE_PYTHON=	yes
> CONFIGURE_ENV+=	PYTHON_PREFIX=${PREFIX} \
> 		PYTHON_VERSION=${PYTHON_VERSION:S/python//}
> CONFIGURE_ARGS+=--enable-python-install
> PLIST_SUB+=	PYTHON=""
144c127
< CONFIGURE_ARGS+=	--enable-raw-sockets
---
> PLIST_SUB+=	PYTHON="@comment "
147,153c130,131
< .if defined(WITHOUT_SERVER)
< CONFIGURE_ARGS+=	--disable-server
< PLIST_SUB+=		SERVER="@comment "
< .else
< CONFIGURE_ARGS+=	--enable-server
< MAN6+=			wesnothd.6
< PLIST_SUB+=		SERVER=""
---
> .if ${PORT_OPTIONS:MRAWSOCKETS}
> CFLAGS+=	-DNETWORK_USE_RAW_SOCKETS
156,158c134,137
< .if defined(WITHOUT_TESTS)
< CONFIGURE_ARGS+=	--disable-tests
< PLIST_SUB+=		TESTS="@comment "
---
> .if ${PORT_OPTIONS:MSERVER}
> CMAKE_ARGS+=	-DENABLE_SERVER=on
> MAN6+=		wesnothd.6
> PLIST_SUB+=	SERVER=""
160,161c139,140
< CONFIGURE_ARGS+=	--enable-tests
< PLIST_SUB+=		TESTS=""
---
> CMAKE_ARGS+=	-DENABLE_SERVER=off
> PLIST_SUB+=	SERVER="@comment "
164,165c143,145
< .if defined(WITHOUT_TINYGUI)
< CONFIGURE_ARGS+=	--disable-tinygui
---
> .if ${PORT_OPTIONS:MTESTS}
> CMAKE_ARGS+=	-DENABLE_TESTS=on
> PLIST_SUB+=	TESTS=""
167,168c147,148
< BUILD_DEPENDS+=		convert:${PORTSDIR}/graphics/ImageMagick
< CONFIGURE_ARGS+=	--enable-tinygui
---
> CMAKE_ARGS+=	-DENABLE_TESTS=off
> PLIST_SUB+=	TESTS="@comment "
171,173c151,153
< .if defined(WITHOUT_TOOLS)
< CONFIGURE_ARGS+=	--disable-tools
< PLIST_SUB+=		TOOLS="@comment "
---
> .if ${PORT_OPTIONS:MTOOLS}
> CMAKE_ARGS+=	-DENABLE_TOOLS=on
> PLIST_SUB+=	TOOLS=""
175,176c155,156
< CONFIGURE_ARGS+=	--enable-tools
< PLIST_SUB+=		TOOLS=""
---
> CMAKE_ARGS+=	-DENABLE_TOOLS=off
> PLIST_SUB+=	TOOLS="@comment "
179,180c159,160
< .if defined(NOPORTDOCS)
< CONFIGURE_ARGS+=	--without-docs
---
> .if empty(PORT_OPTIONS:MDOCS)
> CMAKE_ARGS+=	-DDOCDIR=none
183,185c163,165
< .if defined(NOPORTDATA)
< IGNORE=		game data is required, undefine NOPORTDATA
< .endif
---
> pre-build:
> 	${CP} ${LOCALBASE}/lib/X11/fonts/junicode/Junicode.ttf \
> 		${WRKSRC}/fonts/Junicode-Regular.ttf
187,190c167,168
< post-patch:	.SILENT
< 	${REINPLACE_CMD} -e 's|png_voidp_NULL|NULL|g' \
< 		-e 's|png_error_ptr_NULL|NULL|g' \
< 		${WRKSRC}/src/tools/exploder_utils.cpp
---
> post-install:
> 	-@update-desktop-database ${STAGEDIR}${PREFIX}/share/applications
192c170
< .include <bsd.port.post.mk>
---
> .include <bsd.port.mk>
