summary refs log tree commit diff
path: root/pkgs/applications/science/math/programmer-calculator/default.nix
blob: e9c7cb985cb9b6f6093e4ee73854aa98deaa52ba (plain) (blame)
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
{ lib, gccStdenv, fetchFromGitHub, ncurses }:

gccStdenv.mkDerivation rec {
  pname = "programmer-calculator";
  version = "2.2";

  src = fetchFromGitHub {
    owner = "alt-romes";
    repo = pname;
    rev = "v${version}";
    sha256 = "sha256-JQcYCYKdjdy8U2XMFzqTH9kAQ7CFv0r+sC1YfuAm7p8=";
  };

  buildInputs = [ ncurses ];

  installPhase = ''
    runHook preInstall
    install -Dm 555 pcalc -t "$out/bin"
    runHook postInstall
  '';

  meta = with lib; {
    description = "A terminal calculator for programmers";
    longDescription = ''
      Terminal calculator made for programmers working with multiple number
      representations, sizes, and overall close to the bits
    '';
    homepage = "https://alt-romes.github.io/programmer-calculator";
    changelog = "https://github.com/alt-romes/programmer-calculator/releases/tag/v${version}";
    license = licenses.gpl3Only;
    maintainers = with lib.maintainers; [ cjab ];
    platforms = platforms.all;
  };
}