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

name                qsynth
version             0.5.7
revision            2
maintainers         {gmail.com:rjvbertin @RJVB} openmaintainer
categories          audio
platforms           {darwin > 9}
license             GPL-2+
conflicts           qsynth-qt4

description         A fluidsynth GUI front-end application
long_description    Qsynth is a fluidsynth GUI front-end application, written in C++ using the Qt framework. \
                    Eventually it may evolve into a softsynth management application allowing the user to \
                    control and manage a variety of command line softsynths.

homepage            https://qsynth.sourceforge.io
master_sites        sourceforge:project/${name}/${name}/${version}

checksums           rmd160  feeebed368c7224d3c980db9efb0c30e9ab3ff75 \
                    sha256  86eef57606423f4a369d130c3e222d7f847ba1c57d2e7eefb4c0c8a7102735a2 \
                    size    315715

qt5.depends_build_component \
                    qttools

depends_lib-append \
                    port:fluidsynth

variant gm description {Use the MIDI instrument patches from port:fluid-soundfont} {
    depends_run-append \
                    port:fluid-soundfont
}
variant gu description {Use the MIDI instrument patches from port:generaluser-soundfont} {
    depends_run-append \
                    port:generaluser-soundfont
}
default_variants    +gu

patchfiles-append   patch-src-CMakeLists.txt.diff

configure.args-append \
                    -DBUNDLE_INSTALL_DIR=${qt_apps_dir}

if {${os.platform} eq "darwin"} {
    post-destroot {
        if {[info procs qt5.add_app_wrapper] ne ""} {
           qt5.add_app_wrapper qsynth
        }
    }
} else {
    cmake.install_rpath-prepend \
                    ${qt_libs_dir} \
                    ${prefix}/lib/${build_arch}-linux-gnu
}