nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 gccStdenv,
4 fetchFromGitHub,
5 ncurses,
6}:
7
8gccStdenv.mkDerivation rec {
9 pname = "programmer-calculator";
10 version = "3.0-unstable-2025-11-06";
11
12 src = fetchFromGitHub {
13 owner = "alt-romes";
14 repo = "programmer-calculator";
15 rev = "153272c50b2491ddf25dfbfcf228a08a3b3ace69";
16 sha256 = "sha256-24OYG3tVxcc/1i9HRrzW/jPY41KnKkugLziWnG1wQIw=";
17 };
18
19 buildInputs = [ ncurses ];
20
21 installPhase = ''
22 runHook preInstall
23 install -Dm 555 bin/pcalc -t "$out/bin"
24 runHook postInstall
25 '';
26
27 meta = {
28 description = "Terminal calculator for programmers";
29 mainProgram = "pcalc";
30 longDescription = ''
31 Terminal calculator made for programmers working with multiple number
32 representations, sizes, and overall close to the bits
33 '';
34 homepage = "https://alt-romes.github.io/programmer-calculator";
35 changelog = "https://github.com/alt-romes/programmer-calculator/releases/tag/v${lib.versions.majorMinor version}";
36 license = lib.licenses.gpl3Only;
37 maintainers = with lib.maintainers; [ cjab ];
38 platforms = lib.platforms.all;
39 };
40}