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

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

VLC*: Add missing libgcrypt dependency (#39348)

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