# -*- 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
# $Id: Portfile 92837 2012-05-09 00:51:48Z ryandesign@macports.org $

PortSystem          1.0

name                mkvtoolnix
version             5.0.1
revision            1
categories          multimedia
maintainers         nomaintainer
license             GPL-2+ LGPL-2.1+

description         Matroska media files manipulation tools.
long_description    mkvtoolnix will evolve to a set of tools to create, \
                    alter and inspect Matroska files under Linux and other \
                    Unices, just what the OGMtools do for the OGM format.
homepage            http://www.bunkus.org/videotools/mkvtoolnix/
platforms           darwin
master_sites        ${homepage}sources/ \
                    http://svn.mandriva.com/svn/packages/cooker/mkvtoolnix/releases/${version}/1/SOURCES/
use_bzip2           yes

# g++-4.2: -E, -S, -save-temps and -M options are not allowed with multiple -arch flags
universal_variant   no

checksums           rmd160  3c6220a1ff304a18e4d7125d6981966c3e9d368e \
                    sha256  eecc48d17c0583b6b071e710bfe88ae09439bd99bb90c694a2fed0651bb08f19

# As of 4.7.0, mkvtoolnix uses internal static libmatroska and libebml.

depends_lib         port:boost \
                    port:bzip2 \
                    port:expat \
                    port:file \
                    port:flac \
                    port:gettext \
                    port:libogg \
                    port:libvorbis \
                    port:lzo2 \
                    port:pcre \
                    port:zlib

build.cmd           ./drake
build.target        default
build.args          -j${build.jobs}

configure.args      --mandir=${prefix}/share/man \
                    --with-boost=${prefix} \
                    --with-extra-libs=${prefix}/lib \
                    --with-extra-includes=${prefix}/include \
                    --disable-gui \
                    --disable-wxwidgets

variant wxwidgets description {Build with the wxWidgets GUI} {
    depends_lib-append port:wxWidgets

    # wxWidgets is 32-bit only
    supported_archs i386 ppc

    configure.args-delete \
        --diable-gui \
        --disable-wxwidgets
    configure.args-append \
        --enable-gui \
        --enable-wxwidgets
}
