# -*- coding: utf-8; mode: tcl; tab-width: 4; truncate-lines: t; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:et:sw=4:ts=4:sts=4
# $Id: Portfile 117450 2014-02-26 20:42:24Z aronnax@macports.org $

PortSystem              1.0
PortGroup               python 1.0
PortGroup               active_variants 1.1

name                    py-healpy
version                 1.7.4
categories-append       science
license                 GPL-2
platforms               darwin
maintainers             aronnax
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}.

set basename            healpy
distname                ${basename}-${version}
master_sites            https://pypi.python.org/packages/source/[string index ${basename} 0]/${basename}/
homepage                http://pypi.python.org/pypi/${basename}/

checksums               md5     bfe12117fe276c05ecf75afe22f1c000 \
                        sha1    8c034cdeb6cf45e00a789e481ec8c742951f2a5e \
                        rmd160  7c746eef081502c2602f6bbf5ab0aca035068616

python.versions         26 27

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

    default_variants    +openmp

    variant openmp description "enable OpenMP parallel acceleration" {
        # FIXME: llvm-gcc42 is broken, https://trac.macports.org/ticket/40713
        # Only clang really needs to be blacklisted
        compiler.blacklist *gcc-4.2 *clang*
        compiler.fallback macports-gcc-4.8 macports-gcc-4.7 macports-gcc-4.6 macports-gcc-4.5 macports-gcc-4.4 macports-gcc-4.3
    }

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

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

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

    livecheck.type      none

} else {

    livecheck.type      regex
    livecheck.url       ${homepage}
    livecheck.regex     {healpy-([0-9]+(\.[0-9]+)*)}

}
