# -*- 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
PortGroup compiler_blacklist_versions 1.0
PortGroup xcode_workaround 1.0
maintainers {stromnov @stromnov} 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 5176d34fa112c4586394398c3a5c9ce1ad4d4c72 \
sha256 874b1f8297c697821f561f9b73b57ffd419ed8f4278c82e05b48806d30c1e979
reinplace "s|/usr/local|${prefix}|" ${worksrcpath}/etc/luajit.pc
compiler.blacklist {clang < 700} macports-clang-3.3 macports-clang-3.4
# changes to compiler flags must be made before `CFLAGS=...`
xcode_workaround.type append_to_compiler_flags
build.args-append CC="${configure.cc}" \
CFLAGS="${configure.cppflags} ${configure.cflags} [get_canonical_archflags] -DLUAJIT_ENABLE_LUA52COMPAT" \
LDFLAGS="${configure.ldflags} [get_canonical_archflags]" \
xinstall -m 755 -d ${destroot}${prefix}/share/doc
copy ${worksrcpath}/doc/ ${destroot}${prefix}/share/doc/${name}
livecheck.url ${master_sites}.html
livecheck.regex {LuaJIT-(\d+(?:\.\d+)*(?:-beta\d+)?).tar.gz}