# $Id: Portfile 113352 2013-11-14 09:46:58Z ryandesign@macports.org $ PortSystem 1.0 name luajit version 2.0.2 categories lang platforms darwin license BSD maintainers and.damore openmaintainer description a Just-In-Time Compiler for Lua long_description LuaJIT is a Just-In-Time Compiler for the Lua programming language. homepage http://luajit.org master_sites ${homepage}/download distname LuaJIT-${version} checksums rmd160 581ead4b18b54000d83f1ff79559c709f781b6c3 \ sha256 c05202974a5890e777b181908ac237625b499aece026654d7cc33607e3f46c38 use_configure no macosx_deployment_target 10.6 build.target amalg build.args-append CC="${configure.cc}" \ CFLAGS="${configure.cflags} ${configure.cppflags} [get_canonical_archflags]" \ LDFLAGS="${configure.ldflags} [get_canonical_archflags]" \ PREFIX="${prefix}" \ Q="" # luajit doesn't depends on lua but if lua 5.2 is installed we're going to change the conf file so we can use 5.2 extensions if { ![catch {set lua_version [string range [lindex [lindex [registry_active lua] 0] 1] 0 2]}] && [vercmp $lua_version 5.2] >= 0} { post-patch { reinplace "s|/usr/local|${prefix}|" ${worksrcpath}/etc/luajit.pc reinplace "s|5\\.1|${lua_version}|g" ${worksrcpath}/src/luaconf.h ${worksrcpath}/etc/luajit.pc set lua_release [string range [lindex [lindex [registry_active lua] 0] 1] 4 4] reinplace "/VERSION/s,5.1,${lua_version}," ${worksrcpath}/src/lua.h reinplace "/RELEASE/s,5.1,${lua_version}\\.${lua_release}," ${worksrcpath}/src/lua.h } configure.args-append ABIVER=$lua_version build.args-append ABIVER=$lua_version destroot.args-append ABIVER=$lua_version build.args-delete CFLAGS="${configure.cflags} ${configure.cppflags} [get_canonical_archflags]" build.args-append CFLAGS="${configure.cflags} ${configure.cppflags} [get_canonical_archflags] -DLUAJIT_ENABLE_LUA52COMPAT" } post-patch { reinplace "s|/usr/local|${prefix}|" ${worksrcpath}/etc/luajit.pc } destroot.args-append PREFIX="${prefix}" post-destroot { xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name} xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name}/img xinstall -m 644 ${worksrcpath}/COPYRIGHT ${worksrcpath}/README ${destroot}${prefix}/share/doc/${name} eval xinstall -m 644 [glob ${worksrcpath}/doc/*.html] ${destroot}${prefix}/share/doc/${name} eval xinstall -m 644 [glob ${worksrcpath}/doc/*.css] ${destroot}${prefix}/share/doc/${name} eval xinstall -m 644 [glob ${worksrcpath}/doc/img/*] ${destroot}${prefix}/share/doc/${name}/img xinstall -d -m 755 ${destroot}${prefix}/share/pkgconfig xinstall -m 644 ${worksrcpath}/etc/luajit.pc ${destroot}${prefix}/share/pkgconfig xinstall -m 644 ${worksrcpath}/etc/luajit.1 ${destroot}${prefix}/share/man/man1 } livecheck.type regex livecheck.url ${master_sites}.html livecheck.regex {LuaJIT-(\d+(?:\.\d+)*(?:-beta\d+)?).tar.gz}