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

name                kyotocabinet
version             1.2.80
revision            0
categories          databases
license             GPL

maintainers         nomaintainer

description         Kyoto Cabinet is a library of routines for managing \
                    a database.
long_description \
    Kyoto Cabinet is a library of routines for managing a database. \
    The database is a simple data file containing records, each is a pair of \
    a key and a value. Every key and value is serial bytes with variable \
    length. Both binary data and character string can be used as a key \
    and a value. Each key must be unique within a database. There is \
    neither concept of data tables nor data types.

homepage            https://dbmx.net/${name}
master_sites        ${homepage}/pkg/

checksums           rmd160  3b669a47f5ea89ee44da3ad3bcf4f89bdf79cc1e \
                    sha256  4c85d736668d82920bfdbdb92ac3d66b7db1108f09581a769dd9160a02def349 \
                    size    942543

dist_subdir         ${name}/${version}_${revision}

patchfiles          patch-configure.diff \
                    patch-kcthread.cc \
                    patch-kccommon.h.diff

depends_lib         port:zlib

# To avoid linking against a previously installed version, remove the default
# CPPFLAGS and LDFLAGS. The build scripts already add
# the destination include and lib directories.
configure.cppflags
configure.ldflags

configure.args      --datadir=${prefix}/share/doc \
                    --disable-lzma \
                    --disable-lzo \
                    --mandir=${prefix}/share/man

compiler.cxx_standard   2011

universal_variant   no

test.run            yes
test.target         check

variant debug conflicts devel profile description {build for debugging} {
    configure.args-append   --enable-debug
}

variant devel conflicts debug profile description {build for development} {
    configure.args-append   --enable-devel
}

variant profile conflicts debug devel description {build for profiling} {
    configure.args-append   --enable-profile
}

variant lzo description {build with LZO compression} {
    configure.args-delete   --disable-lzo
    configure.args-append   --enable-lzo
    depends_lib-append      port:lzo2
}

variant lzma description {build with LZMA compression} {
    configure.args-delete   --disable-lzma
    configure.args-append   --enable-lzma
    depends_lib-append      port:xz
}

livecheck.type      regex
livecheck.url       ${master_sites}
livecheck.regex     "${name}-(\\d+(?:\\.\\d+)*)${extract.suffix}"
