Ticket #33048: Portfile2.diff

File Portfile2.diff, 11.1 KB (added by ranauei@…, 13 years ago)

Moved to sha256/rmd160, removed unnecessary configure parameters and other fixes

  • Portfile

    old new  
    11# -*- 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
    2 # $Id: Portfile 89315 2012-01-24 22:31:47Z ryandesign@macports.org $
     2# $Id: Portfile 87501 2011-11-23 22:53:13Z devans@macports.org $
    33
    44PortSystem 1.0
    55PortGroup xcodeversion 1.0
    66PortGroup muniversal 1.0
    77
    8 name            ffmpeg
    9 conflicts       ffmpeg-devel
    10 epoch           1
    11 version         0.7.8
    12 set branch      [join [lrange [split ${version} .] 0 1] .]
    13 license         GPL-2+
    14 categories      multimedia
    15 maintainers     devans openmaintainer
    16 
    17 description     FFmpeg is a complete solution to play, record, convert and \
    18                 stream audio and video.
    19 
    20 long_description        FFmpeg is a complete solution to record, convert and \
    21                         stream audio and video. It includes libavcodec, the \
    22                         leading audio/video codec library. \
    23                         \
    24                         The project is made of several components: \
    25                         \
    26                         ffmpeg is a command line tool to convert one video \
    27                         file format to another. It also supports grabbing and \
    28                         encoding in real time from a TV card. \
    29                         \
    30                         ffserver is an HTTP (RTSP is being developped) \
    31                         multimedia streaming server for live broadcasts. Time \
    32                         shifting of live broadcast is also supported. \
    33                         \
    34                         ffplay is a simple media player based on SDL and on \
    35                         the ffmpeg libraries. \
    36                         \
    37                         ffprobe gathers information from multimedia streams and \
    38                         prints it in human- and machine-readable fashion. \
    39                         \
    40                         libavcodec is a library containing all the ffmpeg \
    41                         audio/video encoders and decoders. Most codecs were \
    42                         developped from scratch to ensure best performances \
    43                         and high code reusability. \
    44                         \
    45                         libavformat is a library containing parsers and \
    46                         generators for all common audio/video formats.
    47 
    48 platforms       darwin
    49 homepage        http://www.ffmpeg.org/
    50 master_sites    http://www.ffmpeg.org/releases/
    51 
    52 use_bzip2       yes
    53 
    54 checksums       sha1    df4983c028a61d4bf3baceab3bae535b91b8928a \
    55                 rmd160  8f69a6bc5caaba4e3d440c2d5dc96a946454a52c
    56 
    57 depends_build   port:pkgconfig \
    58                 port:gmake \
    59                 port:texi2html
    60 
    61 depends_lib     port:lame \
    62                 port:libvorbis \
    63                 port:libogg \
    64                 port:libtheora \
    65                 port:dirac \
    66                 port:schroedinger \
    67                 port:openjpeg \
    68                 path:lib/libspeex.dylib:speex \
    69                 port:XviD \
    70                 port:x264 \
    71                 port:libvpx \
    72                 path:lib/pkgconfig/sdl.pc:libsdl \
    73                 port:bzip2 \
    74                 port:zlib
     8name            ffmpeg
     9conflicts       ffmpeg-devel
     10version         0.10
     11set branch      [join [lrange [split ${version} .] 0 1] .]
     12license         GPL-2+
     13categories      multimedia
     14maintainers     devans openmaintainer
     15
     16description     FFmpeg is a complete solution to play, record, convert and \
     17                stream audio and video.
     18
     19long_description \
     20                FFmpeg is a complete solution to record, convert and stream audio and \
     21                video. It includes libavcodec, the leading audio/video codec library. \
     22                The project is made of several components: \
     23                \
     24                ffmpeg is a command line tool to convert one video file format to \
     25                another. It also supports grabbing and encoding in real time from a \
     26                TV card. \
     27                \
     28                ffserver is an HTTP (RTSP is being developed) multimedia streaming \
     29                server for live broadcasts. Time shifting of live broadcast is also \
     30                supported. \
     31                \
     32                ffplay is a simple media player based on SDL and on the ffmpeg libraries. \
     33                \
     34                ffprobe gathers information from multimedia streams and prints it in \
     35                human- and machine-readable fashion. \
     36                \
     37                libavcodec is a library containing all the ffmpeg audio/video encoders \
     38                and decoders. Most codecs were developped from scratch to ensure best \
     39                performances and high code reusability. \
     40                \
     41                libavformat is a library containing parsers and generators for all common \
     42                audio/video formats.
     43
     44platforms       darwin
     45homepage        http://www.ffmpeg.org/
     46master_sites    http://www.ffmpeg.org/releases/
     47use_bzip2       yes
     48
     49checksums       sha256 43596aa76d1a0fab6d42927bf60383405de2bca8fbc740c2012877559ae17ff9 \
     50                rmd160 a60568d4e8bd1a44a2c986e0648cfacba766bcd4
     51
     52depends_build   port:pkgconfig
     53depends_lib     port:lame \
     54                port:libvorbis \
     55                port:libogg \
     56                port:libtheora \
     57                port:dirac \
     58                port:schroedinger \
     59                port:openjpeg \
     60                port:speex \
     61                port:XviD \
     62                port:x264 \
     63                port:libvpx \
     64                port:libsdl \
     65                port:bzip2 \
     66                port:zlib
    7567
    76 patchfiles      patch-configure.diff
    77 
    78 build.cmd       ${prefix}/bin/gmake
    79 build.env-append V=1
     68patchfiles      patch-configure.diff
    8069
    8170#
    8271# enable auto configure of mmx and related Intel optimizations by default
    8372# requires Xcode 3.1 or better on Leopard
    8473#
    85 minimum_xcodeversions {9 3.1}
     74minimum_xcodeversions   {9 3.1}
    8675
    87 # Under some conditions, llvm-gcc-4.2 drops some "unused" code even though it is used
    88 # fixed in llvm-gcc trunk, but not in Apple's shipped llvm-gccs.
    89 #
    90 # similarly clang fails to build on i386 platforms
    91 if {${configure.compiler} == "llvm-gcc-4.2"} {
    92     configure.compiler gcc-4.2
    93 } elseif {${configure.compiler} == "clang"} {
    94     depends_build-append port:apple-gcc42
    95     configure.compiler apple-gcc-4.2
    96     # base (as of 2.0.3) doesn't set cxx for apple-gcc-4.2
    97     configure.cxx ${prefix}/bin/g++-apple-4.2
    98 }
    99 
    100 configure.cflags-append    -DHAVE_LRINTF ${configure.cppflags}
     76configure.cflags-append -DHAVE_LRINTF ${configure.cppflags}
    10177configure.args \
    102         --enable-gpl \
    103         --enable-postproc \
    104         --enable-swscale --enable-avfilter \
     78        --disable-doc \
     79        --disable-debug \
     80        --enable-gpl \
     81        --enable-postproc \
     82        --enable-swscale \
     83        --enable-avfilter \
    10584        --enable-libmp3lame \
    10685        --enable-libvorbis \
    10786        --enable-libtheora \
    108         --enable-libdirac --enable-libschroedinger \
     87        --enable-libdirac \
     88        --enable-libschroedinger \
    10989        --enable-libopenjpeg \
    11090        --enable-libxvid \
    11191        --enable-libx264 \
    11292        --enable-libvpx \
    11393        --enable-libspeex \
    114         --mandir=${prefix}/share/man \
    115         --enable-shared --enable-pthreads \
    116         --cc=${configure.cc}
     94        --enable-shared \
     95        --cc=${configure.cc}
    11796
    118 test.run        yes
    119 
    120 #
    121 # configure isn't autoconf and they do use a dep cache
    122 #
     97test.run        yes
    12398
    12499post-destroot {
    125     file mkdir ${destroot}${prefix}/share/doc/ffmpeg
    126     file copy ${worksrcpath}/doc/APIchanges ${destroot}${prefix}/share/doc/ffmpeg
    127     file copy ${worksrcpath}/doc/RELEASE_NOTES ${destroot}${prefix}/share/doc/ffmpeg
    128     foreach f [glob ${worksrcpath}/doc/*.txt] {
    129         file copy $f ${destroot}${prefix}/share/doc/ffmpeg
    130     }
     100        if {[variant_isset doc]} {
     101                file mkdir ${destroot}${prefix}/share/doc/ffmpeg
     102                file copy ${worksrcpath}/doc/APIchanges ${destroot}${prefix}/share/doc/ffmpeg
     103                file copy ${worksrcpath}/doc/RELEASE_NOTES ${destroot}${prefix}/share/doc/ffmpeg
     104                foreach f [glob ${worksrcpath}/doc/*.txt] {
     105                        file copy $f ${destroot}${prefix}/share/doc/ffmpeg
     106                }
     107        }
    131108}
    132109
    133110platform powerpc {
    134     # absence of altivec is not automatically detected
    135     if {[catch {sysctl hw.vectorunit} result] || $result == 0} {
    136         configure.args-append --disable-altivec
    137     }
     111        # absence of altivec is not automatically detected
     112        if {[catch {sysctl hw.vectorunit} result] || $result == 0} {
     113                configure.args-append --disable-altivec
     114        }
    138115}
    139116
    140117configure.universal_args-delete --disable-dependency-tracking
    141118
    142119if {[variant_isset universal]} {
    143     foreach arch ${configure.universal_archs} {
    144         lappend merger_configure_args($arch) --arch=${arch}
    145         lappend merger_configure_env($arch)  ASFLAGS='-arch ${arch}'
    146     }
    147     if {[string match "*86*" ${configure.universal_archs}]} {
    148         depends_build-append port:yasm
    149     }
    150     lappend merger_configure_args(i386) --enable-yasm
    151     lappend merger_configure_args(x86_64) --enable-yasm
     120        foreach arch ${configure.universal_archs} {
     121                lappend merger_configure_args($arch) --arch=${arch}
     122                lappend merger_configure_env($arch)  ASFLAGS='-arch ${arch}'
     123        }
     124        if {[string match "*86*" ${configure.universal_archs}]} {
     125                depends_build-append port:yasm
     126        }
     127                lappend merger_configure_args(i386) --enable-yasm
     128                lappend merger_configure_args(x86_64) --enable-yasm
    152129} else {
    153     configure.args-append --arch=${configure.build_arch}
    154     configure.env-append  ASFLAGS='[get_canonical_archflags]'
    155     if {$build_arch == "i386" || $build_arch == "x86_64"} {
    156         depends_build-append port:yasm
    157         configure.args-append --enable-yasm
    158     }
     130        configure.args-append --arch=${configure.build_arch}
     131        configure.env-append  ASFLAGS='[get_canonical_archflags]'
     132        if {$build_arch == "i386" || $build_arch == "x86_64"} {
     133                depends_build-append port:yasm
     134                configure.args-append --enable-yasm
     135        }
    159136}
    160137
    161138variant no_mmx description {disable all x86 asm optimizations} {
    162     configure.args-append --disable-mmx --disable-mmx2 --disable-sse --disable-ssse3 --disable-amd3dnow --disable-amd3dnowext
     139        configure.args-append --disable-mmx --disable-mmx2 --disable-sse --disable-ssse3 --disable-amd3dnow --disable-amd3dnowext
    163140}
    164141
    165142variant no_gpl conflicts nonfree description {disallow use of GPL code, license will be LGPL} {
    166     configure.args-delete   --enable-gpl \
    167                             --enable-postproc \
    168                             --enable-libx264 \
    169                             --enable-libxvid
    170     depends_lib-delete      port:XviD \
    171                             port:x264
    172     license-delete          GPL-2+
    173     license-append          LGPL-2.1+
     143        configure.args-delete   --enable-gpl \
     144                                --enable-postproc \
     145                                --enable-libx264 \
     146                                --enable-libxvid
     147        depends_lib-delete      port:XviD \
     148                                port:x264
     149        license-delete          GPL-2+
     150        license-append          LGPL-2.1+
    174151}
    175152
    176153# the build server uses the default variants, and we want distributable binaries
    177154# nonfree code is disabled by default but can be enabled using the +nonfree variant
    178155
    179156variant nonfree conflicts no_gpl description {enable nonfree code, libraries and binaries will not be redistributable} {
    180     configure.args-append   --enable-nonfree \
    181                             --enable-libfaac
    182     depends_lib-append      port:faac
    183     license-delete          GPL-2+
    184     license-append          Restrictive
     157        configure.args-append   --enable-nonfree \
     158                                --enable-libfaac
     159        depends_lib-append      port:faac
     160        license-delete          GPL-2+
     161        license-append          Restrictive
     162}
     163
     164variant doc description {install documentation files} {
     165        configure.args-delete   --disable-doc
     166        depends_build-append    port:texi2html
    185167}
    186168
    187169if {[variant_isset nonfree]} {