2023-10-29 22:11:43 +00:00
|
|
|
{ lib
|
2023-11-01 14:14:46 +00:00
|
|
|
, stdenv
|
2023-11-03 23:00:27 +00:00
|
|
|
, testers
|
2023-10-29 22:11:43 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, rustPlatform
|
2023-11-01 14:14:46 +00:00
|
|
|
, darwin
|
2023-11-03 23:00:27 +00:00
|
|
|
, numbat
|
2023-10-29 22:11:43 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "numbat";
|
2024-02-13 12:19:16 +00:00
|
|
|
version = "1.10.1";
|
2023-10-29 22:11:43 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "sharkdp";
|
|
|
|
repo = "numbat";
|
|
|
|
rev = "v${version}";
|
2024-02-13 12:19:16 +00:00
|
|
|
hash = "sha256-/jt1+21yem0q/dlc7z89MRaVrnllb9QLSQUo2f/9q8o=";
|
2023-10-29 22:11:43 +00:00
|
|
|
};
|
|
|
|
|
2024-02-13 12:19:16 +00:00
|
|
|
cargoHash = "sha256-8AA0LTw/9kd6yDme4N3/ANVkS67eoLrJviNhdqUftXM=";
|
2023-10-29 22:11:43 +00:00
|
|
|
|
2023-11-01 14:14:46 +00:00
|
|
|
buildInputs = lib.optionals stdenv.isDarwin [
|
|
|
|
darwin.apple_sdk.frameworks.Security
|
|
|
|
];
|
|
|
|
|
2023-11-05 21:26:28 +00:00
|
|
|
env.NUMBAT_SYSTEM_MODULE_PATH = "${placeholder "out"}/share/${pname}/modules";
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
mkdir -p $out/share/${pname}
|
|
|
|
cp -r $src/${pname}/modules $out/share/${pname}/
|
|
|
|
'';
|
|
|
|
|
2023-11-03 23:00:27 +00:00
|
|
|
passthru.tests.version = testers.testVersion {
|
|
|
|
package = numbat;
|
|
|
|
};
|
|
|
|
|
2023-10-29 22:11:43 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "High precision scientific calculator with full support for physical units";
|
|
|
|
longDescription = ''
|
|
|
|
A statically typed programming language for scientific computations
|
|
|
|
with first class support for physical dimensions and units
|
|
|
|
'';
|
|
|
|
homepage = "https://numbat.dev";
|
|
|
|
changelog = "https://github.com/sharkdp/numbat/releases/tag/v${version}";
|
|
|
|
license = with licenses; [ asl20 mit ];
|
|
|
|
mainProgram = "numbat";
|
2023-11-13 13:58:19 +00:00
|
|
|
maintainers = with maintainers; [ giomf atemu ];
|
2023-10-29 22:11:43 +00:00
|
|
|
};
|
|
|
|
}
|