source: trunk/dports/multimedia/VLC-devel/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.8 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-devel
7version             2.0.99
8revision            10
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
23
24homepage            http://www.videolan.org
25
26# http://git.videolan.org/?p=vlc.git
27fetch.type      git
28git.url         git://git.videolan.org/vlc.git
29git.branch      ecfe16669a5df27ad031e51af39d5d6f745d4fd0
30
31#master_sites        http://download.videolan.org/pub/videolan/vlc/${version}/
32#distname            vlc-${version}
33#use_xz              yes
34#
35#checksums           md5     5ad114755670e4881a2b35354e2f79bc \
36#                    sha1    40d0ed360dd3fa7dc3ff4fbc9c319553ebb22538 \
37#                    rmd160  9d932e1be72b65cf47057191d9e84deeedea282c
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.6 or greater, use port 'VLC09' instead"
56        return -code error "incompatible Mac OS X version"
57    }
58    if {"darwin" == ${os.platform} && ${os.major} < 10} {
59        ui_error "${name} ${version} requires Mac OS X 10.6 or greater, use port 'VLC' instead"
60        return -code error "incompatible Mac OS X version"
61    }
62}
63
64patchfiles \
65    buildfix-package.mak.patch \
66    configure.ac-no-arch.patch \
67    PR-34741-no__clang_version__.patch \
68    class_struct.patch \
69    qtkit.patch \
70    static_assert.patch \
71    no-sparkle.patch
72
73post-patch {
74    reinplace "s:librsvg-2/librsvg:librsvg:" \
75        ${worksrcpath}/modules/text_renderer/svg.c
76}
77
78pre-configure {
79    system "cd ${worksrcpath}/modules && find . -name Modules.am | sed 's|Modules.am||' | xargs ./genmf"
80}
81
82use_autoreconf yes
83autoreconf.args -fvi
84
85configure.env-append CXXCPP="${configure.cxx} -E"
86build.args-append    DESTDIR=${worksrcpath}/dest_ignore
87
88# gl.c:121:3: error: Platform not recognized.
89configure.cppflags-append -D__unix__=1
90
91build.target    all
92destroot.target install
93
94livecheck.type  none
95
96# live555 and possibly others are not universal, so disabling for now
97universal_variant   no
98
99# Older gcc fail at register allocation
100if {${build_arch} == "i386" || ([variant_isset universal] && [lsearch ${universal_archs} i386] != -1)} {
101    compiler.blacklist gcc-4.0 gcc-4.2 llvm-gcc-4.2
102}
103
104# TODO: base should do this: http://trac.macports.org/ticket/32542
105if {[info exists portconfigure::compiler_name_map(${configure.compiler})]} {
106    depends_build-append port:$portconfigure::compiler_name_map(${configure.compiler})
107
108    # base 2.1.x ignores the argument and just use ${configure.compiler}
109    if {[portconfigure::arch_flag_supported ${configure.compiler}]} {
110        depends_skip_archcheck-append $portconfigure::compiler_name_map(${configure.compiler})
111    }
112
113    if {[string match macports-gcc* ${configure.compiler}]} {
114        depends_lib-append port:$portconfigure::compiler_name_map(${configure.compiler})
115    }
116}
117
118# Other
119configure.args-append \
120    --with-contrib=${worksrcpath}/contrib \
121    --disable-debug --disable-update-check --enable-gnutls \
122    --disable-notify --disable-telepathy --disable-dbus \
123    --disable-growl --disable-macosx-vlc-app \
124    --enable-libproxy --enable-lua
125
126# Input Plugins
127configure.args-append \
128    --enable-dvdnav --enable-dvdread --disable-smb --disable-vcdx \
129    --disable-macosx-qtkit --disable-macosx-eyetv --disable-realrtsp \
130    --enable-sftp
131
132# Mux/Demux Plugins
133configure.args-append \
134    --disable-dvbpsi --enable-ogg --enable-mux_ogg \
135    --enable-mkv --disable-mod --disable-mpc --disable-shout
136
137# Codec Plugins
138configure.args-append \
139    --enable-a52 --enable-faad --enable-flac --disable-live555 \
140    --enable-opus --enable-vorbis --enable-ogg --enable-mad --disable-libass \
141    --enable-dca --enable-png --disable-quicktime --enable-twolame \
142    --disable-speex --enable-theora --enable-x264 --enable-postproc \
143    --enable-avcodec --enable-avformat --enable-swscale \
144    --enable-fluidsynth
145
146# Video Plugins
147configure.args-append \
148    --disable-caca --disable-sdl --disable-macosx-vout \
149    --without-x --disable-xcb --disable-xvideo --disable-glx \
150    --disable-fontconfig --disable-freetype --disable-fribidi \
151    --disable-svg
152
153# Audio Plugins
154configure.args-append \
155    --disable-macosx-audio --disable-jack --enable-samplerate
156
157# Interface Plugins
158configure.args-append \
159    --disable-macosx --disable-macosx-dialog-provider \
160    --disable-qt4 --enable-ncurses --disable-skins2
161
162# Visualisations and Video Filter Plugins
163configure.args-append \
164    --disable-goom
165
166# Service Discovery Plugins
167configure.args-append \
168    --enable-bonjour --enable-upnp
169
170variant jack description {Enable jack plugin for audio output} {
171    depends_lib-append      port:jack
172    configure.args-delete   --disable-jack
173    configure.args-append   --enable-jack
174}
175
176variant qtkit description {Enable qtcapture and qtaudio} {
177    configure.args-delete   --disable-macosx-qtkit
178    configure.args-append   --enable-macosx-qtkit
179
180    if {${os.major} < 10} {
181        ui_error "The +qtkit variant requires Snow Leopard or greater"
182        return -code error "incompatible Mac OS X version"
183    }
184}
185
186variant eyetv description {Enable eyetv plugin} {
187    configure.args-delete --disable-macosx-eyetv
188    configure.args-append --enable-macosx-eyetv
189}
190
191variant speex description {Enable Speex decoder support} {
192    depends_lib-append      path:lib/libspeex.dylib:speex
193    configure.args-delete   --disable-speex
194    configure.args-append   --enable-speex
195}
196
197variant svg description {Enable SVG support} {
198    depends_lib-append      port:librsvg
199    configure.args-delete   --disable-svg
200    configure.args-append   --enable-svg
201}
202
203variant shout description {Enable Shoutcast support} {
204    depends_lib-append      port:libshout2
205    configure.args-delete   --disable-shout
206    configure.args-append   --enable-shout
207}
208
209variant vcd description {Enable VCD support} {
210    depends_lib-append      port:vcdimager
211    configure.args-delete   --disable-vcdx
212    configure.args-append   --enable-vcdx
213}
214
215variant mod description {Enable MOD demuxer support} {
216    depends_lib-append      port:libmodplug
217    configure.args-delete   --disable-mod
218    configure.args-append   --enable-mod
219}
220
221variant mpc description {enable Musepack Decoder library support} {
222    depends_lib-append      port:libmpcdec
223    configure.args-delete   --disable-mpc
224    configure.args-append   --enable-mpc
225}
226
227variant dvb description {enable DVB Program Specific Information support} {
228    depends_lib-append      port:libdvbpsi
229    configure.args-delete   --disable-dvbpsi
230    configure.args-append   --enable-dvbpsi
231}
232
233variant osd description {Enable onscreen display and TrueType font support} {
234    depends_lib-append      port:fontconfig port:freetype
235    configure.args-delete   --disable-freetype --disable-fontconfig
236    configure.args-append   --enable-freetype --enable-fontconfig
237}
238
239variant fribidi requires osd description {Enable FriBidi Unicode support} {
240    depends_lib-append      port:fribidi
241    configure.args-delete   --disable-fribidi
242    configure.args-append   --enable-fribidi
243}
244
245variant sdl description {Enable SDL/SDL-Image support} {
246    depends_lib-append      path:lib/pkgconfig/sdl.pc:libsdl port:libsdl_image
247    configure.args-delete   --disable-sdl
248    configure.args-append   --enable-sdl
249}
250
251variant smb description {Enable Samba 3 support} {
252    depends_lib-append      port:samba3
253    configure.args-delete   --disable-smb
254    configure.args-append   --enable-smb
255    configure.ldflags-append    -L${prefix}/lib/samba3
256}
257
258variant x11 {
259    depends_lib-append \
260        port:mesa \
261        port:xorg-libXinerama \
262        port:xorg-libXv \
263        port:xorg-libXxf86vm \
264        port:xorg-xcb-util \
265        port:xorg-xcb-util-keysyms
266
267    configure.args-delete   --without-x --disable-xvideo --disable-glx --disable-xcb
268    configure.args-append   --with-x --x-include=${prefix}/include --x-lib=${prefix}/lib \
269                            --enable-xvideo --enable-glx --enable-xcb
270}
271
272variant qt4 description {Build using QT4 UI.  This will use qt4-mac} {
273    configure.args-delete   --disable-qt4
274    configure.args-append   --enable-qt4
275
276    PortGroup qt4 1.0
277
278    post-activate {
279        if {![variant_isset quartz]} {
280            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."
281        }
282    }
283}
284
285variant quartz {
286    depends_lib-append      port:BGHUDAppKit
287    configure.args-delete   --disable-macosx --disable-macosx-dialog-provider
288    configure.args-append   --enable-macosx --enable-macosx-dialog-provider
289}
290
291default_variants +mod +mpc +osd +quartz
292
293variant huge \
294    requires dvb eyetv fribidi jack mod mpc osd sdl shout speex svg vcd \
295    description {Enable all variants except quartz, qt4, smb, and x11} {}
296
297variant full \
298    requires huge qt4 quartz smb x11 \
299    description {Enable all variants} {}
300
301platform macosx {
302    if {${os.major} > 9} {
303        default_variants-append +qtkit
304    }
305
306    if {${os.major} == 9} {
307        # FIXME: x86_64 segfaults on Leopard on dlclose() ... not sure why
308        supported_archs i386 ppc
309    }
310
311    configure.args-delete \
312        --disable-macosx-vout --disable-macosx-audio \
313
314    configure.args-append \
315        --enable-macosx-vout --enable-macosx-audio \
316        --with-macosx-sdk=/
317
318    if {[variant_isset qt4] || [variant_isset quartz]} {
319        configure.args-delete --disable-macosx-vlc-app
320        configure.args-append --enable-macosx-vlc-app
321    }
322
323    post-patch {
324        reinplace "s/Appkit/AppKit/" ${worksrcpath}/configure.ac
325        reinplace "/Sparkle.framework/d" \
326            ${worksrcpath}/extras/package/macosx/vlc.xcodeproj/project.pbxproj
327        reinplace "/SDKROOT/d" \
328            ${worksrcpath}/extras/package/macosx/vlc.xcodeproj/project.pbxproj
329        reinplace "/Growl.framework/d" \
330            ${worksrcpath}/extras/package/macosx/package.mak
331
332        reinplace "s:LD_LIBRARY_PATH:DYLD_LIBRARY_PATH:g" \
333            ${worksrcpath}/Makefile.am
334
335        reinplace "/argv/s/environ/*_NSGetEnviron()/" \
336            ${worksrcpath}/modules/misc/inhibit/xdg.c \
337            ${worksrcpath}/modules/stream_filter/decomp.c
338
339        reinplace "s/extern char \\*\\*environ;/#include <crt_externs.h>/" \
340            ${worksrcpath}/modules/misc/inhibit/xdg.c \
341            ${worksrcpath}/modules/stream_filter/decomp.c
342
343        ln -s ${frameworks_dir}/BGHUDAppKit.framework ${worksrcpath}/contrib/BGHUDAppKit.framework
344
345        # To trick configure
346        file mkdir "${worksrcpath}/contrib/lib"
347    }
348
349    post-destroot {
350        eval file delete [glob ${destroot}${prefix}/lib/vlc/plugins/*.la]
351
352        if {[variant_isset qt4] || [variant_isset quartz]} {
353            file rename ${worksrcpath}/VLC.app ${destroot}${applications_dir}/VLC.app
354
355            # These are already in ${prefix}, so we don't need to bundle them as well
356            file delete -force ${destroot}${applications_dir}/VLC.app/Contents/Frameworks
357            file delete -force ${destroot}${applications_dir}/VLC.app/Contents/lib
358
359            # There's no need to install these into the bundle and the prefix
360            file delete -force ${destroot}${applications_dir}/VLC.app/Contents/MacOS/include
361            file delete -force ${destroot}${applications_dir}/VLC.app/Contents/MacOS/lib
362            file delete -force ${destroot}${applications_dir}/VLC.app/Contents/MacOS/plugins
363
364            # http://trac.macports.org/ticket/35131
365            ln -s ${prefix}/lib ${destroot}${applications_dir}/VLC.app/Contents/MacOS/lib
366            ln -s ${prefix}/lib/vlc/plugins ${destroot}${applications_dir}/VLC.app/Contents/MacOS/plugins
367        }
368    }
369}
Note: See TracBrowser for help on using the repository browser.