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

# strndup, clock_gettime
legacysupport.newest_darwin_requires_legacy 15

github.setup        Softmotions ejdb 0bef7559e78041cdfb4320bbb18629b71f1fea41
version             2024.02.17
name                ejdb2
revision            0
categories          databases
license             MIT
maintainers         {@barracuda156 gmail.com:vital.had} openmaintainer
description         Embeddable JSON database engine
long_description    {*}${description}. Single-file database, online backups support, \
                    Fault-tolerant storage, HTTP REST/websockets network endpoints.
homepage            https://ejdb.org
checksums           rmd160  54c7648719221a7da9b1b6aed1b540fe692fb947 \
                    sha256  e8110ed3961303b988e68f76b49b76f08ead1403a2538f280473dacc64853802 \
                    size    815065
github.tarball_from archive

depends_build-append \
                    port:cunit
depends_lib-append  port:iowow

compiler.c_standard 2011

configure.args-append \
                    -DASAN:BOOL=OFF \
                    -DBUILD_ANDROID_LIBS:BOOL=OFF \
                    -DBUILD_BENCHMARKS:BOOL=OFF \
                    -DBUILD_DART_BINDING:BOOL=OFF \
                    -DBUILD_EXAMPLES:BOOL=OFF \
                    -DBUILD_FLUTTER_BINDING:BOOL=OFF \
                    -DBUILD_FRAMEWORK:BOOL=OFF \
                    -DBUILD_JNI_BINDING:BOOL=OFF \
                    -DBUILD_NODEJS_BINDING:BOOL=OFF \
                    -DBUILD_REACT_NATIVE_BINDING:BOOL=OFF \
                    -DBUILD_SHARED_LIBS:BOOL=ON \
                    -DBUILD_SWIFT_BINDING:BOOL=OFF \
                    -DBUILD_TESTS:BOOL=ON \
                    -DENABLE_HTTP:BOOL=ON \
                    -DPACKAGE_TGZ:BOOL=OFF \
                    -DPACKAGE_ZIP:BOOL=OFF

if {[string match *gcc* ${configure.compiler}]} {
    configure.ldflags-append \
                    -latomic
}

# FIXME: on PowerPC tests fail.
test.run            yes
