Tweak games/cataclysm-dda version 0.9
[dports.git] / games / cataclysm-dda / Makefile
1 # Created by: Vladimir Kondratiev <wulf@cicgroup.ru>
2 # $FreeBSD$
3
4 PORTNAME=       cataclysm-dda
5 PORTVERSION=    0.9
6 CATEGORIES=     games
7
8 MAINTAINER=     wulf@cicgroup.ru
9 COMMENT=        Fork/variant of Cataclysm Roguelike by Whales
10
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
15
16 USES=           gmake shebangfix
17 SHEBANG_FILES=  lang/*.sh
18 bash_CMD=       /bin/sh
19
20 USE_GITHUB=     yes
21 GH_ACCOUNT=     CleverRaven
22 GH_PROJECT=     Cataclysm-DDA
23 GH_TAGNAME=     ${GH_COMMIT}
24 GH_COMMIT=      ebd2393
25 MAKE_ARGS+=     RELEASE=1
26 CXXFLAGS+=      -I${LOCALBASE}/include
27 LDFLAGS+=       -L${LOCALBASE}/lib
28
29 OPTIONS_DEFINE= NLS DOCS
30 OPTIONS_DEFAULT=NCURSES
31 OPTIONS_SINGLE= UI
32 OPTIONS_SINGLE_UI=      NCURSES SDL
33
34 UI_DESC=        User Interface
35
36 OPTIONS_SUB=    yes
37 SUB_FILES=      cataclysm
38 REINPLACE_ARGS= -i ''
39
40 NCURSES_USES=   ncurses
41 SDL_USE=        SDL=sdl,ttf,image
42 SDL_MAKE_ARGS=  TILES=1 TILESTARGET=cataclysm
43 NLS_USES=       gettext
44 NLS_LDFLAGS=    -lintl
45 NLS_MAKE_ARGS=  L10N=localization
46
47 .include <bsd.port.options.mk>
48
49 .if ! ${PORT_OPTIONS:MNLS}
50 MAKE_ARGS+=     LOCALIZE=0
51 .endif
52
53 post-extract:
54         ${RM} ${WRKSRC}/data/.gitignore
55
56 post-patch:
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
71
72 do-install:
73         ${INSTALL_SCRIPT} ${WRKDIR}/cataclysm ${STAGEDIR}${PREFIX}/bin
74         ${INSTALL_PROGRAM} ${WRKSRC}/cataclysm ${STAGEDIR}${PREFIX}/libexec
75 .for dir in data gfx
76         cd ${WRKSRC} && ${COPYTREE_SHARE} ${dir} ${STAGEDIR}${DATADIR}
77 .endfor
78 .if ${PORT_OPTIONS:MNLS}
79         cd ${WRKSRC}/lang/mo && ${COPYTREE_SHARE} . ${STAGEDIR}${PREFIX}/share/locale
80 .endif
81         @${MKDIR} ${STAGEDIR}${DOCSDIR}
82         ${FIND} ${WRKSRC} \( -name "*.md" -or -name "*.txt" \) \
83                 -exec ${INSTALL_DATA} {} ${STAGEDIR}${DOCSDIR}/ \;
84
85 .include <bsd.port.mk>