freebsd-ports/games/glest/Makefile

81 lines
2.4 KiB
Makefile
Raw Normal View History

# Created by: Jose Alonso Cardenas Marquez <acardenas@bsd.org.pe>
# $FreeBSD$
PORTNAME= glest
PORTVERSION= 3.2.2
PORTREVISION= 9
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
LIB_DEPENDS= libxerces-c.so:${PORTSDIR}/textproc/xerces-c3 \
libvorbis.so:${PORTSDIR}/audio/libvorbis
BUILD_DEPENDS= jam:${PORTSDIR}/devel/jam
RUN_DEPENDS= ${DATADIR}/servers.ini:${PORTSDIR}/games/glest-data
USES= dos2unix openal:al,alut pkgconfig zip lua:51
2010-12-04 08:34:27 +01:00
USE_AUTOTOOLS= automake:env autoconf:env
USE_SDL= yes
USE_GL= yes
GNU_CONFIGURE= yes
CONFIGURE_SCRIPT= mk/linux/configure
Support LIBS like LDFLAGS. - Add LIBS="${LIBS}" to MAKE_ENV and CONFIGURE_ENV. - Add an option helper for LIBS. - Adjust all ports that already use LIBS. Also remove references to PTHREAD_CFLAGS and PTHREAD_LIBS while here. - Some ports did not support having a LIBS environment variable and required additional patches. Somewhat simplified a linker command line looks like: ${CC} ${src_LDFLAGS} ${LDFLAGS} ${src_LIBS} ${LIBS} where src_LDFLAGS and src_LIBS are controlled by upstream and LDFLAGS and LIBS can be controlled by us. If possible -L and -l flags need to be added to LIBS to make sure they appear after any -L and -l flags set by upstream. Many ports currently add -L${LOCALBASE}/lib to LDFLAGS but this may appear too early on the command line causing installed libraries to be linked in instead of freshly built ones. Additional changes: benchmarks/netio: Replace WITH_IPV6 with an IPV6 option. comms/gnokii: Replace some patches with USES=pathfix. Also remove -fPIC. graphics/gimageview: USES=libtool and install desktop file in DESKTOPDIR. graphics/visionworkbench: Remove FreeBSD 7 support. multimedia/libmovtar: New LIB_DEPENDS syntax. multimedia/opencinematools: Use standard do-build. net/siproxd: USES=libtool:keepla (port actually needs .la files for plugins) net-mgmt/nagios: Remove -fPIC. net-mgmt/nagios4: Remove -fPIC. print/cups-base: Only add -lssp_nonshared on i386 and OSVERSION < 1000036. security/p11-kit: Replace PTHREAD_LIBS in CONFIGURE_ENV with ac_cv_func_pthread_mutexattr_init=no in CONFIGURE_ARGS. This skips a test in configure that falsely detects pthread_mutexattr_init in our libc. sysutils/dar: Fix iconv detection. x11/rxvt-unicode: Remove -lstdc++ and patch configure to remove a FreeBSD hack and use $CXX as linker as on other platforms. PR: 190592 Exp-run by: antoine Approved by: portmgr (antoine)
2014-06-11 16:49:59 +02:00
CPPFLAGS+= -I${LOCALBASE}/include
LIBS+= -L${LOCALBASE}/lib
SUB_FILES= glest-wrapper pkg-message
JAM_CMD= ${LOCALBASE}/bin/jam -qa
OPTIONS_DEFINE= DOCS EDITOR
OPTIONS_SUB= yes
EDITOR_DESC= Build map editor
EXTRACT_AFTER_ARGS= -d ${WRKDIR}/${DISTNAME}
.include <bsd.port.options.mk>
.if ${PORT_OPTIONS:MEDITOR}
USE_WX= 2.6+
WX_CONF_ARGS= relative
WANT_UNICODE= yes
HAVE_EDITOR= true
.endif
pre-extract:
@${MKDIR} ${WRKDIR}/${DISTNAME}
post-patch:
@${REINPLACE_CMD} -e "s|%%ACLOCAL%%|${ACLOCAL}|g" -e "s|%%AUTOCONF%%|${AUTOCONF}|g" \
${WRKSRC}/mk/linux/autogen.sh
@${REINPLACE_CMD} -e 's|-lpthread|${PTHREAD_LIBS}|g' -e \
's|PTHREAD_LIBS="-l[$$]flag"|PTHREAD_LIBS="${PTHREAD_LIBS}"|g' -e \
's|pthreads library -l[$$]flag|pthreads library ${PTHREAD_LIBS}|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} -E ${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}
${INSTALL_DATA} ${WRKSRC}/docs/code_license.txt ${STAGEDIR}${DOCSDIR}/code_license.txt
@${MKDIR} ${STAGEDIR}${DATADIR}
${INSTALL_PROGRAM} ${WRKSRC}/glest ${STAGEDIR}${DATADIR}
${INSTALL_DATA} ${WRKSRC}/mk/linux/glest.ini ${STAGEDIR}${DATADIR}
${INSTALL_SCRIPT} ${WRKDIR}/glest-wrapper ${STAGEDIR}${PREFIX}/bin/${PORTNAME}
.if ${PORT_OPTIONS:MEDITOR}
${INSTALL_PROGRAM} ${WRKSRC}/glest_editor ${STAGEDIR}${PREFIX}/bin/
.endif
.include <bsd.port.mk>