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