# -*- 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
github.setup keplerproject luafilesystem [string map {. _ - _} ${ver}] v
# github.setup overwrites the version
description File System Library for the Lua Programming Language
long_description LuaFileSystem is a Lua library developed to complement the set of functions \
related to file systems offered by the standard Lua distribution.
homepage https://keplerproject.github.com/luafilesystem/
checksums rmd160 2c1ddbe3855f8418a5b65dc935dc77edbd2cca34 \
sha256 b8884702cdf729a0de25899197e8f4f29163583fba1d9e2b1f496ad860691d42 \
patchfiles patch-config.diff MDT.diff
reinplace "s|@@PREFIX@@|${prefix}|g" ${worksrcpath}/config
reinplace "s|luaL_reg |luaL_Reg |g" ${worksrcpath}/src/lfs.c
reinplace "/^LUA_LIBDIR=/s,lib/lua/5.1,lib/lua/5.3," ${worksrcpath}/config
reinplace "s|@@MDT@@|${macosx_deployment_target}|" ${worksrcpath}/config
build.args CC="${configure.cc}" \
CFLAGS="${configure.cflags} -I${prefix}/include [get_canonical_archflags cc] -DLUA_COMPAT_MODULE" \
LDFLAGS="${configure.ldflags} -llua -lm [get_canonical_archflags ld]"
xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name}
xinstall -m 755 -d ${destroot}${prefix}/share/examples/${name}
xinstall -m 644 {*}[glob ${worksrcpath}/doc/us/*] ${destroot}${prefix}/share/doc/${name}
xinstall -m 644 {*}[glob ${worksrcpath}/tests/*] ${destroot}${prefix}/share/examples/${name}