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

# dprintf
legacysupport.newest_darwin_requires_legacy 10

name                oilshell
version             0.36.0
revision            0

homepage            https://oils.pub

description         \
    Oils is our upgrade path from bash to a better language and runtime.

long_description    \
    {*}${description} Compared to POSIX shell and bash, Oil is easier to \
    learn, write, and debug. It's designed for programmers who know Python, \
    JavaScript, or Ruby, but avoid shell. Oil will do everything bash can, \
    and more. For example, it will have dynamic types and structured data, \
    not just strings.

categories          shells
installs_libs       no
license             {Apache-2 PSF}
maintainers         {gmail.com:herby.gillot @herbygillot} \
                    openmaintainer

checksums           rmd160  ad34715d9dcda5ceb006fcd5d2b0d239da616968 \
                    sha256  9b65fc7333708dc1dc777e8a6145ae868eac6fbe0c444a8b12bb6d6d29652902 \
                    size    882434

set archivename     oils-for-unix
master_sites        ${homepage}/download/
distname            ${archivename}-${version}

# cpp/stdlib.cc: error: expected unqualified-id before 'sizeof'
patchfiles-append   patch-fix-cmath.diff

depends_lib-append  port:readline

# cc1plus: error: unrecognized command line option "-std=c++11"
compiler.cxx_standard   2011

configure.args-append \
                    --cxx-for-configure=${configure.cxx} \
                    --with-readline

build.cmd           _build/oils.sh
build.pre_args      {}
build.args          --cxx ${configure.cxx}
build.env-append    CXXFLAGS=${configure.cxxflags} \
                    LDFLAGS=${configure.ldflags}

destroot {
    foreach oilbin {oils-for-unix osh ysh} {
        copy ${worksrcpath}/_bin/${configure.cxx}-opt-sh/${oilbin} \
            ${destroot}${prefix}/bin/
    }

    xinstall -d ${destroot}${prefix}/share/man/man1
    xinstall -m 0444 \
        ${worksrcpath}/doc/osh.1 ${destroot}${prefix}/share/man/man1/
}

livecheck.regex     "${archivename}-(\[0-9.\]+)${extract.suffix}"
