depot/third_party/nixpkgs/pkgs/development/interpreters/nelua/default.nix

36 lines
1.1 KiB
Nix
Raw Normal View History

{ lib, stdenv, fetchFromGitHub, luaPackages, unstableGitUpdater }:
stdenv.mkDerivation rec {
pname = "nelua";
version = "unstable-2024-02-03";
src = fetchFromGitHub {
owner = "edubart";
repo = "nelua-lang";
rev = "05a2633a18dfdde7389394b9289da582c10e79bc";
hash = "sha256-oRW+pCB10T0A6fEPP3S+8iurQ2J5WMpQlCYScfIk07c=";
};
postPatch = ''
substituteInPlace lualib/nelua/version.lua \
--replace "NELUA_GIT_HASH = nil" "NELUA_GIT_HASH = '${src.rev}'" \
--replace "NELUA_GIT_DATE = nil" "NELUA_GIT_DATE = '${lib.removePrefix "unstable-" version}'"
'';
makeFlags = [ "PREFIX=$(out)" ];
nativeCheckInputs = [ luaPackages.luacheck ];
doCheck = true;
passthru.updateScript = unstableGitUpdater { };
meta = with lib; {
description = "Minimal, efficient, statically-typed and meta-programmable systems programming language heavily inspired by Lua, which compiles to C and native code";
homepage = "https://nelua.io/";
license = licenses.mit;
platforms = platforms.all;
maintainers = [ maintainers.marsam ];
};
}