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

name                    luash
version                 0.9
revision                2
license                 AGPL-3+
categories              shells
maintainers             nomaintainer
description             shell written in Lua/C++
long_description        luash is a shell written in Lua/C++ that allow you to run command using Lua syntax
homepage                http://luaforge.net/projects/luash
platforms               darwin
master_sites            http://files.luaforge.net/releases/luash/luash/luash${version}
distname                ${name}
dist_subdir             ${name}/${version}
checksums               md5     67bbb8985166579686361fe840e016c0 \
                        sha1    ef1d56843f19a29b96f6d5ce8f983b54074b955f \
                        rmd160  165d88850e8d068d7586f1785b36dd20c9c8ce37

use_bzip2               yes

# patch for luash.lua addresses a change in API for os.execute() in 5.2
# remove it if a lua51 port is introduced and used to compile luash
patchfiles              patch-makefile.diff \
                        patch-luash_cpp.diff \
                        patch-luash_lua.diff

use_configure           no
universal_variant       yes

depends_lib             port:lua \
                        port:lua-luafilesystem

pre-build {
    build.args          CXX=${configure.cxx} \
                        CXX_FLAGS="${configure.cppflags} ${configure.cxxflags} \
                            [get_canonical_archflags cxx] ${configure.ldflags}"
}

destroot.destdir        PREFIX=${destroot}${prefix}

post-destroot {
    xinstall -d -m 755 ${destroot}${prefix}/share/doc/${name}
    xinstall    -m 644 -W ${worksrcpath} COPYING README ${destroot}${prefix}/share/doc/${name}
}

