# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:et:sw=4:ts=4:sts=4

PortSystem          1.0
PortGroup           github 1.0
PortGroup           makefile 1.0

github.setup        IlyaGrebnov libbsc 3.3.4 v
github.tarball_from archive
name                bsc
revision            0
categories          archivers devel
maintainers         {i0ntempest @i0ntempest} openmaintainer
license             Apache-2

description         High performance block-sorting data compressor
long_description    ${name} is a high performance file compressor based on lossless, block-sorting data\
                    compression algorithms. lib${name} is a library based on ${name}, it uses the same\
                    algorithms as ${name} and enables you to compress memory blocks.

checksums           rmd160  26b4333eef8ebca5c5d16de140d1ed1b9464b977 \
                    sha256  dad297ec3cd0fbaca63214746f6ae3f27a745642a2e0199c20b624fca3d04c53 \
                    size    189560

# https site has a misconfigured cert
homepage            http://${github.project}.com

compiler.cxx_standard \
                    2011
                    
makefile.override-append \
                    PREFIX

# See https://github.com/IlyaGrebnov/libbsc/pull/8
patchfiles-append   patch-makefile.diff

variant openmp description {enable parallelism support using OpenMP} {
    compiler.openmp_version \
                    4.5
    compiler.blacklist-append \
                    {macports-clang-[0-9].*}

    build.args-append \
                    OPENMP=1

    configure.ldflags-append \
                    -lc++
}

variant debug description {Build debug binaries} {
    build.args-append \
                    DEBUG=1
}

variant native description {Force local build and optimize for CPU} {
    build.args-append \
                    NATIVE=1
}

default_variants    +openmp
