# -*- 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
description powerful, lightweight programming language
long_description Lua is a powerful, light-weight programming language designed for \
extending applications. Lua is also frequently used as a general-purpose, \
homepage http://www.lua.org/
master_sites ${homepage}ftp/
checksums rmd160 08126da480196edd3e1b58077456f3b7a31b18c0 \
sha256 f681aa518233bc407e23acf0f5887c884f17436f000d453b2491a9f11a52400c
patchfiles patch-Makefile.diff \
patch-src-Makefile.diff \
# TODO: also add lua50 and lua51 here
checksums rmd160 3bad2da85f354132da6a53b45882006f0a451b5c \
sha256 b9e2e4aad6789b3b63a056d442f7b39f0ecfca3ae0f1fc0ae4e9614401b69f4b
patchfiles patch-Makefile-52.diff \
patch-src-Makefile-52.diff \
patch-src-luaconf.h-52.diff
set branch [join [lrange [split ${version} .] 0 1] .]
depends_lib port:readline
test.env DYLD_LIBRARY_PATH=./lib
reinplace "s|@PREFIX@|${prefix}|g" ${worksrcpath}/lua.pc ${worksrcpath}/Makefile ${worksrcpath}/src/Makefile ${worksrcpath}/src/luaconf.h
reinplace "s|@VERSION@|${version}|g" ${worksrcpath}/lua.pc ${worksrcpath}/Makefile ${worksrcpath}/src/Makefile
reinplace "s|@BRANCH@|${branch}|g" ${worksrcpath}/lua.pc ${worksrcpath}/Makefile ${worksrcpath}/src/Makefile
reinplace -E "/^MYLDFLAGS=/s|\$| ${configure.ldflags} [get_canonical_archflags]|" ${worksrcpath}/src/Makefile
reinplace -E "/^CFLAGS=/s|\$| ${configure.cflags} ${configure.cppflags} [get_canonical_archflags]|" ${worksrcpath}/src/Makefile
reinplace "s|CC= .*\$|CC= ${configure.cc}|" ${worksrcpath}/src/Makefile
destroot.target install INSTALL_TOP=${destroot}${prefix}
set docdir ${prefix}/share/doc/${subport}
xinstall -d -m 0755 ${destroot}${docdir}/html
xinstall -m 0644 -W ${worksrcpath} COPYRIGHT README ${destroot}${docdir}
foreach html [glob ${worksrcpath}/doc/*.html ${worksrcpath}/doc/*.css ${worksrcpath}/doc/*.gif ${worksrcpath}/doc/*.png] {
xinstall -m 0644 ${html} ${destroot}${docdir}/html
xinstall -m 0644 -W ${filespath} COPYRIGHT lua.pc ${worksrcpath}
xinstall -W ${worksrcpath} -m 0644 lua.pc ${destroot}${prefix}/lib/pkgconfig/
xinstall -m 0644 -W ${filespath}/${branch} COPYRIGHT lua.pc ${worksrcpath}
# version executable and man pages files
foreach f [glob ${destroot}${prefix}/bin/*] {
foreach f [glob ${destroot}${prefix}/share/man/man1/*] {