source: trunk/dports/multimedia/VLC-devel/Portfile @ 102113

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

VLC*: Use compiler.blacklist

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 12.4 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 102113 2013-01-28 07:14:19Z 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 {[portconfigure::compiler_is_port ${configure.compiler}]} {
106    depends_build-append port:$portconfigure::compiler_name_map(${configure.compiler})
107    depends_skip_archcheck-append $portconfigure::compiler_name_map(${configure.compiler})
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 "s/Appkit/AppKit/" ${worksrcpath}/configure.ac
317        reinplace "/Sparkle.framework/d" \
318            ${worksrcpath}/extras/package/macosx/vlc.xcodeproj/project.pbxproj
319        reinplace "/SDKROOT/d" \
320            ${worksrcpath}/extras/package/macosx/vlc.xcodeproj/project.pbxproj
321        reinplace "/Growl.framework/d" \
322            ${worksrcpath}/extras/package/macosx/package.mak
323
324        reinplace "s:LD_LIBRARY_PATH:DYLD_LIBRARY_PATH:g" \
325            ${worksrcpath}/Makefile.am
326
327        reinplace "/argv/s/environ/*_NSGetEnviron()/" \
328            ${worksrcpath}/modules/misc/inhibit/xdg.c \
329            ${worksrcpath}/modules/stream_filter/decomp.c
330
331        reinplace "s/extern char \\*\\*environ;/#include <crt_externs.h>/" \
332            ${worksrcpath}/modules/misc/inhibit/xdg.c \
333            ${worksrcpath}/modules/stream_filter/decomp.c
334
335        ln -s ${frameworks_dir}/BGHUDAppKit.framework ${worksrcpath}/contrib/BGHUDAppKit.framework
336
337        # To trick configure
338        file mkdir "${worksrcpath}/contrib/lib"
339    }
340
341    post-destroot {
342        eval file delete [glob ${destroot}${prefix}/lib/vlc/plugins/*.la]
343
344        if {[variant_isset qt4] || [variant_isset quartz]} {
345            file rename ${worksrcpath}/VLC.app ${destroot}${applications_dir}/VLC.app
346
347            # These are already in ${prefix}, so we don't need to bundle them as well
348            file delete -force ${destroot}${applications_dir}/VLC.app/Contents/Frameworks
349            file delete -force ${destroot}${applications_dir}/VLC.app/Contents/lib
350
351            # There's no need to install these into the bundle and the prefix
352            file delete -force ${destroot}${applications_dir}/VLC.app/Contents/MacOS/include
353            file delete -force ${destroot}${applications_dir}/VLC.app/Contents/MacOS/lib
354            file delete -force ${destroot}${applications_dir}/VLC.app/Contents/MacOS/plugins
355
356            # http://trac.macports.org/ticket/35131
357            ln -s ${prefix}/lib ${destroot}${applications_dir}/VLC.app/Contents/MacOS/lib
358            ln -s ${prefix}/lib/vlc/plugins ${destroot}${applications_dir}/VLC.app/Contents/MacOS/plugins
359        }
360    }
361}
Note: See TracBrowser for help on using the repository browser.