# -*- 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
# $Id: Portfile 92937 2012-05-11 14:01:55Z ryandesign@macports.org $

PortSystem              1.0

name                    lisaem
version                 1.2.6
revision                1
maintainers             ryandesign
platforms               darwin
categories              emulators
homepage                http://lisa.sunder.net/
master_sites            ${homepage}downloads/
use_bzip2               yes
use_parallel_build      no

description \
    Apple Lisa emulator

long_description \
    ${description}

checksums \
    md5 b236d7fa06c7589bb0de5d13ed680c9a \
    sha1 c3552eb2fc89ff6e47994767aa4e524de7000dc7 \
    rmd160 bc541ef181b417ee369ed960f29637f87cc1308a

depends_lib \
    port:wxWidgets

patchfiles \
    patch-build.sh.diff

use_configure           no
universal_variant       no

build.cmd               ./build.sh
build.target            build

destroot.destdir
destroot.env            PREFIXAPP=${destroot}${applications_dir} \
                        PREFIXBIN=${destroot}${prefix}/bin \
                        PREFIXLIB=${destroot}${prefix}/share

pre-destroot {
    xinstall -d ${destroot}${applications_dir}
}

post-activate {
    # lisaem 1.2.6_0 installed items to /usr/local/bin; remove them if found
    foreach file {lisadiskinfo lisafsh-tool} {
        set filepath /usr/local/bin/${file}
        if {[file exists ${filepath}] && [registry_file_registered ${filepath}] == "0"} {
            if {[catch {delete ${filepath}}]} {
                ui_warn "Cannot delete ${filepath}; please remove it manually"
            }
        }
    }
}

livecheck.type          regex
livecheck.url           ${homepage}downloads.html
livecheck.regex         ${name}-(\[0-9.\]+)\\.tar
