# $Id: Portfile 67978 2010-05-23 18:43:52Z ryandesign@macports.org $

PortSystem                  1.0

name                        sounddecompress
version                     1.11
platforms                   darwin
categories                  games audio sysutils
maintainers                 ryandesign
homepage                    http://uru.zero-factorial.com/index.php?page=tools
master_sites                http://uru.zero-factorial.com/tools/

description                 decompresses Myst Online: URU Live sounds

long_description            SoundDecompress is a utility to decompress sounds \
                            used by the game Myst Online: URU Live so that \
                            they can be played by the game. The game should \
                            do this on its own, but in certain configurations \
                            (such as when running the game under Wine) the \
                            sounds get decompressed incorrectly, resulting in \
                            silence or static. Run this tool to fix the sounds.

notes                       To have SoundDecompress decompress the sounds in \
                            a Myst Online: URU Live installation installed by \
                            the mystonline-cider or mystonline-wine ports, run \
                            \n\
                            \nsounddecompress.py -u ${prefix}/share/mystonline/data

distname                    ${name}_v[strsed ${version} {g/\.//}]
use_bzip2                   yes

checksums                   md5     8a3dace5f7158e65e81fcc337c4b8082 \
                            sha1    724358f43d38009512d6d03f0b1e28b07efccc4d \
                            rmd160  4adab63b65699aae5fc0e7941da94cc23718f728

depends_lib                 port:libhsplasma \
                            port:sox
#                            port:py26-wxpython

depends_run                 port:python26

extract.mkdir               yes

patchfiles                  patch-wxSoundDecompress.py.diff

post-patch {
    reinplace "s|^#!/usr/bin/env python$|#!${prefix}/bin/python2.6|g" \
        ${worksrcpath}/sounddecompress.py \
        ${worksrcpath}/wxSoundDecompress.py
    reinplace "s|@PREFIX@|${prefix}|g" \
        ${worksrcpath}/wxSoundDecompress.py
}

use_configure               no
if {[info exists supported_archs]} {
    supported_archs noarch
}

build                       {}

destroot {
    xinstall ${worksrcpath}/sounddecompress.py ${destroot}${prefix}/bin
#    xinstall ${worksrcpath}/wxSoundDecompress.py ${destroot}${prefix}/bin
    set docdir ${destroot}${prefix}/share/doc/${name}
    xinstall -d ${docdir}
    xinstall -m 644 ${worksrcpath}/ReadMe.txt ${docdir}
}

livecheck.type              regex
livecheck.regex             {(?i)SoundDecompress(?:or)? v([0-9.]+)}
