# -*- 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 92472 2012-04-29 16:59:37Z cal@macports.org $

PortSystem          1.0

set uname           yeti
name                yorick-${uname}
version             6.3.2
license             CeCILL-C
categories          science
platforms           darwin
maintainers         users.sourceforge.net:paumard
description         Miscellaneous compiled utilities for Yorick (hash tables...)
long_description    Yeti is an extension of Yorick which implements:\n\
                      * hash table objects\n\
                      * regular expressions\n\
                      * complex, real-complex and complex-real FFT by FFTW2\n\
                      * wavelet filtering ("à trou" method)\n\
                      * fast convolution along a chosen dimension\n\
                      * more string functions\n\
                      * memory hacking routines\n\
                      * more math functions (sinc, round, arc)\n\
                      * generalized matrix-vector multiplication\n\
                      * sparse matrix\n\
                      * routines to query/check Yorick's symbols\n\
                      * support for reading TIFF images\n\
                      * morpho-math operators\n\
                      * 120 special functions from GNU Scientific Library\n\
                      * ...
homepage            http://www-obs.univ-lyon1.fr/labo/perso/eric.thiebaut/yeti.html

master_sites        http://www-obs.univ-lyon1.fr/labo/perso/eric.thiebaut/files/
distname            ${uname}-${version}
use_bzip2           yes
checksums           rmd160 055f23f4d25189b1a80918cbe63025a60d54efc2\
                    sha256 578f7b6c85654218e52e2776240fcd50fa246ef93d5993bec986e2d9b686e7a1

depends_lib         path:bin/yorick:yorick \
                    port:tiff \
                    port:fftw \
                    port:gsl

universal_variant   no

# the build seems to hang with llvm-gcc-4.2
if {${configure.compiler} == "llvm-gcc-4.2"} {
    configure.compiler clang
}

configure.pre_args  --yorick=${prefix}/bin/yorick
configure.args      --with-regex \
                    --with-fftw --with-fftw-libs="-ldfftw -ldrfftw" \
                    --with-gsl --with-tiff

build.args-append   CC=${configure.cc}

post-configure {
    file link ${worksrcpath}/yeti_fftw/fftw.h \
        ${prefix}/include/dfftw.h
    file link ${worksrcpath}/yeti_fftw/rfftw.h \
        ${prefix}/include/drfftw.h
}

pre-destroot {
    file mkdir ${destroot}${prefix}/lib/yorick/doc
}
destroot.args       DOCDIR=${destroot}${prefix}/lib/yorick/doc
