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";
|
2023-11-12 12:11:24 +00:00
|
|
|
version = "1.8.0";
|
2023-10-29 22:11:43 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "sharkdp";
|
|
|
|
repo = "numbat";
|
|
|
|
rev = "v${version}";
|
2023-11-12 12:11:24 +00:00
|
|
|
hash = "sha256-mwDpdQEIgvdGbcXEtA3TLP1e2yFNRCdcljaOzDEoKjg=";
|
2023-10-29 22:11:43 +00:00
|
|
|
};
|
|
|
|
|
2023-11-12 12:11:24 +00:00
|
|
|
cargoHash = "sha256-hGNfB82m2w9wDiPs8PMUExWOBN9ZQ+XVs1v8jhHuVhA=";
|
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
|
|
|
};
|
|
|
|
}
|