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

# configure: error: unable to determine endian
PortGroup           muniversal 1.0

name                libmemcached
if {[file exists ${prefix}/bin/MemParse]} {
    conflicts-append xercesc3
}
version             1.0.18
set branch          [join [lrange [split ${version} .] 0 1] .]
revision            0
categories          devel
platforms           darwin
maintainers         nomaintainer
license             BSD

description         libmemcached is a C and C++ client library to the memcached server

long_description    libmemcached is a C and C++ client library for memcached. \
                    It has been designed to be light on memory usage, thread safe, \
                    and provide full access to server side methods.

homepage            http://libmemcached.org/
master_sites        http://launchpad.net/${name}/${branch}/${version}/+download/

checksums           rmd160  647ea760191755da4832f1a4c78847a330e5b515 \
                    sha256  e22c0bb032fde08f53de9ffbc5a128233041d9f33b5de022c0978a2149885f82 \
                    size    1039649

# Uses umem.h if present.
depends_build-append \
                    port:umem

depends_lib-append  port:cyrus-sasl2 \
                    port:memcached

patchfiles-append   htonll.patch
patchfiles-append   memflush.patch

compiler.cxx_standard   2011

configure.args      --disable-dtrace \
                    --disable-hsieh_hash \
                    --disable-jobserver \
                    --disable-silent-rules \
                    --with-memcached=${prefix}/bin/memcached \
                    --without-gearmand \
                    --without-mysql

variant hsieh description {Include support for hsieh hashing} {
    configure.args-replace \
                    --disable-hsieh_hash --enable-hsieh_hash
}

# platform darwin 8 {
#     patchfiles-append   no_memslap.diff
#     configure.compiler  macports-gcc-4.6
#     universal_variant   no
# }
# 
# platform darwin 9 {
#     configure.compiler  macports-gcc-4.6
#     universal_variant   no
# }

livecheck.type      regex
livecheck.url       https://launchpad.net/libmemcached/+download
livecheck.regex     {libmemcached-(\d+(?:\.\d+)*)\.[tz]}