# -*- 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               compiler_blacklist_versions 1.0

name                    gnuastro
version                 0.21
revision                0
categories              science
license                 GPL-3+
maintainers             {@sikmir disroot.org:sikmir} openmaintainer
description             GNU astronomy utilities and library
long_description        The GNU Astronomy Utilities (Gnuastro) is an official GNU package \
                        consisting of various programs and library functions for \
                        the manipulation and analysis of astronomical data.
homepage                https://www.gnu.org/software/gnuastro/
master_sites            gnu

checksums               rmd160  bb31d76785a71ba58c88f6903c6b04cd274b6ff4 \
                        sha256  2fba993d8422391517b55f7eb511788946d7a886aa1584984fd4678bdd27537f \
                        size    7601435

depends_build-append    port:libtool

depends_lib-append      port:cfitsio \
                        port:gsl \
                        path:lib/pkgconfig/libgit2.pc:libgit2 \
                        port:openjpeg \
                        port:tiff \
                        port:wcslib \
                        port:zlib

# TODO: add port:ds9 when it will be fixed
depends_run-append      port:curl \
                        port:ghostscript

patchfiles-append       patch-buildjobs.diff

post-patch {
    reinplace "s|@MP_BUILDJOBS@|${buildmakejobs}|" ${worksrcpath}/configure
}

# https://trac.macports.org/ticket/68977
compiler.blacklist-append \
                        *gcc-4.0 *gcc-4.2 {clang < 400}

# https://trac.macports.org/ticket/66254
platform darwin powerpc {
    configure.args-append \
                        --disable-dependency-tracking
}
