Ticket #56417: Portfile

File Portfile, 8.0 KB (added by ajdudman, 6 years ago)

This Portfile patches transcode for ffmpeg 4 and as needed ImageMagick 7.

Line 
1# -*- 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
3PortSystem      1.0
4PortGroup       muniversal 1.0
5
6name            transcode
7version         1.1.7
8revision        22
9epoch           1
10license         GPL-2+
11categories      multimedia
12maintainers     cogweb.net:lionteeth {devans @dbevans}
13description     Video and audio processing tools
14long_description    transcode is a suite of tools, all of which are \
15                command line utilities, for transcoding various \
16                video, audio, and container formats, running on a \
17                platform that supports shared libraries and threads.\
18                \
19                Decoding and encoding is done by modules that are \
20                responsible for feeding transcode with raw video/ \
21                audio streams (import modules) and encoding the frames \
22                (export modules). \
23                \
24                It includes a variety of video and audio filters, \
25                including (but not limited to) video de-interlacing, \
26                audio resampling, framerate conversion, different \
27                resizing algorithms, smoothing, sharpening, denoisifying, \
28                and cutting.
29
30homepage        https://bitbucket.org/france/transcode-tcforge/overview
31
32master_sites    https://bitbucket.org/france/transcode-tcforge/downloads/
33
34use_bzip2       yes
35
36checksums       transcode-1.1.7.tar.bz2 \
37                    rmd160  faa854acbbfd52faaa216505176f94d756d77841 \
38                    sha256  1e4e72d8e0dd62a80b8dd90699f5ca64c9b0cb37a5c9325c184166a9654f0a92 \
39                    size    2183627 \
40                transcode-ffmpeg3.patch \
41                    rmd160  bac993cb3bbe6ce69c995b596bb76e75fb185fa2 \
42                    sha256  728ec3101039d98116275e36ea5cf0434a23a0bb82aca830ea9612fb9d16b062 \
43                    size    50234 \
44                transcode-ffmpeg4.patch \
45                    rmd160  df5df5fb91b7051a580d697a52c3a6bd4d44e91a \
46                    sha256  2cc680666f705685a9fdc54b5a377e7728765bde6ed83c43b835634e27767721 \
47                    size    26970 \
48                transcode-imagemagick7.patch \
49                    rmd160  af4e4214203f4879c359b772afa73ef928710347 \
50                    sha256  4ede15540ea6932954ac332c12dde130bf48e7e4773d1e04d3c3f23038c6ac51 \
51                    size    34353
52
53depends_build   port:pkgconfig
54
55depends_lib     path:lib/libavcodec.dylib:ffmpeg \
56                port:libmpeg2 \
57                port:libdvdread \
58                port:jpeg \
59                port:lame
60
61platforms       darwin
62
63patch.pre_args  -p1
64patch.args      -b -V numbered
65patchfiles      \
66                avilib-avidump.c.diff \
67                configure.in.diff \
68                filter-subtitler-load_font.c.diff
69
70# https://www.archlinux.org/packages/community/x86_64/transcode/
71patch_sites     https://git.archlinux.org/svntogit/community.git/plain/trunk/?h=packages/transcode
72patchfiles-append \
73                transcode-ffmpeg3.patch \
74                transcode-ffmpeg4.patch
75
76# Simple macports-base/src/port1.0/fetch_common.tcl does not parse query in url.
77proc portfetch::assemble_url {site distfile} {
78        package require uri
79        set parts [uri::split $site]
80        if {[string index [dict get $parts path] end] ne "/"} {
81                set slash /
82        } else {
83                set slash ""
84        }
85        dict append parts path $slash [percent_encode ${distfile}]
86        set rval [uri::join {*}$parts]
87        return "$rval"
88}
89
90use_autoreconf  yes
91autoreconf.args -fiv
92
93configure.args  --disable-mmx \
94                --enable-libmpeg2 \
95                --enable-libmpeg2convert \
96                --without-x
97
98# With muniversal configure needs help.  This configure's tests do not handle cross-compling, so we must set build and not just host alone.
99platform darwin {
100        lappend merger_configure_args(i386)  --build=i686-apple-${os.platform}${os.version}
101}
102
103default_variants +full +x11
104
105# Optional components
106
107variant mmx description {enable mmx optimizations} {
108     configure.args-delete --disable-mmx
109}
110
111variant full requires a52dec faac freetype imagemagick libdv libogg libpostproc libquicktime libsdl libtheora libvorbis libxml2 lzo mjpegtools x264 xvid description {enable all optional components except deprecated} {
112}
113
114variant a52dec description {enable support for decoding ATSC A/52 streams} {
115    depends_lib-append port:a52dec
116    configure.args-append --enable-a52 --with-a52-prefix=${prefix}
117}
118
119variant faac requires experimental description {enable AAC encoding support via libfaac (experimental)} {
120    depends_lib-append port:faac
121    configure.args-append --enable-faac --with-faac-prefix=${prefix}
122}
123
124variant freetype description {enable support for the FreeType font engine} {
125    depends_lib-append port:freetype
126    configure.args-append --enable-freetype2
127}
128
129variant imagemagick description {enable support for the manipulation of still images} {
130    depends_lib-append port:ImageMagick
131    configure.args-append --enable-imagemagick --with-imagemagick-prefix=${prefix}
132    if {![catch {set vers [lindex [registry_active ImageMagick] 0]}] && [vercmp [lindex $vers 1] 7.0] >= 0 } {
133        patchfiles-append transcode-imagemagick7.patch
134    }
135}
136
137variant libdv description {enable support for the Digital Video format via libdv} {
138    depends_lib-append port:libdv
139    configure.args-append --enable-libdv
140}
141
142variant libogg description {enable support for encoding and decoding ogg audio} {
143    depends_lib-append port:libogg
144    configure.args-append --enable-ogg
145}
146
147variant libpostproc description {enable libpostproc support from ffmpeg} {
148    configure.args-append --enable-libpostproc
149}
150
151variant libquicktime description {enable support for QuickTime video} {
152# use only libquicktime-devel until libquicktime is upgraded to build
153# with ffmpeg-2.0
154#    depends_lib-append path:lib/libquicktime.dylib:libquicktime-devel
155    depends_lib-append port:libquicktime-devel
156    configure.args-append --enable-libquicktime
157}
158
159variant libtheora description {enable support for the open video codec theora} {
160    depends_lib-append port:libtheora
161    configure.args-append --enable-theora
162}
163
164variant libvorbis description {enable support for a fully open compressed audio format} {
165    depends_lib-append port:libvorbis
166    configure.args-append --enable-vorbis
167}
168
169variant libxml2 description {enable support for the XML metalanguage} {
170    depends_lib-append port:libxml2
171    configure.args-append --enable-libxml2
172}
173
174variant lzo requires experimental description {enable lossless data compression via lzo2 (experimental)} {
175    depends_lib-append port:lzo2
176    configure.args-append --enable-lzo --with-lzo-prefix=${prefix}
177}
178
179variant mjpegtools description {enable mjpegtools support} {
180    depends_lib-append port:mjpegtools
181    configure.args-append --enable-mjpegtools
182}
183
184variant x264 requires experimental description {enable support for encoding H264/AVC video (experimental)} {
185    depends_lib-append port:x264
186    configure.args-append --enable-x264
187}
188
189variant xvid requires experimental description {enable support for the open Xvid video codec (experimental)} {
190    depends_lib-append port:XviD
191    configure.args-append --enable-xvid --with-xvid-prefix=${prefix}
192}
193
194variant experimental description {enable new, experimental or even incomplete components} {
195    configure.args-append --enable-experimental
196}
197
198variant deprecated description {enable deprecated or even broken components} {
199    configure.args-append --enable-deprecated
200}
201
202#
203# Display options
204#
205
206variant libsdl description {enable Simple DirectMedia Layer display support} {
207    depends_lib-append port:libsdl
208    configure.args-append --enable-sdl
209}
210
211variant x11 {
212    depends_lib-append port:xorg-libXv
213    depends_lib-append port:xorg-libXaw
214    depends_lib-append port:xpm
215    configure.args-append --x-includes=${prefix}/include
216    configure.args-append --x-libraries=${prefix}/lib
217    configure.args-delete --without-x
218}
219
220livecheck.type  regex
221livecheck.url   [lindex ${master_sites} 0]
222livecheck.regex "${name}-(\\d+(?:\\.\\d+)*)${extract.suffix}"