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}";
|
2016-11-24 13:34:11 +01:00
|
|
|
version = "2.1.0-beta2";
|
2016-03-19 10:35:20 +01:00
|
|
|
luaversion = "5.1";
|
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";
|
2016-11-24 13:34:11 +01:00
|
|
|
sha256 = "0iyghj1xjlmd9ywa4flf9yszynf3jhbp0yqb9b49k7ab0g528fbi";
|
2014-04-09 04:15:55 +02:00
|
|
|
};
|
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
|
2014-12-17 19:11:30 +01:00
|
|
|
|
|
|
|
substituteInPlace src/Makefile --replace gcc cc
|
|
|
|
'' + stdenv.lib.optionalString (stdenv.cc.libc != null)
|
2014-04-09 04:15:55 +02:00
|
|
|
''
|
|
|
|
substituteInPlace Makefile \
|
2016-03-11 15:57:39 +01:00
|
|
|
--replace ldconfig ${stdenv.cc.libc.bin or stdenv.cc.libc}/bin/ldconfig
|
2014-04-09 04:15:55 +02:00
|
|
|
'';
|
2013-11-15 17:20:29 +01:00
|
|
|
|
2014-04-09 04:15:55 +02:00
|
|
|
configurePhase = false;
|
|
|
|
buildFlags = [ "amalg" ]; # Build highly optimized version
|
2016-03-19 10:35:20 +01:00
|
|
|
installPhase = ''
|
|
|
|
make install INSTALL_INC=$out/include PREFIX=$out
|
2016-03-21 22:17:31 +01:00
|
|
|
ln -s $out/bin/luajit* $out/bin/lua
|
2016-03-19 10:35:20 +01:00
|
|
|
ln -s $out/bin/luajit* $out/bin/luajit
|
|
|
|
'';
|
2014-04-09 04:15:55 +02:00
|
|
|
|
2014-05-09 09:06:29 +02:00
|
|
|
meta = with stdenv.lib; {
|
2016-06-20 12:53:46 +02:00
|
|
|
description = "High-performance JIT compiler for Lua 5.1";
|
2014-04-09 04:15:55 +02:00
|
|
|
homepage = http://luajit.org;
|
2014-05-09 09:06:29 +02:00
|
|
|
license = licenses.mit;
|
|
|
|
platforms = platforms.linux ++ platforms.darwin;
|
2016-03-19 10:35:20 +01:00
|
|
|
maintainers = with maintainers ; [ thoughtpolice smironov ];
|
2014-04-09 04:15:55 +02:00
|
|
|
};
|
2013-11-15 17:20:29 +01:00
|
|
|
}
|