# $Id: Portfile 65792 2010-04-01 00:11:41Z ryandesign@macports.org $

PortSystem              1.0

name                    chromium
version                 0.9.12
revision                1
categories              games
platforms               darwin
maintainers             nomaintainer

description             fast paced, arcade-style, top-scrolling space shooter.
long_description        ${description}

homepage                http://www.reptilelabour.com/software/chromium/
master_sites            http://www.reptilelabour.com/software/files/chromium/
distfiles               ${name}-src-${version}.tar.gz \
                        ${name}-data-${version}.tar.gz
checksums               ${name}-src-${version}.tar.gz \
                            md5 969883f2f20f10cd6cdb380582f130c4 \
                        ${name}-data-${version}.tar.gz \
                            md5 173fdf76f1e4d7496142cd5662456a73
patchfiles              patch-configure_functions \
                        patch-Makefile.no-setup \
                        patch-NCString.cpp \
                        patch-Makefile

worksrcdir              Chromium-0.9

depends_lib             port:libvorbis \
                        path:lib/pkgconfig/sdl.pc:libsdl \
                        port:smpeg \
                        port:openal

extract.post_args       "| tar -xf - --exclude 'CVS'"

post-patch {
    reinplace "s|/usr/local|${prefix}|g" ${worksrcpath}/configure
    reinplace "s|\"../data\"|\"${prefix}/share/${name}\"|g" \
        ${worksrcpath}/src/main.cpp \
        ${worksrcpath}/src/define.h
}

configure.pre_args
configure.args          --enable-sdl \
                        --enable-smpeg \
                        --enable-vorbis \
                        --disable-setup

use_parallel_build      no

destroot {
    xinstall -m 755 ${worksrcpath}/bin/chromium ${destroot}${prefix}/bin
    xinstall -m 755 -d ${destroot}${prefix}/share/
    file copy ${worksrcpath}/data ${destroot}${prefix}/share/${name}
    xinstall -m 644 ${filespath}/powerUpShield.png \
        ${destroot}${prefix}/share/${name}/png
}

platform darwin {
    post-destroot {
        xinstall -d ${destroot}${applications_dir}/Chromium.app/Contents/MacOS
        ln -s ${prefix}/bin/chromium \
            ${destroot}${applications_dir}/Chromium.app/Contents/MacOS/Chromium
    }
}

livecheck.distname      Chromium B.S.U.
