2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, meson, ninja }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "janet";
|
2022-11-21 17:40:18 +00:00
|
|
|
version = "1.25.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "janet-lang";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2022-11-21 17:40:18 +00:00
|
|
|
sha256 = "sha256-TWKiSE8mqXz5i4vd32WylTsyxMXXKGmVl3U2q2sMwDQ=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-02-20 05:27:41 +00:00
|
|
|
postPatch = ''
|
2021-07-14 22:03:04 +00:00
|
|
|
substituteInPlace janet.1 \
|
2022-02-20 05:27:41 +00:00
|
|
|
--replace /usr/local/ $out/
|
2021-07-14 22:03:04 +00:00
|
|
|
'';
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
nativeBuildInputs = [ meson ninja ];
|
2021-07-14 22:03:04 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
mesonFlags = [ "-Dgit_hash=release" ];
|
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
|
2022-07-14 12:49:19 +00:00
|
|
|
doInstallCheck = true;
|
|
|
|
|
|
|
|
installCheckPhase = ''
|
2022-09-22 12:36:57 +00:00
|
|
|
$out/bin/janet -e '(+ 1 2 3)'
|
2022-07-14 12:49:19 +00:00
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Janet programming language";
|
|
|
|
homepage = "https://janet-lang.org/";
|
|
|
|
license = licenses.mit;
|
2021-07-14 22:03:04 +00:00
|
|
|
maintainers = with maintainers; [ andrewchambers peterhoeg ];
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
|
|
|
}
|