2013-12-15 06:04:07 +00:00
|
|
|
{ stdenv, fetchurl }:
|
2013-11-15 16:20:29 +00:00
|
|
|
|
2014-04-09 03:15:55 +01:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "luajit-${version}";
|
2015-05-27 22:36:08 +01:00
|
|
|
version = "2.0.4";
|
2013-11-15 16:20:29 +00:00
|
|
|
|
2014-04-09 03:15:55 +01:00
|
|
|
src = fetchurl {
|
|
|
|
url = "http://luajit.org/download/LuaJIT-${version}.tar.gz";
|
2015-05-27 22:36:08 +01:00
|
|
|
sha256 = "0zc0y7p6nx1c0pp4nhgbdgjljpfxsb5kgwp4ysz22l1p2bms83v2";
|
2014-04-09 03:15:55 +01:00
|
|
|
};
|
2013-11-15 16:20:29 +00:00
|
|
|
|
2014-04-09 03:15:55 +01:00
|
|
|
enableParallelBuilding = true;
|
2013-12-15 06:04:07 +00:00
|
|
|
|
2014-05-09 08:06:29 +01:00
|
|
|
patchPhase = ''
|
|
|
|
substituteInPlace Makefile \
|
|
|
|
--replace /usr/local $out
|
2014-12-17 18:11:30 +00:00
|
|
|
|
|
|
|
substituteInPlace src/Makefile --replace gcc cc
|
|
|
|
'' + stdenv.lib.optionalString (stdenv.cc.libc != null)
|
2014-04-09 03:15:55 +01:00
|
|
|
''
|
|
|
|
substituteInPlace Makefile \
|
2014-12-17 18:11:30 +00:00
|
|
|
--replace ldconfig ${stdenv.cc.libc}/sbin/ldconfig
|
2014-04-09 03:15:55 +01:00
|
|
|
'';
|
2013-11-15 16:20:29 +00:00
|
|
|
|
2014-04-09 03:15:55 +01:00
|
|
|
configurePhase = false;
|
|
|
|
buildFlags = [ "amalg" ]; # Build highly optimized version
|
|
|
|
installPhase = "make install PREFIX=$out";
|
|
|
|
|
2014-05-09 08:06:29 +01:00
|
|
|
meta = with stdenv.lib; {
|
2014-04-09 03:15:55 +01:00
|
|
|
description = "high-performance JIT compiler for Lua 5.1";
|
|
|
|
homepage = http://luajit.org;
|
2014-05-09 08:06:29 +01:00
|
|
|
license = licenses.mit;
|
|
|
|
platforms = platforms.linux ++ platforms.darwin;
|
|
|
|
maintainers = [ maintainers.thoughtpolice ];
|
2014-04-09 03:15:55 +01:00
|
|
|
};
|
2013-11-15 16:20:29 +00:00
|
|
|
}
|