nixpkgs/pkgs/tools/misc/fend/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

48 lines
1.0 KiB
Nix
Raw Normal View History

{ lib
, stdenv
, fetchFromGitHub
, rustPlatform
, darwin
2022-10-10 12:33:52 +00:00
, pandoc
, installShellFiles
}:
2020-11-09 01:03:25 +00:00
rustPlatform.buildRustPackage rec {
pname = "fend";
2023-04-09 16:50:50 +00:00
version = "1.1.6";
2020-11-09 01:03:25 +00:00
src = fetchFromGitHub {
owner = "printfn";
repo = pname;
rev = "v${version}";
2023-04-09 16:50:50 +00:00
sha256 = "sha256-PO8QKZwtiNMlEFT2P61oe5kj6PWsP5uouOOTRtvpyxI=";
2020-11-09 01:03:25 +00:00
};
2023-04-09 16:50:50 +00:00
cargoHash = "sha256-og2YoPUKKMBqEjryzSGqwLIm44WfKkerNtG2N7yl1wE=";
2020-11-09 01:03:25 +00:00
2022-10-10 12:33:52 +00:00
nativeBuildInputs = [ pandoc installShellFiles ];
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
'';
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 ];
};
}