# -*- 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           active_variants 1.1

name                xschem
version             3.4.6
revision            0

categories          science cad
license             GPL-2+
maintainers         {gmail.com:degnan.68k @bpdegnan} openmaintainer

description         schematic capture and netlisting EDA tool
long_description    Xschem is a schematic capture program that supports digital, \
                    analog, behavioral circuit design and simulation. It is designed \
                    to interface well with ngspice and other simulation tools.

homepage            https://xschem.sourceforge.io/stefan/index.html

master_sites        sourceforge:xschem

checksums           rmd160  bf5f75f9e0838293515796bdead483ff2b667049 \
                    sha256  a46bd296b2b9f8436370892eb81264599c2e3ae84b298d7a4e3b89c4126185e7 \
                    size    14990039

depends_build-append \
                    path:bin/pkg-config:pkgconfig

depends_lib-append  path:lib/pkgconfig/cairo.pc:cairo \
                    path:include/turbojpeg.h:libjpeg-turbo \
                    port:tcl \
                    port:tk  \
                    port:xorg-libxcb \
                    port:xorg-libX11 \
                    port:xpm \
                    port:xrender

if {${os.platform} eq "darwin"} {
    require_active_variants tk x11
    require_active_variants cairo x11
}

post-destroot {
    set docdir      ${prefix}/share/doc/${subport}
    set sharedir    ${prefix}/share/xschem

    # Install *.tcl and *.awk from src/
    foreach f [glob -nocomplain -directory ${worksrcpath}/src *.tcl *.awk] {
        xinstall -m 0644 ${f} ${destroot}${sharedir}
    }

    xinstall -m 0644 -W ${worksrcpath} README LICENSE AUTHORS \
        INSTALL ${destroot}${docdir}
}

notes "
Xschem has been installed to ${prefix}/bin/xschem.
Libraries and examples are in ${prefix}/share/xschem.
You may wish to create ~/.xschem/xschemrc for custom settings.
"
