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

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

VLC-devel: Bump to 2.1.0rc, build fixes for Lion and SL

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