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

name                swi-prolog
conflicts           swi-prolog-devel
epoch               20051223
version             10.0.1
revision            0

categories          lang
universal_variant   no
license             BSD
maintainers         {swi-prolog.org:jan @JanWielemaker} openmaintainer

description         SWI-Prolog compiler plus extra packages (stable version)
long_description    ISO/Edinburgh-style Prolog compiler including modules, \
                    autoload, libraries, Garbage-collector, stack-expandor, \
                    C/C++-interface, Multiple threads, GNU-readline interface, \
                    coroutining, constraint programming, global variables, \
                    very fast compiler. Including packages clib (Unix process \
                    control, sockets, MIME), cpp (C++ interface), sgml (reading \
                    XML/SGML), sgml/RDF (reading RDF into triples), ODBC \
                    interface and XPCE (Graphics UI toolkit, integrated editor \
                    (Emacs-clone) and graphical debugger).

homepage            https://www.swi-prolog.org/
master_sites        https://www.swi-prolog.org/download/stable/src/

distname            swipl-${version}
dist_subdir         swi-prolog

checksums           rmd160  ab9ae9dfbf406c3aeb8814d2d0d1303c987a099b \
                    sha256  a9504745310e36195cf8cee9ad9164a7aa99e389c669ca6d279e321efc2ad9d4 \
                    size    12812508

depends_build-append \
                    port:pkgconfig

depends_lib-append  port:db62 \
                    port:gmp \
                    path:include/turbojpeg.h:libjpeg-turbo \
                    port:libarchive \
                    port:libmcrypt \
                    port:ncurses \
                    port:ossp-uuid \
                    port:pcre2 \
                    port:SDL3 \
                    port:SDL3_image \
                    path:lib/pkgconfig/cairo.pc:cairo \
                    path:lib/pkgconfig/pango.pc:pango \
                    port:libyaml \
                    port:zlib \
                    port:python313

compiler.c_standard 2011
compiler.cxx_standard 2017
compiler.thread_local_storage yes

configure.cmd       cmake
cmake.generator     Ninja
configure.pre_args  -DCMAKE_INSTALL_PREFIX=${prefix} \
                    -DCMAKE_BUILD_TYPE=Release \
                    -DCMAKE_INCLUDE_PATH=${prefix}/include \
                    -DCMAKE_LIBRARY_PATH=/usr/lib:${prefix}/lib \
                    -DCPYTHON_VERSION="3.13\;EXACT"

build.env-append    SDL_VIDEODRIVER=dummy

test.run            yes
test.cmd            ctest --output-on-failure

livecheck.type      regex
livecheck.url       ${homepage}download/stable/src
livecheck.regex     "swipl-(\\d+\\.\\d+\\.\\d+).tar.gz"
