# -*- 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
PortGroup           legacysupport 1.0

github.setup        Blosc c-blosc 1.21.6 v
revision            0

name                blosc
categories          archivers devel
license             MIT

maintainers         {stromnov @stromnov} openmaintainer

description         A blocking, shuffling and loss-less compression library.

long_description    Blosc is a high performance compressor optimized \
                    for binary data. It has been designed to transmit data \
                    to the processor cache faster than the traditional, \
                    non-compressed, direct memory fetch approach via \
                    a memcpy() OS call. It uses the blocking technique \
                    to reduce activity on the memory bus as much as possible.

homepage            http://www.blosc.org/

checksums           rmd160  006cb815e3027ea106de7a1d02f4f0cb1bab5c54 \
                    sha256  9fcd60301aae28f97f1301b735f966cc19e7c49b6b4321b839b4579a0c156f38 \
                    size    2495309
github.tarball_from archive

depends_lib-append  port:lz4    \
                    port:zlib   \
                    port:zstd   \
                    port:snappy

# error: ‘for’ loop initial declaration used outside C99 mode
configure.cflags-append -std=c99

configure.args-append \
                    -DPREFER_EXTERNAL_LZ4=ON \
                    -DPREFER_EXTERNAL_ZLIB=ON \
                    -DPREFER_EXTERNAL_ZSTD=ON

if {${build_arch} in [list ppc ppc64]} {
    configure.args-append \
                    -DDEACTIVATE_SSE2=ON
}

# https://trac.macports.org/ticket/67478
platform darwin {
    if {${os.major} < 11 && [string match *gcc* ${configure.compiler}]} {
        configure.args-append \
                    -DDEACTIVATE_AVX2=ON
    }
}

test.run            yes

# fix test run, doesn't affect install_names
configure.args-append -DCMAKE_BUILD_WITH_INSTALL_RPATH=OFF
