# -*- 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 88339 2011-12-29 08:21:23Z hum@macports.org $

PortSystem          1.0

name                re2
fetch.type          hg
hg.url              https://code.google.com/p/re2/
hg.tag              d49d9934b9aa
version             20111209-${hg.tag}
categories          devel textproc
platforms           darwin
maintainers         hum openmaintainer
license             BSD

homepage            http://code.google.com/p/re2/
description         an efficient, principled regular expression library
long_description    RE2 is a fast, safe, thread-friendly alternative to \
                    backtracking regular expression engines like those \
                    used in PCRE, Perl, and Python. It is a C++ library.

patchfiles          patch-Makefile.diff

post-patch {
    reinplace "s|/usr/local|${prefix}|g" ${worksrcpath}/Makefile
}

use_configure       no

variant universal   {}

build.args          CXX="${configure.cxx}" \
                    CXXFLAGS="${configure.cxxflags} [get_canonical_archflags cxx]"

post-destroot {
    set libpath ${prefix}/lib/libre2.0.dylib
    system "install_name_tool -id ${libpath} ${destroot}${libpath}"
}

livecheck.type      none
