description powerful, light-weight 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, stand-alone language.
homepage http://www.lua.org
master_sites ${homepage}/ftp/
checksums md5 feee27132056de2949ce499b0ef4c480
depends_lib port:readline
patchfiles patch-config \
reinplace s|@PREFIX@|${prefix}| ${worksrcpath}/config
reinplace s|@DESTROOT@|${destroot}| ${worksrcpath}/config
reinplace s|@CC@|${configure.cc}| ${worksrcpath}/config
reinplace "s|@CFLAGS@|${configure.cflags} [get_canonical_archflags]|" ${worksrcpath}/config
reinplace "s|@LDFLAGS@|[get_canonical_archflags]|" ${worksrcpath}/config ${worksrcpath}/Makefile
build.target all dylib dylibbin
destroot.target install dylibinstall
xinstall -d -m 0755 ${destroot}${prefix}/share/doc/${name}
xinstall -W ${worksrcpath} -m 0644 README ${destroot}${prefix}/share/doc/${name}
xinstall -W ${worksrcpath} -m 0644 COPYRIGHT ${destroot}${prefix}/share/doc/${name}
xinstall -W ${worksrcpath} -m 0644 HISTORY ${destroot}${prefix}/share/doc/${name}
xinstall -d -m 0755 ${destroot}${prefix}/share/doc/${name}/html
foreach html [glob doc/*.html doc/*.gif] {
xinstall -W ${worksrcpath} -m 0644 ${html} ${destroot}${prefix}/share/doc/${name}/html
xinstall -d -m 0755 ${destroot}${prefix}/share/doc/${name}/test
foreach test [glob test/README test/*.lua] {
xinstall -W ${worksrcpath} -m 0644 ${test} ${destroot}${prefix}/share/doc/${name}/test
test.env DYLD_LIBRARY_PATH=./lib
livecheck.url ${master_sites}
livecheck.regex "lua-(5.0(?:\\.\\d+)*)${extract.suffix}"