# -*- 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.2
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  a491b2618ff6dc262ec893145d571ba8f954b5da \
                    sha256  e42cc098f7b8a6051c4f79a99b55162d467098aba60f69649bdc7583f0734b57 \
                    size    12825701

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"
