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

github.setup        pdewacht oberon-risc-emu 26c8ac5
# Change github.tarball_from to 'releases' or 'archive' next update
github.tarball_from tarball

name                oberon-risc
version             20200818
categories          emulators
license             BSD
description         Project Oberon RISC system emulator
long_description    Project Oberon 2013 by Niklaus Wirth and Jürg Gutknecht \
    is a lean and easily understandable desktop computer. This emulation \
    by Peter De Wachter includes a disk image of the latest full system \
    (note: make a scratch, writable copy)
homepage            https://www.projectoberon.net/
maintainers         {@jflude hotmail.com:justin_flude} openmaintainer

checksums           rmd160 205aba103984e4606633f39cdb3d9b5a829e650c \
                    sha256 43ca13736b0e5618a18d95efaeb57d529d71cb4f1fd43950103d25f24dfa05c9 \
                    size 1073579

depends_lib         port:libsdl2

patch.pre_args-replace  -p0 -p1
patchfiles          patch-rename-program.diff

use_configure       no
build.args-append   CC=${configure.cc}
build.target        risc

destroot {
    xinstall ${worksrcpath}/risc ${destroot}${prefix}/bin/${name}
    xinstall -d ${destroot}${prefix}/share/${name}
    xinstall -m 644 -W ${worksrcpath} DiskImage/Oberon-2020-08-18.dsk \
        README.md po2013.png ${destroot}${prefix}/share/${name}
    xinstall -W ${worksrcpath} pcsend.sh pcreceive.sh \
        ${destroot}${prefix}/share/${name}
}