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

PortSystem          1.0
PortGroup           github 1.0
PortGroup           cmake 1.1

name                charm
version             1.11.0

github.setup        KDAB Charm ${version}
# Change github.tarball_from to 'releases' or 'archive' next update
github.tarball_from tarball

maintainers         {gmail.com:rjvbertin @RJVB} openmaintainer
categories          office
license             GPL-2+ LGPL-2.1+
description         Charm - the Cross-Platform Time Tracker
long_description    Charm is a program for OS X, Linux and Windows that helps to keep track of time. It is built around two major ideas - tasks and events. Tasks are the things time is spend on, repeatedly. For example, ironing laundry is a task. The laundry done for two hours on last Tuesday is an event in that task. When doing laundry multiple times, the events will be accumulated, and can later be printed in activity reports or weekly/monthly time sheets. So in case laundry would be done for three hours on Wednesday again, the activity report for the "Ironing Laundry" task would list the event on tuesday, the event on wednesday and a total of five hours.

subport ${name}-qt5 {
    PortGroup       qt5 1.0

    conflicts       ${name}
    qt5.depends_component \
                    qtmacextras qtscript sqlite-plugin

    patchfiles-append \
                    patch-fix-Qt5.diff

    configure.args-append \
                    -DCHARM_FORCE_QT4:BOOL=OFF
}

if {${subport} ne "${name}-qt5"} {
    PortGroup       qt4 1.0

    revision        20151018

    conflicts       ${name}-qt5
    depends_build-append \
                    port:automoc
    depends_lib-append \
                    port:qt4-mac-sqlite3-plugin
    configure.args-append \
                    -DCHARM_FORCE_QT4:BOOL=ON
}

checksums           rmd160  da690a57d743e8c79e2d60d8bb2f29a276b69055 \
                    sha256  8729bc0936a481a113b8a56a747455ec488bf565182ca29d8bb583c74b194267

configure.args-append \
                    -DCharm_VERSION="${version}"

# These patches have still do be adapted to the current version:
#patchfiles          adapt-to-osx-macports.patch

# cc1plus: error: unrecognized command line option "-std=c++0x"
compiler.cxx_standard 2011

destroot {
    xinstall -m 0755 -d ${destroot}${qt_apps_dir}
    file copy ${workpath}/build/Charm/Charm.app ${destroot}${qt_apps_dir}
}
