2004-12-17 15:38:00 +01:00
|
|
|
# New ports collection makefile for: OpenTTD
|
|
|
|
# Date created: 16 Dec 2004
|
|
|
|
# Whom: Alexey Dokuchaev <danfe@FreeBSD.org>
|
|
|
|
#
|
|
|
|
# $FreeBSD$
|
|
|
|
#
|
|
|
|
|
|
|
|
PORTNAME= openttd
|
2012-01-16 04:51:20 +01:00
|
|
|
PORTVERSION= 1.1.5
|
2012-06-01 07:26:28 +02:00
|
|
|
PORTREVISION= 2
|
2004-12-17 15:38:00 +01:00
|
|
|
CATEGORIES= games
|
2010-02-16 13:35:40 +01:00
|
|
|
MASTER_SITES= http://gb.binaries.openttd.org/binaries/releases/${PORTVERSION}/ \
|
2010-11-24 08:33:28 +01:00
|
|
|
http://ftp.snt.utwente.nl/pub/games/openttd/binaries/releases/${PORTVERSION}/ \
|
2011-05-16 20:20:04 +02:00
|
|
|
http://de.binaries.openttd.org/binaries/releases/${PORTVERSION}/ \
|
|
|
|
http://us.binaries.openttd.org/binaries/releases/${PORTVERSION}/
|
|
|
|
DISTNAME= ${PORTNAME}-${PORTVERSION}-source
|
2004-12-17 15:38:00 +01:00
|
|
|
|
|
|
|
MAINTAINER= danfe@FreeBSD.org
|
|
|
|
COMMENT= An open source clone of Microprose Transport Tycoon Deluxe
|
|
|
|
|
2010-11-24 07:13:07 +01:00
|
|
|
LICENSE= GPLv2
|
|
|
|
|
2012-06-01 07:26:28 +02:00
|
|
|
LIB_DEPENDS= png15:${PORTSDIR}/graphics/png \
|
2010-05-12 22:26:00 +02:00
|
|
|
lzo2.2:${PORTSDIR}/archivers/lzo2
|
2006-11-29 23:56:41 +01:00
|
|
|
|
2011-05-19 12:01:04 +02:00
|
|
|
USE_XZ= yes
|
2008-06-19 14:47:42 +02:00
|
|
|
HAS_CONFIGURE= yes
|
2010-05-12 22:26:00 +02:00
|
|
|
CONFIGURE_ARGS= --prefix-dir="${PREFIX}" --data-dir="${DATADIR_REL}"
|
2006-11-29 23:56:41 +01:00
|
|
|
USE_GMAKE= yes
|
2011-05-19 12:01:04 +02:00
|
|
|
MAKE_ARGS= VERBOSE=1 # We want to see what's going on
|
2009-04-03 12:32:40 +02:00
|
|
|
MAKE_JOBS_SAFE= yes
|
2008-06-19 14:47:42 +02:00
|
|
|
|
2007-08-15 15:25:07 +02:00
|
|
|
WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION}
|
2011-05-19 12:01:04 +02:00
|
|
|
CXXFLAGS= # Set to empty as OpenTTD treats it as an addition to CFLAGS
|
2007-03-01 13:30:45 +01:00
|
|
|
|
2011-11-28 15:03:51 +01:00
|
|
|
SUB_FILES= pkg-message
|
|
|
|
MAN6= ${PORTNAME}.6
|
|
|
|
|
|
|
|
PORTDOCS= 32bpp.txt HOWTO_compile_lang_files.txt admin_network.txt \
|
|
|
|
elrail.svg elrail_tile.png elrail_track.png landscape.html \
|
|
|
|
landscape_externals.html landscape_grid.html multiplayer.txt \
|
|
|
|
obg_format.txt obm_format.txt obs_format.txt \
|
|
|
|
ottd-colourtext-palette.png tileh.png
|
|
|
|
|
|
|
|
DESKTOP_ENTRIES="OpenTTD" "${COMMENT}" "${PORTNAME}" "${PORTNAME}" \
|
|
|
|
"Game;Simulation;StrategyGame;" false
|
|
|
|
|
2006-11-29 23:56:41 +01:00
|
|
|
.if defined(WITH_MIDI_PLAYER)
|
2008-06-19 14:47:42 +02:00
|
|
|
CONFIGURE_ARGS+= --with-midi=${WITH_MIDI_PLAYER}
|
|
|
|
.endif
|
2011-11-28 15:03:51 +01:00
|
|
|
|
2008-06-19 14:47:42 +02:00
|
|
|
.if defined(WITH_MIDI_PLAYER_ARGS)
|
|
|
|
CONFIGURE_ARGS+= --with-midi-arg=${WITH_MIDI_PLAYER_ARGS}
|
2006-11-29 23:56:41 +01:00
|
|
|
.endif
|
2011-11-28 15:03:51 +01:00
|
|
|
|
2006-11-29 23:56:41 +01:00
|
|
|
.if defined(WITH_DEDICATED_SERVER_ONLY)
|
2011-05-19 12:01:04 +02:00
|
|
|
USE_GNOME= pkgconfig # Needed for liblzma support
|
2008-06-19 14:47:42 +02:00
|
|
|
CONFIGURE_ARGS+= --enable-dedicated
|
2010-05-12 22:26:00 +02:00
|
|
|
# Aid it to find lzo2 headers; client build gets it via sdl-config
|
2011-05-19 12:01:04 +02:00
|
|
|
CFLAGS+= -I${LOCALBASE}/include
|
2010-11-24 07:13:07 +01:00
|
|
|
USE_RC_SUBR= ${PORTNAME}
|
2006-11-29 23:56:41 +01:00
|
|
|
.else
|
2010-02-17 14:10:25 +01:00
|
|
|
LIB_DEPENDS+= freetype.9:${PORTSDIR}/print/freetype2 \
|
|
|
|
fontconfig.1:${PORTSDIR}/x11-fonts/fontconfig
|
2006-11-29 23:56:41 +01:00
|
|
|
USE_SDL= sdl
|
2011-11-28 15:03:51 +01:00
|
|
|
INSTALLS_ICONS= yes
|
2006-11-29 23:56:41 +01:00
|
|
|
.endif
|
2011-11-28 15:03:51 +01:00
|
|
|
|
2011-10-17 05:44:38 +02:00
|
|
|
.if defined(WITH_OPEN_GAME_FILES)
|
|
|
|
RUN_DEPENDS= ${LOCALBASE}/share/${PORTNAME}/data/opengfx/opengfx.obg:${PORTSDIR}/games/opengfx \
|
|
|
|
${LOCALBASE}/share/${PORTNAME}/gm/openmsx/openmsx.obm:${PORTSDIR}/games/openmsx \
|
|
|
|
${LOCALBASE}/share/${PORTNAME}/data/opensfx/opensfx.obs:${PORTSDIR}/games/opensfx
|
|
|
|
.endif
|
2006-11-29 23:56:41 +01:00
|
|
|
|
2011-05-16 20:20:04 +02:00
|
|
|
.include <bsd.port.pre.mk>
|
2007-03-01 13:30:45 +01:00
|
|
|
|
2004-12-17 15:38:00 +01:00
|
|
|
pre-everything::
|
|
|
|
.if !defined(WITH_MIDI_PLAYER)
|
|
|
|
@${ECHO_MSG} "Define WITH_MIDI_PLAYER=/path/to/player to build with external MIDI player"
|
|
|
|
.endif
|
2008-06-19 14:47:42 +02:00
|
|
|
.if !defined(WITH_MIDI_PLAYER_ARGS)
|
|
|
|
@${ECHO_MSG} "Define WITH_MIDI_PLAYER_ARGS=arguments for external MIDI player"
|
|
|
|
.endif
|
2005-01-14 11:30:03 +01:00
|
|
|
.if !defined(WITH_DEDICATED_SERVER_ONLY)
|
|
|
|
@${ECHO_MSG} "Define WITH_DEDICATED_SERVER_ONLY to build CLI-based dedicated server"
|
2004-12-17 15:38:00 +01:00
|
|
|
.endif
|
2011-10-17 05:44:38 +02:00
|
|
|
.if !defined(WITH_OPEN_GAME_FILES)
|
|
|
|
@${ECHO_MSG} "Define WITH_OPEN_GAME_FILES to install with libre graphics, music, and sound"
|
|
|
|
.endif
|
2004-12-17 15:38:00 +01:00
|
|
|
|
2008-06-19 14:47:42 +02:00
|
|
|
post-patch:
|
2010-11-24 07:13:07 +01:00
|
|
|
# Remove extra (vendor-provided) CFLAGS and LDFLAGS and make the port more
|
2011-10-17 05:44:38 +02:00
|
|
|
# LOCALBASE safe
|
|
|
|
@${REINPLACE_CMD} -e '/-O2 -fomit-frame-pointer/d ; \
|
|
|
|
s,/usr/local,${LOCALBASE},' ${WRKSRC}/config.lib
|
2011-05-19 12:01:04 +02:00
|
|
|
# Use custom liblzma.pc for when we use liblzma from base
|
2011-05-16 20:20:04 +02:00
|
|
|
.if ${OSVERSION} >= 900012 || (${OSVERSION} >= 800505 && ${OSVERSION} < 900000)
|
2011-05-19 12:01:04 +02:00
|
|
|
@${REINPLACE_CMD} -e \
|
|
|
|
's,pkg-config liblzma,pkg-config ${FILESDIR}/liblzma.pc,' \
|
|
|
|
${WRKSRC}/config.lib
|
2011-05-16 20:20:04 +02:00
|
|
|
.else
|
2011-05-18 13:58:22 +02:00
|
|
|
LIB_DEPENDS+= lzma.5:${PORTSDIR}/archivers/xz
|
2011-05-16 20:20:04 +02:00
|
|
|
.endif
|
2005-01-14 11:30:03 +01:00
|
|
|
|
2004-12-17 15:38:00 +01:00
|
|
|
do-install:
|
2008-06-19 14:47:42 +02:00
|
|
|
${INSTALL_PROGRAM} ${WRKSRC}/bin/${PORTNAME} ${PREFIX}/bin
|
2010-05-12 22:26:00 +02:00
|
|
|
@${MKDIR} ${DATADIR}/ai ${DATADIR}/data ${DATADIR}/gm \
|
|
|
|
${DATADIR}/lang ${DATADIR}/scripts
|
|
|
|
${INSTALL_DATA} ${WRKSRC}/bin/ai/*.nut ${DATADIR}/ai
|
2008-06-19 14:47:42 +02:00
|
|
|
${INSTALL_DATA} ${WRKSRC}/bin/data/* ${DATADIR}/data
|
2010-05-12 22:26:00 +02:00
|
|
|
${INSTALL_DATA} ${WRKSRC}/bin/gm/* ${DATADIR}/gm
|
2008-06-19 14:47:42 +02:00
|
|
|
${INSTALL_DATA} ${WRKSRC}/bin/lang/* ${DATADIR}/lang
|
|
|
|
${INSTALL_DATA} ${WRKSRC}/bin/scripts/* ${DATADIR}/scripts
|
2005-01-14 11:30:03 +01:00
|
|
|
${INSTALL_MAN} ${WRKSRC}/docs/${MAN6} ${MANPREFIX}/man/man6
|
2010-05-12 22:26:00 +02:00
|
|
|
${INSTALL_DATA} ${WRKSRC}/media/openttd.32.xpm ${PREFIX}/share/pixmaps
|
2011-11-28 15:03:51 +01:00
|
|
|
.if !defined(WITH_DEDICATED_SERVER_ONLY)
|
|
|
|
. for n in 16 32 48 64 128 256
|
2008-06-19 14:47:42 +02:00
|
|
|
@${MKDIR} ${PREFIX}/share/icons/hicolor/${n}x${n}/apps
|
|
|
|
${INSTALL_DATA} ${WRKSRC}/media/openttd.${n}.png \
|
|
|
|
${PREFIX}/share/icons/hicolor/${n}x${n}/apps/openttd.png
|
2011-11-28 15:03:51 +01:00
|
|
|
. endfor
|
|
|
|
.endif
|
2004-12-17 15:38:00 +01:00
|
|
|
.if !defined(NOPORTDOCS)
|
|
|
|
@${MKDIR} ${DOCSDIR}
|
2010-02-16 13:35:40 +01:00
|
|
|
${INSTALL_DATA} ${PORTDOCS:S,^,${WRKSRC}/docs/,} ${DOCSDIR}
|
2004-12-17 15:38:00 +01:00
|
|
|
.endif
|
|
|
|
|
|
|
|
post-install:
|
2011-11-28 15:03:51 +01:00
|
|
|
.if defined(WITH_DEDICATED_SERVER_ONLY)
|
|
|
|
@${REINPLACE_CMD} -e '/icons/d' ${TMPPLIST}
|
|
|
|
.endif
|
2008-06-19 14:47:42 +02:00
|
|
|
@${ECHO_MSG}
|
2004-12-17 15:38:00 +01:00
|
|
|
@${CAT} ${PKGMESSAGE}
|
2008-06-19 14:47:42 +02:00
|
|
|
@${ECHO_MSG}
|
2004-12-17 15:38:00 +01:00
|
|
|
|
2011-05-16 20:20:04 +02:00
|
|
|
.include <bsd.port.post.mk>
|