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

name                lanHEP
version             3.1.7
revision            1
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}
# stealth update, remove this with next proper update
dist_subdir         ${name}/${version}_1
extract.suffix      .tgz

checksums           rmd160  68b5c4df1c7664b81217a076b431a953e1d3e0a9 \
                    sha256  97e458626da9d9307a0189a20574fe671e384cf5143f5fa5c5ed4faf753f3fed

worksrcdir          lanhep${short_version}

use_configure       no

compilers.choose    fc
compilers.setup     require_fortran

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}
}