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

# Release is archaic.
github.setup        nanodbc nanodbc 86dd2750c84ff234c05dbed8b92d0b7ef94c9d53
version             2.15.0
revision            0
categories          databases
license             MIT
maintainers         {@barracuda156 macos-powerpc.org:barracuda} openmaintainer
description         C++ wrapper for the native C ODBC API
long_description    Small {*}${description}.
homepage            https://nanodbc.github.io/nanodbc
checksums           rmd160  f0ea0dd7c88fd9c4db5cee77a5e5e5af82ccd40f \
                    sha256  043a6f5d96e98bcbc740e6e36f452c3bbd35624481bea2761fec4ce2e9151164 \
                    size    766383
github.tarball_from archive

# https://github.com/nanodbc/nanodbc/pull/440
patchfiles          0001-macOS-respect-deployment-target-if-set-use-meaningfu.patch

compiler.cxx_standard   2014

# Tests do not build: https://github.com/nanodbc/nanodbc/issues/439
configure.args-append \
                    -DNANODBC_BUILD_TESTS=OFF \
                    -DNANODBC_GENERATE_INSTALL=ON

if {${configure.cxx_stdlib} ne "libc++"} {
    configure.args-append \
                    -DNANODBC_FORCE_LIBCXX=OFF
}

variant libiodbc conflicts unixODBC description "Use libiodbc" {
    depends_lib-append \
                    port:libiodbc
}

variant unixODBC conflicts libiodbc description "Use unixODBC" {
    depends_lib-append \
                    port:unixODBC
}

if {![variant_isset libiodbc] && ![variant_isset unixODBC]} {
    default_variants    +libiodbc
}
