# -*- 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
# $Id: Portfile 117504 2014-03-01 17:21:26Z aronnax@macports.org $

PortSystem          1.0

name                healpix-c
version             3.11.4
categories          science
license             GPL-2
maintainers         aronnax
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            http://healpix.sourceforge.net
platforms           darwin
master_sites        sourceforge:project/healpix/Healpix_3.11/autotools_packages/
distname            chealpix-${version}

checksums           md5     da330c99c3fac4ae73f9369da4e372cc \
                    sha1    214484d8959f37f890338c1624b0152f68c9a49d

depends_build       port:pkgconfig
depends_lib         port:cfitsio

pre-activate {
    if {[file exists ${prefix}/lib/libchealpix.a]
        && ![catch {set vers [lindex [registry_active healpix] 0]}]
        && [vercmp [lindex $vers 1] 3.00] < 0} {
        registry_deactivate_composite healpix "" [list ports_nodepcheck 1]
    }
}
