Skip to content

Commit

Permalink
Merge eb9743e into fa5a57b
Browse files Browse the repository at this point in the history
  • Loading branch information
luc-tielen committed Apr 16, 2019
2 parents fa5a57b + eb9743e commit 3c4c1a3
Show file tree
Hide file tree
Showing 8 changed files with 127 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ spec/fixtures/*.so
.lqc
*.rock
doc/
.envrc
36 changes: 36 additions & 0 deletions default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{ luaVersion ? "luajit_2_1", pkgs ? import ./nix/packages.nix {} }:

with pkgs;
with luaPackages;

let
buildArgs = { inherit buildLuarocksPackage fetchurl lua; };
deps = builtins.mapAttrs (dep: path: import path buildArgs) {
moonscript = ./nix/moonscript.nix;
luacov = ./nix/luacov.nix;
luacov-coveralls = ./nix/luacov-coveralls.nix;
lanes = ./nix/lanes.nix;
};
ffi = if isLuaJIT then [] else [ luaffi ];
runTimeDeps = [ lua argparse luafilesystem ];
testDeps = with deps; ffi ++ [
lanes
moonscript
busted
luacheck
luacov
luacov-coveralls
];
in
{
lua-quickcheck = stdenv.mkDerivation rec {
name = "lua-quickcheck";
env = buildEnv { name = name; paths = buildInputs; };
buildInputs = runTimeDeps;
src = ./.;
};
shell = mkShell {
inputsFrom = testDeps;
buildInputs = runTimeDeps;
};
}
24 changes: 24 additions & 0 deletions nix/lanes.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{ buildLuarocksPackage, fetchurl, lua }:

buildLuarocksPackage rec {
pname = "lanes";
version = "3.13.0-0";

knownRockspec = (fetchurl {
url = "https://luarocks.org/${pname}-${version}.rockspec";
sha256 = "1l6vcj8102cy2nawfvwmlmfxsl0b12cqlfx10rb886rv6h2nqd3l";
}).outPath;

src = fetchurl {
url = https://github.com/LuaLanes/lanes/archive/v3.13.0.tar.gz;
sha256 = "1wcg5khzlm848pmd1832g39n5jwd410acnmf8c2wl5qzw5z7v8ak";
};
propagatedBuildInputs = [ lua ];

meta = {
homepage = "https://github.com/LuaLanes/lanes";
description = "Lua Lanes is a portable, message passing multithreading library providing the possibility to run multiple Lua states in parallel.";

license = { fullName = "MIT/X11 https://github.com/LuaLanes/lanes/blob/master/COPYRIGHT"; };
};
}
18 changes: 18 additions & 0 deletions nix/luacov-coveralls.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{ buildLuarocksPackage, fetchurl, lua }:

buildLuarocksPackage rec {
pname = "luacov-coveralls";
version = "0.2.2-1";

src = fetchurl {
url = "https://luarocks.org/${pname}-${version}.src.rock";
sha256 = "1kqv1s3ih1wgcanp6zh9yxzzdmrz5zx3xsr9x73j5w5fpq3jczqp";
};
propagatedBuildInputs = [ lua ];

meta = {
homepage = "http://github.com/moteus/luacov-coveralls";
description = "Coveralls.io support for Lua projects using luacov";
license = { fullName = "MIT/X11 <https://github.com/moteus/luacov-coveralls/blob/master/LICENSE>"; };
};
}
18 changes: 18 additions & 0 deletions nix/luacov.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{ buildLuarocksPackage, fetchurl, lua }:

buildLuarocksPackage rec {
pname = "luacov";
version = "0.13.0-1";

src = fetchurl {
url = "https://luarocks.org/${pname}-${version}.src.rock";
sha256 = "16am0adzr4y64n94f64d4yrz65in8rwa8mmjz1p0k8afm5p5759i";
};
propagatedBuildInputs = [ lua ];

meta = {
homepage = "http://keplerproject.github.io/luacov/";
description = "Simple coverage analysis tool for Lua scripts.";
license = { fullName = "MIT <http://opensource.org/licenses/MIT>"; };
};
}
18 changes: 18 additions & 0 deletions nix/moonscript.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{ buildLuarocksPackage, fetchurl, lua }:

buildLuarocksPackage rec {
pname = "moonscript";
version = "0.5.0-1";

src = fetchurl {
url = "https://luarocks.org/${pname}-${version}.src.rock";
sha256 = "09vv3ayzg94bjnzv5fw50r683ma0x3lb7sym297145zig9aqb9q9";
};
propagatedBuildInputs = [ lua ];

meta = {
homepage = "https://moonscript.org";
description = "A programmer friendly language that compiles to Lua.";
license = { fullName = "MIT <http://opensource.org/licenses/MIT>"; };
};
}
9 changes: 9 additions & 0 deletions nix/packages.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
let
nixpkgs = builtins.fetchTarball {
name = "nixos-19.03";
url = https://github.com/nixos/nixpkgs/archive/19.03.tar.gz;
sha256 = "0q2m2qhyga9yq29yz90ywgjbn9hdahs7i8wwlq7b55rdbyiwa5dy";
};
pkgs = import nixpkgs;
in
pkgs
3 changes: 3 additions & 0 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{ luaVersion ? "luajit_2_1", pkgs ? import ./nix/packages.nix {} }:

(import ./. { inherit luaVersion pkgs; }).shell

0 comments on commit 3c4c1a3

Please sign in to comment.