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

github.setup            kanjitalk755 macemu b63490dadb0b70bb83775283716754af0e1e290d
# Change github.tarball_from to 'releases' or 'archive' next update
github.tarball_from     tarball
version                 20240609
checksums               rmd160  2783ef2b69123d18294af239f8a4f736151aa11a \
                        sha256  1657c037ae3a888c879e5ebb9d8566d042da451eaea6e278848441e31b8774bf \
                        size    3325858
    
epoch                   1
# we need a name here as the github-supplied name is not correct for this port
name                    sheepshaver

categories              emulators
license                 GPL-2+
maintainers             {@ZapDotZip gmail.com:zapdotzip} openmaintainer

homepage                http://sheepshaver.cebix.net/

worksrcdir              ${distname}/SheepShaver/src/MacOSX

xcode.project           "SheepShaver_Xcode8.xcodeproj"
xcode.configuration     Release

# this allows SheepShaver to be built with MacPort's SDL2 port.
patchfiles              xcode-sdl2.diff

depends_lib             port:libsdl

description             Open source PPC Mac emulator.

long_description \
    Longstanding PowerPC Macintosh emulator. Requires an appropriate Macintosh ROM image and a copy \
    of Mac OS (7.5.2 through 9.0.4), and these are not supplied with this port. The emulator will \
    be installed into your MacPorts Applications folder. This is the more frequently updated \
    "kanjitalk755" fork of the original by cebix.
    

platform darwin powerpc {
    # untested at present
    supported_archs   ppc
    pre-fetch {
        ui_error "${name} is presently untested on PowerPC Mac systems."
        return -code error "incompatible processor"
    }
}

# this is needed because at least on 10.13 the xcodebuild process produces a bad symlink and deletes SheepShaver.app.
destroot {
    copy [glob ${workpath}/macemu-*/SheepShaver/src/MacOSX/build/Release/SheepShaver.app] ${destroot}${applications_dir}
}
