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

name                soprano
version             2.9.4
revision            7
categories          devel
maintainers         nomaintainer
license             GPL-2+ LGPL-2+

description         The Qt-based RDF framework.
long_description    Soprano is a software library that provides an \
                    object-oriented C++/Qt4 framework for RDF data.
platforms           darwin
homepage            https://projects.kde.org/projects/kdesupport/soprano
master_sites        sourceforge:soprano

#Deactivate pre-compiled binaries to avoid case-sensitive install (see ##62105)
archive_sites

use_bzip2           yes

checksums           rmd160  b5e8db32a77ab9fed5dac74783cb137259d91bb2 \
                    sha256  64066fbd54e71d7ae4c8a4116997448a72808a2813cff3bb5d2c28f0fce9e0e5 \
                    size    1958856

depends_lib-append  port:strigi \
                    port:raptor2 \
                    port:redland \
                    port:libiodbc

depends_run-append  port:virtuoso

#Virtuoso builds only on 64bit, but it is only a runtime dependency,
#automatically deactivated if not available (ticket #41773)
depends_skip_archcheck  virtuoso

patchfiles          patch-parsers-raptor-raptorparser.h.diff \
                    patch-serializers-raptor-raptorserializer.cpp.diff \
                    pkgconfig.patch

post-patch {
    reinplace "s|SOPRANO_LIB_SUFFIX| &|g" \
        ${worksrcpath}/soprano/pluginmanager.cpp \
        ${worksrcpath}/soprano/sopranodirs.cpp
}

configure.args-append \
                    -DSOPRANO_DISABLE_CLUCENE_INDEX=1 \
                    -DSOPRANO_DISABLE_SESAME2_BACKEND=1

test.run yes
configure.args-append \
                    -DSOPRANO_BUILD_TESTS=ON
configure.pre_args-replace \
                    -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=ON \
                    -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF

# the JavaVM requirement is a problem, as there is no current universal JavaVM for arm64/x86_64
# and the kde ports can't build as arm64. So they would need an x86_64 JavaVM installed if there
# is one. Any JavaVM the user has installed on an arm Mac is unlikely to be Intel arch.
# just disable the java backend to allow the kde4 ports to build.

# this variant left behind but disabled in case there is a user somewhere who really
# needs the java backend to work on soprano -- I can't find any such use case so far

# variant sesame2 description "enable sesame2 backend, requires JavaVM" {
#     PortGroup java 1.0
#
#     java.version   11+
#     java.fallback  openjdk11
#
#     configure.args-delete -DSOPRANO_DISABLE_SESAME2_BACKEND=1
# }

livecheck.type      sourceforge
livecheck.url       http://sourceforge.net/projects/soprano/files/Soprano/
livecheck.regex     ${name}-(\\d+(\\.\\d+)+)
