# -*- 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 112262 2013-10-16 05:32:39Z ryandesign@macports.org $

PortSystem  1.0
PortGroup   github 1.0
PortGroup   xcode 1.0

github.setup gnachman iTerm2 1.0.0.20130811 v
categories  aqua shells
maintainers emer.net:emer
license         GPL-2+
description Enhanced terminal emulator program, successor to iTerm
long_description    \
    iTerm2 is a replacement for Terminal and the successor to iTerm. Its focus is on \
    performance, internationalization, and supporting innovative features \
    that make your life better.

homepage        http://www.iterm2.com/

checksums       rmd160  166bce10474465288f06f20e61482d303d56cea3 \
                sha256  682cafc2f88675bf9a2ef5d988fabe84ae936aece958d1bc23c4664840fc3033

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
}

if {${os.platform} eq "darwin" && ${os.major} < 11} {
    pre-fetch {
        ui_error "${name} requires OS X 10.7 or newer"
        return -code error "unsupported OS X version"
    }
}
