# -*- 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 91373 2012-03-31 00:08:55Z ryandesign@macports.org $

PortSystem              1.0
PortGroup               python 1.0

name                    py-healpy
version                 0.10.2
categories              python science
platforms               darwin
maintainers             aronnax
description             Python wrapper for healpix
long_description        Python wrapper for healpix

homepage                http://code.google.com/p/healpy/
master_sites            googlecode:healpy
distname                healpy-${version}
checksums               md5     c9561c318af1dedb6859de1436e98719 \
                        sha1    56006d7f38a6ce5d90f84a894d3721c7c574b1c5 \
                        rmd160  aa703d90fb23926469691773366e4628036e2068

python.versions         25 26 27
python.default_version  27

if {${subport} != ${name}} {

patchfiles              patch-setup.py.diff

# Find a compiler that supports OpenMP
if {${configure.compiler} == "clang"} {
   configure.compiler llvm-gcc-4.2
}

if {${configure.compiler} == "gcc-4.0"} {
   configure.compiler gcc-4.2
   if {![file executable ${configure.cc}]} {
       depends_build-append port:apple-gcc42
       configure.compiler apple-gcc-4.2
   }
}

build.env-append        CFITSIO_EXT_PREFIX=${prefix} \
                        CC=${configure.cc} CXX=${configure.cxx} CPP=${configure.cpp} \
                        LDSHARED="${configure.cc} -L${prefix}/lib -bundle -undefined dynamic_lookup"

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

}
