1 # Created by: Vladimir Kondratiev <wulf@cicgroup.ru>
4 PORTNAME= cataclysm-dda
8 MAINTAINER= wulf@cicgroup.ru
9 COMMENT= Fork/variant of Cataclysm Roguelike by Whales
11 LICENSE= CCPL.BY-SA.30
12 LICENSE_NAME= Creative Commons Attribution-ShareAlike 3.0 Unported License
13 LICENSE_FILE= ${WRKSRC}/LICENSE.txt
14 LICENSE_PERMS= dist-mirror dist-sell pkg-mirror pkg-sell auto-accept
16 USES= gmake shebangfix
17 SHEBANG_FILES= lang/*.sh
21 GH_ACCOUNT= CleverRaven
22 GH_PROJECT= Cataclysm-DDA
23 GH_TAGNAME= ${GH_COMMIT}
26 CXXFLAGS+= -I${LOCALBASE}/include
27 LDFLAGS+= -L${LOCALBASE}/lib
29 OPTIONS_DEFINE= NLS DOCS
30 OPTIONS_DEFAULT=NCURSES
32 OPTIONS_SINGLE_UI= NCURSES SDL
34 UI_DESC= User Interface
41 SDL_USE= SDL=sdl,ttf,image
42 SDL_MAKE_ARGS= TILES=1 TILESTARGET=cataclysm
45 NLS_MAKE_ARGS= L10N=localization
47 .include <bsd.port.options.mk>
49 .if ! ${PORT_OPTIONS:MNLS}
50 MAKE_ARGS+= LOCALIZE=0
54 ${RM} ${WRKSRC}/data/.gitignore
57 ${REINPLACE_CMD} -e 's|"lang/mo"|"${PREFIX}/share/locale"|' ${WRKSRC}/main.cpp
58 cd ${WRKSRC} && ${REINPLACE_CMD} -e 's|gfx|${DATADIR}/&|' options.cpp \
59 sdltiles.cpp cata_tiles.cpp gfx/*/tileset.txt
60 cd ${WRKSRC} && ${REINPLACE_CMD} -e 's|data/json|${DATADIR}/&|' \
61 game.cpp init.cpp map.cpp sdltiles.cpp
62 cd ${WRKSRC} && ${REINPLACE_CMD} -e 's|data/raw|${DATADIR}/&|' \
63 input.cpp iuse_software_sokoban.cpp
64 ${REINPLACE_CMD} -e 's|data/font["/]|${DATADIR}/&| ; \
65 s|data/FONTDATA|${DATADIR}/&|' ${WRKSRC}/sdltiles.cpp
66 ${REINPLACE_CMD} -e 's|data/motd|${DATADIR}/&| ; \
67 s|data/credits|${DATADIR}/&|' ${WRKSRC}/main_menu.cpp
68 ${REINPLACE_CMD} -e '/^CXX *=/d ; /^LD *=/s/g++/$$(CXX)/ ; \
69 /OTHERS += -O3/d ; s/\(-lncurses\)\(w*\)/\1\2 -ltinfo\2/ ; \
70 /^WARNINGS *=/d' ${WRKSRC}/Makefile
73 ${INSTALL_SCRIPT} ${WRKDIR}/cataclysm ${STAGEDIR}${PREFIX}/bin
74 ${INSTALL_PROGRAM} ${WRKSRC}/cataclysm ${STAGEDIR}${PREFIX}/libexec
76 cd ${WRKSRC} && ${COPYTREE_SHARE} ${dir} ${STAGEDIR}${DATADIR}
78 .if ${PORT_OPTIONS:MNLS}
79 cd ${WRKSRC}/lang/mo && ${COPYTREE_SHARE} . ${STAGEDIR}${PREFIX}/share/locale
81 @${MKDIR} ${STAGEDIR}${DOCSDIR}
82 ${FIND} ${WRKSRC} \( -name "*.md" -or -name "*.txt" \) \
83 -exec ${INSTALL_DATA} {} ${STAGEDIR}${DOCSDIR}/ \;
85 .include <bsd.port.mk>