2022-03-21 21:59:01 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, rustPlatform
|
|
|
|
, darwin
|
2022-10-10 12:33:52 +00:00
|
|
|
, pandoc
|
|
|
|
, installShellFiles
|
2022-03-21 21:59:01 +00:00
|
|
|
}:
|
2020-11-09 01:03:25 +00:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "fend";
|
2023-06-08 05:15:32 +00:00
|
|
|
version = "1.2.0";
|
2020-11-09 01:03:25 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "printfn";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2023-06-08 05:15:32 +00:00
|
|
|
sha256 = "sha256-vV7P2e6kv6CCHbI5Roz9WElntl3t/5ySXUw3XXEXMv4=";
|
2020-11-09 01:03:25 +00:00
|
|
|
};
|
|
|
|
|
2023-06-08 05:15:32 +00:00
|
|
|
cargoHash = "sha256-oAkZHx33YrwRUUIoooqpy72QCq0ZkAgBZ8W8XDe2fNE=";
|
2020-11-09 01:03:25 +00:00
|
|
|
|
2022-10-10 12:33:52 +00:00
|
|
|
nativeBuildInputs = [ pandoc installShellFiles ];
|
2022-03-21 21:59:01 +00:00
|
|
|
buildInputs = lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.Security ];
|
|
|
|
|
2022-10-10 12:33:52 +00:00
|
|
|
postBuild = ''
|
|
|
|
patchShebangs --build ./documentation/build.sh
|
|
|
|
./documentation/build.sh
|
|
|
|
'';
|
|
|
|
|
|
|
|
preFixup = ''
|
|
|
|
installManPage documentation/fend.1
|
|
|
|
'';
|
|
|
|
|
2021-02-16 07:46:13 +00:00
|
|
|
doInstallCheck = true;
|
|
|
|
|
|
|
|
installCheckPhase = ''
|
|
|
|
[[ "$($out/bin/fend "1 km to m")" = "1000 m" ]]
|
|
|
|
'';
|
|
|
|
|
2020-11-09 01:03:25 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Arbitrary-precision unit-aware calculator";
|
|
|
|
homepage = "https://github.com/printfn/fend";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ djanatyn ];
|
|
|
|
};
|
|
|
|
}
|