Ticket #54064: mlt.diff

File mlt.diff, 5.4 KB (added by RJVB (René Bertin), 7 years ago)
  • multimedia/mlt/Portfile

    old new  
    55
    66name                mlt
    77epoch               3
    8 version             6.4.1
     8version             6.4.1 ; revision 2
    99categories          multimedia
    1010maintainers         dennedy.org:dan gmail.com:rjvbertin openmaintainer
    1111license             GPL-2+
     
    3939} else {
    4040    conflicts       ${name}
    4141    PortGroup       qt5 1.0
    42     if {[info procs qt5.depends_component] eq ""} {
    43         # A procedure to indicate dependencies on Qt components that are not
    44         # included in the default dependency declared by the Qt5 PortGroup.
    45         # It allows to specify those dependencies without having to handle
    46         # the appropriate path-style declarations that work against every Qt5 port
    47         # (currently port:qt5, port:qt55, "soon" port:qt5-kde too.)
    48         # A complete version of this procedure will be provided by the Qt5 PG
    49         # after qt5-kde is introduced. Provide a simplified version in the meantime.
    50         proc qt5.depends_component {first args} {
    51             global os.major
    52             # join ${first} and (the optional) ${args}
    53             set args [linsert $args[set list {}] 0 ${first}]
    54             # select the Qt5 port prefix, depending on OS version and which Qt5 port is installed
    55             if {${os.major} == 11} {
    56                 set qt5pprefix  "qt55"
     42    if {[info procs qt5.active_version] eq ""} {
     43        proc qt5.active_version {} {
     44            global prefix
     45            if {[file exists ${prefix}/bin/pkg-config]} {
     46                set av [exec ${prefix}/bin/pkg-config --modversion Qt5Core]
     47                return ${av}
    5748            } else {
    58                 set qt5pprefix  "qt5"
    59             }
    60             foreach comp ${args} {
    61                 if {${comp} eq "qt5"} {
    62                     # in case one needs an explicit dependency on the Qt5 main port itself:
    63                     depends_lib-append port:${qt5pprefix}
    64                 } else {
    65                     set portname "${qt5pprefix}-${comp}"
    66                     depends_lib-append port:${portname}
    67                 }
     49                return 0.0.0
    6850            }
    6951        }
    7052    }
    7153
    7254    qt5.depends_component \
    7355                    qtsvg
     56    if {[vercmp [qt5.active_version] 5.7.0] >= 0} {
     57        configure.cxxflags-append \
     58                    -stdlib=libc++ \
     59                    -std=c++11
     60    }
    7461}
    7562
    7663depends_build-append port:git \
     
    8774                    port:libxml2 \
    8875                    port:libexif
    8976
     77if {[variant_isset opencv]} {
     78    PortGroup       active_variants 1.1
     79    if {${subport} eq "${name}"} {
     80        require_active_variants opencv qt4
     81    } else {
     82        require_active_variants opencv qt5
     83    }
     84}
     85
     86# cherrypicked commit from the next release that fixes a crash-on-exit issue
     87# in recent Kkdenlive versions.
     88patchfiles-append   patch-commit-a3188e3.diff
     89
    9090# NB: qt-includedir can and should be set to ${qt_includes_dir},
    9191# not ${qt_includes_dir}/Qt !!
    9292configure.args-append \
     
    9696                    --disable-jackrack \
    9797                    --disable-mmx \
    9898                    --disable-gtk2 \
    99                     --disable-swfdec
     99                    --disable-swfdec \
     100                    --disable-opencv
    100101
    101102platform darwin 10 {
    102103    if {${build_arch} eq "x86_64"} {
     
    108109configure.cflags-append     "-I${qt_includes_dir}"
    109110configure.ldflags-delete    "-L${prefix}/lib"
    110111
     112# make sure the build system actually sees our settings by amending the toplevel config.mak.
     113post-configure {
     114    set config.mak [open ${worksrcpath}/config.mak "a"]
     115    puts ${config.mak} "CC=${configure.cc}"
     116    puts ${config.mak} "CXX=${configure.cxx}"
     117    puts ${config.mak} "CFLAGS+=${configure.cflags} ${configure.cppflags}"
     118    puts ${config.mak} "CXXFLAGS+=${configure.cxxflags} ${configure.cppflags}"
     119    puts ${config.mak} "LDLAGS+=${configure.ldflags}"
     120    close ${config.mak}
     121}
     122
    111123build.args-append           CC="${configure.cc}" CXX="${configure.cxx}" CPP="${configure.cpp}"
    112124
    113125if {[variant_isset universal]} {
     
    127139    depends_lib-append      port:gtk2
    128140}
    129141
     142variant gpl3 description {enable GPLv3 components} {
     143    configure.args-append   --enable-gpl3
     144    license                 GPL-3+
     145}
     146
     147# use an opencv variant to avoid opportunistic dependencies on this library
     148# the opencv dependency must match our choice of Qt version, which is
     149# another reason why opencv support is provided through a variant.
     150variant opencv description {enable OpenCV support} {
     151    depends_lib-append      port:opencv
     152    configure.args-delete   --disable-opencv
     153}
     154
     155# Allow building without SDL support, useful when used in dependents that themselves
     156# depend on SDL2, to avoid (warnings about) runtime conflicts. It can be hoped that
     157# one day MLT will support SDL2 too.
     158variant disable_sdl description {disable SDL support to avoid SDL vs. SDL2 conflicts} {
     159    patchfiles-append       patch-no-sdl.diff
     160    configure.args-append   --disable-sdl
     161    configure.cppflags-append \
     162                            -DMELT_NOSDL
     163    depends_lib-delete \
     164                            port:libsdl \
     165                            port:libsdl_image
     166}
     167
    130168livecheck.type      regex
    131169livecheck.url       http://sourceforge.net/projects/${name}/files/
    132170livecheck.regex     /${name}-(\[0-9.\]+)${extract.suffix}