# -*- 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           legacysupport 1.1
PortGroup           meson 1.0

# memmem
legacysupport.newest_darwin_requires_legacy 10

name                tinysparql
version             3.11.1
revision            0
set branch          [join [lrange [split ${version} .] 0 1] .]
description         Low-footprint RDF triple store with SPARQL 1.1 interface
long_description    {*}${description}
maintainers         nomaintainer
categories          gnome
license             {GPL-2+ LGPL-2+}
homepage            https://${name}.org
master_sites        gnome:sources/${name}/${branch}/

use_xz              yes
checksums           rmd160  81c8b49387b15f04c41b00c6f4adc4ee79a28b71 \
                    sha256  cfd46021ee1514ad435e714f7aa1ec7a787c7f516a94f4c7438897ee3d6eca1e \
                    size    2399760

# Our tracker3 includes it already.
conflicts           tracker3

# tracker-main.c:60:2: error: implicit declaration of function 'puts' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
patchfiles          patch-tracker-main.c.diff

# Fix configure bug on 32-bit
patchfiles-append   patch-meson.build.diff

# Fix invalid cp syntax
patchfiles-append   patch-fix-cp.diff

set py_ver          3.14
set py_ver_nodot    [string map {. {}} ${py_ver}]

configure.python    ${prefix}/bin/python${py_ver}

# Type redefinition
post-patch {
    reinplace "s|c_std=c99|c_std=c11|" ${worksrcpath}/meson.build
    reinplace "s|python3|${configure.python}|" ${worksrcpath}/meson.build
}

depends_build-append \
                    port:gettext \
                    path:lib/pkgconfig/gobject-introspection-1.0.pc:gobject-introspection \
                    path:bin/pkg-config:pkgconfig \
                    port:python${py_ver_nodot} \
                    path:bin/vala:vala

depends_lib-append  port:avahi \
                    port:dbus \
                    port:gettext-runtime \
                    path:lib/pkgconfig/glib-2.0.pc:glib2 \
                    path:lib/pkgconfig/icu-uc.pc:icu \
                    port:json-glib \
                    path:lib/pkgconfig/libsoup-3.0.pc:libsoup \
                    port:libxml2 \
                    port:sqlite3

compiler.c_standard 2011

configure.args-append \
                    -Davahi=enabled \
                    -Dbash_completion=false \
                    -Ddocs=false \
                    -Dintrospection=enabled \
                    -Dman=false \
                    -Dstemmer=disabled \
                    -Dsystemd_user_services=false \
                    -Dtests=false \
                    -Dvapi=enabled

livecheck.type      gnome
