Update sysutils/cfengine36 to version 3.6.1_1,1
[dports.git] / graphics / povray37 / Makefile
1 # $FreeBSD$
2
3 PORTNAME=       povray
4 DISTVERSION=    3.7.0.RC6
5 PORTREVISION=   5
6 CATEGORIES=     graphics
7 MASTER_SITES=   http://www.povray.org/beta/source/
8 PKGNAMESUFFIX=  37
9 DIST_SUBDIR=    ${PORTNAME}${PKGNAMESUFFIX}
10
11 MAINTAINER=     bkoenig@alpha-tierchen.de
12 COMMENT=        Persistence of Vision Ray Tracer
13
14 LIB_DEPENDS=    libboost_thread.so:${PORTSDIR}/devel/boost-libs
15
16 OPTIONS_DEFINE= X11 PNG JPEG TIFF OPENEXR STATIC IO EXAMPLES DOCS
17 OPTIONS_DEFAULT=PNG JPEG EXAMPLES DOCS
18 OPTIONS_SUB=    yes
19 IO_DESC=        Without I/O restrictions (security risk)
20 EXAMPLES_DESC=  Install example scenes
21 DOCS_DESC=      Install HTML documentation
22
23 USES=           gmake
24 GNU_CONFIGURE=  yes
25
26 VERSION_BASE=   ${PORTVERSION:C/([0-9]+\.[0-9]+).*/\1/}
27
28 DOCSDIR=        ${PREFIX}/share/doc/${PORTNAME}-${VERSION_BASE}
29 EXAMPLESDIR=    ${PREFIX}/share/examples/${PORTNAME}-${VERSION_BASE}
30 DATADIR=        ${PREFIX}/share/${PORTNAME}-${VERSION_BASE}
31 ETCDIR=         ${PREFIX}/etc/${PORTNAME}/${VERSION_BASE}
32
33 CPPFLAGS+=      -I${LOCALBASE}/include
34 LIBS+=          -L${LOCALBASE}/lib -lboost_system
35
36 CONFIGURE_ARGS= COMPILED_BY=${MAINTAINER} \
37                 --program-transform-name='s/${PORTNAME}/${PORTNAME}${PKGNAMESUFFIX}/' \
38                 --disable-optimiz
39
40 .include <bsd.port.options.mk>
41
42 .if ${PORT_OPTIONS:MX11}
43 USE_XORG=               xpm sm ice x11
44 USE_SDL=                sdl
45 .else
46 CONFIGURE_ARGS+=        --without-x
47 .endif
48
49 .if ${PORT_OPTIONS:MSTATIC}
50 CONFIGURE_ARGS+=--enable-static
51 .endif
52
53 .if ${PORT_OPTIONS:MIO}
54 CONFIGURE_ARGS+=--disable-io-restrictions
55 .endif
56
57 .if ${PORT_OPTIONS:MPNG}
58 .if ${PORT_OPTIONS:MSTATIC}
59 BUILD_DEPENDS+= png>=1.4:${PORTSDIR}/graphics/png
60 .else
61 LIB_DEPENDS+=   libpng15.so:${PORTSDIR}/graphics/png
62 .endif
63 .else
64 CONFIGURE_ARGS+=--without-libpng
65 .endif
66
67 .if ${PORT_OPTIONS:MJPEG}
68 .if ${PORT_OPTIONS:MSTATIC}
69 BUILD_DEPENDS+= jpeg>=6b:${PORTSDIR}/graphics/jpeg
70 .else
71 LIB_DEPENDS+=   libjpeg.so:${PORTSDIR}/graphics/jpeg
72 .endif
73 .else
74 CONFIGURE_ARGS+=--without-libjpeg
75 .endif
76
77 .if ${PORT_OPTIONS:MTIFF}
78 .if ${PORT_OPTIONS:MSTATIC}
79 BUILD_DEPENDS+= tiff>=4:${PORTSDIR}/graphics/tiff
80 .else
81 LIB_DEPENDS+=   libtiff.so:${PORTSDIR}/graphics/tiff
82 .endif
83 .else
84 CONFIGURE_ARGS+=--without-libtiff
85 .endif
86
87 .if ${PORT_OPTIONS:MOPENEXR}
88 .if ${PORT_OPTIONS:MSTATIC}
89 BUILD_DEPENDS+= OpenEXR>=1.6:${PORTSDIR}/graphics/OpenEXR
90 .else
91 LIB_DEPENDS+=   libIlmImf.so:${PORTSDIR}/graphics/OpenEXR
92 CPPFLAGS+=      -I${LOCALBASE}/include/OpenEXR
93 .endif
94 .else
95 CONFIGURE_ARGS+=--without-openexr
96 .endif
97
98 .if !${PORT_OPTIONS:MPNG} || !${PORT_OPTIONS:MJPEG} || !${PORT_OPTIONS:MTIFF}
99 CONFIGURE_ARGS+=NON_REDISTRIBUTABLE_BUILD=yes
100 .endif
101
102 .if ${ARCH} == "sparc64"
103 BROKEN=         Does not compile on sparc64: thread-local storage not supported
104 .endif
105
106 MAN1=           ${PORTNAME}${PKGNAMESUFFIX}.1
107
108 DOC_FILES=      AUTHORS ChangeLog NEWS
109 PORTDOCS=       *
110 PORTEXAMPLES=   *
111
112 post-patch:
113 # Fix with boost 1.52 and now boost 1.55
114         @${REINPLACE_CMD} -e 's/TIME_UTC/TIME_UTC_/g' ${WRKSRC}/source/backend/scene/view.cpp \
115                 ${WRKSRC}/source/base/timer.cpp \
116                 ${WRKSRC}/vfe/vfepovms.cpp \
117                 ${WRKSRC}/vfe/unix/platformbase.cpp \
118                 ${WRKSRC}/vfe/vfesession.cpp
119         ${FIND} ${WRKSRC}/source/*end \( -name \*.h -o -name \*.cpp \) | \
120                 ${XARGS} ${GREP} -l shared_ptr | ${SED} '/shellout/d' | \
121                 ${XARGS} ${REINPLACE_CMD} -e 's|shared_ptr|boost::shared_ptr|g'
122
123 pre-build:
124 .if ${PORT_OPTIONS:MSTATIC} && ${PORT_OPTIONS:MTIFF}
125 #       graphics/tiff adds dependencies on libjpeg and libjbig
126         @${REINPLACE_CMD} -e 's,^\(LIBS = .*\)-ltiff\(.*\),\1-ltiff -ljpeg -ljbig\2,' ${WRKSRC}/unix/Makefile
127 .endif
128
129 do-install:
130         @${INSTALL_PROGRAM} ${WRKSRC}/unix/${PORTNAME} ${STAGEDIR}${PREFIX}/bin/${PORTNAME}${PKGNAMESUFFIX}
131         @${INSTALL_MAN} ${WRKSRC}/${PORTNAME}.1 ${STAGEDIR}${MAN1PREFIX}/man/man1/${MAN1}
132         @${MKDIR} ${STAGEDIR}${ETCDIR}
133         @${INSTALL_DATA} ${WRKSRC}/${PORTNAME}.conf ${STAGEDIR}${ETCDIR}
134         @${INSTALL_DATA} ${WRKSRC}/${PORTNAME}.ini ${STAGEDIR}${ETCDIR}
135 .for i in include ini scripts
136         ${MKDIR} ${STAGEDIR}${DATADIR}/$i
137         cd ${WRKSRC}/$i && ${COPYTREE_SHARE} . ${STAGEDIR}${DATADIR}/$i
138 .endfor
139 .if ${PORT_OPTIONS:MX11}
140         @${MKDIR} ${STAGEDIR}${DATADIR}/icons
141         cd ${WRKSRC}/icons && ${COPYTREE_SHARE} . ${STAGEDIR}${DATADIR}/icons
142 .endif
143 .if ${PORT_OPTIONS:MEXAMPLES}
144         @${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
145         cd ${WRKSRC}/scenes && ${COPYTREE_SHARE} . ${STAGEDIR}${EXAMPLESDIR}
146 .endif
147 .if ${PORT_OPTIONS:MDOCS}
148         @${MKDIR} ${STAGEDIR}${DOCSDIR}
149         cd ${WRKSRC} && ${INSTALL_DATA} ${DOC_FILES} ${STAGEDIR}${DOCSDIR}
150         cd ${WRKSRC}/doc && ${COPYTREE_SHARE} . ${STAGEDIR}${DOCSDIR}
151 .endif
152
153 .include <bsd.port.mk>