aboutsummaryrefslogtreecommitdiffstats
path: root/multimedia/mplayer/Makefile
blob: 1aaefe0d2d2629528440fa4cc1dd8b00b91b04b9 (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
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
# New ports collection makefile for:    mplayer
# Date created:     10 August 2001
# Whom:         Thomas E. Zander
#           with lots of help from Vladimir Kushnir
# $FreeBSD$
#

PORTNAME=   mplayer
PORTVERSION=    ${MPLAYER_PORT_VERSION}
PORTREVISION=   2
COMMENT=    High performance media player supporting many formats

.include "${.CURDIR}/Makefile.shared"

OPTIONS=    DEBUG "Include debug symbols in mplayer's binaries" off
OPTIONS+=   BLURAY "Build with libbluray support" off
OPTIONS+=   RTCPU "Allow runtime CPU detection" on
OPTIONS+=   OCFLAGS "Use optimized compiler flags" on
OPTIONS+=   IPV6 "Include inet6 network support" on
OPTIONS+=   X11 "Enable X11 support for mplayer's video output" on
OPTIONS+=   X11XV "X11 video drivers: XV" on
OPTIONS+=   X11DGA "X11 video drivers: DGA" on
OPTIONS+=   X11GL "X11 video drivers: OpenGL" on
OPTIONS+=   X11XIN "X11 video drivers: Xinerama" on
OPTIONS+=   X11VM "X11 VidMode support" on
OPTIONS+=   X11XVMC "Enable XvMC acceleration" off
OPTIONS+=   VDPAU "Enable Nvidia VDPAU acceleration" off
OPTIONS+=   GUI "Enable GTK2 graphical user interface with X11" on
OPTIONS+=   SDL "Enable SDL video output" off
OPTIONS+=   SKINS "Force dependency on mplayer-skins" on
OPTIONS+=   RTC "Add support for kernel real time clock timing" off
OPTIONS+=   ARTS "Enable KDE sound system support" off
OPTIONS+=   ESOUND "Enable GNOME esound support" off
OPTIONS+=   JACK "Enable JackIt audio server support" off
OPTIONS+=   NAS "Enable NAS sound server support" off
OPTIONS+=   OPENAL "Enable OpenAL sound support" off
OPTIONS+=   PULSE "Enable PulseAudio" off
OPTIONS+=   LIBUNGIF "Enable gif support" on
OPTIONS+=   OPENJPEG "Enable JPEG2000 support" off
OPTIONS+=   MNG "Enable MNG input support" off
OPTIONS+=   AALIB "Enable aalib support" off
OPTIONS+=   LIBCACA "Enable libcaca support" off
OPTIONS+=   SVGALIB "Enable svgalib support" off
OPTIONS+=   LIBDV "Enable libdv support" off
OPTIONS+=   MAD "Enable mad MPEG audio engine support" off
OPTIONS+=   AMR_NB "AMR Narrow Band encoder (opencore)" off
OPTIONS+=   AMR_WB "AMR Wide Band encoder (opencore)" off
OPTIONS+=   GSM "GSM audio codec" off
OPTIONS+=   LADSPA "Enable LADSPA plugin support" off
OPTIONS+=   SPEEX "Enable speex audio codec support" on
OPTIONS+=   THEORA "Enable ogg theora video support" off
OPTIONS+=   VPX "Enable VP8 video via libvpx" off
OPTIONS+=   SCHROEDINGER "Dirac codec via libschroedinger" off
.if !defined(PACKAGE_BUILDING)
OPTIONS+=   WIN32 "Enable win32 codec set on the IA32 arch" on
.endif
OPTIONS+=   REALPLAYER "Enable real player plugin" off
OPTIONS+=   LIVEMEDIA "Enable LIVE555 streaming support" off
OPTIONS+=   SMB "Enable Samba input support" off
OPTIONS+=   FRIBIDI "Enable FriBiDi support" off
OPTIONS+=   LIRC "Enable lirc support" off
OPTIONS+=   LIBCDIO "Enable libcdio support" off
OPTIONS+=   CDPARANOIA "Enable cdparanoia support" off
OPTIONS+=   LIBLZO "Enable external liblzo library" off
OPTIONS+=   JOYSTICK "Enable joystick support" off
OPTIONS+=   V4L "Enable Video4Linux TV support" off
OPTIONS+=   LIBRTMP "Enable RTMPDump Streaming Media support" off

MAN1=       mplayer.1
MANCOMPRESSED=  no

SUB_FILES=  pkg-message

CONFFILES=  example.conf input.conf menu.conf dvb-menu.conf

.include <bsd.port.pre.mk>

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

CONFIGURE_ARGS+=    --disable-ssse3 \
            --disable-directfb \
            --disable-faac \
            --disable-libdca \
            --disable-twolame \
            --disable-x264 \
            --disable-xvid \
            --disable-libdirac-lavc \
            --disable-mencoder \
            --disable-mpg123 \
            --disable-musepack

.include "${.CURDIR}/Makefile.options"

.if !defined(WITHOUT_GUI) && !defined(WITHOUT_X11)
MLINKS+=    mplayer.1 gmplayer.1
PLIST_SUB+= GMPLAYER=""
DESKTOP_ENTRIES=    "MPlayer" "High performance media player" "mplayer" "gmplayer" "" false
.if !defined(WITHOUT_SKINS)
RUN_DEPENDS+=   ${LOCALBASE}/share/mplayer/skins:${PORTSDIR}/multimedia/mplayer-skins
.endif

USE_GNOME+= gtk20
CONFIGURE_ARGS+=    --enable-gui

.if defined(WITH_LANG)
WITH_LANG=  ""
.endif

.else
PLIST_SUB+= GMPLAYER="@comment "
.endif #WITHOUT_GUI

.if !defined(WITHOUT_X11)
USE_XORG=   x11
.if !defined(WITHOUT_X11XV)
USE_XORG+=  xv
.else
CONFIGURE_ARGS+=--disable-xv
.endif
.if !defined(WITHOUT_X11DGA)
USE_XORG+=  xxf86dga
.else
CONFIGURE_ARGS+=--disable-dga1 --disable-dga2
.endif
.if !defined(WITHOUT_X11GL)
USE_XORG+=  glproto
LIB_DEPENDS+=   GL.1:${PORTSDIR}/graphics/libGL
.else
CONFIGURE_ARGS+=--disable-gl
.endif
.if !defined(WITHOUT_X11XIN)
USE_XORG+=  xinerama xineramaproto
.else
CONFIGURE_ARGS+=--disable-xinerama
.endif
.if !defined(WITHOUT_X11VM)
USE_XORG+=  xxf86vm
.else
CONFIGURE_ARGS+=--disable-vm
.endif
.if defined(WITH_X11XVMC)
USE_XORG+=  xvmc
CONFIGURE_ARGS+=--enable-xvmc --with-xvmclib=XvMCW
.endif
.else               #WITHOUT_X11
CONFIGURE_ARGS+=--disable-x11 \
        --disable-fontconfig
.endif

.if defined(WITH_VDPAU)
LIB_DEPENDS+=   vdpau.1:${PORTSDIR}/multimedia/libvdpau
.else
CONFIGURE_ARGS+=    --disable-vdpau
.endif

.if defined(WITH_RTC)
BUILD_DEPENDS+= ${LOCALBASE}/modules/rtc.ko:${PORTSDIR}/emulators/rtc
RUN_DEPENDS+=   ${LOCALBASE}/modules/rtc.ko:${PORTSDIR}/emulators/rtc
CONFIGURE_ARGS+=    --enable-rtc
CONFIGURE_ENV+=     CFLAGS+="-I/${LOCALBASE}/include"
.else
CONFIGURE_ARGS+=    --disable-rtc
.endif

.if defined(WITH_ARTS)
LIB_DEPENDS+=   artsc.0:${PORTSDIR}/audio/arts
.else
CONFIGURE_ARGS+=    --disable-arts
.endif

.if defined(WITH_LIBCACA)
LIB_DEPENDS+=caca.0:${PORTSDIR}/graphics/libcaca
.else
CONFIGURE_ARGS+=    --disable-caca
.endif

.if defined(WITH_LIRC)
LIB_DEPENDS+=   lirc_client.2:${PORTSDIR}/comms/lirc
.else
CONFIGURE_ARGS+=    --disable-lirc
.endif

.if defined(WITH_SDL)
USE_SDL=    sdl
WITH_AALIB= yes
.undef(WITHOUT_AALIB)
.else
CONFIGURE_ARGS+=    --disable-sdl
.endif

.if defined(WITH_SVGALIB)
LIB_DEPENDS+=   vga.1:${PORTSDIR}/graphics/svgalib
.else
CONFIGURE_ARGS+=    --disable-svga
.endif

.if defined(WITH_AALIB)
LIB_DEPENDS+=   aa.1:${PORTSDIR}/graphics/aalib
.else
CONFIGURE_ARGS+=    --disable-aa
.endif

.if defined(WITH_ESOUND)
USE_GNOME+= esound
.else
CONFIGURE_ARGS+=    --disable-esd
.endif

.if defined(WITH_KERN_HZ)
DEFAULT_KERN_HZ=${WITH_KERN_HZ}
.else
DEFAULT_KERN_HZ=1024
.endif

.if defined(WITH_JOYSTICK)
BUILD_DEPENDS+= ${LOCALBASE}/include/linux/joystick.h:${PORTSDIR}/devel/linux-js
CONFIGURE_ARGS+=--enable-joystick
.else
CONFIGURE_ARGS+=--disable-joystick
.endif

pre-everything::
    @${ECHO_MSG} "N - O - T - E"
    @${ECHO_MSG} ""
    @${ECHO_MSG} "There are some knobs which *can* *not* be selected via the"
    @${ECHO_MSG} "OPTIONS framework. You might want to check the Makefile in"
    @${ECHO_MSG} "order to learn more about them."

.if !defined(WITHOUT_GUI) && !defined(WITHOUT_X11)
    @${ECHO_MSG} "If you want to use the GUI, you can either install"
    @${ECHO_MSG} "${PORTSDIR}/multimedia/mplayer-skins"
    @${ECHO_MSG} "or download official skin collections from"
    @${ECHO_MSG} "http://www.mplayerhq.hu/homepage/dload.html"
.endif

post-patch:
.if ${OSVERSION} >= 900010
    @${REINPLACE_CMD} -e \
        '/CFLAGS.*-D_LARGEFILE64_SOURCE/ s/-D_LARGEFILE64_SOURCE/-D_FILE_OFFSET_BITS=64/' \
        ${CONFIGURE_WRKSRC}/${CONFIGURE_SCRIPT}
.endif
    @${REINPLACE_CMD} \
        -e 's|/dev/dvd|${DEFAULT_DVD_DEVICE}|; \
        s|/dev/cdrom|${DEFAULT_CDROM_DEVICE}|' \
        -e 's|/usr/local|${LOCALBASE}|' \
        -e 's|-lbz2|/usr/lib/libbz2.so|' \
        -e 's|-L$$_prefix/lib|-L${LOCALBASE}/lib|' \
        -e 's|-I$$_prefix/include|-I${LOCALBASE}/include|' \
        ${CONFIGURE_WRKSRC}/${CONFIGURE_SCRIPT}
    @${FIND} -E ${WRKSRC} -type f \
        -iregex ".*(configure|.sh|Makefile)" -print0 | \
        ${XARGS} -x -0 -n 10 \
        ${REINPLACE_CMD} -E \
            -e 's|[[:space:]]gcc[-[:digit:]\.]+| ${CC}|' \
            -e 's|[[:space:]]gcc| ${CC}|' \
            -e 's|\$$\(CC\)|${CC}|' \
            -e 's|/usr/X11R6|${LOCALBASE}|'
    @${FIND} ${WRKSRC}/DOCS/man -name "mplayer.1" | ${XARGS} ${REINPLACE_CMD} -E -e \
        's|/usr/\\:local/\\:etc/\\:mplayer|${DATADIR:S/\//\/\\\:/g}|g ; \
         s|/dev/\\:(dvd[[:alnum:]]*[[:>:]])|${DEFAULT_DVD_DEVICE:S/dev\//dev\/\\\:/}|g ; \
         s|/dev/\\:(cdrom[[:alnum:]]*[[:>:]])|${DEFAULT_CDROM_DEVICE:S/dev\//dev\/\\\:/}|g'
.if defined(WITH_RTC)
    @${REINPLACE_CMD} -e \
        's|irqp = 1024|irqp = ${DEFAULT_KERN_HZ}|' \
        ${WRKSRC}/mplayer.c
.endif

post-configure:
    @${REINPLACE_CMD} -e 's#-pthread#${PTHREAD_LIBS}#g' \
        ${WRKSRC}/config.mak
    @${REINPLACE_CMD} \
        -e 's#HAVE_FAST_CMOV 1#HAVE_FAST_CMOV 0#g' \
        -e 's#HAVE_LOG2 1#HAVE_LOG2 0#g' \
        -e 's#HAVE_LOG2F 1#HAVE_LOG2F 0#g' \
        ${WRKSRC}/config.h

post-install:
    @${MKDIR} ${DATADIR}
    @${CHMOD} 755 ${DATADIR}
    @${MKDIR} ${DATADIR}/examples/etc
    @${CHMOD} 755 ${DATADIR}/examples/etc
.for conf in ${CONFFILES}
    ${INSTALL_DATA} ${WRKSRC}/etc/${conf} ${DATADIR}/examples/etc
.endfor
.if !defined(WITHOUT_GUI) && !defined(WITHOUT_X11)
    @${LN} -sf ${PREFIX}/bin/mplayer ${PREFIX}/bin/gmplayer
    ${INSTALL_DATA} ${WRKSRC}/etc/mplayer.xpm ${LOCALBASE}/share/pixmaps
.endif
    @${CAT} ${PKGMESSAGE}

.include <bsd.port.post.mk>