# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4 # $Id: Portfile 47772 2009-03-05 23:54:53Z devans@macports.org $ PortSystem 1.0 name ffmpeg version 15261 revision 5 categories multimedia maintainers acho@macports.org openmaintainer description Digital VCR and streaming server long_description FFmpeg is a complete solution to record, convert and \ stream audio and video. It includes libavcodec, the \ leading audio/video codec library. \ \ The project is made of several components: \ \ ffmpeg is a command line tool to convert one video \ file format to another. It also supports grabbing and \ encoding in real time from a TV card. \ \ ffserver is an HTTP (RTSP is being developped) \ multimedia streaming server for live broadcasts. Time \ shifting of live broadcast is also supported. \ \ ffplay is a simple media player based on SDL and on \ the ffmpeg libraries. \ \ libavcodec is a library containing all the ffmpeg \ audio/video encoders and decoders. Most codecs were \ developped from scratch to ensure best performances \ and high code reusability. \ \ libavformat is a library containing parsers and \ generators for all common audio/video formats. homepage http://www.ffmpeg.org/ master_sites distfiles patchfiles patch-libavcodec_ppc_check_altivec.c.diff \ patch-libavcodec_libx264.c.diff \ patch-libavfilter-avfilter.h.diff \ patch-libswscale-Makefile.diff \ patch-libswscale-swscale.h.diff use_parallel_build yes worksrcdir trunk depends_build bin:svn:subversion \ port:gmake depends_lib port:lame \ port:libvorbis \ port:libogg \ port:libtheora \ port:x264 \ port:dirac \ port:schroedinger \ port:faac \ port:faad2 \ port:XviD \ port:libsdl \ port:bzip2 \ port:zlib build.cmd gmake configure.compiler gcc-4.0 set svn_rev ${version} set libswscale_rev 27728 pre-fetch { if {[file isdirectory ${distpath}/${svn_rev}]} { if {![file isdirectory ${distpath}/${svn_rev}/trunk/.svn] || ![file exists ${distpath}/${svn_rev}/trunk/.complete]} { file delete -force ${distpath}/${svn_rev} } } } fetch { if {![file isdirectory ${distpath}/${svn_rev}]} { file mkdir ${distpath}/${svn_rev} system "svn co -r${svn_rev} --ignore-externals svn://svn.ffmpeg.org/ffmpeg/trunk ${distpath}/${svn_rev}/trunk" system "svn co -r${libswscale_rev} svn://svn.ffmpeg.org/mplayer/trunk/libswscale ${distpath}/${svn_rev}/trunk/libswscale" system "touch ${distpath}/${svn_rev}/trunk/.complete" } } extract { file copy ${distpath}/${svn_rev}/trunk ${worksrcpath} } platforms darwin configure.cflags-append -DHAVE_LRINTF ${configure.cppflags} configure.args \ --disable-vhook \ --enable-gpl \ --enable-swscale --enable-avfilter --enable-avfilter-lavf \ --enable-postproc \ --enable-libmp3lame \ --enable-libvorbis \ --enable-libtheora \ --enable-libdirac --enable-libschroedinger \ --enable-libfaac \ --enable-libfaad \ --enable-libx264 \ --enable-libxvid \ --mandir=${prefix}/share/man \ --enable-shared --enable-pthreads \ --disable-mmx \ --cc=gcc-4.0 test.run yes default_variants +a52 # configure isn't autoconf and they do use a dep cache universal_variant no post-destroot { file mkdir ${destroot}${prefix}/share/doc/${name} file copy ${worksrcpath}/doc/TODO ${destroot}${prefix}/share/doc/${name} foreach f [glob ${worksrcpath}/doc/*.txt ${worksrcpath}/doc/*.html] { file copy $f ${destroot}${prefix}/share/doc/${name} } } platform darwin i386 { post-patch { reinplace "s|defined\(ARCH_X86\) \&\& defined\(CONFIG_GPL\)|defined\(ARCH_X86\) \\\&\\\& defined\(CONFIG_GPL\) \\\&\\\& \\\!defined\(__APPLE__\)|g" ${worksrcpath}/libswscale/rgb2rgb.c } } variant mmx description {enable mmx support, experimental; does not build in gcc-4.2 or xcode 3.0 gcc-4.0} { # make no-mmx default and allow mmx enabling for the brave. configure.args-delete --disable-mmx # Fix Leopard problems by disabling the cavs decoder for now configure.args-append --disable-decoder=cavs } variant a52 description {enable GPLed liba52 support} { depends_lib-append port:a52dec configure.args-append --enable-liba52 post-destroot { file mkdir ${destroot}${prefix}/include/ffmpeg foreach f [glob ${destroot}${prefix}/include/libavcodec/*.h ${destroot}${prefix}/include/libavformat/*.h ${destroot}${prefix}/include/libavutil/*.h] { regsub -all $destroot ${f} "" srclink ln -s ${srclink} ${destroot}${prefix}/include/ffmpeg/[lindex [split ${f} /] end] } } } variant no_gpl conflicts a52 description {disallow use of GPL code, license will be LGPL} { configure.args-delete --enable-gpl configure.args-delete --enable-postproc configure.args-delete --enable-swscale configure.args-delete --enable-libfaad depends_lib-delete port:faad2 configure.args-delete --enable-libxvid depends_lib-delete port:XviD } post-activate { if {![variant_isset no_gpl]} { ui_msg " ******* ******* This build of ${name} includes GPLed code and ******* is therefore licensed under GPL. ******* ******* The following modules are GPLed: ******* ******* postproc ******* swscale ******* liba52 ******* libfaad ******* libx264 ******* libxvid ******* ******* To include only LGPLed code use variants +no_gpl -a52 ******* " } else { ui_msg " ******* ******* This build of ${name} includes no GPLed ******* code and is therefore licensed under LGPL. ******* " } } # #disable livecheck # livecheck.check none