# $Id: Portfile 30664 2007-11-02 21:09:04Z afb@macports.org $ PortSystem 1.0 name lua version 5.1.2 categories lang platforms darwin maintainers pmq@macports.org openmaintainer 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, standalone language. homepage http://www.lua.org master_sites ${homepage}/ftp/ checksums sha1 8a460d2d7e70e93cb72bf3d584405464763cb5f0 \ rmd160 01350549b3a05838925dae1a666700bb9f1bc01a depends_lib port:readline patchfiles patch-use_readline.diff build.target macosx test.run yes test.env DYLD_LIBRARY_PATH=./lib post-patch { reinplace "s|/usr/local|${prefix}|g" ${worksrcpath}/Makefile reinplace "s|/usr/local|${prefix}|g" ${worksrcpath}/src/luaconf.h reinplace "s|/man/man1|/share/man/man1|g" ${worksrcpath}/Makefile # to complement the use_readline patch reinplace "s|MYLDFLAGS=|MYLDFLAGS=-L${prefix}/lib|" ${worksrcpath}/src/Makefile # for the pkgconfig file reinplace "s|/usr/local|${prefix}|g" ${worksrcpath}/etc/lua.pc } # "use_configure no" nullifies the configure.universal_* hooks configure { if {[variant_isset universal]} { reinplace "s|MYCFLAGS=|MYCFLAGS=\"${configure.universal_cflags} \"|g" ${worksrcpath}/src/Makefile reinplace "s|MYLDFLAGS=|MYLDFLAGS=${configure.universal_ldflags} |g" ${worksrcpath}/src/Makefile } } destroot.target install INSTALL_TOP=${destroot}/${prefix} post-destroot { xinstall -d -m 0755 ${destroot}${prefix}/share/doc/${name} xinstall -m 0644 ${worksrcpath}/README ${destroot}${prefix}/share/doc/${name} xinstall -m 0644 ${worksrcpath}/COPYRIGHT ${destroot}${prefix}/share/doc/${name} xinstall -m 0644 ${worksrcpath}/HISTORY ${destroot}${prefix}/share/doc/${name} xinstall -d -m 0755 ${destroot}${prefix}/share/doc/${name}/html foreach html [glob ${worksrcpath}/doc/*.html ${worksrcpath}/doc/*.gif] { xinstall -m 0644 ${html} ${destroot}${prefix}/share/doc/${name}/html } xinstall -d -m 0755 ${destroot}${prefix}/share/doc/${name}/test foreach test [glob ${worksrcpath}/test/README ${worksrcpath}/test/*.lua] { xinstall -m 0644 ${test} ${destroot}${prefix}/share/doc/${name}/test } xinstall -d -m 0755 ${destroot}${prefix}/lib/pkgconfig xinstall -m 0644 ${worksrcpath}/etc/lua.pc ${destroot}${prefix}/lib/pkgconfig/lua.pc } platform darwin 7 { depends_lib-delete port:readline patchfiles-delete patch-use_readline.diff }