depot/third_party/nixpkgs/pkgs/tools/misc/fend/default.nix
Default email 6d4aeb4377 Project import generated by Copybara.
GitOrigin-RevId: 0f213d0fee84280d8c3a97f7469b988d6fe5fcdf
2023-01-11 08:51:40 +01:00

47 lines
1 KiB
Nix

{ lib
, stdenv
, fetchFromGitHub
, rustPlatform
, darwin
, pandoc
, installShellFiles
}:
rustPlatform.buildRustPackage rec {
pname = "fend";
version = "1.1.3";
src = fetchFromGitHub {
owner = "printfn";
repo = pname;
rev = "v${version}";
sha256 = "sha256-3A+MxRonN1dhF7PrsGgc6zai1TQ9K8YIyqD0lqa3/EY=";
};
cargoSha256 = "sha256-VgueZKMDI35ERQR+V2SFxnUplHFS0LbJlGb/bRXUYWk=";
nativeBuildInputs = [ pandoc installShellFiles ];
buildInputs = lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.Security ];
postBuild = ''
patchShebangs --build ./documentation/build.sh
./documentation/build.sh
'';
preFixup = ''
installManPage documentation/fend.1
'';
doInstallCheck = true;
installCheckPhase = ''
[[ "$($out/bin/fend "1 km to m")" = "1000 m" ]]
'';
meta = with lib; {
description = "Arbitrary-precision unit-aware calculator";
homepage = "https://github.com/printfn/fend";
license = licenses.mit;
maintainers = with maintainers; [ djanatyn ];
};
}