summaryrefslogtreecommitdiff
path: root/multimedia/mplayer/Makefile
blob: e6e777689402d85b57e4729595adc2403c43e8ba (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
294
295
296
297
# 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=	17

COMMENT=	High performance media player supporting many formats

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

OPTIONS=	DEBUG "Include debug symbols in mplayer's binary files" off
OPTIONS+=	RTCPU "Let mplayer dynamically check for CPU features" on
OPTIONS+=	OCFLAGS "Use optimized compiler flags" on
OPTIONS+=	SIMD "Allow mplayer to use vector engines (MMX...)" 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+=	GUI "Enable GTK2 graphical user interface with X11" on
OPTIONS+=	SDL "Enable SDL video output" off
OPTIONS+=	VIDIX "Enable VIDIX video output on supported archs" on
OPTIONS+=	SKINS "Force dependency on mplayer-skins" on
OPTIONS+=	FREETYPE "Use freetype for OSD fonts (TrueType!)" 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+=	POLYP "Enable polyp sound server support" off
OPTIONS+=	NAS "Enable NAS sound server support" off
OPTIONS+=	OPENAL "Enable OpenAL sound support" off
OPTIONS+=	LIBUNGIF "Enable gif support" on
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+=	DTS "Enable DTS audio codec support" on
OPTIONS+=	LIBMPCDEC "Enable libmpcdec support" off
OPTIONS+=	LADSPA "Enable LADSPA plugin support" off
OPTIONS+=	SPEEX "Enable speex audio codec support" on
OPTIONS+=	TREMOR "Use built-in tremor instead of libvorbis" off
OPTIONS+=	XMMS "Enable XMMS plugin support" off
OPTIONS+=	THEORA "Enable ogg theora video support" off
.if !defined(PACKAGE_BUILDING)
OPTIONS+=	WIN32 "Enable win32 codec set on the IA32 arch" on
OPTIONS+=	AMR "Enable AMR audio codec support" off
.endif
OPTIONS+=	X264 "Enable x264 (H.264) video codec support" off
OPTIONS+=	XANIM "Enable xanim DLL support" off
OPTIONS+=	XVID "Enable XVID video codec support" on
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

MAN1=		mplayer.1
MANCOMPRESSED=	no

SUB_FILES=	pkg-message

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

.include <bsd.port.pre.mk>

CONFIGURE_ARGS+=	--disable-ssse3 \
			--disable-directfb \
			--disable-faac \
			--disable-twolame \
			--disable-mencoder

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

#Building of vidix dependent shared libs is only possible
#on i386 and amd64 at the moment.
.if !defined(WITHOUT_VIDIX)
.if !(${ARCH} == "i386" || ${ARCH} == "amd64")
CONFIGURE_ARGS+=--disable-vidix-internal
.endif
.else
CONFIGURE_ARGS+=--disable-vidix-internal
.endif

.if !defined(WITHOUT_GUI) && !defined(WITHOUT_X11)
PLIST_SUB+=	GMPLAYER=""
DESKTOP_ENTRIES=	"MPlayer" "High performance media player" "${DATADIR}/skins/Blue/icons/icon32x32.png" "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_FREETYPE)
CONFIGURE_ARGS+=	--with-extraincdir=${LOCALBASE}/include/freetype2 \
			--enable-freetype
LIB_DEPENDS+=		freetype.9:${PORTSDIR}/print/freetype2
.else
.if !defined(WITHOUT_X11)
RUN_DEPENDS+=	${LOCALBASE}/share/mplayer/fonts:${PORTSDIR}/multimedia/mplayer-fonts
.endif
CONFIGURE_ARGS+=	--disable-freetype
.endif

.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_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
CONFIGURE_ARGS+=	--enable-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.1:${PORTSDIR}/comms/lirc
CONFIGURE_ARGS+=	--enable-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:
	@${REINPLACE_CMD} -e \
		's|libxmms.so.1|libxmms.so|' \
		${CONFIGURE_WRKSRC}/${CONFIGURE_SCRIPT}
	@${REINPLACE_CMD} -e 's|/dev/dvd|${DEFAULT_DVD_DEVICE}|; \
		s|/dev/cdrom|${DEFAULT_CDROM_DEVICE}|' \
		${WRKSRC}/${CONFIGURE_SCRIPT}
	@${REINPLACE_CMD} -e 's!/usr/local!${PREFIX}!' \
		${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

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(NOPORTDOCS)
	@${MKDIR} ${DOCSDIR}
	@${CHMOD} 755 ${DOCSDIR}
	@${INSTALL_DATA} ${WRKSRC}/DOCS/HTML/en/* ${DOCSDIR}
.endif
.if !defined(WITHOUT_GUI) && !defined(WITHOUT_X11)
	@${LN} -sf ${PREFIX}/bin/mplayer ${PREFIX}/bin/gmplayer
.endif
	@${CAT} ${PKGMESSAGE}

install-user:
	@${PERL} ${FILESDIR}/install-user

.include <bsd.port.post.mk>