2016-06-15 01:37:37 +02:00
|
|
|
{ stdenv, fetchFromGitHub, fetchurl, which, llvmPackages, ncurses, lua }:
|
|
|
|
|
|
|
|
let
|
|
|
|
luajitArchive = "LuaJIT-2.0.4.tar.gz";
|
|
|
|
luajitSrc = fetchurl {
|
|
|
|
url = "http://luajit.org/download/${luajitArchive}";
|
|
|
|
sha256 = "0zc0y7p6nx1c0pp4nhgbdgjljpfxsb5kgwp4ysz22l1p2bms83v2";
|
|
|
|
};
|
|
|
|
in
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2016-01-18 01:50:10 +01:00
|
|
|
name = "terra-git-${version}";
|
2016-06-15 01:37:37 +02:00
|
|
|
version = "2016-06-09";
|
2016-01-18 01:50:10 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "zdevito";
|
|
|
|
repo = "terra";
|
2016-06-15 01:37:37 +02:00
|
|
|
rev = "22696f178be8597af555a296db804dba820638ba";
|
|
|
|
sha256 = "1c2i9ih331304bh31c5gh94fx0qa49rsn70pvczvdfhi8pmcms6g";
|
2016-01-18 01:50:10 +01:00
|
|
|
};
|
|
|
|
|
2016-06-15 01:37:37 +02:00
|
|
|
outputs = [ "dev" "out" "bin" "static" ];
|
|
|
|
|
|
|
|
postPatch = ''
|
2016-01-18 01:50:10 +01:00
|
|
|
substituteInPlace Makefile --replace \
|
|
|
|
'-lcurses' '-lncurses'
|
|
|
|
'';
|
|
|
|
|
2016-06-15 01:37:37 +02:00
|
|
|
preBuild = ''
|
2016-01-18 01:50:10 +01:00
|
|
|
mkdir -p build
|
|
|
|
cp ${luajitSrc} build/${luajitArchive}
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
2016-06-15 01:37:37 +02:00
|
|
|
mkdir -pv $out/lib
|
|
|
|
cp -v release/lib/terra.so $out/lib
|
|
|
|
|
|
|
|
mkdir -pv $bin/bin
|
|
|
|
cp -v release/bin/terra $bin/bin
|
|
|
|
|
|
|
|
mkdir -pv $static/lib
|
|
|
|
cp -v release/lib/libterra.a $static/lib
|
|
|
|
|
|
|
|
mkdir -pv $dev/include
|
|
|
|
cp -rv release/include/terra $dev/include
|
|
|
|
''
|
|
|
|
;
|
2016-01-18 01:50:10 +01:00
|
|
|
|
2016-06-15 01:37:37 +02:00
|
|
|
buildInputs = with llvmPackages; [ which lua llvm clang-unwrapped ncurses ];
|
2016-01-18 01:50:10 +01:00
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
inherit (src.meta) homepage;
|
|
|
|
description = "A low-level counterpart to Lua";
|
|
|
|
maintainers = with maintainers; [ jb55 ];
|
|
|
|
license = licenses.mit;
|
|
|
|
};
|
|
|
|
}
|