# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4

PortSystem              1.0
PortGroup               active_variants 1.1
PortGroup               compiler_blacklist_versions 1.0
PortGroup               legacysupport 1.1
PortGroup               openssl 1.0

name                    VLC2

platforms               {darwin < 16}

categories              multimedia devel
maintainers             {@barracuda156 gmail.com:vital.had} \
                        openmaintainer

description             VLC is a cross-platform media player and streaming server
long_description        VLC media player is a highly portable multimedia player for \
                        various audio and video formats (MPEG-1, MPEG-2, MPEG-4, DivX, \
                        mp3, ogg, ...) as well as DVDs, VCDs, and various streaming protocols. \
                        It can also be used as a server to stream in unicast or multicast \
                        in IPv4 or IPv6 on a high-bandwidth network.

homepage                https://www.videolan.org

subport lib${name} {
    description         The core engine and interface to VLC's multimedia framework
    long_description    libVLC is the core engine and the interface to the multimedia \
                        framework on which VLC media player is based. It allows developers \
                        to create a wide range of multimedia applications using the VLC features.
    conflicts           ${name}
    homepage            https://www.videolan.org/vlc/libvlc.html
}

if {${subport} eq ${name}} {
    conflicts           lib${name}
}

# Let's see what OS versions this port really builds on. IOW, leave the commented-
# out code as placeholders and edit or delete based on feedback from the wild.
# Background: because of overall building wonkyness, port:VLC (3.x) now installs
# the app bundle from the official distribution DMG, and runs on 10.7 and upwards.
# However, VLC2 still has some benefits, such as giving control over the proxy to
# be used for streaming (VLC 3 only supports using the system proxy, which is known
# to break access to certain streaming sites; google it). The 2 versions can co-exist.

universal_variant       no

