# -*- 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 100537 2012-12-15 01:29:05Z ryandesign@macports.org $

PortSystem          1.0

name                grantlee
maintainers         nomaintainer
description         String template engine based on the Django template system
license             LGPL
homepage            http://www.grantlee.org
master_sites        http://downloads.grantlee.org/

subport grantlee5   {}

if {${subport} eq "${name}"} {
    PortGroup       kde4 1.1
    version         0.5.1
    revision        2
    categories      devel kde kde4
    long_description \
                    Grantlee is a ${description}.
    checksums       rmd160  5d2aa17b60cc4e34df0d08623aeb62766f3ebe82 \
                    sha256  34e2d3dc057022b78df1c5d15d688721cfa0f40e1abb110b68ee6f7236f68a8e \
                    size    1172759

    extract.rename  yes

    patch.pre_args-replace -p0 -p1
    patchfiles      util-path.patch \
                    templates-i18n-with_locale.cpp.patch \
                    templates-tests-testfilters.cpp.patch
    # install the headers in KDE4's header directory to avoid clashes with KF5
    patchfiles-append \
                    patch-include-dir.diff
    configure.args-append \
                    -DINCLUDE_INSTALL_DIR=include/${kde4.include_prefix}
    # there's no need to "hide" the grantlee cmake module directory; in fact,
    # doing so will lead to parsing failures because the install location is used
    # to determine the _IMPORT_PREFIX (see the installed .cmake files).
    set kde4.cmake_module_dir \
                    ${prefix}/lib/cmake
} else {
    # don't allow the KF5 portgroup to set use_xz
    set kf5.dont_use_xz yes
    PortGroup       kf5 1.1
    version         5.1.0
    categories      devel kde kf5
    long_description \
                    Grantlee5 is a ${description}
    checksums       rmd160  7ebd801276dd2aa257f2fd5717ddf4537551d810 \
                    sha256  ea2e402466c74bb533eee2c7252209ec61cd93a5d236fecd625b4a0eb13a1478

    patch.pre_args-replace -p0 -p1
#     patchfiles      patch-g5-util-path.diff
}

livecheck.url       http://downloads.grantlee.org/
livecheck.regex     "${name}-(\\d+(?:\\.\\d+)*)${extract.suffix}"
