source: trunk/dports/multimedia/VLC/Portfile

Last change on this file was 148228, checked in by mps@…, 17 months ago

gnutls: update to version 3.4.11, bump to the current stable branch 3.4.x (#51147), rebuild dependents

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 18.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 148228 2016-04-30 17:55:10Z ryandesign@macports.org $
3
4PortSystem          1.0
5PortGroup           compiler_blacklist_versions 1.0
6PortGroup           active_variants 1.1
7
8# TODO
9# if {[file exists ${prefix}/etc/macports/locales.tcl]} {
10#     # experimental feature to cut down the NLS/locale files, which take up over 50% of
11#     # the install footprint for VLC. This feature loads the locale_select PortGroup
12#     # if its configuration file exist; a variant is then added which prunes all translations from
13#     # ${destroot}${prefix}/share/locale except those whitelisted in etc/macports/locales.tcl .
14#     PortGroup       locale_select 1.0
15# }
16
17name                VLC
18version             2.2.2
19revision            4
20
21categories          multimedia devel
22maintainers         nomaintainer
23
24description         VLC is a cross-platform media player and streaming server
25long_description    VLC media player is a highly portable multimedia player for \
26                    various audio and video formats (MPEG-1, MPEG-2, MPEG-4, DivX, \
27                    mp3, ogg, ...) as well as DVDs, VCDs, and various streaming protocols. \
28                    It can also be used as a server to stream in unicast or multicast \
29                    in IPv4 or IPv6 on a high-bandwidth network.
30
31homepage            http://www.videolan.org
32
33subport             lib${name} {
34    maintainers         gmail.com:rjvbertin openmaintainer
35    description         the core engine and interface to VLC's multimedia framework
36    long_description    libVLC is the core engine and the interface to the multimedia \
37                        framework on which VLC media player is based.  It allows developers \
38                        to create a wide range of multimedia applications using the VLC features.
39    conflicts           ${name} VLC-devel libVLC-devel
40    homepage            http://www.videolan.org/vlc/libvlc.html
41}
42
43if {${subport} eq ${name}} {
44    conflicts           lib${name} libVLC-devel VLC-devel
45}
46
47license             GPL-2
48
49platforms           darwin
50
51master_sites        http://download.videolan.org/pub/videolan/vlc/${version}/
52distname            vlc-${version}
53use_xz              yes
54
55checksums           rmd160  ff302536334622427e06250457c74f061d4329f8 \
56                    sha256  9ad23128be16f9b40ed772961272cb0748ed8e4aa1bc79c129e589feebea5fb5
57
58# Enable HFS compression.
59depends_extract-append      port:libarchive
60extract.post_args           "| bsdtar -x --hfsCompression"
61
62depends_build       port:pkgconfig
63
64depends_lib         port:a52dec \
65                    port:avahi \
66                    port:bzip2 \
67                    port:faad2 \
68                    path:lib/libavcodec.dylib:ffmpeg \
69                    port:flac \
70                    port:fluidsynth \
71                    port:fontconfig \
72                    port:freetype \
73                    port:fribidi \
74                    port:gettext \
75                    path:lib/pkgconfig/glib-2.0.pc:glib2 \
76                    port:gmp \
77                    port:gnutls \
78                    port:jpeg \
79                    port:lame \
80                    port:libass \
81                    port:libbluray \
82                    port:libcddb \
83                    port:libcdio \
84                    port:libdc1394 \
85                    port:libdca \
86                    port:libdvbpsi \
87                    port:libdvdnav \
88                    port:libdvdread \
89                    port:libebml \
90                    port:libgcrypt \
91                    port:libgpg-error \
92                    port:libiconv \
93                    port:libid3tag \
94                    port:libidn \
95                    port:libmad \
96                    port:libmatroska \
97                    port:libmodplug \
98                    port:libmpcdec \
99                    port:libmpeg2 \
100                    port:libmtp \
101                    port:libogg \
102                    port:libopus \
103                    port:libpng \
104                    port:libproxy \
105                    port:libsamplerate \
106                    port:libsdl \
107                    port:libsdl_image \
108                    port:libsndfile \
109                    port:libssh2 \
110                    port:libtheora \
111                    port:libupnp \
112                    port:libusb \
113                    port:libvorbis \
114                    port:libvpx \
115                    port:libxml2 \
116                    port:live555 \
117                    port:ncurses \
118                    port:nettle \
119                    port:opencv \
120                    port:openjpeg15 \
121                    path:lib/libssl.dylib:openssl \
122                    port:orc \
123                    port:p11-kit \
124                    port:readline \
125                    port:schroedinger \
126                    port:speex \
127                    port:taglib \
128                    port:tiff \
129                    port:twolame \
130                    port:vcdimager \
131                    port:x264 \
132                    port:x265
133
134# the +qt5 and/or +qt4 variants of port:opencv currently lead to build errors
135pre-configure {
136    if {![active_variants opencv "" {qt4 qt5}]} {
137        ui_error "${subport} cannot currently be built against port:opencv with the qt4 or qt5 variant.\
138        Install port:opencv without either qt variant and try again. This is only a build conflict; \
139        after building you can reactivate your preferred opencv variant"
140        return -code error "Install or activate port:opencv without a qt variant before building ${subport}"
141    }
142}
143
144# VLC 2.2.2 should have full Lua 5.3 compatibility, for now, depend on port:lua52
145# That requires the patch-for-lua52.diff which is appended to patchfiles below.
146# update 2.2.2 : lua 5.3 gives compiler syntax errors so we stick with 5.2 for now.
147depends_lib-append  port:lua52
148# depends_lib-append  port:lua
149
150# VLC-2.1 and later are x86_64-only: https://trac.videolan.org/vlc/ticket/8161
151universal_variant   no
152supported_archs     x86_64
153
154compiler.blacklist  gcc-4.2 llvm-gcc-4.2 {clang < 300}
155
156pre-fetch {
157    if {${os.platform} eq "darwin" && ${os.major} < 10} {
158        ui_error "${name} ${version} requires Mac OS X 10.6 or greater."
159        return -code error "incompatible Mac OS X version"
160    }
161}
162
163patchfiles          buildfix-package.mak.patch \
164                    configure.ac-no-arch.patch \
165                    PR-34741-no__clang_version__.patch \
166                    static_assert.patch \
167                    no-sparkle.patch \
168                    patch-vlc-no-O4.diff \
169                    patch-opencv_includes.diff
170
171# The opencv example apparently builds on 10.11 but I'm having issues with it on 10.9
172# it doesn't appear to be indispensable, so simply skip it.
173patchfiles-append   patch-no-opencv_example.diff
174
175post-patch {
176    reinplace "s:librsvg-2/librsvg:librsvg:" \
177        ${worksrcpath}/modules/text_renderer/svg.c
178
179    if {[string match *clang* ${configure.cxx}] && ${configure.cxx_stdlib} == "libc++"} {
180        reinplace "s:-lstdc\+\+:-lc++:" \
181            ${worksrcpath}/configure.ac \
182            ${worksrcpath}/modules/access/Makefile.am
183    }
184}
185
186use_autoreconf      yes
187autoreconf.cmd      ./bootstrap
188autoreconf.pre_args
189autoreconf.args
190depends_build-append port:libtool port:autoconf port:automake
191
192configure.env-append CXXCPP="${configure.cxx} -E"
193build.args-append    DESTDIR=${worksrcpath}/dest_ignore V=1
194
195# gl.c:121:3: error: Platform not recognized.
196configure.cppflags-append -D__unix__=1
197
198# live555 is installed to a weird location
199configure.cppflags-append -I${prefix}/lib/live/liveMedia/include
200
201build.target        all
202destroot.target     install
203
204livecheck.url       http://download.videolan.org/pub/videolan/vlc/
205livecheck.regex     <a href=\"(\\d\[\\d|\.|\\w\]+).*/\">
206
207# Other
208configure.args-append \
209                    --with-contrib=${worksrcpath}/contrib \
210                    --disable-debug --disable-update-check --enable-gnutls \
211                    --disable-notify --disable-dbus --enable-lua \
212                    --disable-gnomevfs --disable-growl --disable-macosx-vlc-app
213
214# Input Plugins
215configure.args-append \
216                    --enable-dvdnav --enable-dvdread --disable-smbclient --enable-vcdx \
217                    --disable-macosx-qtkit --disable-macosx-eyetv --disable-realrtsp \
218                    --disable-freerdp --enable-opencv --enable-sftp
219
220# Mux/Demux Plugins
221configure.args-append \
222                    --enable-dvbpsi --enable-ogg --enable-mux_ogg \
223                    --enable-mkv --enable-mod --enable-mpc --disable-shout
224
225# Codec Plugins
226configure.args-append \
227                    --enable-a52 --enable-faad --enable-flac --enable-live555 \
228                    --enable-opus --enable-vorbis --enable-ogg --enable-mad --enable-libass \
229                    --enable-dca --enable-png --disable-quicktime --enable-twolame \
230                    --enable-speex --enable-theora --enable-x264 --enable-x265 --enable-postproc \
231                    --disable-gst-decode --enable-avcodec --enable-avformat --enable-swscale \
232                    --disable-fluidsynth --enable-schroedinger --enable-vpx
233
234# Video Plugins. We do our best to deactivate X11 and disable its auto-detection by
235# claiming the headers and libs are somewhere they're not.
236configure.args-append \
237                    --disable-caca --enable-sdl --enable-sdl-image \
238                    --without-x --disable-xcb --disable-xvideo \
239                    --x-includes=${destroot} --x-libraries=${destroot} \
240                    --enable-freetype --enable-fontconfig --enable-fribidi \
241                    --disable-svg --disable-svgdec
242
243# Audio Plugins
244configure.args-append \
245                    --disable-jack \
246                    --enable-samplerate \
247                    --disable-pulse \
248                    --disable-chromaprint
249
250# Interface Plugins
251configure.args-append \
252                    --disable-macosx \
253                    --disable-macosx-dialog-provider \
254                    --disable-qt \
255                    --enable-ncurses \
256                    --disable-skins2 \
257                    --disable-vnc
258
259# Visualisations and Video Filter Plugins
260configure.args-append \
261                    --disable-goom
262
263# Service Discovery Plugins
264configure.args-append \
265                    --enable-bonjour \
266                    --enable-upnp
267
268# 20150209: Jack really would require a newer variant than what's currently in MacPorts
269variant jack description {Enable jack and fluidsynth plugins for audio output} {
270    depends_lib-append      port:jack port:fluidsynth port:portaudio
271    configure.args-delete   --disable-jack --disable-fluidsynth
272    configure.args-append   --enable-jack --enable-fluidsynth
273}
274
275variant dbus description {Enable DBus support} {
276    depends_lib-append      port:dbus
277    configure.args-replace  --disable-dbus --enable-dbus
278}
279
280variant qtkit description {Enable qtcapture and qtaudio} {
281    configure.args-replace  --disable-macosx-qtkit --enable-macosx-qtkit
282}
283
284variant svg description {Enable SVG rendering and decoding support} {
285    depends_lib-append      port:librsvg
286    configure.args-replace  --disable-svg --enable-svg
287    configure.args-replace  --disable-svgdec --enable-svgdec
288}
289
290variant shout description {Enable Shoutcast/Icecast streaming output support} {
291    depends_lib-append      port:libshout2
292    configure.args-replace  --disable-shout --enable-shout
293}
294
295variant smb description {Enable Samba 3 input support} {
296    depends_lib-append      port:samba3
297    configure.args-replace  --disable-smbclient --enable-smbclient
298    configure.ldflags-append    -L${prefix}/lib/samba3
299}
300
301variant pulse description {Enable PulseAudio support} {
302    depends_lib-append      port:pulseaudio
303    configure.args-replace  --disable-pulse --enable-pulse
304}
305
306variant x11 {
307    depends_lib-append \
308        port:xorg-libX11 \
309        port:xorg-libXau \
310        port:xorg-libXdmcp \
311        port:xorg-libXext \
312        port:xorg-libXrandr \
313        port:xorg-libxcb \
314        port:xrender \
315        port:XviD \
316        port:mesa \
317        port:xorg-libXinerama \
318        port:xorg-libXv \
319        port:xorg-libXxf86vm \
320        port:xorg-xcb-util \
321        port:xorg-xcb-util-keysyms
322
323    configure.args-delete   --without-x --disable-xvideo --disable-xcb \
324                            --x-includes=${destroot} --x-libraries=${destroot}
325    configure.args-append   --with-x --enable-xvideo --enable-xcb
326}
327
328if {${subport} ne "lib${name}"} {
329    variant qt4 conflicts qt5 description {Build using Qt4 UI. This will use qt4-mac. Experimental and probably dysfunctional} {
330        patchfiles-append       patch-vlc-no-qt5.diff \
331                                patch-vlc-qt-configureac.diff \
332                                patch-simplepreferences.diff
333
334        configure.args-replace  --disable-qt --enable-qt
335
336        PortGroup               qt4 1.0
337    }
338    variant qt5 conflicts qt4 description {Build using Qt5 UI. This will use qt5-mac. Experimental and probably dysfunctional} {
339        patchfiles-append       patch-vlc-qt-configureac.diff \
340                                patch-simplepreferences.diff
341
342        configure.args-replace  --disable-qt --enable-qt
343
344        PortGroup               qt5 1.0
345    }
346}
347
348variant quartz {
349    depends_lib-delete      port:libsamplerate
350    depends_lib-append      port:BGHUDAppKit
351
352    patchfiles-append       patch-vlc-for-macports.diff
353
354    configure.args-delete   --disable-macosx \
355                            --enable-samplerate \
356                            --disable-realrtsp
357    configure.args-append   --enable-macosx
358    # taken from VLC's own configure.sh script for OS X:
359    configure.args-append   --disable-samplerate \
360                            --enable-merge-ffmpeg \
361                            --enable-realrtsp
362}
363
364# FreeRDP currently doesn't build with CMake >= 3.1 (#47389)
365variant freerdp description {Build the FreeRDP support; currently dysfunctional} {
366    depends_lib-append          port:FreeRDP
367    # access/rdp.c:45:11: fatal error: 'freerdp/version.h' file not found
368    configure.cppflags-append   -DFREERDP_INTERFACE_VERSION \
369                                -DFREERDP_VERSION_MAJOR=1 \
370                                -DFREERDP_VERSION_MINOR=1
371    configure.args-replace      --disable-freerdp --enable-freerdp
372}
373
374variant huge \
375    requires jack shout svg \
376    description {Enable all variants except quartz, smb, freerdp and x11} {}
377
378if {${subport} ne "lib${name}"} {
379    variant full \
380        requires huge quartz smb x11 \
381        description {Enable all variants except x11 (and except freerdp, currently)} {}
382} else {
383    variant full \
384        requires huge quartz smb \
385        description {Enable all variants (except freerdp, currently)} {}
386}
387
388# this patchfile can probably go with VLC 2.2.2, or should be reviewed then.
389# update 2.2.2 : lua 5.3 gives compiler syntax errors so we stick with 5.2 for now.
390patchfiles-append           patch-for-lua52.diff
391
392platform macosx {
393    default_variants-append +quartz +qtkit
394
395    configure.args-replace  --disable-macosx-eyetv --enable-macosx-eyetv
396
397    if {${subport} ne "lib${name}"} {
398        configure.args-replace  --disable-macosx-vlc-app --enable-macosx-vlc-app
399    }
400
401    post-patch {
402        reinplace "s/Appkit/AppKit/" ${worksrcpath}/configure.ac
403        reinplace "/Sparkle.framework/d" \
404            ${worksrcpath}/extras/package/macosx/vlc.xcodeproj/project.pbxproj
405        reinplace "/SDKROOT/d" \
406            ${worksrcpath}/extras/package/macosx/vlc.xcodeproj/project.pbxproj
407        reinplace "/Growl.framework/d" \
408            ${worksrcpath}/extras/package/macosx/package.mak
409
410        reinplace "s:LD_LIBRARY_PATH:DYLD_LIBRARY_PATH:g" \
411            ${worksrcpath}/Makefile.am
412
413        reinplace "/argv/s/environ/*_NSGetEnviron()/" \
414            ${worksrcpath}/modules/misc/inhibit/xdg.c \
415            ${worksrcpath}/modules/stream_filter/decomp.c
416
417        reinplace "s/extern char \\*\\*environ;/#include <crt_externs.h>/" \
418            ${worksrcpath}/modules/misc/inhibit/xdg.c \
419            ${worksrcpath}/modules/stream_filter/decomp.c
420
421        if {![file exists ${worksrcpath}/contrib/BGHUDAppKit.framework]} {
422            ln -s ${frameworks_dir}/BGHUDAppKit.framework ${worksrcpath}/contrib/BGHUDAppKit.framework
423        }
424
425        # To trick configure
426        file mkdir "${worksrcpath}/contrib/lib"
427    }
428
429    post-destroot {
430        eval file delete [glob ${destroot}${prefix}/lib/vlc/plugins/*/*.la]
431
432        if {[variant_isset qt4] || [variant_isset qt5] || [variant_isset quartz]} {
433            if {${subport} ne "lib${name}"} {
434                copy ${worksrcpath}/VLC.app ${destroot}${applications_dir}/VLC.app
435
436                # These are already in ${prefix}, so we don't need to bundle them as well
437                delete ${destroot}${applications_dir}/VLC.app/Contents/Frameworks
438                delete ${destroot}${applications_dir}/VLC.app/Contents/lib
439
440                # There's no need to install these into the bundle and the prefix
441                delete ${destroot}${applications_dir}/VLC.app/Contents/MacOS/include
442                delete ${destroot}${applications_dir}/VLC.app/Contents/MacOS/lib
443                delete ${destroot}${applications_dir}/VLC.app/Contents/MacOS/plugins
444                delete ${destroot}${applications_dir}/VLC.app/Contents/MacOS/share/locale
445                delete ${destroot}${applications_dir}/VLC.app/Contents/MacOS/share/lua
446
447                # http://trac.macports.org/ticket/35131
448                ln -s ${prefix}/lib ${destroot}${applications_dir}/VLC.app/Contents/MacOS/lib
449                ln -s ${prefix}/lib/vlc/plugins ${destroot}${applications_dir}/VLC.app/Contents/MacOS/plugins
450                ln -s ${prefix}/lib/vlc/lua ${destroot}${applications_dir}/VLC.app/Contents/MacOS/share/lua
451                ln -s ${prefix}/share/locale ${destroot}${applications_dir}/VLC.app/Contents/MacOS/share/locale
452
453                # the vlc executable needs to be started with a full path to the app bundle executable
454                # or else the Mac OS X interface will hang beyond even a ^C or ^\ :
455                move ${destroot}${prefix}/bin/vlc ${destroot}${prefix}/bin/vlc.exe
456                system "echo \"#!/bin/sh\nexec \\\"${applications_dir}/VLC.app/Contents/MacOS/VLC\\\" \\\"\\\$\@\\\"\" > ${destroot}${prefix}/bin/vlc"
457                system "chmod 755 ${destroot}${prefix}/bin/vlc"
458            } else {
459                delete ${destroot}${prefix}/bin
460                delete ${destroot}${prefix}/share/applications
461                delete ${destroot}${prefix}/share/man
462            }
463        }
464    }
465    post-activate {
466        if {[variant_isset qt4] || [variant_isset qt5]} {
467            notes-append "The Qt interface modules for VLC are currently dysfunctional. If you encounter bugs with them, please file them with VLC and not MacPorts."
468        }
469        system "${prefix}/lib/vlc/vlc-cache-gen -f ${prefix}/lib/vlc"
470    }
471}
472
473# kate: backspace-indents true; indent-pasted-text true; indent-width 4; keep-extra-spaces true; remove-trailing-spaces modified; replace-tabs true; replace-tabs-save true; syntax Tcl/Tk; tab-indents true; tab-width 4;
Note: See TracBrowser for help on using the repository browser.