# -*- 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 2024.03.25
github.tarball_from archive
name                libmamba
version             1.5.8
revision            1
categories          devel
license             BSD
maintainers         {l2dy @l2dy} openmaintainer

checksums           rmd160  8229157ae93d198c2922a31e3aeadf15bb37348f \
                    sha256  6ddaf4b0758eb7ca1250f427bc40c2c3ede43257a60bac54e4320a4de66759a6 \
                    size    1005020

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.prefix_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
}

livecheck.url       ${github.homepage}/releases/latest
livecheck.regex     {releases/expanded_assets/([^"]+)"}
