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

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

41 lines
1.3 KiB
Nix
Raw Normal View History

2019-05-27 23:34:35 +00:00
{ stdenv, lib, fetchFromGitHub, rustPlatform
, ncurses ? null
, darwin ? null }:
let useNcurses = !stdenv.hostPlatform.isWindows; in
assert useNcurses -> ncurses != null;
2019-04-23 22:45:59 +00:00
rustPlatform.buildRustPackage rec {
pname = "xxv";
version = "0.1.2";
2019-04-23 22:45:59 +00:00
src = fetchFromGitHub {
owner = "chrisvest";
repo = pname;
2019-09-08 23:38:31 +00:00
rev = version;
sha256 = "0ppfsgdigza2jppbkg4qanjhlkpnq7p115c4471vc6vpikpfrlk3";
2019-04-23 22:45:59 +00:00
};
cargoSha256 = "0pmpvlmy4pw252is34r9af1ysrp78xs8pz8cw4rys9s4fh2hmhjb";
2019-05-27 23:34:35 +00:00
buildInputs = lib.optionals useNcurses [ ncurses ]
++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ Security ])
;
2019-04-23 22:45:59 +00:00
2019-05-27 23:34:35 +00:00
# I'm picking pancurses for Windows simply because that's the example given in Cursive's
# documentation for picking an alternative backend. We could just as easily pick crossterm.
2021-11-16 00:12:23 +00:00
buildNoDefaultFeatures = !useNcurses;
buildFeatures = lib.optional (!useNcurses) "pancurses-backend";
2019-04-23 22:45:59 +00:00
2019-05-27 23:34:35 +00:00
meta = with lib; {
2019-04-23 22:45:59 +00:00
description = "A visual hex viewer for the terminal";
longDescription = ''
XXV is a terminal hex viewer with a text user interface, written in 100% safe Rust.
2019-04-23 22:45:59 +00:00
'';
homepage = "https://chrisvest.github.io/xxv/";
license = with licenses; [ gpl3 ];
2019-04-23 22:45:59 +00:00
maintainers = with maintainers; [ lilyball ];
};
}