# -*- 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 90277 2012-02-29 08:27:20Z royliu@macports.org $

PortSystem          1.0
PortGroup           archcheck 1.0

name                dosbox
version             0.74
revision            1
categories          emulators
platforms           darwin
maintainers         nomaintainer

description         DOS emulator featuring 386 realmode, filesystem, XMS, EMS

long_description    DOSBox is a DOS emulator supporting 286/386 realmode, directory \
                    file system, XMS/EMS and many sound cards. \
                    It can be configured to run a wide range of DOS games, from \
                    CGA/Tandy/PCjr classics up to games from the Quake era.

homepage            http://dosbox.sourceforge.net/
master_sites        sourceforge:project/dosbox/dosbox/${version}

checksums           sha1    2d99f0013350efb29b769ff19ddc8e4d86f4e77e \
                    rmd160  4534d87206de8401cd0de471d8172726f2c6b788

depends_lib         path:lib/pkgconfig/sdl.pc:libsdl \
                    port:libsdl_net \
                    port:libsdl_sound \
                    port:libpng

archcheck.files     lib/libSDL.dylib \
                    lib/libSDL_net.dylib \
                    lib/libSDL_sound.dylib \
                    lib/libpng.dylib

# Assembly language issues
universal_variant no

configure.args      --disable-sdltest \
                    --disable-alsatest
configure.cxxflags-append   -mdynamic-no-pic

post-destroot {
    xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name}
    xinstall -W ${worksrcpath} \
        README \
        AUTHORS \
        COPYING \
        ChangeLog \
        INSTALL \
        THANKS \
        ${destroot}${prefix}/share/doc/${name}
}

supported_archs     i386 ppc x86_64

platform darwin {
    configure.args-append --build=${configure.build_arch}-apple-darwin${os.major}
}

variant debug description {Enable debug mode} {
    depends_lib-append port:ncurses
    use_autoreconf yes
    patchfiles-append patch-configure.in.diff
    configure.args-append --enable-debug
    configure.cppflags-append -I${prefix}/include/ncurses
}
