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

ruby.branches       3.4 3.3 3.2 3.1
ruby.setup          jekyll 4.4.1 gem {} rubygems
categories-append   devel www
platforms           any
license             MIT
maintainers         nomaintainer
description         Jekyll is a simple, blog aware, static site generator
long_description    {*}${description}
homepage            https://jekyllrb.com
checksums           rmd160  652717ccab98e909d7d44d4f6fe8caa15c045bc7 \
                    sha256  4c1144d857a5b2b80d45b8cf5138289579a9f8136aadfa6dd684b31fe2bc18c1 \
                    size    128512
supported_archs     noarch

if {${subport} ne ${name}} {
    depends_run-append \
                    path:bin/git:git \
                    port:rb${ruby.suffix}-addressable \
                    port:rb${ruby.suffix}-base64 \
                    port:rb${ruby.suffix}-colorator \
                    port:rb${ruby.suffix}-csv \
                    port:rb${ruby.suffix}-em-websocket \
                    port:rb${ruby.suffix}-i18n \
                    port:rb${ruby.suffix}-jekyll-sass-converter \
                    port:rb${ruby.suffix}-jekyll-watch \
                    port:rb${ruby.suffix}-json \
                    port:rb${ruby.suffix}-kramdown \
                    port:rb${ruby.suffix}-kramdown-parser-gfm \
                    port:rb${ruby.suffix}-liquid \
                    port:rb${ruby.suffix}-mercenary \
                    port:rb${ruby.suffix}-pathutil \
                    port:rb${ruby.suffix}-rouge \
                    port:rb${ruby.suffix}-safe_yaml \
                    port:rb${ruby.suffix}-terminal-table \
                    port:rb${ruby.suffix}-webrick

    # These must be verified on every update:
    post-destroot {
        # rb-liquid
        reinplace "s|~> 4.0|>= 4.0|g" ${destroot}${ruby.gemdir}/specifications/${ruby.module}-${version}.gemspec
        # rb-terminal-table
        reinplace "s|< 4.0|< 5.0|g" ${destroot}${ruby.gemdir}/specifications/${ruby.module}-${version}.gemspec
        # rb-webrick
        reinplace "s|~> 1.7|>= 1.7|g" ${destroot}${ruby.gemdir}/specifications/${ruby.module}-${version}.gemspec
    }

    notes "
    To avoid requiring optional dependencies, you may need to set JEKYLL_NO_BUNDLER_REQUIRE=0 in environment.
    "
}
