# $Id: Portfile 105913 2013-05-09 18:30:21Z eborisch@macports.org $

PortSystem  1.0
PortGroup   github 1.0
PortGroup   xcode 1.0

github.setup gnachman iTerm2 1.0.0.20130319 v
categories  aqua shells
maintainers nomaintainer
license         GPL-2+
description Enhanced terminal emulator program, successor to iTerm
long_description    \
    iTerm2 is a replacement for Terminal and the successor to iTerm. It \
    works on Macs with Leopard or Snow Leopard. Its focus is on \
    performance, internationalization, and supporting innovative features \
    that make your life better.

homepage        http://www.iterm2.com/

checksums \
    rmd160  2c026ec9934f88c626cad08f47c0a49ab9b60690 \
    sha256  7705a01f0943f4af38ee42afff9d624a8eeebe04cbe7b9ab521e0e169a557fbc

xcode.project   iTerm.xcodeproj
xcode.target    iTerm

post-patch {
    reinplace "s|^version *= *.*$|version = \"${version}\"|" ${worksrcpath}/updateVersion.py
    # disable Sparkle autoupdate
    reinplace "s|.*Sparkle.*||g" ${worksrcpath}/${xcode.project}/project.pbxproj
}

destroot {
    file copy ${build.dir}/build/Deployment/iTerm.app \
        ${destroot}${applications_dir}/${name}.app
}

platform darwin 8 {
    pre-fetch {
        ui_error "${name} requires Mac OS X 10.5 or newer"
        return -code error "unsupported Mac OS X version"
    }
}
