aboutsummaryrefslogtreecommitdiff
path: root/graphics/crystalspace-devel/Makefile
blob: 225a99bfeecb547f02bc237baf4e88a723e63bcd (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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
# New ports collection makefile for:	Crystal Space 3d
# Date created:		2005-11-19
# Whom:			Jose Alonso Cardenas Marquez <acardenas@bsd.org.pe>
#
# $FreeBSD$
#

PORTNAME=	crystalspace
PORTVERSION=	20061105
PORTREVISION=	5
CATEGORIES=	graphics
MASTER_SITES=	http://alex.foxybanana.com/freebsd/
PKGNAMESUFFIX=	-devel
DIST_SUBDIR=	${PORTNAME}

MAINTAINER=	acm@FreeBSD.org
COMMENT=	Free and portable 3D Game Development Kit

BUILD_DEPENDS=	nasm:${PORTSDIR}/devel/nasm \
		swig:${PORTSDIR}/devel/swig13 \
		jam:${PORTSDIR}/devel/jam
LIB_DEPENDS=	png.5:${PORTSDIR}/graphics/png \
		jpeg.9:${PORTSDIR}/graphics/jpeg \
		aa.1:${PORTSDIR}/graphics/aalib \
		openal.0:${PORTSDIR}/audio/openal \
		alut.1:${PORTSDIR}/audio/freealut \
		CEGUIBase.0:${PORTSDIR}/graphics/cegui

BROKEN=		Incorrect pkg-plist

USE_BZIP2=	yes
GNU_CONFIGURE=	yes
USE_GCC=	3.4+
USE_GL=		yes
WANT_PERL=	yes
LDFLAGS=	-L${LOCALBASE}/lib -L${LOCALBASE}/lib ${PTHREAD_LIBS}
CPPFLAGS=	-I${LOCALBASE}/include -I${LOCALBASE}/include
CONFIGURE_TARGET=	--build=${MACHINE_ARCH}-portbld-freebsd${OSREL}
MAKE_ENV=	CC="${CC}" CFLAGS="${CFLAGS} ${CXX}" \
		CPPFLAGS="${CPPFLAGS} "LDFLAGS="${LDFLAGS}"
CONFIGURE_ARGS+=	--disable-cpu-specific-optimizations \
			--disable-make-emulation \
			--prefix=${PREFIX} \
			--datarootdir=${PREFIX}/share
DOCSDIR=	share/doc/${PORTNAME}-1.1
JAM_CMD=	${LOCALBASE}/bin/jam
JAM_ARGS=	-qa

OPTIONS=	DEBUG	"Build with debugging information"	off \
		PYTHON	"PYTHON interface"	on \
		PERL	"PERL interface"	on \
		LCMS	"Little Color Management System support"	on \
		MNG	"MNG/JNG graphic files support"	on \
		MIKMOD	"MIKMOD support" on \
		VORBIS	"Ogg/Vorbis sound plugin support"	on \
		3DS	"3DS files support"	on \
		ODE	"Plugin providing physics through ODE"	on \
		FREETYPE2	"FREETYPE2 support"	on \
		CAL3D	"Skeletal based 3D character animation support"	on \
		SDL	"SDL support"	on \
		CACA	"LIBCACA support"	on \
		CPPUNIT	"The C++ Unit Test Library"	on \
		BFD	"Universal BFD library from the GNU binutils"	on

.include <bsd.port.pre.mk>

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

.if !defined(WITHOUT_DEBUG)
CONFIGURE_ARGS+=	--enable-debug=yes
.else
CONFIGURE_ARGS+=	--enable-debug=no
.endif

.if !defined(WITHOUT_PYTHON)
USE_PYTHON=	yes
.include <${PORTSDIR}/Mk/bsd.python.mk>
.else
CONFIGURE_ARGS+=	--without-python
.endif

.if !defined(WITHOUT_PERL)
USE_PERL5=	yes
.else
CONFIGURE_ARGS+=	--without-perl
.endif

.if !defined(WITHOUT_LCMS)
LIB_DEPENDS+=	lcms.1:${PORTSDIR}/graphics/lcms
.else
CONFIGURE_ARGS+=	--without-lcms
.endif

.if !defined(WITHOUT_MNG)
LIB_DEPENDS+=	mng.1:${PORTSDIR}/graphics/libmng
.else
CONFIGURE_ARGS+=	--without-mng
.endif

.if !defined(WITHOUT_MIKMOD)
LIB_DEPENDS+=	mikmod.2:${PORTSDIR}/audio/libmikmod
.else
CONFIGURE_ARGS+=	--without-mikmod
.endif

.if !defined(WITHOUT_VORBIS)
LIB_DEPENDS+=	vorbis:${PORTSDIR}/audio/libvorbis
.else
CONFIGURE_ARGS+=	--without-ogg \
			--without-vorbis
.endif

.if !defined(WITHOUT_3DS)
LIB_DEPENDS+=	3ds-1.3:${PORTSDIR}/graphics/lib3ds
.else
CONFIGURE_ARGS+=	--without-3ds
.endif

.if !defined(WITHOUT_ODE)
BUILD_DEPENDS+=	${LOCALBASE}/lib/libode.a:${PORTSDIR}/devel/ode
CONFIGURE_ARGS+=	--with-ode=${LOCALBASE}
.else
CONFIGURE_ARGS+=	--without-ode
.endif

.if !defined(WITHOUT_FREETYPE2)
LIB_DEPENDS+=	freetype.9:${PORTSDIR}/print/freetype2
.else
CONFIGURE_ARGS+=	--without-freetype2
.endif

.if !defined(WITHOUT_CAL3D)
LIB_DEPENDS+=	cal3d.12:${PORTSDIR}/graphics/cal3d
.else
CONFIGURE_ARGS+=	--without-cal3d
.endif

.if !defined(WITHOUT_SDL)
USE_SDL=	sdl
.else
CONFIGURE_ARGS+=	--without-sdl
.endif

.if !defined(WITHOUT_CACA)
BUILD_DEPENDS+=	${LOCALBASE}/lib/libcaca.a:${PORTSDIR}/graphics/libcaca
.else
CONFIGURE_ARGS+=	--without-caca
.endif

.if !defined(WITHOUT_CPPUNIT)
BUILD_DEPENDS+=	cppunit-config:${PORTSDIR}/devel/cppunit
.else
CONFIGURE_ARGS+=	--without-cppunit
.endif

.if !defined(WITHOUT_BFD)
BUILD_DEPENDS+=	${LOCALBASE}/lib/libbfd.a:${PORTSDIR}/devel/libbfd
.else
CONFIGURE_ARGS+=	--without-bfd
.endif

pre-configure:
	@${REINPLACE_CMD} -e 's,sdl-config,${SDL_CONFIG:T},g; \
		s,86\*),86\*|amd64|ia64),' ${WRKSRC}/configure

post-configure:
	@${REINPLACE_CMD} -i "" -e 's|^COMPILER.LFLAGS += "-lm"|COMPILER.LFLAGS += "-lm -lc"|g' \
		${WRKSRC}/Jamconfig
	@${REINPLACE_CMD} -i "" -e 's|-lcaca|-lcaca_pic|g' ${WRKSRC}/Jamconfig
	@${REINPLACE_CMD} -i "" -e 's|$$(datarootdir)|${PREFIX}/share|g' ${WRKSRC}/Jamconfig
.if defined(NOPORTDOCS)
	@${REINPLACE_CMD} -e 26d ${WRKSRC}/Jamfile
	@${REINPLACE_CMD} -e 84d ${WRKSRC}/Jamfile
.endif

do-build:
	@cd ${WRKSRC} && \
		${SETENV} ${MAKE_ENV} ${JAM_CMD} ${JAM_ARGS}

do-install:
	@cd ${WRKSRC} && \
		${SETENV} PREFIX=${PREFIX} ${JAM_CMD} install

.include <bsd.port.post.mk>