# -*- 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           conflicts_build 1.0
PortGroup           openssl 1.0

openssl.branch      1.0

name                virtuoso-5
set myname          virtuoso
version             5.0.15
revision            1
categories          devel
maintainers         {@barracuda156 gmail.com:vital.had} openmaintainer
license             GPL
description         a high-performance object-relational SQL database
long_description    Virtuoso is an enterprise-grade server that delivers a platform \
                    for Data Access, Integration and Management.
homepage            http://${myname}.openlinksw.com/dataspace/dav/wiki/Main/
master_sites        sourceforge:project/${myname}/${myname}/${version}
distname            ${myname}-opensource-${version}

checksums           rmd160  f0d849b49cffd1ccee2bfbb197e2f51195ea0663 \
                    sha256  b5684608e28b78cffaf437044ca9c5917c6bb03db1847a33a6c5f43d96df3174 \
                    size    65145784

# arm64: ../../libsrc/Dk/Dkconfig.h:109:3: error: "Unknown Apple architecture"
supported_archs     i386 ppc ppc64 x86_64
# implicit declarations
platforms           {darwin < 20}
conflicts           virtuoso-7 virtuoso-6

depends_build-append \
                    port:gawk

depends_lib-append  port:ImageMagick \
                    port:kerberos5 \
                    path:lib/libldap.dylib:openldap

conflicts_build     unixODBC

configure.args-append   --disable-all-vads \
                        --enable-krb
post-configure {
    reinplace "s|\"gcc\"|\"${configure.cc}\"|" ${worksrcpath}/bin/libtool.macosx
    foreach note $PortInfo(notes) {
        ui_msg $note
    }
}

post-build {
    touch ${worksrcpath}/docsrc/html_virt/test.html
}

pre-activate {
    if {[file exists ${prefix}/bin/inifile]
        && ![catch {set vers [lindex [registry_active $myname ] 0]}]} {
        registry_deactivate_composite ${myname} "" [list ports_nodepcheck 1]
    }
}

notes "
Some antivirus software can cause the virtuoso build to hang indefinitely.\
If you have any antivirus software installed, please disable it while\
building virtuoso; it can be re-enabled after virtuoso has been installed.
"

livecheck.url       http://sourceforge.net/api/file/index/project-id/161622/mtime/desc/rss?path=/virtuoso
livecheck.type      regex
livecheck.regex     ${myname}/(6(\\.\\d+)+)/${myname}-opensource-(6(\\.\\d+)+)
