# -*- 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-6
set myname          virtuoso
version             6.1.8
revision            9
categories          devel
maintainers         {snc @nerdling} 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  76a397dbd4b7689cbfc55f9373c3e2ed83d497bc \
                    sha256  08d05c6165117de0370e81aa89ddab618e645b5110be301f72e6ffea7044ca50 \
                    size    117756529

supported_archs     ppc i386 x86_64
conflicts           virtuoso-7 virtuoso-5

depends_build       port:gawk

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

conflicts_build     unixODBC

patchfiles-append   patch-missing-includes.diff

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

if {[string match *clang* ${configure.compiler}]} {
    configure.cflags-append \
                    -Wno-error=implicit-function-declaration
}

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.
"

test.run            yes
test.target         check

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+)+)
