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

github.setup        facebook openzl 0.1.0 v
revision            1
categories          archivers
license             BSD
maintainers         nomaintainer

description         OpenZL delivers high compression ratios while preserving high speed, \
                    a level of performance that is out of reach for generic compressors.
long_description    {*}${description}
homepage            https://openzl.org

checksums           rmd160  ba360950e8a5a31447e0a711e476626cac69d81f \
                    sha256  3278546dcdbae3aef3887f07b435ebe0aa9f6943a5ac74cf9b7baeefe6526c2e \
                    size    14437924
github.tarball_from archive

# https://github.com/facebook/openzl/issues/364
# assertion.h:337:50: error: implicit declaration of function 'static_assert' [-Wimplicit-function-declaration]
patchfiles-append   patch-fix-static_assert.diff

# https://github.com/facebook/openzl/issues/342
patchfiles-append   patch-32-bit.diff

compiler.c_standard 2011

depends_build-append \
                    path:bin/pkg-config:pkgconfig

depends_lib-append  port:lz4 \
                    port:zstd

configure.ldflags-append \
                    -llz4 \
                    -lzstd

# At the moment only an executable is installed.
configure.args-append \
                    -DOPENZL_BUILD_SHARED_LIBS=OFF

destroot {
    set builddir    ${worksrcpath}/../build
    xinstall ${builddir}/cli/zli ${destroot}${prefix}/bin
}
