# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4

PortSystem          1.0
PortGroup           boost 1.0
PortGroup           cmake 1.1
PortGroup           github 1.0

boost.version       1.81

github.setup        thliebig openEMS 32c5c6b537b33a8b70f9ba4f5c9a8ecbb12777b3
version             20260122-[string range ${github.version} 0 7]
revision            0

checksums           rmd160  8824177c39eaea6a8a3a1ad0d766bca276b0f5e2 \
                    sha256  fc2b44c4817bca4085ac7166d000394cfbaa3313bffb8fd9401d7173f3bbab43 \
                    size    1789578
github.tarball_from archive

platforms           darwin macosx
categories          science
license             GPL-3
maintainers         {ra1nb0w @ra1nb0w} openmaintainer
description         ${name} is a free and open-source electromagnetic field solver using the EC-FDTD method
long_description    {*}${description}

compiler.cxx_standard 2011

patchfiles-append \
    clocale_fix.patch

# https://github.com/thliebig/openEMS/pull/144
patchfiles-append \
    0001-operator_ext_lumpedRLC.h-fix-includes.patch

depends_build-append \
    port:bison \
    port:flex \
    path:bin/pkg-config:pkgconfig

depends_lib-append \
    port:cgal6 \
    port:CSXCAD \
    port:fparser \
    port:hdf5 \
    port:tinyxml \
    port:vtk

depends_run-append \
    port:octave

# maybe in the future we can support mpi

notes "
To use openEMS in Octave run the following commands in the Octave console

    addpath('${prefix}/share/openEMS/matlab');
    addpath('${prefix}/share/CSXCAD/matlab');
    savepath()
"
