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

github.setup        crystal-lang shards 0.20.0 v

categories          devel
platforms           {darwin >= 16}
license             Apache-2
maintainers         {@conradwt gmail.com:conradwt} openmaintainer

description         dependency manager for crystal

long_description    Dependency manager for the Crystal programming language

depends_build       port:crystal

depends_lib         port:boehmgc \
                    port:libiconv \
                    port:libyaml \
                    port:pcre2

depends_run         port:crystal

depends_test        port:fossil \
                    port:mercurial

# Update with shard.lock, see Makefile.
set molinillo.version   0.2.0
set molinillo.distname  crystal-molinillo-${molinillo.version}

github.tarball_from archive
master_sites        ${master_sites}:main \
                    https://github.com/crystal-lang/crystal-molinillo/archive/v${molinillo.version}:molinillo

distfiles           ${distfiles}:main \
                    ${molinillo.distname}${extract.suffix}:molinillo

checksums           ${distname}${extract.suffix} \
                    rmd160  bad1ad989c058c0e82a23ed724067f166f867a85 \
                    sha256  8655b87761016409e4411056e350b24e7fe79eae3f227b3354b181a03f14d5da \
                    size    109618 \
                    ${molinillo.distname}${extract.suffix} \
                    rmd160  6937976d1e249b1de948b8a88acc549b0f9f42ca \
                    sha256  e231cf2411a6a11a1538983c7fb52b19e650acc3338bd3cdf6fdb13d6463861a \
                    size    23959

post-patch {
    xinstall -d ${worksrcpath}/lib
    move ${workpath}/${molinillo.distname} ${worksrcpath}/lib/molinillo
}

use_configure       no

build.args          release=1

destroot.args       PREFIX=${prefix}

test.run            yes
