Ticket #47192: VLC221-20150504.diff

File VLC221-20150504.diff, 28.0 KB (added by RJVB (René Bertin), 9 years ago)
  • multimedia/VLC/Portfile

    old new  
    11# -*- 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# 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;
    23# $Id: Portfile 133968 2015-03-16 09:49:19Z petr@macports.org $
    34
    45PortSystem          1.0
    56PortGroup           compiler_blacklist_versions 1.0
    67
    78name                VLC
    8 version             2.1.5
    9 revision            4
    10 categories          multimedia
    11 
    12 maintainers         gmail.com:rjvbertin openmaintainer
    13 description         VLC is a cross-platform media player and streaming server
    14 long_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.
    19 license             GPL
     9version             2.2.1
    2010
    21 platforms           darwin
    22 conflicts           VLC-devel
    2311
    24 homepage            http://www.videolan.org
     12categories          multimedia devel
     13
     14subport             lib${name} {
     15    maintainers         gmail.com:rjvbertin openmaintainer
     16    description         the core engine and interface to VLC's multimedia framework
     17    long_description    libVLC is the core engine and the interface to the multimedia \
     18                        framework on which VLC media player is based.  It allows developers \
     19                        to create a wide range of multimedia applications using the VLC features.
     20    conflicts           ${name} VLC-devel libVLC-devel
     21    homepage            http://www.videolan.org/vlc/libvlc.html
     22}
     23
     24if {${subport} ne "lib${name}"} {
     25    maintainers         nomaintainer
     26    description         VLC is a cross-platform media player and streaming server
     27    long_description    VLC media player is a highly portable multimedia player for \
     28                        various audio and video formats (MPEG-1, MPEG-2, MPEG-4, DivX, \
     29                        mp3, ogg, ...) as well as DVDs, VCDs, and various streaming protocols. \
     30                        It can also be used as a server to stream in unicast or multicast \
     31                        in IPv4 or IPv6 on a high-bandwidth network.
     32    conflicts           lib${name} libVLC-devel VLC-devel
     33    homepage            http://www.videolan.org
     34}
    2535
    26 # http://git.videolan.org/?p=vlc.git
    27 # http://git.videolan.org/?p=vlc.git;a=forks
    28 #fetch.type          git
    29 #git.url             git://git.videolan.org/vlc/vlc-2.1.git
    30 #git.url             git://git.videolan.org/vlc.git
    31 #git.branch          edd88358218f273fddde646a172a2104796d46c2
     36license             GPL
     37
     38platforms           darwin
    3239
    3340master_sites        http://download.videolan.org/pub/videolan/vlc/${version}/
    3441distname            vlc-${version}
    3542use_xz              yes
    3643
    37 checksums           md5     3941b561f590cc95ca5e795213cba2f2 \
    38                     sha1    7f1cb6324a04cf393896bbb5976ca9febd7b3efc \
    39                     rmd160  4a18210f0f01ac8dfaf166926ab10eea6d97fbae
     44checksums           rmd160  3b199e3555e8aa52a760a9ed7b89874c782e0dff \
     45                    sha256  543d9d7e378ec0fa1ee2e7f7f5acf8c456c7d0ecc32037171523197ef3cf1fcb
     46
     47# Enable HFS compression.
     48depends_extract-append      port:libarchive
     49extract.post_args           "| bsdtar -x -k --hfsCompression"
    4050
    4151depends_build       port:pkgconfig
    4252
    43 depends_lib         \
     53depends_lib         port:a52dec \
     54                    port:avahi \
     55                    port:bzip2 \
     56                    port:faad2 \
     57                    path:lib/libavcodec.dylib:ffmpeg \
     58                    port:flac \
     59                    port:fluidsynth \
     60                    port:fontconfig \
     61                    port:freetype \
     62                    port:fribidi \
     63                    port:gettext \
     64                    path:lib/pkgconfig/glib-2.0.pc:glib2 \
     65                    port:gmp \
     66                    port:gnutls \
    4467                    port:jpeg \
    4568                    port:lame \
     69                    port:libass \
     70                    port:libbluray \
     71                    port:libcddb \
    4672                    port:libcdio \
     73                    port:libdc1394 \
     74                    port:libdca \
     75                    port:libdvbpsi \
     76                    port:libdvdnav \
     77                    port:libdvdread \
    4778                    port:libebml \
    4879                    port:libgcrypt \
     80                    port:libgpg-error \
     81                    port:libiconv \
    4982                    port:libid3tag \
     83                    port:libidn \
     84                    port:libmad \
    5085                    port:libmatroska \
     86                    port:libmodplug \
     87                    port:libmpcdec \
    5188                    port:libmpeg2 \
     89                    port:libmtp \
     90                    port:libogg \
     91                    port:libopus \
     92                    port:libpng \
     93                    port:libproxy \
     94                    port:libsamplerate \
     95                    port:libsdl \
     96                    port:libsdl_image \
     97                    port:libsndfile \
     98                    port:libssh2 \
     99                    port:libtheora \
     100                    port:libupnp \
     101                    port:libusb \
     102                    port:libvorbis \
    52103                    port:libxml2 \
     104                    port:live555 \
     105                    port:lua \
     106                    port:ncurses \
     107                    port:nettle \
     108                    port:opencv \
    53109                    port:openjpeg15 \
     110                    port:openssl \
     111                    port:orc \
     112                    port:p11-kit \
     113                    port:readline \
     114                    port:schroedinger \
     115                    port:speex \
    54116                    port:taglib \
    55117                    port:tiff \
    56 
    57 # TODO: live555 opencv FreeRDP
     118                    port:twolame \
     119                    port:vcdimager \
     120                    port:x264
    58121
    59122# VLC-2.1 and later are x86_64-only: https://trac.videolan.org/vlc/ticket/8161
    60123universal_variant   no
     
    72135patchfiles          buildfix-package.mak.patch \
    73136                    configure.ac-no-arch.patch \
    74137                    PR-34741-no__clang_version__.patch \
    75                     class_struct.patch \
    76                     qtkit.patch \
    77138                    static_assert.patch \
    78139                    no-sparkle.patch \
    79                     patch-ffmpeg-2.4.diff
     140                    patch-vlc-no-O4.diff
    80141
    81142post-patch {
    82143    reinplace "s:librsvg-2/librsvg:librsvg:" \
     
    101162# gl.c:121:3: error: Platform not recognized.
    102163configure.cppflags-append -D__unix__=1
    103164
     165# live555 is installed to a weird location
     166configure.cppflags-append -I${prefix}/lib/live/liveMedia/include
     167
    104168build.target        all
    105169destroot.target     install
    106170
     
    108172livecheck.regex     <a href=\"(\\d\[\\d|\.|\\w\]+).*/\">
    109173
    110174# Other
    111 
    112 depends_lib-append  port:gnutls \
    113                     port:lua
    114 
    115175configure.args-append \
    116176                    --with-contrib=${worksrcpath}/contrib \
    117                     --enable-shared \
    118                     --disable-debug \
    119                     --disable-update-check \
    120                     --disable-dbus \
    121                     --disable-growl \
    122                     --disable-macosx-vlc-app \
    123                     --disable-notify \
    124                     --enable-gnutls \
    125                     --enable-lua
     177                    --disable-debug --disable-update-check --enable-gnutls \
     178                    --disable-notify --disable-dbus --enable-lua \
     179                    --disable-gnomevfs --disable-growl --disable-macosx-vlc-app
    126180
    127181# Input Plugins
    128 # build fails when FreeRDP is installed
    129 # build fails when opencv is installed
    130 
    131 depends_lib-append  \
    132                     port:libbluray \
    133                     port:libcddb \
    134                     port:libdc1394 \
    135                     port:libdvdnav \
    136                     port:libdvdread \
    137                     port:libssh2
    138 
    139182configure.args-append \
    140                     --disable-decklink \
    141                     --disable-dv1394 \
    142                     --disable-gnomevfs \
    143                     --disable-libfreerdp \
    144                     --disable-libvnc \
    145                     --disable-linsys \
    146                     --disable-macosx-eyetv \
    147                     --disable-macosx-qtkit \
    148                     --disable-macosx-avfoundation \
    149                     --disable-opencv \
    150                     --disable-realrtsp \
    151                     --disable-smbclient \
    152                     --disable-v4l2 \
    153                     --disable-vcdx \
    154                     --enable-bluray \
    155                     --enable-dc1394 \
    156                     --enable-dvdnav \
    157                     --enable-dvdread \
    158                     --enable-libcddb \
    159                     --enable-sftp \
    160                     --enable-vcd
     183                    --enable-dvdnav --enable-dvdread --disable-smbclient --enable-vcdx \
     184                    --disable-macosx-qtkit --disable-macosx-eyetv --disable-realrtsp \
     185                    --disable-freerdp --enable-opencv --enable-sftp
    161186
    162187# Mux/Demux Plugins
    163 depends_lib-append \
    164                     port:libogg
    165 
    166188configure.args-append \
    167                     --disable-dvbpsi \
    168                     --disable-gme \
    169                     --disable-mod \
    170                     --disable-mpc \
    171                     --disable-sid \
    172                     --disable-shout \
    173                     --enable-mkv \
    174                     --enable-mux_ogg \
    175                     --enable-ogg
     189                    --enable-dvbpsi --enable-ogg --enable-mux_ogg \
     190                    --enable-mkv --enable-mod --enable-mpc --disable-shout
    176191
    177192# Codec Plugins
    178 
    179 depends_lib-append  \
    180                     port:a52dec \
    181                     path:lib/libavcodec.dylib:ffmpeg \
    182                     port:libdca \
    183                     port:dirac \
    184                     port:faad2 \
    185                     port:flac \
    186                     port:fluidsynth \
    187                     port:libmad \
    188                     port:libopus \
    189                     port:libpng \
    190                     port:schroedinger \
    191                     port:libtheora \
    192                     port:twolame \
    193                     port:libvorbis \
    194                     port:x264
    195 
    196 
    197193configure.args-append \
    198                     --disable-crystalhd \
    199                     --disable-dxva2 \
    200                     --disable-fdkaac \
    201                     --disable-kate \
    202                     --disable-libass \
    203                     --disable-libva \
    204                     --disable-live555 \
    205                     --disable-omxil \
    206                     --disable-omxil-vout \
    207                     --disable-quicksync \
    208                     --disable-quicktime \
    209                     --disable-rpi-omxil \
    210                     --disable-speex \
    211                     --disable-tiger \
    212                     --disable-wma-fixed \
    213                     --disable-shine \
    214                     --disable-zvbi \
    215                     --enable-a52 \
    216                     --enable-avcodec \
    217                     --enable-avformat \
    218                     --enable-dca \
    219                     --enable-dirac \
    220                     --enable-faad \
    221                     --enable-flac \
    222                     --enable-fluidsynth \
    223                     --enable-mad \
    224                     --enable-opus \
    225                     --enable-png \
    226                     --enable-postproc \
    227                     --enable-schroedinger \
    228                     --enable-swscale \
    229                     --enable-telx \
    230                     --enable-theora \
    231                     --enable-twolame \
    232                     --enable-vorbis \
    233                     --enable-x264
    234 
    235 # Video Plugins
     194                    --enable-a52 --enable-faad --enable-flac --enable-live555 \
     195                    --enable-opus --enable-vorbis --enable-ogg --enable-mad --enable-libass \
     196                    --enable-dca --enable-png --disable-quicktime --enable-twolame \
     197                    --enable-speex --enable-theora --enable-x264 --enable-postproc \
     198                    --enable-avcodec --enable-avformat --enable-swscale \
     199                    --disable-fluidsynth --enable-schroedinger
    236200
     201# Video Plugins. We do our best to deactivate X11 and disable its auto-detection by
     202# claiming the headers and libs are somewhere they're not.
    237203configure.args-append \
    238                     --without-x \
    239                     --disable-aa \
    240                     --disable-caca \
    241                     --disable-egl \
    242                     --disable-fontconfig \
    243                     --disable-freetype \
    244                     --disable-fribidi \
    245                     --disable-gles1 \
    246                     --disable-gles2 \
    247                     --disable-glx \
    248                     --disable-macosx-vout \
    249                     --disable-sdl \
    250                     --disable-sdl-image \
    251                     --disable-svg \
    252                     --disable-vdpau \
    253                     --disable-xcb \
    254                     --disable-xvideo
     204                    --disable-caca --enable-sdl --enable-sdl-image \
     205                    --without-x --disable-xcb --disable-xvideo --disable-glx \
     206                    --x-includes=${destroot} --x-libraries=${destroot} \
     207                    --enable-freetype --enable-fontconfig --enable-fribidi \
     208                    --disable-svg
    255209
    256210# Audio Plugins
    257 depends_lib-append  \
    258                     port:libsamplerate
    259 
    260211configure.args-append \
    261                     --disable-chromaprint  \
    262                     --disable-macosx-audio \
    263                     --enable-samplerate \
    264                     --disable-jack \
    265                     --disable-pulse
     212                    --disable-jack --enable-samplerate --disable-pulse
    266213
    267214# Interface Plugins
    268 depends_lib-append  \
    269                     port:ncurses
    270 
    271215configure.args-append \
    272                     --disable-macosx \
    273                     --disable-macosx-dialog-provider \
    274                     --disable-qt \
    275                     --disable-skins2 \
    276                     --enable-ncurses
     216                    --disable-macosx --disable-macosx-dialog-provider \
     217                    --disable-qt --enable-ncurses --disable-skins2
    277218
    278219# Visualisations and Video Filter Plugins
    279220configure.args-append \
    280                     --disable-goom \
    281                     --disable-projectm \
    282                     --disable-vsxu
     221                    --disable-goom
    283222
    284223# Service Discovery Plugins
    285 depends_lib-append  \
    286                     port:avahi \
    287                     port:libupnp
    288 
    289224configure.args-append \
    290                     --disable-mtp \
    291                     --disable-udev \
    292                     --enable-bonjour \
    293                     --enable-upnp
     225                    --enable-bonjour --enable-upnp
     226
     227# 20150209: Jack really would require a newer variant than what's currently in MacPorts
     228variant jack description {Enable jack and fluidsynth plugins for audio output} {
     229    depends_lib-append      port:jack port:fluidsynth port:portaudio
     230    configure.args-delete   --disable-jack --disable-fluidsynth
     231    configure.args-append   --enable-jack --enable-fluidsynth
     232}
    294233
    295234variant dbus description {Enable DBus support} {
    296235    depends_lib-append      port:dbus
    297     configure.args-delete   --disable-dbus
     236    configure.args-delete   --disable-dbus 
    298237    configure.args-append   --enable-dbus
    299238}
    300239
    301 variant pulse description {Enable PulseAudio support} {
    302     depends_lib-append      port:pulseaudio
    303     configure.args-delete   --disable-pulse
    304     configure.args-append   --enable-pulse
    305 }
    306 
    307 variant eyetv description {Enable eyetv plugin} {
    308     configure.args-delete --disable-macosx-eyetv
    309     configure.args-append --enable-macosx-eyetv
    310 }
    311 
    312 variant dvb description {enable DVB Program Specific Information support} {
    313     depends_lib-append      port:libdvbpsi
    314     configure.args-delete   --disable-dvbpsi
    315     configure.args-append   --enable-dvbpsi
    316 }
    317 
    318 variant fribidi requires osd description {Enable FriBidi Unicode support} {
    319     depends_lib-append      port:fribidi
    320     configure.args-delete   --disable-fribidi
    321     configure.args-append   --enable-fribidi
    322 }
    323 
    324 variant jack description {Enable jack plugin for audio output} {
    325     depends_lib-append      port:jack
    326     configure.args-delete   --disable-jack
    327     configure.args-append   --enable-jack
    328 }
    329 
    330 variant mod description {Enable MOD demuxer support} {
    331     depends_lib-append      port:libmodplug
    332     configure.args-delete   --disable-mod
    333     configure.args-append   --enable-mod
    334 }
    335 
    336 variant mpc description {enable Musepack Decoder library support} {
    337     depends_lib-append      port:libmpcdec
    338     configure.args-delete   --disable-mpc
    339     configure.args-append   --enable-mpc
    340 }
    341 
    342 variant osd description {Enable onscreen display and TrueType font support} {
    343     depends_lib-append      port:fontconfig port:freetype
    344     configure.args-delete   --disable-freetype --disable-fontconfig
    345     configure.args-append   --enable-freetype --enable-fontconfig
    346 }
    347 
    348240variant qtkit description {Enable qtcapture and qtaudio} {
    349241    configure.args-delete   --disable-macosx-qtkit
    350242    configure.args-append   --enable-macosx-qtkit
    351243}
    352244
    353 variant sdl description {Enable SDL/SDL-Image support} {
    354     depends_lib-append      port:libsdl port:libsdl_image
    355     configure.args-delete   --disable-sdl
    356     configure.args-append   --enable-sdl
     245variant svg description {Enable SVG support} {
     246    depends_lib-append      port:librsvg
     247    configure.args-delete   --disable-svg
     248    configure.args-append   --enable-svg
    357249}
    358250
    359 variant shout description {Enable Shoutcast support} {
     251variant shout description {Enable Shoutcast/Icecast streaming output support} {
    360252    depends_lib-append      port:libshout2
    361253    configure.args-delete   --disable-shout
    362254    configure.args-append   --enable-shout
    363255}
    364256
    365 variant smb description {Enable Samba 3 support} {
     257variant smb description {Enable Samba 3 input support} {
    366258    depends_lib-append      port:samba3
    367259    configure.args-delete   --disable-smbclient
    368260    configure.args-append   --enable-smbclient
    369261    configure.ldflags-append    -L${prefix}/lib/samba3
    370262}
    371263
    372 variant speex description {Enable Speex decoder support} {
    373     depends_lib-append      path:lib/libspeex.dylib:speex
    374     configure.args-delete   --disable-speex
    375     configure.args-append   --enable-speex
    376 }
    377 
    378 variant svg description {Enable SVG support} {
    379     depends_lib-append      port:librsvg
    380     configure.args-delete   --disable-svg
    381     configure.args-append   --enable-svg
    382 }
    383 
    384 variant vcd description {Enable VCD support} {
    385     depends_lib-append      port:vcdimager
    386     configure.args-delete   --disable-vcdx
    387     configure.args-append   --enable-vcdx
     264variant pulse description {Enable PulseAudio support} {
     265    depends_lib-append      port:pulseaudio
     266    configure.args-delete   --disable-pulse
     267    configure.args-append   --enable-pulse
    388268}
    389269
    390270variant x11 {
    391271    depends_lib-append \
     272        port:xorg-libX11 \
     273        port:xorg-libXau \
     274        port:xorg-libXdmcp \
     275        port:xorg-libXext \
     276        port:xorg-libXrandr \
     277        port:xorg-libxcb \
     278        port:xrender \
     279        port:XviD \
    392280        port:mesa \
    393281        port:xorg-libXinerama \
    394282        port:xorg-libXv \
     
    396284        port:xorg-xcb-util \
    397285        port:xorg-xcb-util-keysyms
    398286
    399     configure.args-delete   --without-x \
    400                             --disable-glx \
    401                             --disable-xcb \
    402                             --disable-xvideo
    403     configure.args-append   --with-x \
    404                             --x-include=${prefix}/include \
    405                             --x-lib=${prefix}/lib \
    406                             --enable-glx \
    407                             --enable-xcb \
    408                             --enable-xvideo
    409 }
    410 
    411 variant qt4 description {Build using QT4 UI. This will use qt4-mac} {
    412     configure.args-delete   --disable-qt
    413     configure.args-append   --enable-qt
    414     patchfiles-append       patch-vlc-qt4mac.diff
     287    configure.args-delete   --without-x --disable-xvideo --disable-glx --disable-xcb \
     288                            --x-includes=${destroot} --x-libraries=${destroot}
     289    configure.args-append   --with-x --enable-xvideo --enable-xcb
     290}
    415291
    416     PortGroup qt4 1.0
     292if {${subport} ne "lib${name}"} {
     293    variant qt4 conflicts qt5 description {Build using Qt4 UI. This will use qt4-mac. Experimental and probably dysfunctional} {
     294        patchfiles-append       patch-vlc-no-qt5.diff \
     295                                patch-vlc-qt-configureac.diff \
     296                                patch-simplepreferences.diff
    417297
    418     post-activate {
    419         if {![variant_isset quartz]} {
    420             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."
    421         }
     298        configure.args-delete   --disable-qt
     299        configure.args-append   --enable-qt
     300
     301        PortGroup               qt4 1.0
     302    }
     303    variant qt5 conflicts qt4 description {Build using Qt5 UI. This will use qt5-mac. Experimental and probably dysfunctional} {
     304        patchfiles-append       patch-vlc-qt-configureac.diff \
     305                                patch-simplepreferences.diff
     306
     307        configure.args-delete   --disable-qt
     308        configure.args-append   --enable-qt
     309
     310        PortGroup               qt5 1.0
    422311    }
    423312}
    424313
    425314variant quartz {
    426     patchfiles-append       patch-vlc-for-macports.diff
    427 
    428     depends_lib-append      port:BGHUDAppKit
    429315    depends_lib-delete      port:libsamplerate
     316    depends_lib-append      port:BGHUDAppKit
     317
     318    patchfiles-append       patch-vlc-for-macports.diff \
     319                            patch-ignore-libGL.diff
     320
    430321    configure.args-delete   --disable-macosx \
    431                             --disable-macosx-avfoundation \
    432                             --enable-samplerate
    433                            
    434     configure.args-append   --enable-macosx \
    435                             --enable-macosx-avfoundation
     322                            --enable-samplerate --disable-realrtsp
     323    configure.args-append   --enable-macosx
    436324    # taken from VLC's own configure.sh script for OS X:
    437325    configure.args-append   --disable-samplerate \
    438326                            --enable-merge-ffmpeg \
    439                             --enable-realrtsp \
    440                             --enable-libass
     327                            --enable-realrtsp
    441328}
    442329
    443 default_variants +mod +mpc +osd +quartz
     330# FreeRDP currently doesn't build with CMake >= 3.1 (#47389)
     331variant freerdp description {Build the FreeRDP support; currently dysfunctional} {
     332    depends_lib-append          port:FreeRDP
     333    # access/rdp.c:45:11: fatal error: 'freerdp/version.h' file not found
     334    configure.cppflags-append   -DFREERDP_INTERFACE_VERSION -DFREERDP_VERSION_MAJOR=1 -DFREERDP_VERSION_MINOR=1
     335    configure.args-delete --disable-freerdp
     336    configure.args-append --enable-freerdp
     337}
    444338
    445339variant huge \
    446     requires dvb eyetv fribidi jack mod mpc osd sdl shout speex svg vcd pulse \
    447         description {Enable all variants except quartz, qt4, smb, and x11} {}
     340    requires jack shout svg vcd \
     341    description {Enable all variants except quartz, smb, freerdp and x11} {}
    448342
    449 variant full \
    450     requires huge qt4 quartz smb x11 \
    451         description {Enable all variants} {}
     343if {${subport} ne "lib${name}"} {
     344    variant full \
     345        requires huge quartz smb x11 \
     346        description {Enable all variants except x11 (and except freerdp, currently)} {}
     347} else {
     348    variant full \
     349        requires huge quartz smb \
     350        description {Enable all variants (except freerdp, currently)} {}
     351}
    452352
    453353platform macosx {
    454     default_variants-append +qtkit
     354    default_variants-append +quartz +qtkit
    455355
    456356    configure.args-delete \
    457         --disable-macosx-vout --disable-macosx-audio \
     357        --disable-macosx-eyetv
    458358
    459359    configure.args-append \
    460         --enable-macosx-vout --enable-macosx-audio \
    461         --with-macosx-sdk=/
     360        --enable-macosx-eyetv
    462361
    463     if {[variant_isset qt4] || [variant_isset quartz]} {
     362    if {${subport} ne "lib${name}"} {
    464363        configure.args-delete --disable-macosx-vlc-app
    465364        configure.args-append --enable-macosx-vlc-app
    466365    }
     
    494393    post-destroot {
    495394        eval file delete [glob ${destroot}${prefix}/lib/vlc/plugins/*/*.la]
    496395
    497         if {[variant_isset qt4] || [variant_isset quartz]} {
    498             file rename ${worksrcpath}/VLC.app ${destroot}${applications_dir}/VLC.app
    499 
    500             # These are already in ${prefix}, so we don't need to bundle them as well
    501             file delete -force ${destroot}${applications_dir}/VLC.app/Contents/Frameworks
    502             file delete -force ${destroot}${applications_dir}/VLC.app/Contents/lib
    503 
    504             # There's no need to install these into the bundle and the prefix
    505             file delete -force ${destroot}${applications_dir}/VLC.app/Contents/MacOS/include
    506             file delete -force ${destroot}${applications_dir}/VLC.app/Contents/MacOS/lib
    507             file delete -force ${destroot}${applications_dir}/VLC.app/Contents/MacOS/plugins
    508 
    509             # http://trac.macports.org/ticket/35131
    510             ln -s ${prefix}/lib ${destroot}${applications_dir}/VLC.app/Contents/MacOS/lib
    511             ln -s ${prefix}/lib/vlc/plugins ${destroot}${applications_dir}/VLC.app/Contents/MacOS/plugins
    512             # the vlc executable needs to be started with a full path to the app bundle executable
    513             # or else the Mac OS X interface will hang beyond even a ^C or ^\ :
    514             file delete ${destroot}${prefix}/bin/vlc
    515             set vlc [open "${workpath}/vlc" "w"]
    516             puts ${vlc} "#!/bin/sh"
    517             puts ${vlc} ""
    518             puts ${vlc} "exec ${applications_dir}/VLC.app/Contents/MacOS/VLC \"$@\""
    519             close ${vlc}
    520             xinstall -m 755 ${workpath}/vlc ${destroot}${prefix}/bin
     396        if {[variant_isset qt4] || [variant_isset qt5] || [variant_isset quartz]} {
     397            if {${subport} ne "lib${name}"} {
     398                copy ${worksrcpath}/VLC.app ${destroot}${applications_dir}/VLC.app
     399
     400                # These are already in ${prefix}, so we don't need to bundle them as well
     401                delete ${destroot}${applications_dir}/VLC.app/Contents/Frameworks
     402                delete ${destroot}${applications_dir}/VLC.app/Contents/lib
     403
     404                # There's no need to install these into the bundle and the prefix
     405                delete ${destroot}${applications_dir}/VLC.app/Contents/MacOS/include
     406                delete ${destroot}${applications_dir}/VLC.app/Contents/MacOS/lib
     407                delete ${destroot}${applications_dir}/VLC.app/Contents/MacOS/plugins
     408
     409                # http://trac.macports.org/ticket/35131
     410                ln -s ${prefix}/lib ${destroot}${applications_dir}/VLC.app/Contents/MacOS/lib
     411                ln -s ${prefix}/lib/vlc/plugins ${destroot}${applications_dir}/VLC.app/Contents/MacOS/plugins
     412
     413                # the vlc executable needs to be started with a full path to the app bundle executable
     414                # or else the Mac OS X interface will hang beyond even a ^C or ^\ :
     415                move ${destroot}${prefix}/bin/vlc ${destroot}${prefix}/bin/vlc.exe
     416                xinstall -m 755 ${filespath}/vlc ${destroot}${prefix}/bin
     417                reinplace "s|@APPLICATIONS_DIR@|${applications_dir}|g" ${destroot}${prefix}/bin/vlc
     418            } else {
     419                delete ${destroot}${prefix}/bin
     420                delete ${destroot}${prefix}/share/applications
     421                delete ${destroot}${prefix}/share/man
     422            }
     423        }
     424    }
     425    post-activate {
     426        if {[variant_isset qt4] || [variant_isset qt5]} {
     427            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."
    521428        }
     429        system "${prefix}/lib/vlc/vlc-cache-gen -f ${prefix}/lib/vlc"
    522430    }
    523431}