aboutsummaryrefslogtreecommitdiffstats
path: root/multimedia/avidemux2/Makefile.common
blob: 83dcf9016a16c34e0481a89d18da531538ad746b (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
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
# $FreeBSD$
#

AVIDEMUX2_VERSION=  2.5.6
PORTREVISION=   3
MASTER_SITES=   BERLIOS \
        SF/avidemux/avidemux/${PORTVERSION}
DISTNAME=   avidemux_${PORTVERSION}

BUILD_DEPENDS+= yasm:${PORTSDIR}/devel/yasm
LIB_DEPENDS+=   mad.2:${PORTSDIR}/audio/libmad \
        a52.0:${PORTSDIR}/audio/liba52 \
        png15:${PORTSDIR}/graphics/png \
        samplerate.1:${PORTSDIR}/audio/libsamplerate \
        dca.0:${PORTSDIR}/multimedia/libdca \
        execinfo.1:${PORTSDIR}/devel/libexecinfo

LICENSE=    GPLv2

CONFLICTS=  avidemux2-2.[0-46-9].*

USE_GNOME=  libxml2
USE_QT4=    # empty

USE_GMAKE=  yes
USE_ICONV=  yes
WANT_SDL=   yes
USE_CMAKE=  yes
CMAKE_USE_PTHREAD=yes
CMAKE_ARGS+=    -DTHREADS_HAVE_PTHREAD_ARG:STRING="${PTHREAD_LIBS}"
CMAKE_OUTSOURCE=    yes
MAKE_JOBS_UNSAFE=   yes

BUILD_DEPENDS+= ${LOCALBASE}/bin/as:${PORTSDIR}/devel/binutils
CONFIGURE_ENV+= COMPILER_PATH=${LOCALBASE}/bin
MAKE_ENV+=  COMPILER_PATH=${LOCALBASE}/bin

OPTIONS_DEFINE= GTK2 QT4 FREETYPE FONTCONFIG OSS ESOUND JACK PULSEAUDIO XVIDEO FAAC \
        FAAD X264 VPX XVID SDL AMR VORBIS NLS LAME
OPTIONS_DEFAULT=    GTK2 FREETYPE FONTCONFIG OSS XVIDEO VPX XVID SDL FAAD VORBIS

.if !defined(PACKAGE_BUILDING)
OPTIONS_DEFAULT=    LAME FAAC AMR
.endif

.include <bsd.port.pre.mk>

# for libexecinfo: (so that __builtin_frame_address() finds the top
# of the stack)
.if ${ARCH} == "amd64"
CFLAGS+=    -fno-omit-frame-pointer
.endif

# We haven't ALSA(Never) & Aften(Yet) on FreeBSD
CMAKE_ARGS+=    -DARTS:BOOL=OFF -DALSA:BOOL=OFF -DAFTEN:BOOL=OFF

.if empty(PORT_OPTIONS:MGTK2) && empty(PORT_OPTIONS:MQT4)
CMAKE_ARGS+=    -DX11:BOOL=OFF
.else
USE_GNOME+= libxslt desktopfileutils
.endif

.if ${PORT_OPTIONS:MGTK2}
USE_GNOME+= gnomeprefix gnomehack gtk20
PLIST_SUB+= GTK=""
.else
CMAKE_ARGS+=    -DGTK:BOOL=OFF
PLIST_SUB+= GTK="@comment "
.endif

.if ${PORT_OPTIONS:MQT4}
CMAKE_ARGS+=    -DLRELEASE_EXECUTABLE=${LOCALBASE}/bin/lrelease-qt4
USE_QT4=    qmake_build moc_build rcc_build uic_build linguist_build gui
PLIST_SUB+= QT4=""
.else
CMAKE_ARGS+=    -DQT4:BOOL=OFF
PLIST_SUB+= QT4="@comment "
.endif

.if ${PORT_OPTIONS:MOSS}
CMAKE_ARGS+=    -DOSS_SUPPORT:BOOL=ON
.else
CMAKE_ARGS+=    -DOSS_SUPPORT:BOOL=OFF
.endif

.if ${PORT_OPTIONS:MESOUND}
USE_GNOME+= esound
PLIST_SUB+= ESD=""
.else
CMAKE_ARGS+=    -DESD:BOOL=OFF
PLIST_SUB+= ESD="@comment "
.endif

.if ${PORT_OPTIONS:MJACK}
LIB_DEPENDS+=   jack.0:${PORTSDIR}/audio/jack
PLIST_SUB+= JACK=""
.else
CMAKE_ARGS+=    -DJACK:BOOL=OFF
PLIST_SUB+= JACK="@comment "
.endif

.if ${PORT_OPTIONS:MPULSEAUDIO}
LIB_DEPENDS+=   pulse.0:${PORTSDIR}/audio/pulseaudio
PLIST_SUB+= PULSE=""
.else
CMAKE_ARGS+=    -DPULSEAUDIOSIMPLE:BOOL=OFF
PLIST_SUB+= PULSE="@comment "
.endif

.if ${PORT_OPTIONS:MFREETYPE}
LIB_DEPENDS+=   freetype.9:${PORTSDIR}/print/freetype2
PLIST_SUB+= FREETYPE=""
.else
CMAKE_ARGS+=    -DFREETYPE2:BOOL=OFF
PLIST_SUB+= FREETYPE="@comment "
.endif

.if ${PORT_OPTIONS:MFONTCONFIG}
LIB_DEPENDS+=   fontconfig.1:${PORTSDIR}/x11-fonts/fontconfig
.else
CMAKE_ARGS+=    -DFONTCONFIG:BOOL=OFF
.endif

.if ${PORT_OPTIONS:MXVIDEO}
LIB_DEPENDS+=   Xv.1:${PORTSDIR}/x11/libXv
.else
CMAKE_ARGS+=    -DXVIDEO:BOOL=OFF
.endif

.if ${PORT_OPTIONS:MFAAC}
LIB_DEPENDS+=   faac.0:${PORTSDIR}/audio/faac
PLIST_SUB+= FAAC=""
.else
CMAKE_ARGS+=    -DFAAC:BOOL=OFF
PLIST_SUB+= FAAC="@comment "
.endif

.if ${PORT_OPTIONS:MLAME}
LIB_DEPENDS+=   mp3lame.0:${PORTSDIR}/audio/lame
PLIST_SUB+= LAME=""
.else
CMAKE_ARGS+=    -DLAME:BOOL=OFF
PLIST_SUB+= LAME="@comment "
.endif

.if ${PORT_OPTIONS:MFAAD}
LIB_DEPENDS+=   faad.2:${PORTSDIR}/audio/faad
PLIST_SUB+= FAAD=""
.else
CMAKE_ARGS+=    -DFAAD:BOOL=OFF -DNeAAC:BOOL=OFF
PLIST_SUB+= FAAD="@comment "
.endif

.if ${PORT_OPTIONS:MX264}
LIB_DEPENDS+=   x264.123:${PORTSDIR}/multimedia/x264
PLIST_SUB+= X264=""
.else
CMAKE_ARGS+=    -DX264:BOOL=OFF
PLIST_SUB+= X264="@comment "
.endif

.if ${PORT_OPTIONS:MVPX}
LIB_DEPENDS+=   vpx.1:${PORTSDIR}/multimedia/libvpx
.else
CMAKE_ARGS+=    -DVPXDEC:BOOL=OFF
.endif

.if ${PORT_OPTIONS:MXVID}
LIB_DEPENDS+=   xvidcore.4:${PORTSDIR}/multimedia/xvid
PLIST_SUB+= XVID=""
.else
CMAKE_ARGS+=    -DXVID:BOOL=OFF
PLIST_SUB+= XVID="@comment "
.endif

.if ${PORT_OPTIONS:MSDL}
USE_SDL=    sdl
PLIST_SUB+= SDL=""
.else
CMAKE_ARGS+=    -DSDL:BOOL=OFF
PLIST_SUB+= SDL="@comment "
.endif

.if ${PORT_OPTIONS:MVORBIS}
LIB_DEPENDS+=   vorbis.4:${PORTSDIR}/audio/libvorbis
PLIST_SUB+= VORBIS=""
.else
CMAKE_ARGS+=    -DVORBIS:BOOL=OFF
PLIST_SUB+= VORBIS="@comment "
.endif

.if ${PORT_OPTIONS:MAMR}
LIB_DEPENDS+=   opencore-amrnb.0:${PORTSDIR}/audio/opencore-amr
PLIST_SUB+= AMRNB=""
PLIST_SUB+= AMRWB=""
.else
CMAKE_ARGS+=    -DOPENCORE_AMRNB:BOOL=OFF
PLIST_SUB+= AMRNB="@comment "
CMAKE_ARGS+=    -DOPENCORE_AMRWB:BOOL=OFF
PLIST_SUB+= AMRWB="@comment "
.endif

.if ${PORT_OPTIONS:MNLS}
USE_GETTEXT=    yes
PLIST_SUB+= NLS=""
.   if !defined(WITH_QT4)
PLIST_SUB+= QT_NLS="@comment "
.   else
PLIST_SUB+= QT_NLS=""
.   endif
.else
CMAKE_ARGS+=    -DNO_NLS:BOOL=ON
PLIST_SUB+= NLS="@comment " QT_NLS="@comment "
.endif

.if ${ARCH} == "ia64" || ${ARCH} == "powerpc" || ${ARCH} == "sparc64"
BROKEN=     Does not compile on ia64, powerpc, or sparc64
.endif

post-extract:
    @${REINPLACE_CMD} -e 's/[[:cntrl:]]*$$//' \
        ${WRKSRC}/avidemux/ADM_libraries/ADM_mplex/ADM_mplexout.cpp

post-patch:
    @${REINPLACE_CMD} 's|-lpthread|${PTHREAD_LIBS}|g' ${WRKSRC}/*/*/Makefile
    @${CP} ${FILESDIR}/execinfo.cpp ${WRKSRC}/cmake_compile_check/
    @${CP} ${FILESDIR}/*.patch ${WRKSRC}/cmake/patches/
    @${MKDIR} ${CONFIGURE_WRKSRC}/config
    @${LN} -s ${LOCALBASE}/include/iconv.h ${CONFIGURE_WRKSRC}/config

post-configure-common:
    @${FIND} ${CONFIGURE_WRKSRC}/avidemux -name link.txt -print0 |${XARGS} -0 ${REINPLACE_CMD} 's|-ldl||'