summaryrefslogtreecommitdiff
path: root/pkgs/by-name/un/unsure/package.nix
blob: 9dfac7acd78445895f0998ccfc679e868e031cf9 (about) (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
{
  buildDartApplication,
  dart,
  fetchFromGitHub,
  lib,
  runCommand,
  testers,
  unsure,
  writeText,
}:

buildDartApplication rec {
  pname = "unsure";
  version = "0.4.0-unstable-2025-04-15";

  src = fetchFromGitHub {
    owner = "filiph";
    repo = "unsure";
    rev = "123712482b7053974cbef9ffa7ba46c1cdfb765f";
    hash = "sha256-rn10vy6l12ToiqO4vGVT4N7WNlj6PY/r+xVzjmYqILw=";
  };

  pubspecLock = lib.importJSON ./pubspec.lock.json;

  doInstallCheck = true;
  installCheckPhase = ''
    runHook preInstallCheck

    [[ "$("$out/bin/unsure" "4~6 * 1~2" | head --lines=2)" == "$(printf '\n\t%s' '5~11')" ]]

    runHook postInstallCheck
  '';

  passthru.updateScript = ./update.sh;

  meta = {
    changelog = "https://github.com/filiph/unsure/blob/${src.rev}/CHANGELOG.md";
    description = "Calculate with numbers you’re not sure about";
    downloadPage = "https://github.com/filiph/unsure";
    homepage = "https://filiph.github.io/unsure";
    license = lib.licenses.mit;
    mainProgram = "unsure";
    maintainers = [
      lib.maintainers.l0b0
      lib.maintainers.rksm
    ];
  };
}