# -*- 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 97763 2012-09-14 18:56:08Z jeremyhu@macports.org $

PortSystem          1.0

name                blitz-devel
version             0.10-20110812
revision            1
categories          math devel
platforms           darwin
license             GPL-2+
maintainers         gmail.com:andre.dos.anjos

fetch.type      hg
hg.url          http://blitz.hg.sourceforge.net:8000/hgroot/blitz/blitz
hg.tag          4223fee30010

description         a C++ class library for scientific computing

long_description    Blitz++ is a (LGPLv3+) licensed meta-template library for \
                    array manipulation in C++ with a speed comparable to \
                    Fortran implementations, while preserving an \
                    object-oriented interface. These results are being \
                    obtained not through better optimizing compilers, \
                    preprocessors, or language extensions, but through the \
                    use of template techniques. By using templates cleverly, \
                    optimizations such as loop fusion, unrolling, tiling, \
                    and algorithm specialization can be performed \
                    automatically at compile time.

homepage            http://blitz.sourceforge.net/

platforms           darwin

use_autoreconf yes

configure.args      --infodir=${prefix}/share/info \
                    --enable-shared \
                    --enable-static \
                    --enable-optimize \
                    --disable-doxygen \
                    --disable-dot \
                    --disable-latex-docs

if {$build_arch == "x86_64" || $build_arch == "ppc64"} {
    configure.args-append --enable-64bit
}

configure.cppflags-append "-pthread"
configure.cxxflags-append "-pthread"
configure.fflags-append   "-pthread"

destroot.args       docdir=${prefix}/share/doc/${name}

variant docs description {Generate API documentation} {
  depends_lib-append     port:doxygen \
                         path:bin/dot:graphviz
  configure.args-delete --disable-doxygen \
                        --disable-dot
  configure.args-append --enable-doxygen \
                        --enable-dot
}

variant gcc43 conflicts gcc44 gcc45 gcc46 description {Use the gcc43 compiler} {
    depends_lib-append  port:gcc43
    configure.compiler  macports-gcc-4.3
}

variant gcc44 conflicts gcc43 gcc45 gcc46 description {Use the gcc44 compiler} {
    depends_lib-append  port:gcc44
    configure.compiler  macports-gcc-4.4
}

variant gcc45 conflicts gcc43 gcc44 gcc46 description {Use the gcc45 compiler} {
    depends_lib-append  port:gcc45
    configure.compiler  macports-gcc-4.5
}

variant gcc46 conflicts gcc43 gcc44 gcc45 description {Use the gcc46 compiler} {
    depends_lib-append  port:gcc46
    configure.compiler  macports-gcc-4.6
}

pre-build {
    build.env-append CC=${configure.cc} CXX=${configure.cc} F77=${configure.f77}
}
 
pre-destroot {
    destroot.env-append CC=${configure.cc} CXX=${configure.cxx} F77=${configure.f77}
}

# does not build universal software
universal_variant   no

# does not do any live check
livecheck.type sourceforge
