# -*- 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 109727 2013-08-19 19:31:37Z jeremyhu@macports.org $

PortSystem          1.0

name                lanHEP
version             3.1.7
categories          science
maintainers         nomaintainer
platforms           darwin
license             Restrictive/nondistributable

description         Automatic Feynman rule generation
long_description    The LanHEP program for Feynman rules generation in \
                    momentum representation is presented. It reads the \
                    Lagrangian written in the compact form close to one \
                    used in publications. It means that Lagrangian terms \
                    can be written with summation over indices of broken \
                    symmetries and using special symbols for complicated \
                    expressions, such as covariant derivative and \
                    strength tensor for gauge fields. The output is \
                    Feynman rules in terms of physical fields and \
                    independent parameters.
homepage            http://theory.sinp.msu.ru/~semenov/lanhep.html

set short_version [join [split ${version} .] {}]

master_sites        http://theory.sinp.msu.ru/~semenov/
distname            lhep${short_version}
extract.suffix      .tgz
checksums           rmd160  6809ef8057c119141bc7c9cf2276658ac59fa3f5 \
                    sha256  108a04e1b6a7b8ddeb13b1582adce15b8761f5accdb33051dae1f0bfbbd6da3b

worksrcdir          lanhep${short_version}

use_configure       no

pre-build {
    build.args      CC=${configure.cc} \
                    CFLAGS="${configure.cflags} [get_canonical_archflags cc]" \
                    LD=${configure.cc} \
                    FC=${configure.fc} \
                    FFLAGS="${configure.fflags} [get_canonical_archflags fc]"
}
build.target
use_parallel_build  no

destroot {
    xinstall ${worksrcpath}/lhep ${destroot}${prefix}/bin

    xinstall -m 644 ${worksrcpath}/SLHAplus/libSLHAplus.a \
        ${destroot}${prefix}/lib
    xinstall -m 644 -W ${worksrcpath}/SLHAplus SLHAplus.h SLHAplus.fh \
        ${destroot}${prefix}/include

    set share ${destroot}${prefix}/share
    xinstall -d ${share}/${name}
    copy ${worksrcpath}/mdl ${share}/${name}/mdl
    xinstall -d ${share}/doc/${name}
    xinstall -m 644 -W ${worksrcpath}/manuals man30.pdf man31.pdf \
        ${share}/doc/${name}
}

variant gcc43 conflicts gcc45 gcc46 gcc47 description {Build with GCC 4.3} {
    configure.compiler  macports-gcc-4.3
}

variant gcc45 conflicts gcc43 gcc46 gcc47 description {Build with GCC 4.5} {
    configure.compiler  macports-gcc-4.5
}

variant gcc46 conflicts gcc43 gcc45 gcc47 description {Build with GCC 4.6} {
    configure.compiler  macports-gcc-4.6
}

variant gcc47 conflicts gcc43 gcc45 gcc46 description {Build with GCC 4.7} {
    configure.compiler  macports-gcc-4.7
}

if {![variant_isset gcc43] && ![variant_isset gcc45] &&
    ![variant_isset gcc46]
} then {
    default_variants    +gcc47
}
