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

name                sox
conflicts           play
version             14.4.2
revision            8
categories          audio
maintainers         nomaintainer
license             GPL-2+

description         Swiss Army knife of audio manipulation
long_description \
	SoX (also known as Sound eXchange) translates sound samples between \
	different file formats, and optionally applies various sound \
	effects. SoX is intended as the Swiss Army knife of sound processing \
	tools. It doesn't do anything very well, but sooner or later it \
	comes in very handy.

homepage            https://sox.sourceforge.net
master_sites        sourceforge:project/sox/sox/${version}
use_bzip2           yes
checksums           rmd160  738ac41a07f74f66e27cd642f786cc5815ca87ff \
                    sha256  81a6956d4330e75b5827316e44ae381e6f1e8928003c6aa45896da9041ea149c \
                    size    935449

conflicts           sox-ng

depends_build       path:bin/pkg-config:pkgconfig

patchfiles          curl.patch \
                    yosemite-libtool.patch \
                    warnings.patch

platform darwin 11 {
    # System grep fails: "grep: Regular expression too big"
    depends_build-append \
        port:grep
}

depends_lib	\
        port:flac \
        port:lame \
        port:libgsm \
        port:libiconv \
        port:libid3tag \
        port:libmad \
        port:libmagic \
        port:libogg \
        port:libopus \
        port:libpng \
        port:libsndfile \
        port:libvorbis \
        port:opusfile \
        port:twolame \
        port:wavpack \
        port:zlib

configure.args \
        --disable-openmp \
        --disable-silent-libtool \
        --disable-silent-rules \
        --enable-largefile \
        --enable-symlinks \
        --with-distro=macosx \
        --without-libltdl

# additional formats
configure.args-append \
        --with-flac \
        --with-gsm \
        --with-id3tag \
        --with-lame \
        --with-lpc10 \
        --with-mad \
        --with-magic \
        --with-mp3 \
        --with-oggvorbis \
        --with-opus \
        --with-png \
        --with-sndfile \
        --with-twolame \
        --with-wavpack \
        --without-amrnb \
        --without-amrwb \
        --without-ladspa

# output drivers
configure.args-append \
        --with-coreaudio \
        --without-alsa \
        --without-ao \
        --without-oss \
        --without-pulseaudio \
        --without-sndio \
        --without-sunaudio \
        --without-waveaudio
