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

nim.setup           github nim-lang atlas 0.10.1
revision            0
nim.vcs_revision    ff1f4289482dce94ba9f95b3b0ae16d16e21eb3d
categories-append   devel
license             MIT
maintainers         {@barracuda156 macos-powerpc.org:barracuda} openmaintainer

description         The Atlas Package cloner for Nim
long_description    Atlas is a dependency management tool for Nim projects that \
                    manages project dependencies in an isolated deps/ directory. \
                    Unlike Nimble which installs packages globally, Atlas creates \
                    a dedicated workspace containing both your project and its \
                    dependencies, keeping everything organized and isolated. \
                    Atlas works by creating a nim.cfg file with proper compiler \
                    configs - no magic! Ships with Nim 2.0 and later.

homepage            https://github.com/nim-lang/atlas

checksums           rmd160  2d9bb2ad325a615b5c9cd00dba2406aadcb1ea74 \
                    sha256  5f4a20f25b396e4bd886359d818dce81d48047a5441992c8b174315ac592e585 \
                    size    103381

patchfiles          patch-atlas-version.diff

post-patch {
    reinplace "s|@GITHASH@|${nim.vcs_revision}|g" ${worksrcpath}/src/atlas.nim
}

nim.nimble_binaries atlas

depends_lib-append  port:nim-sat

notes "
Atlas is a dependency management tool for Nim that isolates dependencies\
in a project-local deps/ directory, unlike Nimble’s global installation.

Usage:
    atlas init          # Initialize a new project
    atlas use <pkg>     # Add a dependency
    atlas build         # Build the project
    atlas search <pkg>  # Search for packages

Atlas creates a nim.cfg file to configure the Nim compiler with proper paths.\
To clear Atlas’s configuration, simply delete the nim.cfg file.

Example workflow:
    mkdir myproject && cd myproject
    atlas init
    atlas use regex
    atlas build
"
