# -*- 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           cmake 1.1
PortGroup           github 1.0

github.setup        FluidSynth fluidsynth 2.0.5 v
categories          multimedia audio
maintainers         {gmail.com:rjvbertin @RJVB} {mojca @mojca} openmaintainer
license             LGPL

description         FluidSynth is a real-time software synthesizer based on the SoundFont 2 specifications.
long_description    FluidSynth is a cross-platform real-time software synthesizer with \
                    support for SoundFont 2 and a built-in command line shell. \
                    It may be used for playback of MIDI files, but also \
                    provides a shared library which can be used in other programs.

platforms           darwin

homepage            http://www.fluidsynth.org/

checksums           rmd160  aa16d4e0caec65819a574451525494084998c936 \
                    sha256  af29985642f98f66345d47f852ce08cdbf0ac69aaf7b97cfe49ff086bfc72976 \
                    size    1314639

depends_build-append \
                    port:pkgconfig \
                    port:gmake
depends_lib         port:flac \
                    port:gettext \
                    path:lib/pkgconfig/glib-2.0.pc:glib2 \
                    port:libiconv \
                    port:libogg \
                    port:libsndfile \
                    port:libvorbis \
                    port:ncurses \
                    port:portaudio \
                    port:readline

# https://trac.macports.org/ticket/36962
platform darwin 8 {
    patchfiles-append \
                    patch-tiger.diff
}

# respect MacPorts compiler for builing make_tables.exe
# see https://trac.macports.org/wiki/UsingTheRightCompiler
patchfiles-append   patch-external_project_cc.diff

configure.args-append \
                    -Denable-jack=OFF \
                    -Denable-dbus=OFF \
                    -Denable-pulseaudio=OFF \
                    -Denable-framework=OFF \
                    -DLIB_SUFFIX="" \
                    -DCMAKE_DISABLE_FIND_PACKAGE_Doxygen=ON

# support for JACK makes JACK output the default and requires the daemon to be running
variant jack description {Enable JACK support (requires the deamon to be running)} {
    depends_lib-append \
                    port:jack
    configure.args-replace \
                    -Denable-jack=OFF -Denable-jack=ON
}

variant dbus description {Enable D-Bus support} {
    depends_lib-append \
                    port:dbus
    configure.args-replace \
                    -Denable-dbus=OFF -Denable-dbus=ON
}