# -*- 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             4.0.0
revision            0
checksums           rmd160  13bdc20866210f3e07f719bdddeb1a22dfbfd237 \
                    sha256  881dcfad962e21bfe76531799a131b2f2dfc5cfaa3414bb80ab4f14955b6c56b \
                    size    473958

categories          science
maintainers         nomaintainer
platforms           darwin
license             Restrictive

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.

master_sites        https://theory.sinp.msu.ru/~semenov/
homepage            ${master_sites}lanhep.html

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

distname            lhep${short_version}
extract.suffix      .tgz

worksrcdir          lanhep${short_version}

use_configure       no

compilers.choose    fc
compilers.setup     require_fortran
compiler.c_standard 1999

pre-build {
    build.args      CC=${configure.cc} \
                    CFLAGS="${configure.cflags} -std=c99 [get_canonical_archflags cc]" \
                    LD=${configure.cc} \
                    LOPT="${configure.ldflags} [get_canonical_archflags ld]" \
                    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 0644 ${worksrcpath}/SLHAplus/libSLHAplus.a \
        ${destroot}${prefix}/lib
    xinstall -m 0644 -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
}

livecheck.type      regex
livecheck.url       ${homepage}
livecheck.regex     {LanHEP version ([0-9.]+)}
