Compare commits

..

1 Commits
master ... nix

Author SHA1 Message Date
Cadey Ratio a0a64394bb nix
continuous-integration/drone/push Build is passing Details
2020-02-01 21:45:59 +00:00
12 changed files with 25 additions and 97 deletions

2
.envrc
View File

@ -1 +1 @@
eval "$(lorri direnv)" eval "$(lorri direnv)"

1
.gitignore vendored
View File

@ -1 +0,0 @@
result

View File

@ -1,7 +0,0 @@
run = (cmd) ->
status = os.execute cmd
unless status
error string.format "got nonzero exit status %d", status
run "./test.sh"
run "nix-build"

View File

@ -1,23 +1,23 @@
{ pkgs ? import <nixpkgs> { }, lua ? pkgs.lua5_3 { pkgs ? import <nixpkgs> { }
, luaPackages ? pkgs.lua53Packages }: , stdenv ? pkgs.stdenv
, fetchurl ? pkgs.fetchurl
, buildLuarocksPackage ? pkgs.lua53Packages.buildLuarocksPackage
, luaOlder ? pkgs.luaPackages.luaOlder
, luaAtLeast ? pkgs.luaPackages.luaAtLeast, ... }:
with pkgs; with pkgs;
with luaPackages;
buildLuarocksPackage { buildLuarocksPackage {
pname = "ln"; pname = "ln";
version = "0.2.1-2"; version = "0.2.0";
src = fetchurl { src = fetchurl {
url = "https://luarocks.org/ln-0.2.1-2.src.rock"; url = "https://luarocks.org/manifests/xe/ln-0.2.0-1.src.rock";
sha256 = "1hb1vw68w407y05nprp352c0di6iybz4gjdhc0p521cpif4l8i1l"; sha256 = "0ff0139d8fkyp35csfs75b1jn9q37v5y35wzml82ff35k0sgwkam";
}; };
propagatedBuildInputs = [ lua dkjson ]; propagatedBuildInputs = [ lua5_3 ];
disabled = (luaOlder "5.2") || (luaAtLeast "5.4");
meta = with lib; { meta = {
homepage = "https://tulpa.dev/cadey/lua-ln"; homepage = "https://tulpa.dev/cadey/lua-ln";
description = "The natural log function";
license.fullName = "0bsd";
}; };
}
buildInputs = [ luaPackages.dkjson ];
}

View File

@ -9,7 +9,7 @@ description = {
summary = "The natural log function" summary = "The natural log function"
} }
dependencies = { dependencies = {
"lua ~> 5.1", "lua ~> 5.3",
"dkjson" "dkjson"
} }
build = { build = {

View File

@ -1,20 +0,0 @@
package = "ln"
version = "0.2.1-1"
source = {
url = "git+https://tulpa.dev/cadey/lua-ln"
}
description = {
homepage = "https://tulpa.dev/cadey/lua-ln",
license = "0bsd",
summary = "The natural log function"
}
dependencies = {
"lua ~> 5.1",
"dkjson"
}
build = {
type = "builtin",
modules = {
ln = "src/ln.lua"
}
}

View File

@ -1,20 +0,0 @@
package = "ln"
version = "0.2.1-2"
source = {
url = "git+https://tulpa.dev/cadey/lua-ln"
}
description = {
homepage = "https://tulpa.dev/cadey/lua-ln",
license = "0bsd",
summary = "The natural log function"
}
dependencies = {
"lua",
"dkjson"
}
build = {
type = "builtin",
modules = {
ln = "src/ln.lua"
}
}

View File

@ -1,13 +1,8 @@
{ pkgs ? import <nixpkgs> { } }: let
pkgs = import <nixpkgs> {};
let lua = pkgs.lua5_3.withPackages (ps: with ps; [ dkjson ]); in
pkgs.mkShell {
in pkgs.mkShell { buildInputs = [
buildInputs = with pkgs; (pkgs.luajit.withPackages(ps: with ps; [ busted dkjson ]))
with lua53Packages; [ ];
luarocks-nix
lua
busted
moonscript
];
} }

View File

@ -1,12 +0,0 @@
ln = require "ln"
describe "moonscript tests", ->
lgr = ln.default_logger
msg = ""
lgr.filters = {
(message) -> msg = message,
}
it "can log", ->
ln.log {foo: "bar"}
assert.truthy string.find msg, "foo=bar"

11
test.sh
View File

@ -1,10 +1,3 @@
#!/usr/bin/env bash #!/bin/sh
set -e
set -x
nix-shell -p lua5_1 -p lua51Packages.busted -p lua51Packages.moonscript --run "busted"
nix-shell -p lua5_2 -p lua52Packages.busted -p lua52Packages.moonscript --run "busted"
nix-shell -p lua5_3 -p lua53Packages.busted -p lua53Packages.moonscript --run "busted"
nix-shell -p luajit -p luajitPackages.busted -p luajitPackages.moonscript --run "busted"
busted --defer-print