From e66965fdee1cd52bb368739c68268af9498e663f Mon Sep 17 00:00:00 2001 From: William Casarin Date: Sun, 17 Jan 2016 16:50:10 -0800 Subject: [PATCH] terra: init at git-2016-01-06 --- pkgs/development/compilers/terra/default.nix | 42 ++++++++++++++++++++ pkgs/top-level/all-packages.nix | 6 +++ 2 files changed, 48 insertions(+) create mode 100644 pkgs/development/compilers/terra/default.nix diff --git a/pkgs/development/compilers/terra/default.nix b/pkgs/development/compilers/terra/default.nix new file mode 100644 index 000000000000..3586e4c32e5f --- /dev/null +++ b/pkgs/development/compilers/terra/default.nix @@ -0,0 +1,42 @@ +{ stdenv, lua, fetchFromGitHub, fetchurl, which, llvm, clang, ncurses }: + +let luajitArchive = "LuaJIT-2.0.4.tar.gz"; + luajitSrc = fetchurl { + url = "http://luajit.org/download/${luajitArchive}"; + sha256 = "0zc0y7p6nx1c0pp4nhgbdgjljpfxsb5kgwp4ysz22l1p2bms83v2"; + }; +in stdenv.mkDerivation rec { + name = "terra-git-${version}"; + version = "2016-01-06"; + + src = fetchFromGitHub { + owner = "zdevito"; + repo = "terra"; + rev = "914cb98b8adcd50b2ec8205ef5d6914d3547e281"; + sha256 = "1q0dm9gkx2lh2d2sfgly6j5nw32qigmlj3phdvjp26bz99cvxq46"; + }; + + patchPhase = '' + substituteInPlace Makefile --replace \ + '-lcurses' '-lncurses' + ''; + + configurePhase = '' + mkdir -p build + cp ${luajitSrc} build/${luajitArchive} + ''; + + installPhase = '' + mkdir -p $out + cp -r "release/"* $out + ''; + + buildInputs = [ which lua llvm clang ncurses ]; + + meta = with stdenv.lib; { + inherit (src.meta) homepage; + description = "A low-level counterpart to Lua"; + maintainers = with maintainers; [ jb55 ]; + license = licenses.mit; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 4c8cc009b0f1..1b4a0ee76051 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -4966,6 +4966,12 @@ let tbb = callPackage ../development/libraries/tbb { }; + terra = callPackage ../development/compilers/terra { + llvm = llvmPackages_35.llvm.override { enableSharedLibraries = false; }; + clang = clang_35; + lua = lua5_1; + }; + teyjus = callPackage ../development/compilers/teyjus { omake = omake_rc1; };