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

name                healpix-cxx
version             3.82.0
set branch          [join [lrange [split ${version} .] 0 1] .]
categories          science
license             GPL-2+
maintainers         {aronnax @lpsinger} openmaintainer
description         C++ language implementation of HEALPix
long_description \
  Software for pixelization, hierarchical indexing, synthesis, analysis, and \
  visualization of data on the sphere. This is the ${description}.
homepage            https://healpix.sourceforge.io
platforms           darwin
master_sites        sourceforge:project/healpix/Healpix_${branch}/
distname            healpix_cxx-${version}

checksums           rmd160  0fc419c93e628ad3d4fe0bbdab866d61c4979118 \
                    sha256  9c1b0bbbcf007359d1ef10ae3ae9a2f46c72a4eb0c2fdbb43683289002ba8552 \
                    size    531566

depends_build       port:pkgconfig
depends_lib         port:cfitsio \
                    port:libsharp

configure.args-append \
                    --disable-openmp

default_variants    +openmp

if {[variant_isset openmp]} {
    require_active_variants libsharp openmp
} else {
    require_active_variants libsharp "" openmp
}

variant openmp description "enable OpenMP parallel acceleration" {
    configure.args-delete \
                    --disable-openmp
    compiler.openmp_version 2.5
}
