# -*- 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       github 1.0
PortGroup       cmake 1.1

github.setup    open-simh simh c20b391eea8ea3ae7f264837aa9c8dd1476b1ea1
github.tarball_from archive
name            opensimh

version         20250826
revision        0

checksums       rmd160  6f1be78060f93223be4cf251599cf68b38f478c5 \
                sha256  152ccecf096983fd84f525986b66cea8c5a667c4a4e82d3c2d45629d555949b7 \
                size    31365115

categories      emulators

# Note: pmetzger explicitly authorizes all maintainers to make any
# reasonable changes to this port without a three day wait.
maintainers     {pmetzger @pmetzger} openmaintainer

license         X11

description     A highly portable, multi-system simulator.

long_description    SIMH is a framework and family of computer simulators, \
                    with the primary goal of enabling the preservation \
                    of knowledge contained in, and providing the ability \
                    to execute and experience, old and historic software \
                    via simulation of the hardware on which it ran.

homepage        http://opensimh.org/

conflicts       simh

depends_lib     port:brotli \
                port:bzip2 \
                port:freetype \
                port:libedit \
                port:libpcap \
                port:libpng \
                port:libsdl2 \
                port:libsdl2_ttf \
                port:ncurses \
                port:pcre \
                port:zlib

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

patchfiles      zlib-not-static.diff

set bindir      ${worksrcpath}/BIN

configure.cflags-append    -fwrapv -fno-strict-overflow

pre-build {
    file mkdir ${bindir}
}

destroot {
    foreach binary [glob -tails -directory ${bindir} *] {
        xinstall -c -m 755 ${bindir}/${binary} ${destroot}${prefix}/bin/simh-${binary}
    }
}

test.run        yes
test.cmd        ctest

notes "
open-simh executables have been installed with a 'simh-' prefix, for example:
   simh-microvax3900
"

livecheck.type  none
