summaryrefslogtreecommitdiff
path: root/graphics/blender-devel/Makefile
blob: 3e549ca7502f039c5e1b6a61f1ab96629cde68e4 (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
# New ports collection makefile for:	blender
# Date created:				27 Feb 2003
# Whom:					David Yeske <dyeske@yahoo.com>
#
# $FreeBSD$

PORTNAME=	blender
PORTVERSION=	2.26
CATEGORIES=	graphics games
MASTER_SITES=	http://download.blender.org/source/
PKGNAMESUFFIX=	-devel

MAINTAINER=	dyeske@yahoo.com
COMMENT=	3D modeling/rendering/animation/gaming package

LIB_DEPENDS=	jpeg.9:${PORTSDIR}/graphics/jpeg \
		nspr4.1:${PORTSDIR}/devel/nspr \
		openal.0:${PORTSDIR}/audio/openal \
		png.5:${PORTSDIR}/graphics/png

USE_X_PREFIX=	yes
USE_BZIP2=	yes
USE_REINPLACE=	yes
USE_GMAKE=	yes
USE_PYTHON=	yes
USE_MESA=	yes

.if defined(WITH_OPTIMIZED_CFLAGS)
CFLAGS+=	-O3 -ffast-math
.endif

PLUGIN_DIR?=	lib/mozilla/plugins
PLIST_SUB=	PLUGIN_DIR=${PLUGIN_DIR}

pre-everything::
.if !defined(WITH_OPTIMIZED_CFLAGS)
	@${ECHO_MSG} "You can enable additional compilation optimizations"
	@${ECHO_MSG} "by defining WITH_OPTIMIZED_CFLAGS"
.endif

post-patch:
	@${REINPLACE_CMD} -e \
		's|malloc.h|stdlib.h|g' \
		${WRKSRC}/extern/ode/dist/configurator.c \
		${WRKSRC}/source/gameengine/SoundSystem/intern/SND_WaveCache.cpp
	@${REINPLACE_CMD} -E -e \
		's|-Wall||; \
		s|g\+\+|${CXX}|; \
		s|LEVEL_2_C_WARNINGS.+$$||; \
		s|LEVEL_2_CPP_WARNINGS.+$$||; \
		s|-FIX_NAN_WARN||' \
		${WRKSRC}/source/nan_warn.mk
	@${REINPLACE_CMD} -e \
		's|gcc|${CC}|; \
		s|\$$(C_OPT)1|${CFLAGS}|; \
		s|\$$(C_OPT)\$$(OPT)|${CFLAGS}|' \
		${WRKSRC}/extern/ode/dist/Makefile
	@${REINPLACE_CMD} -E -e \
		's|g\+\+|${CXX}|; \
		s,(-O2|-DNDEBUG|^DBG_C.+$$),,; \
		s|-pipe|${CFLAGS}|; \
		s|gcc|${CC}|' \
		${WRKSRC}/source/nan_compile.mk
	@${REINPLACE_CMD} -e \
		's|-pthread -lc_r|${PTHREAD_LIBS}|' \
		${WRKSRC}/source/nan_link.mk
	@${REINPLACE_CMD} -e \
		's|%%CFLAGS%%|${CFLAGS}|' \
		${WRKSRC}/intern/python/freeze/freeze.py
	@${REINPLACE_CMD} -E -e \
		's|-Wall||g; \
		s|^CC.+$$|CC=${CC}|; \
		s|g\+\+|${CXX}|; \
		s|-L/usr/lib/X11R6||; \
		s|-L/usr/lib/X11|-lXext|; \
		s|-ffast-math|-I${X11BASE}/include|' \
		${WRKSRC}/extern/ode/dist/config/makefile.unix-gcc
	@${REINPLACE_CMD} -e \
		's|\$$(NAN_LIBDIR)/\$$(CONFIG_GUESS)|\$$(NAN_LIBDIR)|; \
		s|\$$(NAN_OBJDIR)/\$$(CONFIG_GUESS)|\$$(NAN_OBJDIR)|' \
		${WRKSRC}/source/nan_definitions.mk

do-install:
	@${INSTALL_PROGRAM} ${WRKSRC}/obj/bin/blender ${PREFIX}/bin
	@${INSTALL_PROGRAM} ${WRKSRC}/obj/bin/blenderplayer \
		${PREFIX}/bin
	@${MKDIR} ${PREFIX}/${PLUGIN_DIR}
	@${INSTALL_PROGRAM} ${WRKSRC}/obj/npBlender3DPlugin.so \
		${PREFIX}/${PLUGIN_DIR}

.include <bsd.port.mk>