aboutsummaryrefslogtreecommitdiffstats
path: root/games/cataclysm-dda/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'games/cataclysm-dda/Makefile')
-rw-r--r--games/cataclysm-dda/Makefile85
1 files changed, 85 insertions, 0 deletions
diff --git a/games/cataclysm-dda/Makefile b/games/cataclysm-dda/Makefile
new file mode 100644
index 000000000000..709dde1b75c4
--- /dev/null
+++ b/games/cataclysm-dda/Makefile
@@ -0,0 +1,85 @@
+# Created by: Vladimir Kondratiev <wulf@cicgroup.ru>
+# $FreeBSD$
+
+PORTNAME= cataclysm-dda
+PORTVERSION= 0.9
+CATEGORIES= games
+
+MAINTAINER= wulf@cicgroup.ru
+COMMENT= Fork/variant of Cataclysm Roguelike by Whales
+
+LICENSE= CCPL.BY-SA.30
+LICENSE_NAME= Creative Commons Attribution-ShareAlike 3.0 Unported License
+LICENSE_FILE= ${WRKSRC}/LICENSE.txt
+LICENSE_PERMS= dist-mirror dist-sell pkg-mirror pkg-sell auto-accept
+
+USES= gmake shebangfix
+SHEBANG_FILES= lang/*.sh
+bash_CMD= /bin/sh
+
+USE_GITHUB= yes
+GH_ACCOUNT= CleverRaven
+GH_PROJECT= Cataclysm-DDA
+GH_TAGNAME= ${GH_COMMIT}
+GH_COMMIT= ebd2393
+MAKE_ARGS+= RELEASE=1
+CXXFLAGS+= -I${LOCALBASE}/include
+LDFLAGS+= -L${LOCALBASE}/lib
+
+OPTIONS_DEFINE= NLS
+OPTIONS_DEFAULT=NCURSES
+OPTIONS_SINGLE= UI
+OPTIONS_SINGLE_UI= NCURSES SDL
+
+UI_DESC= User Interface
+
+OPTIONS_SUB= yes
+SUB_FILES= cataclysm
+REINPLACE_ARGS= -i ''
+
+NCURSES_USES= ncurses
+SDL_USE= SDL=sdl,ttf,image
+SDL_MAKE_ARGS= TILES=1 TILESTARGET=cataclysm
+NLS_USES= gettext
+NLS_LDFLAGS= -lintl
+NLS_MAKE_ARGS= L10N=localization
+
+.include <bsd.port.options.mk>
+
+.if ! ${PORT_OPTIONS:MNLS}
+MAKE_ARGS+= LOCALIZE=0
+.endif
+
+post-extract:
+ ${RM} ${WRKSRC}/data/.gitignore
+
+post-patch:
+ ${REINPLACE_CMD} -e 's|"lang/mo"|"${PREFIX}/share/locale"|' ${WRKSRC}/main.cpp
+ cd ${WRKSRC} && ${REINPLACE_CMD} -e 's|gfx|${DATADIR}/&|' options.cpp \
+ sdltiles.cpp cata_tiles.cpp gfx/*/tileset.txt
+ cd ${WRKSRC} && ${REINPLACE_CMD} -e 's|data/json|${DATADIR}/&|' \
+ game.cpp init.cpp map.cpp sdltiles.cpp
+ cd ${WRKSRC} && ${REINPLACE_CMD} -e 's|data/raw|${DATADIR}/&|' \
+ input.cpp iuse_software_sokoban.cpp
+ ${REINPLACE_CMD} -e 's|data/font["/]|${DATADIR}/&| ; \
+ s|data/FONTDATA|${DATADIR}/&|' ${WRKSRC}/sdltiles.cpp
+ ${REINPLACE_CMD} -e 's|data/motd|${DATADIR}/&| ; \
+ s|data/credits|${DATADIR}/&|' ${WRKSRC}/main_menu.cpp
+ ${REINPLACE_CMD} -e '/^CXX *=/d ; /^LD *=/s/g++/$$(CXX)/ ; \
+ /OTHERS += -O3/d ; s/\(-lncurses\)\(w*\)/\1\2 -ltinfo\2/ ; \
+ /^WARNINGS *=/d' ${WRKSRC}/Makefile
+
+do-install:
+ ${INSTALL_SCRIPT} ${WRKDIR}/cataclysm ${STAGEDIR}${PREFIX}/bin
+ ${INSTALL_PROGRAM} ${WRKSRC}/cataclysm ${STAGEDIR}${PREFIX}/libexec
+.for dir in data gfx
+ cd ${WRKSRC} && ${COPYTREE_SHARE} ${dir} ${STAGEDIR}${DATADIR}
+.endfor
+.if ${PORT_OPTIONS:MNLS}
+ cd ${WRKSRC}/lang/mo && ${COPYTREE_SHARE} . ${STAGEDIR}${PREFIX}/share/locale
+.endif
+ @${MKDIR} ${STAGEDIR}${DOCSDIR}
+ ${FIND} ${WRKSRC} \( -name "*.md" -or -name "*.txt" \) \
+ -exec ${INSTALL_DATA} {} ${STAGEDIR}${DOCSDIR}/ \;
+
+.include <bsd.port.mk>