Skip to content

Commit

Permalink
Merge 8cb65f5 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 + 8cb65f5 commit 0b1b126
Show file tree
Hide file tree
Showing 9 changed files with 150 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
38 changes: 38 additions & 0 deletions default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{ luaVersion ? "luajit", pkgs ? import ./nix/packages.nix {} }:

with pkgs;
with pkgs."${luaVersion}Packages";

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;
ldoc = ./nix/ldoc.nix;
};
ffi = if isLuaJIT then [] else [ luaffi ];
runTimeDeps = [ lua argparse luafilesystem ];
testDeps = with deps; ffi ++ [
lanes
moonscript
busted
luacheck
luacov
luacov-coveralls
ldoc
];
in
{
lua-quickcheck = stdenv.mkDerivation rec {
name = "lua-quickcheck";
env = buildEnv { name = name; paths = buildInputs; };
buildInputs = runTimeDeps;
src = ./.;
};
shell = mkShell {
inputsFrom = testDeps;
buildInputs = runTimeDeps ++ testDeps;
};
}
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/ldoc.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{ buildLuarocksPackage, fetchurl, lua }:

buildLuarocksPackage rec {
pname = "ldoc";
version = "1.4.2-1";

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

meta = {
homepage = "http://stevedonovan.github.com/ldoc";
description = "LDoc is a LuaDoc-compatible documentation generator";
license = { fullName = "MIT/X11 https://github.com/stevedonovan/LDoc/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
6 changes: 6 additions & 0 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Possible versions for luaVersion: luajit (latest), lua51, lua52, lua53
# Change version with following command:
# $ nix-shell --argstr luaVersion luajit
{ luaVersion ? "luajit", pkgs ? import ./nix/packages.nix {} }:

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

0 comments on commit 0b1b126

Please sign in to comment.