# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4

PortSystem          1.0
PortGroup           gitlab 1.0
PortGroup           gobject_introspection 1.0

gitlab.instance     https://gitlab.freedesktop.org
gitlab.setup        zeitgeist zeitgeist 1.0.4 v
revision            2

license             LGPL-2.1
categories          devel
maintainers         nomaintainer

description         Zeitgeist is a service which logs the users's activities and \
                    events (files opened, websites visites, conversations held with \
                    other people, etc.) and makes relevant information available to \
                    other applications.
long_description    {*}${description}
homepage            https://zeitgeist.freedesktop.org

# stealth update; remove for next version
dist_subdir         ${name}/${version}_1

checksums           rmd160  d58ccd9c8e78178d21ec07db41834dbfcbe6840e \
                    sha256  9cd8cdd9e5a9cdd3a2b04706c8e21bb393db7dd8320abd757bf340096312cc2f \
                    size    249249

depends_build-append \
                    port:pkgconfig \
                    port:autoconf \
                    port:automake \
                    port:libtool \
                    port:gettext \
                    path:bin/vala:vala

depends_lib-append \
                    path:lib/pkgconfig/gtk+-3.0.pc:gtk3 \
                    path:lib/pkgconfig/glib-2.0.pc:glib2 \
                    port:dbus \
                    port:json-glib \
                    port:gettext-runtime \
                    port:telepathy-glib \
                    port:python310 \
                    port:py310-rdflib \
                    port:raptor2

gobject_introspection yes

configure.python    ${prefix}/bin/python3.10

patchfiles-append \
                    patch-configure.ac.diff \
                    patch-doc-libzeitgeist-Makefile.am.diff \
                    patch-libzeitgeist-Makefile.am.diff \
                    patch-python_Makefile.am.diff

post-patch {
    reinplace "s|^#\!.*|#!${configure.python}|" \
        ${worksrcpath}/data/ontology2code \
        ${worksrcpath}/test/dbus/blacklist-test.py \
        ${worksrcpath}/test/dbus/dsr-test.py \
        ${worksrcpath}/test/dbus/engine-test.py \
        ${worksrcpath}/test/dbus/histogram-test.py \
        ${worksrcpath}/test/dbus/monitor-test.py \
        ${worksrcpath}/test/dbus/remote-test.py \
        ${worksrcpath}/test/dbus/result-types-test.py \
        ${worksrcpath}/test/dbus/run-all-tests.py \
        ${worksrcpath}/test/dbus/upgrade-test.py \
        ${worksrcpath}/tools/development/index_switcher.py \
        ${worksrcpath}/tools/development/insert_events_from_json.py \
        ${worksrcpath}/tools/development/query_timings.py \
        ${worksrcpath}/tools/development/series.py \
        ${worksrcpath}/tools/development/slow_query_finder.py \
        ${worksrcpath}/tools/generate_events.py \
        ${worksrcpath}/tools/gtk/zeitgeist-data-sources-gtk.py \
        ${worksrcpath}/tools/ontology_graph.py \
        ${worksrcpath}/tools/scalability_benchmark.py \
        ${worksrcpath}/tools/talis  \
        ${worksrcpath}/tools/zeitgeist-explorer/zeitgeist-explorer
}

configure.cmd       ./autogen.sh

configure.args-append \
                    --disable-silent-rules \
                    --enable-docs=no

variant docs description {Enable building documentation} {
    depends_build-append \
                    port:gtk-doc

    configure.args-replace \
                    --enable-docs=no --enable-docs=yes
}
