summaryrefslogtreecommitdiff
path: root/games/openfodder/Makefile
blob: 8e1954a93e1cb6a45ed374436bd3291e8bc21496 (plain)
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

PORTNAME=	OpenFodder
DISTVERSION=	1.6.0
CATEGORIES=	games

PATCH_SITES=	https://github.com/${GH_ACCOUNT}/${GH_PROJECT}/commit/
PATCHFILES+=	129d50b3ba09.patch:-p1

MAINTAINER=	jbeich@FreeBSD.org
COMMENT=	Open source port of Cannon Fodder

LICENSE=	BSD3CLAUSE GPLv3+ LGPL21+ MIT ZLIB
LICENSE_COMB=	multi
LICENSE_FILE_BSD3CLAUSE=${WRKSRC}/COPYING.BSD.txt
LICENSE_FILE_GPLv3+ =	${WRKSRC}/COPYING
LICENSE_FILE_LGPL21+ =	${WRKSRC}/COPYING.LGPLv2.1.txt
LICENSE_FILE_MIT=	${WRKSRC}/COPYING.MIT.txt
LICENSE_FILE_ZLIB=	${WRKSRC}/COPYING.ZLIB.txt

USES=		compiler:c++14-lang sdl
USE_GITHUB=	yes
USE_SDL=	mixer2
GH_TUPLE=	${PORTNAME}:data:1.7.0:data/Run \
		${PORTNAME}:scripts:c6f3076:scripts/Run/Scripts
GH_PROJECT=	${PORTNAME:tl}
PLIST_FILES=	bin/${PORTNAME}
PORTDATA=	*
PORTDOCS=	*.md

DESKTOP_ENTRIES="${PORTNAME}" \
		"" \
		"${PORTNAME:tl}" \
		"${PORTNAME}" \
		"Game;ActionGame;" \
		""

OPTIONS_DEFINE=	DOCS ICONS
OPTIONS_DEFAULT=ICONS

ICONS_BUILD_DEPENDS=	mogrify:graphics/ImageMagick6

post-patch:
	@${REINPLACE_CMD} -e 's,clang++,${CXX},' \
		-e 's/ -ferror-limit=100//' \
		-e 's, -I/usr/include[^[:space:]]*,,g' \
		-e 's,git log -n 1 --pretty=,${ECHO_CMD} ,' \
		-e 's,%%h,${DISTVERSIONFULL},' \
		${WRKSRC}/Makefile
	@${REINPLACE_CMD} 's,/usr/local,${PREFIX},' \
		${WRKSRC}/Source/ResourceMan.cpp

post-build-ICONS-on:
	@for size in 16x16 24x24 32x32 48x48 57x57; do \
		${MKDIR} ${WRKDIR}/icons/hicolor/$$size/apps; \
	done
	@mogrify -verbose -set filename:size %wx%h -format png \
		 -path ${WRKDIR}/icons/hicolor/%\[filename:size]/apps \
		${WRKSRC}/Projects/${PORTNAME:tl}.ico

do-test:
	@(cd ${WRKSRC_data} && ${SETENV} ${TEST_ENV} \
		${WRKSRC}/Run/${PORTNAME} --unit-test-headless)

do-install:
	${INSTALL_PROGRAM} ${WRKSRC}/Run/${PORTNAME} \
		${STAGEDIR}${PREFIX}/bin
	(cd ${WRKSRC}/Run && ${COPYTREE_SHARE} "${PORTDATA}" \
		 ${STAGEDIR}${DATADIR} "! -name ${PORTNAME} -type f")

do-install-DOCS-on:
	(cd ${WRKSRC} && ${COPYTREE_SHARE} "${PORTDOCS}" \
		${STAGEDIR}${DOCSDIR})

do-install-ICONS-on:
	(cd ${WRKDIR}/icons && ${COPYTREE_SHARE} . \
		${STAGEDIR}${PREFIX}/share/icons)
	(cd ${STAGEDIR}${PREFIX} && ${FIND} share/icons -type f >>${TMPPLIST})

.include <bsd.port.mk>