# -*- 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 75293 2011-01-20 05:01:33Z jmr@macports.org $

PortSystem          1.0
PortGroup           cmake 1.0
PortGroup           qt4 1.0

name                lmms
version             0.4.8
revision            1
categories          multimedia
maintainers         nomaintainer

description         Linux Multimedia Studio
long_description    Free alternative to popular programs such as FruityLoops, Cubase and Logic

homepage            http://lmms.sourceforge.net
platforms           darwin
master_sites        sourceforge
#parallel build seems broken :(
use_parallel_build  no
use_bzip2           yes
checksums           md5     8573b8376808c77c058cca3a57a36d8d \
                    sha1    851021270157d3eda15c6b6dae8a71ab47db24cd \
                    rmd160  8319667b7c65dc4b14022ebe2d76b39e11703f1f

depends_build-append port:pkgconfig
depends_lib-append  port:libsndfile \
                    path:lib/pkgconfig/sdl.pc:libsdl \
                    port:fftw-3-single \
                    port:fluidsynth \
                    port:jack

patchfiles          patch-qt-include.diff

# Disable zynaddsubfx plugin on x86_64 as the included fltk does not build
if {${configure.build_arch} == "x86_64"} {
    patchfiles-append patch-disable-zynaddsubfx.diff
}

# Use bundled libsamplerate due to link problems with the external library
configure.args-append -DWANT_SYSTEM_SR=OFF
# Disable VST because it is not supported on OS X
configure.args-append -DWANT_VST=OFF

configure.args-append -DWANT_ALSA=OFF \
                      -DWANT_PULSEAUDIO=OFF \
                      -DWANT_FFTW3F=ON \
                      -DWANT_SDL=ON \
                      -DWANT_OGGVORBIS=ON \
                      -DWANT_STK=OFF \
                      -DWANT_JACK=ON

platform darwin 8 {
    configure.ldflags-append -lpng -lz
}

livecheck.type      regex
livecheck.url       http://sourceforge.net/projects/${name}/files/
livecheck.regex     ${name}-(\[0-9.\]+)\\.tar