##
###################  ports VLC2 and libVLC2  ###################
##
if {(${subport} eq ${name}) || (${subport} eq "lib${name}")} {
    version             2.2.8
    revision            23
    license             GPL-2+

    master_sites        https://download.videolan.org/pub/videolan/vlc/${version}/
    distname            vlc-${version}
    use_xz              yes
    use_xcode           yes

    checksums           rmd160  4434e91384520fe1fe129a52f5d66d61e4404a9a \
                        sha256  9bf046848fb56d93518881b39099b8288ee005d5ba0ddf705b6f6643b8d562ec \
                        size    22137276

    depends_build-append \
                        path:bin/pkg-config:pkgconfig

    depends_lib-append  port:a52dec \
                        port:avahi \
                        port:bzip2 \
                        port:faad2 \
                        path:lib/libavcodec.dylib:ffmpeg \
                        port:flac \
                        port:fontconfig \
                        port:freetype \
                        port:fribidi \
                        port:gettext \
                        path:lib/pkgconfig/glib-2.0.pc:glib2 \
                        port:gmp \
                        path:lib/pkgconfig/gnutls.pc:gnutls \
                        port:lame \
                        path:lib/pkgconfig/libass.pc:libass \
                        port:libbluray \
                        port:libcddb \
                        port:libcdio \
                        port:libdc1394 \
                        port:libdca \
                        port:libdvbpsi \
                        port:libdvdnav \
                        port:libdvdread \
                        port:libebml \
                        port:libgcrypt \
                        port:libgpg-error \
                        port:libiconv \
                        port:libid3tag \
                        port:libidn \
                        path:include/turbojpeg.h:libjpeg-turbo \
                        port:libmad \
                        port:libmatroska \
                        port:libmodplug \
                        port:libmpcdec \
                        port:libmpeg2 \
                        port:libmtp \
                        port:libogg \
                        port:libopus \
                        port:libpng \
                        port:libproxy \
                        port:libsamplerate \
                        port:libsdl \
                        port:libsdl_image \
                        port:libsndfile \
                        port:libssh2 \
                        port:libtheora \
                        port:libupnp \
                        path:lib/pkgconfig/libusb-1.0.pc:libusb \
                        port:libvorbis \
                        path:lib/pkgconfig/vpx.pc:libvpx \
                        port:libxml2 \
                        port:live555 \
                        port:minizip \
                        port:ncurses \
                        port:nettle \
                        port:openjpeg15 \
                        port:orc \
                        port:p11-kit \
                        port:readline \
                        port:schroedinger \
                        port:speex \
                        port:speexDSP \
                        port:taglib \
                        port:tiff \
                        port:twolame \
                        port:vcdimager \
                        port:x264 \
                        port:x265 \
                        port:xz \
                        port:zlib \
                        port:zvbi

    depends_run-append  port:libaacs \
                        port:libbdplus

    # Make libVLC2 and libVLC(3) co-installable.
    set vlcprefix       ${prefix}/libexec/vlc2
    configure.pre_args-replace \
                        --prefix=${prefix} \
                        --prefix=${vlcprefix}
    configure.args-append \
                        --bindir=${prefix}/bin

    depends_lib-append  port:lua

    # Some plugins require C++11
    compiler.cxx_standard       2011
    # fatal error: 'stdatomic.h' file not found
    # ld: Assertion failed: (name != NULL), function Fixup,
    # file /Library/Caches/com.apple.xbs/Sources/ld64/ld64-253.9/src/ld/ld.hpp
    compiler.blacklist-append   {clang < 800}

    patchfiles          patch-buildsystem.diff \
                        PR-34741-no__clang_version__.patch \
                        no-sparkle.patch \
                        patch-vlc-no-O4.diff \
                        patch-soundfont-path.diff

    # Cherry-picked from:
    # https://github.com/videolan/vlc/commit/667c3a73b19d056821ba7a64420a4623aae40222
    # https://github.com/videolan/vlc/commit/ab00e6c59d42e05ab08893091783d8b5febc0058
    # https://github.com/videolan/vlc/commit/87724691c899a02d94fb64a3ef16868d65f3551b
    # https://github.com/videolan/vlc/commit/77b86f4452be4dbe0d56a9cd1b66da61b116da60
    # Needed at least to fix gcc14 build.
    patchfiles-append   backport-fixes.patch

    if {[string match *clang* ${configure.compiler}]} {
        patchfiles-append \
                        patch-static_assert.diff \
                        patch-buildsystem-fp-flags.diff
        configure.cflags-append \
                        -Wno-incompatible-function-pointer-types
        configure.cxxflags-append \
                        -Wno-reserved-user-defined-literal
    } elseif {[string match *gcc* ${configure.compiler}]} {
        patchfiles-append \
                        0001-Fixes-for-modern-GCC.patch
    }

    # FFMpeg 3 compatibility (see attributions in the patchfile)
    patchfiles-append   patch-ffmpeg3-compat.diff

    platform darwin {
        patchfiles-append \
                        patch-vda-ffmpeg34+.diff
        if {${os.major} < 11} {
            patchfiles-append \
                        0002-Do-not-build-a-broken-securetransport-module.patch \
                        0003-Fix-macosx.m-in-video_output.patch \
                        0004-Makefile.am-avoid-breaking-destroot.patch \
                        0005-Do-not-err-out-on-no-acceleration.patch
        }
        patchfiles-append \
                        0006-Enable-gnutls-on-macOS.patch

        # Notice, VLC2 assumes SDL1, not SDL2. It will not build against SDL2,
        # unless needed changes are backported.
        patchfiles-append \
                        0007-Allow-SDL-out.patch
    }

    # https://bugs.gentoo.org/795798
    patchfiles-append   0008-Get-addr-by-ref.-from-getConnectionEndpointAddress.patch

    # FFMpeg 4 compatibility (by RJVB)
    patchfiles-append   patch-ffmpeg4-compat.diff

    # libx264 api changed slightly
    patchfiles-append   patch-modules-codec-x264-new-api.diff \
                        patch-build-on-post-1012.diff \
                        patch-vlc-for-macports.diff

    patchfiles-append   patch-for-lua53.diff

    # Make 10.12 and later ignore all QTKit code in modules/gui/macosx/open.m
    patchfiles-append   patch-really-no-qtkit.diff

    # Only needed on < 10.6, since kCFNetworkProxiesHTTP* and AudioComponent*
    # are unavailable. We fall back to an earlier code.
    if {${os.platform} eq "darwin" && ${os.major} < 10} {
        patchfiles-append \
                        patch-AudioComponent.diff \
                        patch-SystemConfiguration.diff
    }

    if {![info exists replaced_by]} {
        post-patch {
            if {[string match *clang* ${configure.cxx}] && ${configure.cxx_stdlib} == "libc++"} {
                reinplace "s:-lstdc\+\+:-lc++:" \
                    ${worksrcpath}/modules/access/Makefile.am
            }

            reinplace "s|@PREFIX@|${prefix}|g" ${worksrcpath}/modules/codec/fluidsynth.c
        }
    }

    # Do autoreconf only the first time around
    use_autoreconf      [expr ![file exists ${worksrcpath}/config.status]]
    autoreconf.cmd      ./bootstrap
    autoreconf.pre_args
    autoreconf.args
    depends_build-append port:autoconf port:automake port:libtool

    # live555 is installed to a weird location.
    # Explicit linking to OpenSSL is needed for its module to build.
    configure.env-append \
                        "CXXCPP=${configure.cxx} -E" \
                        "LIVE555_CFLAGS=-I${prefix}/lib/live/BasicUsageEnvironment/include \
                                -I${prefix}/lib/live/groupsock/include \
                                -I${prefix}/lib/live/liveMedia/include \
                                -I${prefix}/lib/live/UsageEnvironment/include" \
                        "LIVE555_LIBS=-L${prefix}/lib/live/BasicUsageEnvironment -lBasicUsageEnvironment \
                                -L${prefix}/lib/live/groupsock -lgroupsock \
                                -L${prefix}/lib/live/liveMedia -lliveMedia \
                                -L${prefix}/lib/live/UsageEnvironment -lUsageEnvironment \
                                -L[openssl::install_area]/lib -lssl -lcrypto" \
                        "MATROSKA_CFLAGS=-I${prefix}/include/ebml" \
                        "MATROSKA_LIBS=-lmatroska -lebml" \
                        "SDL_CFLAGS=-I${prefix}/include/SDL" \
                        "SDL_LIBS=-lSDL"

    build.args-append   DESTDIR=${worksrcpath}/dest_ignore V=1

    # gl.c:121:3: error: Platform not recognized.
    configure.cppflags-append -D__unix__=1

    # Configure options: misc
    configure.args-append \
                        --disable-atmo \
                        --disable-debug \
                        --disable-dbus \
                        --disable-gnomevfs \
                        --disable-growl \
                        --disable-macosx-vlc-app \
                        --disable-notify \
                        --disable-update-check \
                        --enable-gnutls \
                        --enable-lua \
                        --with-contrib=${worksrcpath}/contrib

    # Input Plugins
    configure.args-append \
                        --disable-freerdp \
                        --disable-macosx-eyetv \
                        --disable-macosx-qtkit \
                        --disable-opencv \
                        --disable-realrtsp \
                        --disable-smbclient \
                        --enable-dvdnav \
                        --enable-dvdread \
                        --enable-sftp \
                        --enable-vcdx

    # Mux/Demux Plugins
    configure.args-append \
                        --disable-shout \
                        --enable-dvbpsi \
                        --enable-mkv \
                        --enable-mod \
                        --enable-mpc \
                        --enable-mux_ogg \
                        --enable-ogg

    # Codec Plugins
    configure.args-append \
                        --disable-fluidsynth \
                        --disable-gst-decode \
                        --disable-quicktime \
                        --enable-a52 \
                        --enable-avcodec \
                        --enable-avformat \
                        --enable-dca \
                        --enable-faad \
                        --enable-flac \
                        --enable-libass \
                        --enable-live555 \
                        --enable-mad \
                        --enable-ogg \
                        --enable-opus \
                        --enable-png \
                        --enable-postproc \
                        --enable-schroedinger \
                        --enable-speex \
                        --enable-swscale \
                        --enable-theora \
                        --enable-twolame \
                        --enable-vorbis \
                        --enable-vpx \
                        --enable-x264 \
                        --enable-x265

    # Video Plugins. We do our best to deactivate X11 and disable its auto-detection
    # by claiming the headers and libs are somewhere they're not.
    configure.args-append \
                        --disable-caca \
                        --disable-svg \
                        --disable-svgdec \
                        --disable-xcb \
                        --disable-xvideo \
                        --enable-fontconfig \
                        --enable-freetype \
                        --enable-fribidi \
                        --enable-sdl \
                        --enable-sdl-image \
                        --without-x \
                        --x-includes=${destroot} \
                        --x-libraries=${destroot}

    # Audio Plugins
    configure.args-append \
                        --disable-chromaprint \
                        --disable-jack \
                        --disable-pulse \
                        --enable-samplerate

    # Interface Plugins
    configure.args-append \
                        --disable-macosx \
                        --disable-macosx-dialog-provider \
                        --disable-qt \
                        --disable-skins2 \
                        --disable-vnc \
                        --enable-ncurses

    # Visualisations and Video Filter Plugins
    configure.args-append \
                        --disable-goom

    # Service Discovery Plugins
    configure.args-append \
                        --enable-bonjour \
                        --enable-upnp

    # Screen module uses CGDisplayCreateImageForRect which exists in 10.6+:
    if {${os.platform} eq "darwin" && ${os.major} < 10} {
        configure.args-append \
                        --disable-screen
    }

    platform macosx {
        # taken from VLC's own configure.sh script for OS X:
        configure.args-replace  --disable-realrtsp --enable-realrtsp
    }

    variant aalib description "Enable AA-lib support" {
        depends_lib-append      port:aalib
        configure.args-append   --enable-aa
    }

    variant dbus description "Enable DBus support" {
        depends_lib-append      port:dbus
        configure.args-replace  --disable-dbus --enable-dbus
    }

    variant fluidsynth description "Enable FluidSynth support" {
        depends_lib-append      port:fluidsynth
        configure.args-replace  --disable-fluidsynth --enable-fluidsynth
    }

    # VLC is not currently compatible with FreeRDP 2
    variant freerdp description "Build the FreeRDP support; currently dysfunctional" {
        depends_lib-append      port:FreeRDP
        # access/rdp.c:45:11: fatal error: 'freerdp/version.h' file not found
        configure.cppflags-append \
                                -DFREERDP_INTERFACE_VERSION \
                                -DFREERDP_VERSION_MAJOR=2 \
                                -DFREERDP_VERSION_MINOR=0
        configure.args-replace  --disable-freerdp --enable-freerdp
    }

    # GStreamer variant builds, but not enabling by default until updated:
    # https://github.com/macports/macports-ports/pull/22425
    variant gstreamer description "Enable GStreamer support" {
        depends_lib-append      port:gstreamer1
        configure.args-replace  --disable-gst-decode --enable-gst-decode
    }

    # 20150209: Jack really would require a newer variant than what's currently in MacPorts
    # Also do not enable by default with gcc until this is fixed:
    # https://github.com/jackaudio/jack2/issues/950
    variant jack description "Enable jack plugin for audio output" {
        depends_lib-append      port:jack \
                                port:portaudio
        configure.args-replace  --disable-jack --enable-jack
    }

    variant notify description "Enable notifications via libnotify" {
        depends_lib-append      port:libnotify
        configure.args-replace  --disable-notify --enable-notify
    }

    variant pulse description "Enable PulseAudio support" {
        depends_lib-append      port:pulseaudio
        configure.args-replace  --disable-pulse --enable-pulse
    }

    if {${os.platform} eq "darwin" && ${os.major} <= 15} {
        # QTKit was disabled in 10.12 "Sierra"
        variant qtkit description "Enable qtcapture and qtaudio" {
            configure.args-replace \
                                --disable-macosx-qtkit --enable-macosx-qtkit
        }
    }

    variant shout description "Enable Shoutcast/Icecast streaming output support" {
        depends_lib-append      port:libshout2
        configure.args-replace  --disable-shout --enable-shout
    }

    variant smb description "Enable Samba 3 input support" {
        depends_lib-append      port:samba3
        configure.args-replace  --disable-smbclient --enable-smbclient
        configure.ldflags-append \
                                -L${prefix}/lib/samba3
    }

    variant svg description "Enable SVG rendering and decoding support" {
        depends_lib-append      path:lib/pkgconfig/librsvg-2.0.pc:librsvg
        configure.args-replace  --disable-svg --enable-svg \
                                --disable-svgdec --enable-svgdec
    }

    # Variants for graphics:
    variant qt4 conflicts quartz description "Enable Qt4 support" {
        PortGroup               qt4 1.0

        patchfiles-append       0009-Fix-for-Qt4-module.patch \
                                0010-Alt-fix-for-searchlineedit-in-Qt4.patch \

        configure.args-replace  --disable-qt --enable-qt
    }

    variant quartz conflicts qt4 x11 {
        depends_lib-append      port:BGHUDAppKit
        # SDL needs X11:
        # sdl.c: error: Xlib required due to XInitThreads
        depends_lib-delete      port:libsdl port:libsdl_image port:libsamplerate

        patchfiles-append       patch-fix-packaging.diff

        configure.args-replace  --disable-macosx --enable-macosx \
                                --disable-macosx-quartztext --enable-macosx-quartztext \
                                --enable-samplerate --disable-samplerate \
                                --enable-sdl --disable-sdl \
                                --enable-sdl-image --disable-sdl-image
        # taken from VLC's own configure.sh script for OS X:
        configure.args-append   --enable-merge-ffmpeg
    }

    variant x11 conflicts quartz {
        depends_lib-append \
            port:mesa \
            port:xorg-libX11 \
            port:xorg-libXau \
            port:xorg-libxcb \
            port:xorg-libXdmcp \
            port:xorg-libXext \
            port:xorg-libXinerama \
            port:xorg-libXrandr \
            port:xorg-libXv \
            port:xorg-libXxf86vm \
            port:xorg-xcb-util \
            port:xorg-xcb-util-keysyms \
            port:xrender \
            port:XviD

        configure.args-delete   --x-includes=${destroot} --x-libraries=${destroot}
        configure.args-replace  --disable-xcb --enable-xcb \
                                --without-x --with-x

        if {${os.platform} ne "darwin"} {
            # Xvideo output does not seem to be functional on macOS.
            configure.args-replace \
                                --disable-xvideo --enable-xvideo
        }
    }

    # This is a generic Unix-like installation:
    if {![variant_isset quartz]} {
        depends_lib-append      port:desktop-file-utils
    }

    # Combo variants:
    variant huge \
        requires aalib fluidsynth notify pulse jack shout svg \
        description "Enable all variants except freerdp, gstreamer, qt4, quartz, smb and x11" {}

    if {${subport} ne "lib${name}"} {
        variant full \
            requires huge quartz smb \
            description "Enable all variants except gstreamer, qt4 and x11 (and except freerdp, currently)" {}
    } else {
        variant full \
            requires huge quartz smb \
            description "Enable all variants except gstreamer, qt4 and x11 (and except freerdp, currently)" {}
    }

    # Variant for PowerPC systems:
    variant power \
        requires aalib fluidsynth notify pulse qt4 shout smb svg x11 \
        description "Enable all variants except dbus, freerdp, gstreamer, jack, qtkit and quartz" {}

    platform macosx {
        if {${configure.build_arch} in [list arm64 x86_64]} {
            default_variants-append +quartz
        } else {
            default_variants-append +x11 +qt4
        }

        if {${os.major} <= 15 && [variant_isset quartz]} {
            default_variants-append +qtkit
        }

        if {[string match macports-gcc* ${configure.compiler}]} {
            configure.objcflags-append \
                                -fobjc-exceptions
        }

        build.args-prepend      "XCODEFLAGS=-UseModernBuildSystem=NO"

        patchfiles-append       patch-use-NSGetEnviron.diff

        if {![info exists replaced_by]} {
            post-patch {
                reinplace "/Sparkle.framework/d" \
                    ${worksrcpath}/extras/package/macosx/vlc.xcodeproj/project.pbxproj
                reinplace "/SDKROOT/d" \
                    ${worksrcpath}/extras/package/macosx/vlc.xcodeproj/project.pbxproj
                reinplace "/Growl.framework/d" \
                    ${worksrcpath}/extras/package/macosx/package.mak
                reinplace "s:LD_LIBRARY_PATH:DYLD_LIBRARY_PATH:g" \
                    ${worksrcpath}/Makefile.am

                if {![file exists ${worksrcpath}/contrib/BGHUDAppKit.framework]} {
                    ln -s ${frameworks_dir}/BGHUDAppKit.framework ${worksrcpath}/contrib/BGHUDAppKit.framework
                }

                # To trick configure
                file mkdir "${worksrcpath}/contrib/lib"
            }
        }

        if {${os.major} > 10} {
            configure.args-replace \
                                --disable-macosx-eyetv --enable-macosx-eyetv

            if {${subport} ne "lib${name}"} {
                configure.args-replace \
                                --disable-macosx-vlc-app --enable-macosx-vlc-app
            }
        }

        if {${subport} ne "lib${name}" && ![variant_isset quartz]} {
            legacysupport.redirect_bins vlc vlc-wrapper
        }

        post-destroot {
            file delete {*}[glob ${destroot}${vlcprefix}/lib/vlc/plugins/*/*.la]

            if {[variant_isset quartz]} {
                if {${subport} ne "lib${name}"} {
                    copy ${worksrcpath}/VLC.app ${destroot}${applications_dir}/VLC2.app

                    # These are already in ${vlcprefix}, so we don't need to bundle them as well
                    delete ${destroot}${applications_dir}/VLC2.app/Contents/Frameworks
                    delete ${destroot}${applications_dir}/VLC2.app/Contents/lib

                    # There's no need to install these into the bundle and the prefix
                    delete ${destroot}${applications_dir}/VLC2.app/Contents/MacOS/include
                    delete ${destroot}${applications_dir}/VLC2.app/Contents/MacOS/lib
                    delete ${destroot}${applications_dir}/VLC2.app/Contents/MacOS/plugins
                    delete ${destroot}${applications_dir}/VLC2.app/Contents/MacOS/share/locale
                    delete ${destroot}${applications_dir}/VLC2.app/Contents/MacOS/share/lua

                    # http://trac.macports.org/ticket/35131
                    xinstall -m 755 -d ${destroot}${applications_dir}/VLC2.app/Contents/MacOS/lib
                    foreach l [glob -nocomplain ${destroot}${vlcprefix}/lib/*] {
                        ln -s ${vlcprefix}/lib/[file tail ${l}] ${destroot}${applications_dir}/VLC2.app/Contents/MacOS/lib
                    }
                    ln -s ${vlcprefix}/lib/vlc/plugins ${destroot}${applications_dir}/VLC2.app/Contents/MacOS/plugins
                    ln -s ${vlcprefix}/lib/vlc/lua ${destroot}${applications_dir}/VLC2.app/Contents/MacOS/share/lua
                    foreach d [glob -nocomplain ${destroot}${vlcprefix}/share/locale/*] {
                        set locale [file tail ${d}]
                        set ldir ${destroot}${applications_dir}/VLC2.app/Contents/MacOS/share/locale/${locale}/LC_MESSAGES
                        xinstall -m 755 -d ${ldir}
                        foreach m [glob -nocomplain ${d}/LC_MESSAGES/*] {
                            ln -s ${vlcprefix}/share/locale/${locale}/LC_MESSAGES/[file tail ${m}] ${ldir}/
                        }
                    }

                    # The VLC executable needs to be started with a full path to the app bundle executable
                    # or else the Mac OS X interface will hang beyond even a ^C or ^\ :
                    file delete ${destroot}${prefix}/bin/vlc
                    system "echo \"#!/bin/sh\nexec \\\"${applications_dir}/VLC2.app/Contents/MacOS/VLC\\\" \\\"\\\$\@\\\"\" > ${destroot}${prefix}/bin/vlc"
                    system "chmod 755 ${destroot}${prefix}/bin/vlc"
                    # Give all executables a suffix (--program-suffix would do that too but isn't supported
                    # in the Mac-specific autoconf install code).
                    foreach a [glob -nocomplain ${destroot}${prefix}/bin/*] {
                        file rename ${a} "${a}2"
                    }
                } else {
                    delete ${destroot}${prefix}/bin
                    delete ${destroot}${vlcprefix}/share/applications
                    delete ${destroot}${vlcprefix}/share/man
                }
            }
#             reinplace "s|prefix=${prefix}$|prefix=${vlcprefix}|g" \
#                 ${destroot}${vlcprefix}/lib/pkgconfig/libvlc.pc \
#                 ${destroot}${vlcprefix}/lib/pkgconfig/vlc-plugin.pc
        }
        post-activate {
            system "${vlcprefix}/lib/vlc/vlc-cache-gen -f ${vlcprefix}/lib/vlc"

            if {![variant_isset quartz]} {
                system "${prefix}/bin/update-desktop-database ${prefix}/share/applications"
                system "${prefix}/bin/update-mime-database ${prefix}/share/mime"
            }
        }
    }
    notes-append "MIDI support requires installing one or more SoundFont files,\
        in ${prefix}/share/sounds/sf2, for instance from port:generaluser-soundfont."

    livecheck.url   https://download.videolan.org/pub/videolan/vlc/
    livecheck.regex <a href=\"(\\d\[\\d|\.|\\w\]+).*/\">
}

# 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;