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

PortSystem          1.0
PortGroup           cxx11 1.0

name                quickfix
version             1.14.3
license             Permissive
# http://www.quickfixengine.org/quickfix/doc/html/license.html
categories          devel finance
platforms           darwin
maintainers         gmail.com:rstachowiak openmaintainer

description         FIX engine implementation

long_description    QuickFIX is a full-featured open source FIX engine, \
                    currently compatible with the FIX 4.0-4.4 spec.

homepage            http://www.quickfixengine.org/
master_sites        sourceforge:project/quickfix/quickfix/${version}
worksrcdir          ${name}

checksums           rmd160  369d5bf7044fa4c90d2d74e4470e50c0ad82951b \
                    sha256  f6e8bdb004eaf45e50f63005b8c2611cb0afd42cf70f110f600c852aa572342d

depends_lib         port:libxml2

patchfiles          patch-UnitTest++-Makefile.diff

post-patch {
    reinplace "s|@CXX@|${configure.cxx}|g" ${worksrcpath}/UnitTest++/Makefile
    reinplace "s|@ARCHFLAGS@|[get_canonical_archflags cxx]|g" ${worksrcpath}/UnitTest++/Makefile
}

configure.args      --with-java \
                    --with-mysql-config=false \
                    --without-postgresql \
                    --without-python \
                    --without-ruby
configure.env       "JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Home"

post-destroot {
    xinstall -m 755 -d ${destroot}${prefix}/share/${name}/sql
    copy ${worksrcpath}/src/sql/postgresql ${destroot}${prefix}/share/${name}/sql
}

variant postgresql84 conflicts postgresql90 description {Include PostgreSQL 8.4 support} {
    depends_lib-append      port:postgresql84
    configure.args-replace  --without-postgresql --with-postgresql=${prefix}/lib/postgresql84/bin/pg_config
}

variant postgresql90 conflicts postgresql84 description {Include PostgreSQL 9.0 support} {
    depends_lib-append      port:postgresql90
    configure.args-replace  --without-postgresql --with-postgresql=${prefix}/lib/postgresql90/bin/pg_config
}

# To be removed after January 2017
variant python requires python27 description {Legacy compatibility variant} {}

variant python27 conflicts python34 python35 description {Include Python 2.7 support} {
    depends_lib-append      port:python27
    configure.python        ${prefix}/bin/python2.7
    configure.args-replace  --without-python --with-python
}

variant python34 conflicts python27 python35 description {Include Python 3.4 support} {
    depends_lib-append      port:python34
    configure.python        ${prefix}/bin/python3.4
    configure.args-replace  --without-python --with-python
}

variant python35 conflicts python27 python34 description {Include Python 3.5 support} {
    depends_lib-append      port:python35
    configure.python        ${prefix}/bin/python3.5
    configure.args-replace  --without-python --with-python
}