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

set uname           yeti
name                yorick-${uname}
version             6.3.3
revision            4
license             CeCILL-C
categories          science yorick
platforms           darwin
maintainers         {thibaut @paumard} openmaintainer
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://cral.univ-lyon1.fr/labo/perso/eric.thiebaut/?Software/Yeti

master_sites        http://cral.univ-lyon1.fr/labo/perso/eric.thiebaut/downloads/yorick/
distname            ${uname}-${version}
use_bzip2           yes
checksums           rmd160  79c5aa6e0a81e715e5816077e08f768e4d745df6 \
                    sha256  cd2630c1603a0995e231a5e2d7bd05665662b851172ffd76d2261f6855c63373

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
compiler.blacklist llvm-gcc-4.2 macports-llvm-gcc-4.2

patchfiles          patch-yeti_tiff-yeti_tiff.c.diff

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-build {
    system -W ${worksrcpath} "${build.cmd} clean"
}

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