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

name                qore-mysql-module
version             2.0.2
categories          lang
license             LGPL-2.1
maintainers         davidnichols
description         MySQL module for Qore
long_description    Module allowing communication with MySQL and MySQL-compatible DBs from the Qore Programming Language
use_bzip2           yes
homepage            http://qore.org
platforms           darwin
master_sites        https://github.com/qorelanguage/module-mysql/releases/download/v${version}

checksums           md5 29800c39a41c90824ef530c551ae4a7e \
                    sha1 5abf5c0ddea7719bee45dae0cbea76d8afe13dbe \
                    rmd160 c3459e518186bfc4176cbb8b06adf5d68bcd4943

variant mariadb conflicts mariadb100 mariadb101 mysql51 mysql55 mysql56 mysql57 percona description {use mariadb} {}
variant mariadb100 conflicts mariadb mariadb101 mysql51 mysql55 mysql56 mysql57 percona description {use mariadb-10.0} {}
variant mariadb101 conflicts mariadb mariadb100 mysql51 mysql55 mysql56 mysql57 percona description {use mariadb-10.1} {}
variant mysql51 conflicts mariadb mariadb100 mariadb101 mysql55 mysql56 mysql57 percona description {use mysql 5.1} {}
variant mysql55 conflicts mariadb mariadb100 mariadb101 mysql51 mysql56 mysql57 percona description {use mysql 5.5} {}
variant mysql56 conflicts mariadb mariadb100 mariadb101 mysql51 mysql55 mysql57 percona description {use mysql 5.6} {}
variant mysql57 conflicts mariadb mariadb100 mariadb101 mysql51 mysql55 mysql56 percona description {use mysql 5.7} {}
variant percona conflicts mariadb mariadb100 mariadb101 mysql51 mysql55 mysql56 mysql57 description {use percona} {}

if {![variant_isset mariadb] && ![variant_isset mariadb100] && ![variant_isset mariadb101] && ![variant_isset mysql51] && ![variant_isset mysql55] && ![variant_isset mysql56] && ![variant_isset mysql57] && ![variant_isset percona]} {
    default_variants +mariadb
}

if {[variant_isset mariadb]} {
    set mysql_port "mariadb"
} elseif {[variant_isset mariadb100]} {
    set mysql_port "mariadb-10.0"
} elseif {[variant_isset mariadb101]} {
    set mysql_port "mariadb-10.1"
} elseif {[variant_isset mysql51]} {
    set mysql_port "mysql51"
} elseif {[variant_isset mysql55]} {
    set mysql_port "mysql55"
} elseif {[variant_isset mysql56]} {
    set mysql_port "mysql56"
} elseif {[variant_isset mysql57]} {
    set mysql_port "mysql57"
} elseif {[variant_isset percona]} {
    set mysql_port "percona"
}

depends_lib         port:qore \
                    port:${mysql_port}

configure.args      --disable-debug \
                    --with-mysql-libs=${prefix}/lib/${mysql_port} --with-mysql-includes=${prefix}/include/${mysql_port}