aboutsummaryrefslogtreecommitdiffstats
path: root/games/stonesoup/Makefile
blob: 8d18d27ce28ecf5ff73e45b9b256bd14a3c8d84d (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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
# New ports collection makefile for:    dcss
# Date created:     2008-07-11
# Whom:         Tobias Rehbein <tobias.rehbein@web.de>
#
# $FreeBSD$
#

PORTNAME=   stonesoup
PORTVERSION=    0.11.1
CATEGORIES= games
MASTER_SITES=   SF/crawl-ref/Stone%20Soup/${PORTVERSION}
DISTNAME=   stone_soup-${PORTVERSION}-nodeps

MAINTAINER= tobias.rehbein@web.de
COMMENT=    Dungeon Crawl Stone Soup - a fun, free rogue-like game

LICENSE=    GPLv2
LICENSE_FILE=   ${WRKDIR}/stone_soup-${PORTVERSION}/licence.txt

USE_SQLITE= yes
USE_XZ=     yes
USE_BISON=  build
USE_GMAKE=  yes
USE_LUA=    5.1
USE_PERL5_BUILD=    yes

MAKE_JOBS_SAFE= yes

SAVEDIR=    \~/.stonesoup
WRKSRC=     ${WRKDIR}/stone_soup-${PORTVERSION}/source/

SUB_FILES=  README.FreeBSD
PLIST_SUB=  SAVEDIR="${SAVEDIR}"

OPTIONS_DEFINE= SOUND WIZARD LUA_BINDINGS DOCS EXAMPLES

SOUND_DESC= Sound support
WIZARD_DESC=    Wizard mode
LUA_BINDINGS_DESC=  Bindings for LUA user scripts

MAKE_ARGS=  prefix=${PREFIX} \
        DATADIR=${DATADIR} \
        SAVEDIR=${SAVEDIR} \
        INSTALL_UGRP=root:games \
        NO_AUTO_OPT=YesPlease \
        NO_OPTIMIZE=YesPlease \
        LUA_INCLUDE_DIR=${LOCALBASE}/include/lua51 \
        LUA_LIB=-llua-5.1 \
        SQLITE_INCLUDE_DIR=${LOCALBASE}/include \
        SQLITE_LIB=-lsqlite3 \
        LDFLAGS="-L${LOCALBASE}/lib -L${LOCALBASE}/lib/lua51"

.include <bsd.port.options.mk>

.if !defined(COMPILER_TYPE)
.if ${CC:T:Mgcc*}
COMPILER_TYPE:= gcc
.elif ${CC:T:Mclang}
COMPILER_TYPE:= clang
.elif ${CC:T} == "cc"
_COMPILER_VERSION!=     ${CC} --version
.if ${_COMPILER_VERSION:Mgcc}
COMPILER_TYPE:= gcc
.elif ${_COMPILER_VERSION:M\(GCC\)}
COMPILER_TYPE:= gcc
.elif ${_COMPILER_VERSION:Mclang}
COMPILER_TYPE:= clang
.endif
.undef _COMPILER_VERSION
.else
COMPILER_TYPE:= ${CC:T}
.endif
.endif

.if ${COMPILER_TYPE} == "clang"
MAKE_ARGS+= NO_INLINE_DEPGEN=1
.endif

.if defined(VERBOSE)
MAKE_ARGS+= V=yes
.endif

.if empty(PORT_OPTIONS:MWIZARD)
MAKE_ARGS+= NOWIZARD=y
.endif

.if ${PORT_OPTIONS:MSDL}
CONFLICTS+= ${PORTNAME}-[0-9]*
MAKE_ARGS+= TILES=y
PLIST_SUB+= SDL=""
PKGNAMESUFFIX=  -sdl
USE_PKGCONFIG=  yes
BUILD_DEPENDS+= fc-list:${PORTSDIR}/x11-fonts/fontconfig \
        ${LOCALBASE}/lib/X11/fonts/dejavu/DejaVuSans.ttf:${PORTSDIR}/x11-fonts/dejavu
RUN_DEPENDS+=   ${LOCALBASE}/lib/X11/fonts/dejavu/DejaVuSans.ttf:${PORTSDIR}/x11-fonts/dejavu
LIB_DEPENDS+=   png15:${PORTSDIR}/graphics/png \
        freetype:${PORTSDIR}/print/freetype2
USE_SDL=    sdl image
.else
USE_NCURSES=    yes
CONFLICTS+= ${PORTNAME}-sdl-[0-9]*
PLIST_SUB+= SDL="@comment "
.endif

.if ${PORT_OPTIONS:MSOUND}
RUN_DEPENDS+=   sox:${PORTSDIR}/audio/sox
.endif

.if empty(PORT_OPTIONS:MLUA_BINDINGS)
MAKE_ARGS+= NO_LUA_BINDINGS=yes
.endif

post-patch:
.if ${PORT_OPTIONS:MSOUND}
    @${REINPLACE_CMD} -e "s,%%LOCALBASE%%,${LOCALBASE}," ${WRKSRC}/AppHdr.h
    @${REINPLACE_CMD} -e "s,%%SOUND%%,," ${WRKSRC}/AppHdr.h
.else
    @${REINPLACE_CMD} -e "s,%%SOUND%%,// ," ${WRKSRC}/AppHdr.h
.endif

post-install:
.if ${PORT_OPTIONS:MDOCS}
    ${MKDIR} ${DOCSDIR}
    ${INSTALL_DATA} ${WRKDIR}/README.FreeBSD ${DOCSDIR}
.endif
.if ${PORT_OPTIONS:MEXAMPLES}
    ${MKDIR} ${EXAMPLESDIR}
    ${INSTALL_DATA} ${DATADIR}/settings/init.txt ${EXAMPLESDIR}/sample.crawlrc
.endif

.include <bsd.port.mk>