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

name                    py-healpy
version                 1.19.0
revision                0
categories-append       science
license                 GPL-2
maintainers             {aronnax @lpsinger} openmaintainer
description             Python language interface for HEALPix
long_description \
  Software for pixelization, hierarchical indexing, synthesis, analysis, and \
  visualization of data on the sphere. This is the ${description}.

homepage                https://github.com/healpy/healpy

checksums               rmd160  5764d2a86703b05b06c3e15d15b7f667dd80ee45 \
                        sha256  28e839cb885a23d36c77fc3423a3cb9271a07fda94085bd12fc329f941130ec5 \
                        size    4075006

python.versions         310 311 312 313 314

patchfiles              patch-pyproject.toml.diff

if {${name} ne ${subport}} {

    default_variants    +openmp

    variant openmp description "enable OpenMP parallel acceleration" {
        # Pick a compiler that supports openmp
        compiler.openmp_version 2.5
    }

    if {[variant_isset openmp]} {
        require_active_variants libsharp openmp
        require_active_variants healpix-cxx openmp
    } else {
        require_active_variants libsharp "" openmp
        require_active_variants healpix-cxx "" openmp
    }

    depends_build       port:pkgconfig \
                        port:py${python.version}-cython \
                        port:py${python.version}-setuptools \
                        port:py${python.version}-setuptools_scm

    depends_lib-append  port:cfitsio \
                        port:py${python.version}-numpy \
                        port:py${python.version}-astropy \
                        port:py${python.version}-matplotlib \
                        port:healpix-cxx \
                        port:libsharp
}
