# -*- 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$

PortSystem          1.0
PortGroup           github 1.0

github.setup        Dieterbe uzbl 2012.05.14
revision            1
categories          www
license             GPL-3
platforms           darwin
maintainers         ryandesign openmaintainer

description         Uzbl Web Browser

long_description    ${name} is a web browser that adheres to the UNIX philosophy.

homepage            http://www.uzbl.org/

checksums           rmd160  a6a1c2b7eb11a80c6c01b9bd8a93a82125656c9d \
                    sha256  4b4b3baf2339250b81818b12918af51a33f353a580856fe27eb193f71a4294cf

depends_build       port:pkgconfig

depends_lib         port:gtk2 \
                    path:lib/pkgconfig/webkit-1.0.pc:webkit-gtk \
                    port:libsoup

depends_run         port:python27

post-patch {
    foreach f [concat [glob ${worksrcpath}/bin/*] [glob ${worksrcpath}/examples/data/scripts/*]] {
        if {[file isfile ${f}]} {
            reinplace -E "s|#!/usr/bin/env python2?|#!${prefix}/bin/python2.7|g" ${f}
        }
    }
}

use_configure       no

variant universal {}

build.args          PREFIX=${prefix} \
                    CC="${configure.cc} [get_canonical_archflags]"

eval destroot.args  ${build.args}

platform darwin {
    if {${configure.cxx_stdlib} eq "libstdc++"} {
       depends_lib-delete path:lib/pkgconfig/webkit-1.0.pc:webkit-gtk
       depends_lib-append path:lib/pkgconfig/webkit-1.0.pc:webkit-gtk-2.0
    }
}