aboutsummaryrefslogtreecommitdiff
path: root/x11-toolkits/irrlicht/Makefile
blob: 4a1c1767fda5065a91eceee1a2b6affde2cd8002 (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
# Created by: Simon Barner <barner@gmx.de>
# $FreeBSD$

PORTNAME=	irrlicht
PORTVERSION=	1.8
CATEGORIES=	x11-toolkits graphics
MASTER_SITES=	SF/${PORTNAME}/Irrlicht%20SDK/${PORTVERSION}/

MAINTAINER=	acm@FreeBSD.org
COMMENT=	High performance realtime 3D engine

LIB_DEPENDS=	libjpeg.so:${PORTSDIR}/graphics/jpeg \
		libpng15.so:${PORTSDIR}/graphics/png

DOS2UNIX_GLOB=	Makefile *.cpp *.h *.txt
USES=		dos2unix gmake zip
USE_GL=		yes
USE_LDCONFIG=	yes
CFLAGS+=	-I${LOCALBASE}/include/libpng15
MAKE_ENV+=	SHLIB_VER=${SHARED_LIB_VER}

PLIST_SUB+=	SHARED_LIB_VER=${SHARED_LIB_VER}
SUB_FILES=	pkg-message
BUILD_WRKSRC=	${WRKSRC}/source/Irrlicht

SHARED_LIB_VER=	1
EXAMPLEDIRS=	01.HelloWorld 02.Quake3Map 03.CustomSceneNode 04.Movement 05.UserInterface \
		06.2DGraphics 07.Collision 08.SpecialFX 09.Meshviewer 10.Shaders \
		11.PerPixelLighting 12.TerrainRendering 13.RenderToTexture 15.LoadIrrFile \
		Demo

OPTIONS_DEFINE=	DEBUG EXAMPLES JOYSTICK
JOYSTICK_DESC=	Support for Linux Joystick

.include <bsd.port.options.mk>

.if (${ARCH} == "amd64") || (${ARCH} == "ia64")
CFLAGS+=	-fPIC
.endif

.if ${ARCH} == "sparc64"
BROKEN=		Does not compile on sparc64
.endif

.if ${PORT_OPTIONS:MEXAMPLES}
PLIST_SUB+=	EXAMPLES=""
.else
PLIST_SUB+=	EXAMPLES="@comment "
.endif

.if ${PORT_OPTIONS:MJOYSTICK}
BUILD_DEPENDS+=	${LOCALBASE}/include/linux/joystick.h:${PORTSDIR}/devel/linux-js
HAVE_JOYSTICK=	true
.endif

.if ${PORT_OPTIONS:MDEBUG}
MAKE_ENV+=	NDEBUG=1
.endif

post-extract:
#	@${RM} ${WRKSRC}/media/Thumbs.db

post-patch:
	@${REINPLACE_CMD} -e '/#define.*_IRR_USE_NON_SYSTEM_JPEG_LIB_/ d' \
		-e '/#define.*_IRR_USE_NON_SYSTEM_LIB_PNG_/ d' \
		-e '/#define.*_IRR_USE_NON_SYSTEM_ZLIB_/ d' \
		-e '/#define.*_IRR_USE_NON_SYSTEM_BZLIB_/ d' \
		${WRKSRC}/include/IrrCompileConfig.h
.if !defined(HAVE_JOYSTICK)
	@${REINPLACE_CMD} -e '/define.*_IRR_COMPILE_WITH_JOYSTICK_EVENTS_/ d' \
		${WRKSRC}/include/IrrCompileConfig.h
.endif

do-install:
	${MKDIR} ${STAGEDIR}${PREFIX}/include/${PORTNAME}
	cd ${WRKSRC}/include && \
		${INSTALL_DATA} *.h ${STAGEDIR}${PREFIX}/include/${PORTNAME}
	${INSTALL_DATA} ${WRKSRC}/lib/FreeBSD/libIrrlicht.a ${STAGEDIR}${PREFIX}/lib
	${INSTALL_PROGRAM} ${WRKSRC}/lib/FreeBSD/libIrrlicht.so.${SHARED_LIB_VER} \
		${STAGEDIR}${PREFIX}/lib && ${LN} -s libIrrlicht.so.${SHARED_LIB_VER} \
			${STAGEDIR}${PREFIX}/lib/libIrrlicht.so

.if ${PORT_OPTIONS:MEXAMPLES}
.for DIRE in ${EXAMPLEDIRS}
	${MKDIR} ${STAGEDIR}${EXAMPLESDIR}/${DIRE}
	${INSTALL_DATA} ${WRKSRC}/examples/${DIRE}/Makefile \
		${STAGEDIR}${EXAMPLESDIR}/${DIRE}
	${FIND} ${WRKSRC}/examples/${DIRE} \( -name "*.cpp" -or -name "*.h" \) \
		-exec ${INSTALL_DATA} "{}" ${STAGEDIR}${EXAMPLESDIR}/${DIRE} \;
.endfor
	${MKDIR} ${STAGEDIR}${EXAMPLESDIR}/media
	${FIND} ${WRKSRC}/media -type f \
		-exec ${INSTALL_DATA} "{}" ${STAGEDIR}${EXAMPLESDIR}/media \;
.endif

.include <bsd.port.mk>