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

github.setup        mamba-org mamba 2023.07.13
name                libmamba
version             1.4.9
revision            0
categories          devel
platforms           darwin
license             BSD
maintainers         {l2dy @l2dy} openmaintainer

checksums           rmd160  d1650ce5eb599d3b4d100e331443f7160e1f72f9 \
                    sha256  340b96a2aa629254b47cbc8ffe9c677ac76cd63620edc2198dd3489ff0771fa8 \
                    size    963073

compiler.cxx_standard 2017

depends_build-append  \
                    port:ghc-filesystem \
                    port:nlohmann-json \
                    port:termcolor \
                    port:tl-expected

depends_lib-append  port:libarchive \
                    port:libfmt9

cmake.module_path-append \
                    ${prefix}/lib/libfmt9/cmake

if {${subport} eq ${name}} {
    description         a reimplementation of the conda package manager in C++
    long_description    Mamba is {*}${description}.

    depends_build-append  \
                        port:python312 \
                        port:zstdConfig.cmake

    depends_lib-append  port:libsolv \
                        port:reproc \
                        port:spdlog \
                        port:yaml-cpp \
                        port:zstd

    configure.args      -DBUILD_LIBMAMBA=ON \
                        -DBUILD_SHARED=ON
}

subport micromamba {
    description         a tiny version of the mamba package manager
    long_description    micromamba is a tiny version of the mamba package manager. \
                        It is a pure C++ package with a separate command line \
                        interface. It can be used to bootstrap environments (as an \
                        alternative to miniconda), but it's currently experimental.

    categories-append   sysutils

    depends_build-append  \
                        port:CLI11 \
                        port:zstdConfig.cmake

    depends_lib-append  port:libmamba

    configure.args      -DBUILD_MICROMAMBA=ON \
                        -DMICROMAMBA_LINKAGE=DYNAMIC
}
