# -*- coding: utf-8; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:et:sw=4:ts=4:sts=4
# $Id: Portfile 57875 2009-09-18 00:52:08Z mnick@macports.org $

PortSystem          1.0
PortGroup           xcode 1.0

name                GitX
version             0.7.1
maintainers         mnick

categories          devel
description         GitX is a git GUI specifically for Mac OS X
long_description    GitX is a gitk like clone written specifically for OS X Leopard and higher. \
                    This means that it has a native interface and tries to integrate with the \
                    operating system as good as possible. Examples of this are drag and drop \
                    support and QuickLook support.

platforms           darwin
license             GPL
homepage            http://gitx.frim.nl/

fetch.type          git
git.url             git://github.com/pieter/gitx.git
git.branch          v${version}

depends_lib-append  port:git-core

xcode.target        GitX
xcode.configuration Release

pre-fetch {
    if {${os.major} < 9} {
        return -code error "This version of ${name} is only for Mac OS X 10.5 or later."
    }
}

configure {
    if {[variant_isset universal]} {
        set arch_flags ${configure.universal_cflags}
    } else {
        set arch_flags ${configure.cc_archflags}
    }
    reinplace "s|make CFLAGS=\\\\\"-arch .*\\\\\"|make CFLAGS=\\\\\"${arch_flags}\\\\\"|g" \
        ${worksrcpath}/GitX.xcodeproj/project.pbxproj
}

post-destroot {
    file mkdir  ${destroot}/${prefix}/bin
    file rename ${destroot}/${applications_dir}/gitx ${destroot}/${prefix}/bin/gitx
}

livecheck.url       http://gitx.frim.nl/release_history.html
livecheck.regex     <h1>v(.*)</h1>
