2012-11-01 09:29:17 +01:00
|
|
|
# Created by: Alexey Dokuchaev <danfe@FreeBSD.org>
|
2004-12-17 15:38:00 +01:00
|
|
|
# $FreeBSD$
|
|
|
|
|
|
|
|
PORTNAME= openttd
|
2016-07-02 09:38:59 +02:00
|
|
|
DISTVERSION= 1.6.1
|
2004-12-17 15:38:00 +01:00
|
|
|
CATEGORIES= games
|
2015-09-08 13:43:03 +02:00
|
|
|
MASTER_SITES= http://ca.binaries.openttd.org/binaries/releases/${DISTVERSION}/ \
|
|
|
|
http://cz.binaries.openttd.org/binaries/releases/${DISTVERSION}/ \
|
|
|
|
http://de.binaries.openttd.org/binaries/releases/${DISTVERSION}/ \
|
|
|
|
http://fr.binaries.openttd.org/binaries/releases/${DISTVERSION}/ \
|
2015-04-07 04:49:01 +02:00
|
|
|
http://ftp.snt.utwente.nl/pub/games/openttd/binaries/releases/${DISTVERSION}/ \
|
2015-09-08 13:43:03 +02:00
|
|
|
http://uk.binaries.openttd.org/binaries/releases/${DISTVERSION}/ \
|
2015-04-07 04:49:01 +02:00
|
|
|
http://us.binaries.openttd.org/binaries/releases/${DISTVERSION}/
|
|
|
|
DISTNAME= ${PORTNAME}-${DISTVERSION}-source
|
2004-12-17 15:38:00 +01:00
|
|
|
|
|
|
|
MAINTAINER= danfe@FreeBSD.org
|
2013-04-17 13:27:40 +02:00
|
|
|
COMMENT= Open source clone of Microprose Transport Tycoon Deluxe
|
2004-12-17 15:38:00 +01:00
|
|
|
|
2010-11-24 07:13:07 +01:00
|
|
|
LICENSE= GPLv2
|
|
|
|
|
2016-04-01 16:00:51 +02:00
|
|
|
LIB_DEPENDS= libpng.so:graphics/png \
|
|
|
|
liblzo2.so:archivers/lzo2
|
2006-11-29 23:56:41 +01:00
|
|
|
|
2015-04-13 15:30:17 +02:00
|
|
|
USES= cpe gmake pkgconfig tar:xz
|
2008-06-19 14:47:42 +02:00
|
|
|
HAS_CONFIGURE= yes
|
2012-07-05 09:46:16 +02:00
|
|
|
CONFIGURE_ENV= STRIP="${STRIP_CMD} ${STRIP}"
|
2010-05-12 22:26:00 +02:00
|
|
|
CONFIGURE_ARGS= --prefix-dir="${PREFIX}" --data-dir="${DATADIR_REL}"
|
2013-12-03 07:28:03 +01:00
|
|
|
|
|
|
|
.if defined(BATCH) || defined(PACKAGE_BUILDING)
|
|
|
|
MAKE_ARGS= VERBOSE=1
|
|
|
|
.endif
|
2008-06-19 14:47:42 +02:00
|
|
|
|
2015-04-07 04:49:01 +02:00
|
|
|
WRKSRC= ${WRKDIR}/${PORTNAME}-${DISTVERSION}
|
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
|
|
|
|
|
2012-07-05 09:46:16 +02:00
|
|
|
PORTDOCS= HOWTO_compile_lang_files.txt admin_network.txt \
|
2011-11-28 15:03:51 +01:00
|
|
|
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)
|
2012-07-05 09:46:16 +02:00
|
|
|
CONFIGURE_ARGS+= --with-midi="${WITH_MIDI_PLAYER}"
|
2008-06-19 14:47:42 +02:00
|
|
|
.endif
|
2011-11-28 15:03:51 +01:00
|
|
|
|
2008-06-19 14:47:42 +02:00
|
|
|
.if defined(WITH_MIDI_PLAYER_ARGS)
|
2012-07-05 09:46:16 +02:00
|
|
|
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)
|
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
|
2016-04-01 16:00:51 +02:00
|
|
|
LIB_DEPENDS+= libfreetype.so:print/freetype2 \
|
|
|
|
libfontconfig.so: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)
|
2016-04-01 16:00:51 +02:00
|
|
|
RUN_DEPENDS+= ${LOCALBASE}/share/${PORTNAME}/baseset/opengfx/opengfx.obg:games/opengfx \
|
|
|
|
${LOCALBASE}/share/${PORTNAME}/baseset/openmsx/openmsx.obm:games/openmsx \
|
|
|
|
${LOCALBASE}/share/${PORTNAME}/baseset/opensfx/opensfx.obs:games/opensfx
|
2011-10-17 05:44:38 +02:00
|
|
|
.endif
|
2006-11-29 23:56:41 +01:00
|
|
|
|
2014-11-16 13:35:54 +01:00
|
|
|
.if defined(WITH_SAVE_PASSWORDS)
|
|
|
|
EXTRA_PATCHES= ${FILESDIR}/extra-patch-save-passwords
|
|
|
|
.endif
|
|
|
|
|
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)
|
2012-08-18 11:27:19 +02:00
|
|
|
@${ECHO_MSG} "Define WITH_OPEN_GAME_FILES to install with libre graphics, music, and sounds"
|
2011-10-17 05:44:38 +02:00
|
|
|
.endif
|
2014-11-16 13:35:54 +01:00
|
|
|
.if !defined(WITH_SAVE_PASSWORDS)
|
|
|
|
@${ECHO_MSG} "Define WITH_SAVE_PASSWORDS to save passwords between server restarts"
|
|
|
|
.endif
|
2004-12-17 15:38:00 +01:00
|
|
|
|
2008-06-19 14:47:42 +02:00
|
|
|
post-patch:
|
2014-06-12 08:06:27 +02:00
|
|
|
@${REINPLACE_CMD} -e 's,/usr/local,${LOCALBASE},' ${WRKSRC}/config.lib
|
2005-01-14 11:30:03 +01:00
|
|
|
|
2004-12-17 15:38:00 +01:00
|
|
|
do-install:
|
2013-10-31 02:26:14 +01:00
|
|
|
${INSTALL_PROGRAM} ${WRKSRC}/bin/${PORTNAME} ${STAGEDIR}${PREFIX}/bin
|
|
|
|
@${MKDIR} ${STAGEDIR}${DATADIR}/ai ${STAGEDIR}${DATADIR}/baseset \
|
|
|
|
${STAGEDIR}${DATADIR}/lang ${STAGEDIR}${DATADIR}/scripts
|
|
|
|
${INSTALL_DATA} ${WRKSRC}/bin/ai/*.nut ${STAGEDIR}${DATADIR}/ai
|
|
|
|
${INSTALL_DATA} ${WRKSRC}/bin/baseset/* ${STAGEDIR}${DATADIR}/baseset
|
|
|
|
${INSTALL_DATA} ${WRKSRC}/bin/lang/* ${STAGEDIR}${DATADIR}/lang
|
|
|
|
${INSTALL_DATA} ${WRKSRC}/bin/scripts/* ${STAGEDIR}${DATADIR}/scripts
|
|
|
|
${INSTALL_MAN} ${WRKSRC}/docs/${PORTNAME}.6 \
|
|
|
|
${STAGEDIR}${MANPREFIX}/man/man6
|
|
|
|
${INSTALL_DATA} ${WRKSRC}/media/openttd.32.xpm \
|
|
|
|
${STAGEDIR}${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
|
2013-10-31 02:26:14 +01:00
|
|
|
@${MKDIR} ${STAGEDIR}${PREFIX}/share/icons/hicolor/${n}x${n}/apps
|
2008-06-19 14:47:42 +02:00
|
|
|
${INSTALL_DATA} ${WRKSRC}/media/openttd.${n}.png \
|
2013-10-31 02:26:14 +01:00
|
|
|
${STAGEDIR}${PREFIX}/share/icons/hicolor/${n}x${n}/apps/openttd.png
|
2011-11-28 15:03:51 +01:00
|
|
|
. endfor
|
|
|
|
.endif
|
2013-10-31 02:26:14 +01:00
|
|
|
@${MKDIR} ${STAGEDIR}${DOCSDIR}
|
|
|
|
${INSTALL_DATA} ${PORTDOCS:S,^,${WRKSRC}/docs/,} ${STAGEDIR}${DOCSDIR}
|
2004-12-17 15:38:00 +01:00
|
|
|
|
|
|
|
post-install:
|
2011-11-28 15:03:51 +01:00
|
|
|
.if defined(WITH_DEDICATED_SERVER_ONLY)
|
|
|
|
@${REINPLACE_CMD} -e '/icons/d' ${TMPPLIST}
|
|
|
|
.endif
|
2004-12-17 15:38:00 +01:00
|
|
|
|
2011-05-16 20:20:04 +02:00
|
|
|
.include <bsd.port.post.mk>
|