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

github.setup        ledger ledger 3.3.2 v
github.tarball_from archive
revision            1

homepage            https://ledger-cli.org/
categories          finance

description         A command-line, double-entry accounting tool.
long_description    Ledger is a powerful, double-entry accounting system that \
                    is accessed from the UNIX command-line.
license             BSD
maintainers         nomaintainer

checksums           rmd160  71d1d75f5bf81bc7f39139fbef1eb73ca3078ef9 \
                    sha256  555296ee1e870ff04e2356676977dcf55ebab5ad79126667bc56464cb1142035 \
                    size    825274

set py_ver          3.13
set py_ver_nodot    [string map {. {}} ${py_ver}]

depends_lib-append  port:python${py_ver_nodot} \
                    port:utfcpp \
                    port:libedit \
                    port:gmp \
                    port:mpfr \
                    port:gettext

boost.version       1.81

require_active_variants [boost::depends_portname] python${py_ver_nodot}

compiler.cxx_standard   2011

configure.args-append \
                    -DBUILD_DOCS=OFF \
                    -DEDIT_LIB=${prefix}/lib/libedit.dylib \
                    -DEDIT_PATH=${prefix}/include \
                    -DGMP_LIB=${prefix}/lib/libgmp.dylib \
                    -DGMP_PATH=${prefix}/include \
                    -DMPFR_LIB=${prefix}/lib/libmpfr.dylib \
                    -DMPFR_PATH=${prefix}/include \
                    -DPython_EXECUTABLE=${prefix}/bin/python${py_ver} \
                    -DUSE_DOXYGEN=OFF \
                    -DUSE_PYTHON=ON

variant gpgme description {Add support for encrypted journals} {
    depends_lib-append    port:gpgme
    configure.args-append -DUSE_GPGME=ON
}

test.run            yes
