Permalink
Fetching contributors…
Cannot retrieve contributors at this time
320 lines (266 sloc) 10.9 KB
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4
PortSystem 1.0
PortGroup compiler_blacklist_versions 1.0
name mplayer-devel
version 37869
revision 4
categories multimedia
license GPL-2+
maintainers {jeremyhu @jeremyhu} openmaintainer
platforms darwin
set dvdnav_ver 1294
set ffmpeg_branch master
set ffmpeg_ver 81c3ce0855f144c89800b824db3e4e0dcdad9016
description The MPlayer movie player built from SVN.
long_description ${description} It plays most MPEG/VOB, AVI, Ogg/OGM, \
VIVO, ASF/WMA/WMV, QT/MOV/MP4, RealMedia, Matroska, \
NUT, NuppelVideo, FLI, YUV4MPEG, FILM, RoQ, PVA files, \
supported by many native, XAnim, and Win32 DLL codecs. \
You can watch VideoCD, SVCD, DVD, 3ivx, DivX 3/4/5, WMV \
and even H.264 movies.
homepage http://www.mplayerhq.hu/
livecheck.type none
depends_build port:pkgconfig port:yasm
depends_lib \
port:jpeg port:openjpeg15 port:lame port:libiconv port:libmad port:gnutls \
port:libogg port:libopus port:libpng port:libtheora port:libvorbis \
port:lzo2 port:ncurses port:zlib port:bzip2 port:liboil port:libass \
port:rtmpdump
fetch.type svn
#svn.revision ${version}
#svn.url svn://svn.mplayerhq.hu/mplayer/trunk
depends_fetch-append bin:git:git
worksrcdir trunk
fetch {
system "svn export -r${version} --ignore-externals svn://svn.mplayerhq.hu/mplayer/trunk ${worksrcpath}/"
system "svn export -r${dvdnav_ver} svn://svn.mplayerhq.hu/dvdnav/trunk/libdvdnav/src ${worksrcpath}/libdvdnav/"
system "svn export -r${dvdnav_ver} svn://svn.mplayerhq.hu/dvdnav/trunk/libdvdread/src ${worksrcpath}/libdvdread4/"
# 10000 should be deep enough to find out checkout within a year
system "git clone -b ${ffmpeg_branch} --depth 10000 git://git.videolan.org/ffmpeg.git ${worksrcpath}/ffmpeg"
system "cd ${worksrcpath}/ffmpeg && git checkout -f ${ffmpeg_ver}"
}
# Do not use the following environment variables, otherwise the build phase
# will fail.
configure.cflags {}
configure.cppflags {}
configure.cxxflags {}
configure.ldflags {}
configure.cc_archflags {}
configure.cxx_archflags {}
# Do not use pipes, otherwise the build phase will fail.
configure.pipe no
configure.args \
--extra-cflags="-I${prefix}/include/lzo -I${prefix}/include" \
--extra-ldflags="-L${prefix}/lib -L${prefix}/lib/samba3" \
--datadir=${prefix}/share/${name} \
--confdir=${prefix}/etc/${name} \
--mandir=${prefix}/share/man \
--enable-png --enable-jpeg --enable-liblzo \
--enable-theora --enable-libvorbis --enable-libopus --enable-mad
# MPlayer autodetects many support libs. To prevent undeclared
# dependencies, explicitly disable everything optional first.
# This list should be expanded each time the port is updated to a
# new version, disabling any newly added options.
configure.args-append \
--disable-smb --disable-live \
--disable-cdparanoia --disable-freetype \
--disable-fontconfig --disable-fribidi \
--disable-enca --disable-libcdio --disable-xvid \
--disable-x264 --disable-speex \
--disable-faac --disable-libdv \
--disable-toolame --disable-twolame --disable-libmpeg2 --disable-xmms \
--disable-musepack --disable-sdl --disable-aa \
--disable-caca --disable-x11 --disable-xss --disable-gl --disable-arts \
--disable-esd --disable-lirc --disable-mng --disable-libdirac-lavc \
--disable-libschroedinger-lavc --disable-libvpx-lavc --disable-liba52 \
--disable-gif
patchfiles configure.x11.patch configure.vorbis.patch
post-patch {
# https://trac.macports.org/ticket/38935
reinplace "s|-maltivec|-faltivec -maltivec|g" \
${worksrcpath}/configure \
${worksrcpath}/ffmpeg/configure
# Newer libvorbis doesn't implicitly provide vorbis as a vorbisenc dependency
reinplace "s|libs vorbisenc|libs vorbisenc vorbis|" ${worksrcpath}/configure
}
post-configure {
# http://trac.macports.org/ticket/41746
reinplace "s|-I/usr/X11/include||g" ${worksrcpath}/config.mak
}
post-destroot {
xinstall -d -m 0755 ${destroot}${prefix}/share/doc/${name}
file copy {*}[glob ${worksrcpath}/DOCS/*] \
${destroot}${prefix}/share/doc/${name}
xinstall -d -m 0755 ${destroot}${prefix}/etc/${name}
foreach etcfile {codecs.conf dvb-menu.conf example.conf \
input.conf menu.conf} {
xinstall -m 0644 ${worksrcpath}/etc/${etcfile} \
${destroot}${prefix}/etc/${name}/${etcfile}
}
xinstall -d -m 0755 ${destroot}${prefix}/share/man/man1
xinstall -m 0644 ${worksrcpath}/DOCS/man/en/mplayer.1 \
${destroot}${prefix}/share/man/man1/
xinstall -m 0755 ${worksrcpath}/TOOLS/midentify.sh ${destroot}${prefix}/bin/midentify
}
universal_variant no
# When adding back in extra features it usually works better to
# just list the correct depends_lib and then let the auto-detect
# code find the library versus using an explicit --enable-feature.
# The later often ends up failing to find the headers or libs or both
variant man_all_lang \
description {Install all possible languages for man pages} {
configure.args-append --language=all
}
# Bundle all the font deps into one onscreen display variant
# Allow autodetect to pick up fontconfig & freetype
variant osd \
description {Enable onscreen display and TrueType font support} {
depends_lib-append port:fontconfig port:freetype
configure.args-delete --disable-fontconfig
configure.args-delete --disable-freetype
configure.args-append --enable-menu
}
variant fribidi requires osd \
description {Enable FriBidi Unicode support} {
depends_lib-append port:fribidi
configure.args-delete --disable-fribidi
}
variant noappleremote \
description {Disable Apple Infrared Remote support} {
configure.args-append --disable-apple-remote
}
variant lirc \
description {Enable Linux Infrared Remote Daemon support} {
depends_lib-append port:lirc
configure.args-delete --disable-lirc
}
variant live \
description {Enable live555 support} {
depends_lib-append port:live555
configure.args-delete --disable-live
}
#####
variant nodvd \
description {Disable DVD and DeCSS support} {
configure.args-append --disable-dvdread-internal --disable-libdvdcss-internal
}
variant smb description {Enable Samba support} {
depends_lib-append port:samba3
configure.args-append --enable-smb
configure.args-delete --disable-smb
}
##### External codecs
variant mencoder_extras \
description {Enable extra codecs for encoding (XviD, x264, aac, DV, MP2)} {
depends_lib-append port:XviD port:x264 port:faac port:libdv \
port:twolame port:libmpeg2
configure.args-delete --disable-xvid
configure.args-delete --disable-x264
configure.args-delete --disable-faac
configure.args-delete --disable-libdv
configure.args-delete --disable-libmpeg2
configure.args-delete --disable-twolame
}
variant xvid requires mencoder_extras \
description {deprecated: use +mencoder_extras instead} {}
variant x264 requires mencoder_extras \
description {deprecated: use +mencoder_extras instead} {}
variant faac requires mencoder_extras \
description {deprecated: use +mencoder_extras instead} {}
variant dv requires mencoder_extras \
description {deprecated: use +mencoder_extras instead} {}
variant twolame requires mencoder_extras \
description {deprecated: use +mencoder_extras instead} {}
variant speex \
description {Enable Speex playback} {
depends_lib-append path:lib/libspeex.dylib:speex
configure.args-delete --disable-speex
}
variant dts \
description {Enable non-passthrough DTS playback} {
depends_lib-append port:libdca
configure.args-delete --disable-libdts
}
variant mng \
description {Enable mng codec support} {
depends_lib-append port:libmng
configure.args-delete --disable-mng
}
variant dirac \
description {Enable dirac codec support} {
depends_lib-append port:dirac port:schroedinger
configure.args-delete --disable-libdirac-lavc
configure.args-delete --disable-libschroedinger-lavc
}
variant a52 \
description {Enable AC-3 codec support} {
depends_lib-append port:a52dec
configure.args-delete --disable-liba52
}
##### Outputs
variant sdl \
description {Enable SDL video output} {
depends_lib-append port:libsdl
configure.args-delete --disable-sdl
}
variant aa \
description {Enable animated ASCII art video output} {
depends_lib-append port:aalib
configure.args-delete --disable-aa
}
variant caca \
description {Enable animated ASCII art video output} {
depends_lib-append path:lib/libcaca.dylib:libcaca
configure.args-delete --disable-caca
}
variant x11 {
depends_lib-append \
port:xorg-libXinerama \
port:xorg-libXScrnSaver \
port:xorg-libXv \
port:xorg-libXxf86vm
configure.args-delete --disable-x11 --disable-xss
configure.args-append --enable-x11 --enable-xv --enable-xinerama --enable-xshape
}
variant esd \
description {Enable EsounD audio output} {
depends_lib-append port:esound
configure.args-delete --disable-esd
}
platform macosx {
if {${configure.build_arch} eq "x86_64"} {
configure.args-append --disable-qtx
} else {
configure.args-append --enable-qtx
}
}
variant glx requires x11 description {Enable glx output support. Due to a bug in mplayer, this disables corevideo support} {
depends_lib-append port:mesa
configure.args-delete --disable-gl
configure.args-append --enable-gl --disable-corevideo
}
variant debug description {Compile with debugging symbols} {
configure.args-append --enable-debug=gdb3 --disable-altivec
}
# gcc-4.0 and older gcc-4.2 (< 5646) used to fail to build cpudetect.c properly, but it seems to work now (38007#comment:20)
# llvm-gcc-4.2 macports-llvm-gcc-4.2 fail (38007#comment:19)
# gcc-4.2 5577 fails to build cpudetect.c for x86_64
compiler.blacklist-append gcc-3.3 {gcc-4.0 < 5493} {gcc-4.2 < 5666} llvm-gcc-4.2 macports-llvm-gcc-4.2
if {[lsearch [get_canonical_archs] i386] != -1} {
# http://trac.macports.org/ticket/38248
compiler.blacklist-append {clang < 300}
}
platform darwin 8 {
depends_build-append port:gmake
build.cmd ${prefix}/bin/gmake
}
platform darwin 9 {
configure.args-delete --extra-cflags="-I${prefix}/include/lzo -I${prefix}/include"
configure.args-append --extra-cflags="-fomit-frame-pointer -I${prefix}/include/lzo -I${prefix}/include"
}
platform darwin {
if {${configure.build_arch} eq "x86_64"} {
configure.args-append --target=${configure.build_arch}-Darwin
}
build.env LD=${configure.cc}
}