source: trunk/dports/multimedia/VLC/Portfile @ 102174

Last change on this file since 102174 was 102174, checked in by jeremyhu@…, 7 years ago

misc: Update compiler dependency workaround for #32542, see #37817

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 12.5 KB
Line 
1# -*- coding: utf-8; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:et:sw=4:ts=4:sts=4
2# $Id: Portfile 102174 2013-01-29 07:53:39Z jeremyhu@macports.org $
3
4PortSystem          1.0
5
6name                VLC
7version             2.0.5
8revision            1
9
10categories          multimedia
11
12maintainers         jeremyhu openmaintainer
13description         VLC is a cross-platform media player and streaming server
14long_description    VLC media player is a highly portable multimedia player for \
15                    various audio and video formats (MPEG-1, MPEG-2, MPEG-4, DivX, \
16                    mp3, ogg, ...) as well as DVDs, VCDs, and various streaming protocols. \
17                    It can also be used as a server to stream in unicast or multicast \
18                    in IPv4 or IPv6 on a high-bandwidth network.
19license             GPL
20
21platforms           darwin
22conflicts           VLC09 VLC-devel
23
24homepage            http://www.videolan.org
25
26# http://git.videolan.org/?p=vlc.git;a=forks
27#fetch.type      git
28#git.url         git://git.videolan.org/vlc/vlc-2.0.git
29#git.branch      a4e92ec8b5ed0cd01478111a80c8f2be19503e92
30
31master_sites        http://download.videolan.org/pub/videolan/vlc/${version}/
32distname            vlc-${version}
33use_xz              yes
34
35checksums           md5     4f959c0766ada8cea5a72c65fce94ebe \
36                    sha1    31bd518f4edd03ea394305176e5df3478e251cc0 \
37                    rmd160  7956c1abb34fda73533019c67010faba9efcbf7e
38
39depends_build   port:pkgconfig
40
41depends_lib     port:lame port:a52dec port:libogg port:flac \
42                port:libdca port:libcddb port:libcdio port:libmad \
43                port:libopus port:libvorbis port:libmatroska port:libid3tag \
44                port:ncurses port:lua port:libpng port:jpeg \
45                port:gnutls port:taglib port:libxml2 port:faad2 \
46                port:x264 port:libtheora port:twolame port:libssh2 \
47                port:libdvdnav port:libdvdread port:libproxy \
48                port:fluidsynth port:libsamplerate port:libupnp \
49                port:avahi path:lib/libavcodec.dylib:ffmpeg
50
51# TODO: port:live555
52
53pre-fetch {
54    if {"darwin" == ${os.platform} && ${os.major} < 9} {
55        ui_error "${name} ${version} requires Mac OS X 10.5 or greater, use port 'VLC09' instead"
56        return -code error "incompatible Mac OS X version"
57    }
58}
59
60patchfiles \
61    buildfix-package.mak.patch \
62    configure.ac-no-arch.patch \
63    PR-34741-no__clang_version__.patch \
64    no-sparkle.patch \
65    automake.patch
66
67post-patch {
68    reinplace "s:librsvg-2/librsvg:librsvg:" \
69        ${worksrcpath}/modules/text_renderer/svg.c
70}
71
72pre-configure {
73    system "cd ${worksrcpath}/modules && find . -name Modules.am | sed 's|Modules.am||' | xargs ./genmf"
74}
75
76use_autoreconf yes
77autoreconf.args -fvi
78
79configure.env-append CXXCPP="${configure.cxx} -E"
80build.args-append    DESTDIR=${worksrcpath}/dest_ignore
81
82build.target    all
83destroot.target install
84
85livecheck.url   http://download.videolan.org/pub/videolan/vlc/
86livecheck.regex <a href=\"(\\d\[\\d|\.|\\w\]+).*/\">
87
88# live555 and possibly others are not universal, so disabling for now
89universal_variant   no
90
91# Older gcc fail at register allocation
92if {${build_arch} == "i386" || ([variant_isset universal] && [lsearch ${universal_archs} i386] != -1)} {
93    compiler.blacklist gcc-4.0 gcc-4.2 llvm-gcc-4.2
94}
95
96# TODO: base should do this: http://trac.macports.org/ticket/32542
97if {[info exists portconfigure::compiler_name_map(${configure.compiler})]} {
98    depends_build-append port:$portconfigure::compiler_name_map(${configure.compiler})
99
100    # base 2.1.x ignores the argument and just use ${configure.compiler}
101    if {[portconfigure::arch_flag_supported ${configure.compiler}]} {
102        depends_skip_archcheck-append $portconfigure::compiler_name_map(${configure.compiler})
103    }
104
105    if {[string match macports-gcc* ${configure.compiler}]} {
106        depends_lib-append port:$portconfigure::compiler_name_map(${configure.compiler})
107    }
108}
109
110# Other
111configure.args-append \
112    --with-contrib=${worksrcpath}/contrib \
113    --disable-debug --disable-update-check --enable-gnutls \
114    --disable-notify --disable-telepathy --disable-dbus \
115    --disable-growl --disable-macosx-vlc-app \
116    --enable-libproxy --enable-lua
117
118# Input Plugins
119configure.args-append \
120    --enable-dvdnav --enable-dvdread --disable-smb --disable-vcdx \
121    --disable-macosx-qtkit --disable-macosx-eyetv --disable-realrtsp \
122    --enable-sftp
123
124# Mux/Demux Plugins
125configure.args-append \
126    --disable-dvbpsi --enable-ogg --enable-mux_ogg \
127    --enable-mkv --disable-mod --disable-mpc --disable-shout
128
129# Codec Plugins
130configure.args-append \
131    --enable-a52 --enable-faad --enable-flac --disable-live555 \
132    --enable-opus --enable-vorbis --enable-ogg --enable-mad --disable-libass \
133    --enable-dca --enable-png --disable-quicktime --enable-twolame \
134    --disable-speex --enable-theora --enable-x264 --enable-postproc \
135    --enable-avcodec --enable-avformat --enable-swscale \
136    --enable-fluidsynth
137
138# Video Plugins
139configure.args-append \
140    --disable-caca --disable-sdl --disable-macosx-vout \
141    --without-x --disable-xcb --disable-xvideo --disable-glx \
142    --disable-fontconfig --disable-freetype --disable-fribidi \
143    --disable-svg
144
145# Audio Plugins
146configure.args-append \
147    --disable-macosx-audio --disable-jack --enable-samplerate
148
149# Interface Plugins
150configure.args-append \
151    --disable-macosx --disable-macosx-dialog-provider \
152    --disable-qt4 --enable-ncurses --disable-skins2
153
154# Visualisations and Video Filter Plugins
155configure.args-append \
156    --disable-goom
157
158# Service Discovery Plugins
159configure.args-append \
160    --enable-bonjour --enable-upnp
161
162variant jack description {Enable jack plugin for audio output} {
163    depends_lib-append      port:jack
164    configure.args-delete   --disable-jack
165    configure.args-append   --enable-jack
166}
167
168variant qtkit description {Enable qtcapture and qtaudio} {
169    configure.args-delete   --disable-macosx-qtkit
170    configure.args-append   --enable-macosx-qtkit
171
172    if {${os.major} < 10} {
173        ui_error "The +qtkit variant requires Snow Leopard or greater"
174        return -code error "incompatible Mac OS X version"
175    }
176}
177
178variant eyetv description {Enable eyetv plugin} {
179    configure.args-delete --disable-macosx-eyetv
180    configure.args-append --enable-macosx-eyetv
181}
182
183variant speex description {Enable Speex decoder support} {
184    depends_lib-append      path:lib/libspeex.dylib:speex
185    configure.args-delete   --disable-speex
186    configure.args-append   --enable-speex
187}
188
189variant svg description {Enable SVG support} {
190    depends_lib-append      port:librsvg
191    configure.args-delete   --disable-svg
192    configure.args-append   --enable-svg
193}
194
195variant shout description {Enable Shoutcast support} {
196    depends_lib-append      port:libshout2
197    configure.args-delete   --disable-shout
198    configure.args-append   --enable-shout
199}
200
201variant vcd description {Enable VCD support} {
202    depends_lib-append      port:vcdimager
203    configure.args-delete   --disable-vcdx
204    configure.args-append   --enable-vcdx
205}
206
207variant mod description {Enable MOD demuxer support} {
208    depends_lib-append      port:libmodplug
209    configure.args-delete   --disable-mod
210    configure.args-append   --enable-mod
211}
212
213variant mpc description {enable Musepack Decoder library support} {
214    depends_lib-append      port:libmpcdec
215    configure.args-delete   --disable-mpc
216    configure.args-append   --enable-mpc
217}
218
219variant dvb description {enable DVB Program Specific Information support} {
220    depends_lib-append      port:libdvbpsi
221    configure.args-delete   --disable-dvbpsi
222    configure.args-append   --enable-dvbpsi
223}
224
225variant osd description {Enable onscreen display and TrueType font support} {
226    depends_lib-append      port:fontconfig port:freetype
227    configure.args-delete   --disable-freetype --disable-fontconfig
228    configure.args-append   --enable-freetype --enable-fontconfig
229}
230
231variant fribidi requires osd description {Enable FriBidi Unicode support} {
232    depends_lib-append      port:fribidi
233    configure.args-delete   --disable-fribidi
234    configure.args-append   --enable-fribidi
235}
236
237variant sdl description {Enable SDL/SDL-Image support} {
238    depends_lib-append      path:lib/pkgconfig/sdl.pc:libsdl port:libsdl_image
239    configure.args-delete   --disable-sdl
240    configure.args-append   --enable-sdl
241}
242
243variant smb description {Enable Samba 3 support} {
244    depends_lib-append      port:samba3
245    configure.args-delete   --disable-smb
246    configure.args-append   --enable-smb
247    configure.ldflags-append    -L${prefix}/lib/samba3
248}
249
250variant x11 {
251    depends_lib-append \
252        port:mesa \
253        port:xorg-libXinerama \
254        port:xorg-libXv \
255        port:xorg-libXxf86vm \
256        port:xorg-xcb-util \
257        port:xorg-xcb-util-keysyms
258
259    configure.args-delete   --without-x --disable-xvideo --disable-glx --disable-xcb
260    configure.args-append   --with-x --x-include=${prefix}/include --x-lib=${prefix}/lib \
261                            --enable-xvideo --enable-glx --enable-xcb
262}
263
264variant qt4 description {Build using QT4 UI.  This will use qt4-mac} {
265    configure.args-delete   --disable-qt4
266    configure.args-append   --enable-qt4
267
268    PortGroup qt4 1.0
269
270    post-activate {
271        if {![variant_isset quartz]} {
272            ui_info "The qt4 interface module for VLC is not very stable.  If you encounter bugs with it, please file them with VLC and not MacPorts."
273        }
274    }
275}
276
277variant quartz {
278    depends_lib-append      port:BGHUDAppKit
279    configure.args-delete   --disable-macosx --disable-macosx-dialog-provider
280    configure.args-append   --enable-macosx --enable-macosx-dialog-provider
281}
282
283default_variants +mod +mpc +osd +quartz
284
285variant huge \
286    requires dvb eyetv fribidi jack mod mpc osd sdl shout speex svg vcd \
287    description {Enable all variants except quartz, qt4, smb, and x11} {}
288
289variant full \
290    requires huge qt4 quartz smb x11 \
291    description {Enable all variants} {}
292
293platform macosx {
294    if {${os.major} > 9} {
295        default_variants-append +qtkit
296    }
297
298    if {${os.major} == 9} {
299        # FIXME: x86_64 segfaults on Leopard on dlclose() ... not sure why
300        supported_archs i386 ppc
301    }
302
303    configure.args-delete \
304        --disable-macosx-vout --disable-macosx-audio \
305
306    configure.args-append \
307        --enable-macosx-vout --enable-macosx-audio \
308        --with-macosx-sdk=/
309
310    if {[variant_isset qt4] || [variant_isset quartz]} {
311        configure.args-delete --disable-macosx-vlc-app
312        configure.args-append --enable-macosx-vlc-app
313    }
314
315    post-patch {
316        reinplace "/Sparkle.framework/d" \
317            ${worksrcpath}/extras/package/macosx/vlc.xcodeproj/project.pbxproj
318        reinplace "/SDKROOT/d" \
319            ${worksrcpath}/extras/package/macosx/vlc.xcodeproj/project.pbxproj
320        reinplace "/Growl.framework/d" \
321            ${worksrcpath}/extras/package/macosx/package.mak
322
323        reinplace "s:LD_LIBRARY_PATH:DYLD_LIBRARY_PATH:g" \
324            ${worksrcpath}/Makefile.am
325
326        reinplace "/argv/s/environ/*_NSGetEnviron()/" \
327            ${worksrcpath}/modules/misc/inhibit/xdg.c \
328            ${worksrcpath}/modules/misc/inhibit/xscreensaver.c
329
330        reinplace "s/extern char \\*\\*environ;/#include <crt_externs.h>/" \
331            ${worksrcpath}/modules/misc/inhibit/xdg.c \
332            ${worksrcpath}/modules/misc/inhibit/xscreensaver.c
333
334        ln -s ${frameworks_dir}/BGHUDAppKit.framework ${worksrcpath}/contrib/BGHUDAppKit.framework
335
336        # To trick configure
337        file mkdir "${worksrcpath}/contrib/lib"
338    }
339
340    post-destroot {
341        eval file delete [glob ${destroot}${prefix}/lib/vlc/plugins/*.la]
342
343        if {[variant_isset qt4] || [variant_isset quartz]} {
344            file rename ${worksrcpath}/VLC.app ${destroot}${applications_dir}/VLC.app
345
346            # These are already in ${prefix}, so we don't need to bundle them as well
347            file delete -force ${destroot}${applications_dir}/VLC.app/Contents/Frameworks
348            file delete -force ${destroot}${applications_dir}/VLC.app/Contents/lib
349
350            # There's no need to install these into the bundle and the prefix
351            file delete -force ${destroot}${applications_dir}/VLC.app/Contents/MacOS/include
352            file delete -force ${destroot}${applications_dir}/VLC.app/Contents/MacOS/lib
353            file delete -force ${destroot}${applications_dir}/VLC.app/Contents/MacOS/plugins
354
355            # http://trac.macports.org/ticket/35131
356            ln -s ${prefix}/lib ${destroot}${applications_dir}/VLC.app/Contents/MacOS/lib
357            ln -s ${prefix}/lib/vlc/plugins ${destroot}${applications_dir}/VLC.app/Contents/MacOS/plugins
358        }
359    }
360}
Note: See TracBrowser for help on using the repository browser.