summaryrefslogtreecommitdiff
path: root/pkgs/development/tcl-modules/critcl/default.nix
blob: 2845cc00b06a438d6774a717dffae53e8a7e4f32 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
{
  lib,
  fetchFromGitHub,
  mkTclDerivation,
  tcl,
  tcllib,
}:

mkTclDerivation rec {
  pname = "critcl";
  version = "3.3.1";

  src = fetchFromGitHub {
    owner = "andreas-kupries";
    repo = "critcl";
    tag = version;
    hash = "sha256-LBTAuwTrvwj42vo/TXVSUK8euxHgvSLai23e1jmhMso=";
  };

  buildInputs = [
    tcl
    tcllib
  ];

  dontBuild = true;
  doCheck = true;

  checkPhase = ''
    runHook preInstall
    HOME="$(mktemp -d)" tclsh ./build.tcl test
    runHook postInstall
  '';

  installPhase = ''
    runHook preInstall
    tclsh ./build.tcl install --prefix $out
    runHook postInstall
  '';

  meta = {
    description = "Easily embed C code in Tcl";
    homepage = "https://andreas-kupries.github.io/critcl/";
    license = lib.licenses.tcltk;
    mainProgram = "critcl";
    maintainers = with lib.maintainers; [ fgaz ];
    platforms = lib.platforms.all;
  };
}