aboutsummaryrefslogtreecommitdiffstats
path: root/graphics/pfstools/Makefile
blob: d83a10b213d580bbb4371a678a4e80a947fdf1ea (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
# New ports collection makefile for:    pfstools
# Date created:     25 September 2007
# Whom:         Daniel O'Connor <darius@dons.net.au>
#
# $FreeBSD$
#

PORTNAME=   pfstools
PORTVERSION=    1.6.4
PORTREVISION=   6
CATEGORIES= graphics
MASTER_SITES=   SF

MAINTAINER= darius@dons.net.au
COMMENT=    Tools for manipulating HDR images and video frames

RUN_DEPENDS+=   bash:${PORTSDIR}/shells/bash

PFS_CPPFLAGS=   -I${LOCALBASE}/include
PFS_LDFLAGS=    -L${LOCALBASE}/lib
PFS_BUILD=  ${MACHINE_ARCH}-portbld-freebsd${OSREL}
PLIST_SUB+= PFS_BASE=${PREFIX}

GNU_CONFIGURE=  yes
CONFIGURE_TARGET=   ${PFS_BUILD}
CONFIGURE_ARGS= --disable-jpeghdr --disable-matlab \
        --with-bash=${LOCALBASE}/bin/bash
CONFIGURE_ENV=  CPPFLAGS="${PFS_CPPFLAGS}" \
        LDFLAGS="${PFS_LDFLAGS}" \
        PKG_CONFIG_PATH="${LOCALBASE}/libdata/pkgconfig"
USE_AUTOTOOLS=  libtool:22
USE_GMAKE=  yes
USE_LDCONFIG=   yes
USE_GNOME=  pkgconfig

OPTIONS=    PPM "Compile programs that use PPM (NetPBM)" off \
        EXR "Compile programs that use OpenEXR library" off \
        TIFF "Compile programs that use TIFF library" on \
        QT "Compile programs that use QT library" off \
        IM "Compile programs that use ImageMagick library" off \
        OCTAVE "Compile octave interface functions" off \
        GL "Compile opengl code (pfsglview)" off

MAN1=       pfsin.1 \
        pfsout.1 \
        pfsinppm.1 \
        pfsinexr.1 \
        pfsinrgbe.1 \
        pfsintiff.1 \
        pfsoutppm.1 \
        pfsoutexr.1 \
        pfsoutffmpeg.1 \
        pfsinpfm.1 \
        pfsoutpfm.1 \
        pfsinmulti.1 \
        pfsinimgmagick.1 \
        pfsoutimgmagick.1 \
        pfsinjpeghdr.1 \
        pfsoutjpeghdr.1 \
        pfsindcraw.1 \
        pfsgamma.1 \
        pfsclamp.1 \
        pfstag.1 \
        pfssize.1 \
        pfsextractchannels.1 \
        pfspanoramic.1 \
        pfsrotate.1 \
        pfsflip.1 \
        pfscut.1 \
        pfspad.1 \
        pfscat.1 \
        pfsabsolute.1
MLINKS=     pfsoutppm.1 \
        pfsouttiff.1 \
        pfsoutppm.1 \
        pfsoutrgbe.1

.include <bsd.port.pre.mk>

.if defined(WITH_PPM)
CONFIGURE_ARGS+=--enable-ppm
LIB_DEPENDS+=   netpbm.1:${PORTSDIR}/graphics/netpbm
PLIST_SUB+= PPM=""
.else
CONFIGURE_ARGS+=--disable-ppm
PLIST_SUB+= PPM="@comment "
.endif

.if defined(WITH_EXR)
PFS_CPPFLAGS+=  ${PTHREAD_CFLAGS}
PFS_LDFLAGS+=   ${PTHREAD_LIBS}
CONFIGURE_ARGS+=--enable-openexr --with-exrdir=${LOCALBASE}/include/OpenEXR
LIB_DEPENDS+=   IlmImf:${PORTSDIR}/graphics/OpenEXR
PLIST_SUB+= EXR=""
.else
CONFIGURE_ARGS+=--disable-openexr
PLIST_SUB+= EXR="@comment "
.endif

.if defined(WITH_TIFF)
CONFIGURE_ARGS+=--enable-tiff
LIB_DEPENDS+=   tiff:${PORTSDIR}/graphics/tiff
PLIST_SUB+= TIFF=""
.else
CONFIGURE_ARGS+=--disable-tiff
PLIST_SUB+= TIFF="@comment "
.endif

.if defined(WITH_QT)
CONFIGURE_ARGS+=--enable-qt
USE_QT_VER= 3
.include "${PORTSDIR}/Mk/bsd.kde.mk"
PLIST_SUB+= QT=""
MAN1+=      pfsview.1 \
        pfsv.1
.else
CONFIGURE_ARGS+=--disable-qt
PLIST_SUB+= QT="@comment "
.endif

.if defined(WITH_IM)
CONFIGURE_ARGS+=--enable-imagemagick
LIB_DEPENDS+=   Magick++.2:${PORTSDIR}/graphics/ImageMagick
PLIST_SUB+= IM=""
.else
CONFIGURE_ARGS+=--disable-imagemagick
PLIST_SUB+= IM="@comment "
.endif

.if defined(WITH_OCTAVE)
CONFIGURE_ARGS+=--enable-octave
USE_FORTRAN=    yes

# need to determine which octave installed which patching
PATCH_DEPENDS+= mkoctfile:${PORTSDIR}/math/octave
BUILD_DEPENDS+= mkoctfile:${PORTSDIR}/math/octave
RUN_DEPENDS+=   octave:${PORTSDIR}/math/octave

OCTAVE_BASE?=   ${LOCALBASE}
OCTAVE_VERSION!=${OCTAVE_BASE}/bin/octave-config -v 2>&1 || ${ECHO} "0"
PLIST_SUB+= OCTAVE="" \
        OCTAVE_VERSION=${OCTAVE_VERSION} \
        OCTAVE_BASE=${OCTAVE_BASE} \
        BUILD=${PFS_BUILD}
.if (!empty(OCTAVE_VERSION:M[3-9].*))
EXTRA_PATCHES+= ${PATCHDIR}/epatch-src-octave-pfsopen.cpp
.endif
MAN1+=      pfsoctavelum.1 \
        pfsoctavergb.1 \
        pfsstat.1
.else
CONFIGURE_ARGS+=--disable-octave
PLIST_SUB+= OCTAVE="@comment "
.endif

.if defined(WITH_GL)
CONFIGURE_ARGS+=--enable-opengl
USE_GL=     glut
PLIST_SUB+= GL=""
.else
CONFIGURE_ARGS+=--disable-opengl
PLIST_SUB+= GL="@comment "
.endif

.if defined(WITH_OCTAVE)
pre-configure:
    @${REINPLACE_CMD} \
        -e 's|/usr/bin/octave|${LOCALBASE}/bin/octave|' \
        ${WRKSRC}/src/octave/*
.endif

.include <bsd.port.post.mk>