aboutsummaryrefslogtreecommitdiffstats
path: root/games/cataclysm-dda/Makefile
blob: 709dde1b75c458e99f9183c32f60d9e81dc17cfc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
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>