2020-04-24 23:36:52 +00:00
|
|
|
{ stdenv, lib, fetchFromGitHub, rustPlatform
|
|
|
|
, ncurses ? null
|
|
|
|
, darwin ? null }:
|
|
|
|
|
|
|
|
let useNcurses = !stdenv.hostPlatform.isWindows; in
|
|
|
|
|
|
|
|
assert useNcurses -> ncurses != null;
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "xxv";
|
|
|
|
version = "0.1.2";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "chrisvest";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
|
|
|
sha256 = "0ppfsgdigza2jppbkg4qanjhlkpnq7p115c4471vc6vpikpfrlk3";
|
|
|
|
};
|
|
|
|
|
2021-05-28 09:39:13 +00:00
|
|
|
cargoSha256 = "0pmpvlmy4pw252is34r9af1ysrp78xs8pz8cw4rys9s4fh2hmhjb";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildInputs = lib.optionals useNcurses [ ncurses ]
|
|
|
|
++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ Security ])
|
|
|
|
;
|
|
|
|
|
|
|
|
# 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-12-06 16:07:01 +00:00
|
|
|
buildNoDefaultFeatures = !useNcurses;
|
|
|
|
buildFeatures = lib.optional (!useNcurses) "pancurses-backend";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Visual hex viewer for the terminal";
|
2020-04-24 23:36:52 +00:00
|
|
|
longDescription = ''
|
|
|
|
XXV is a terminal hex viewer with a text user interface, written in 100% safe Rust.
|
|
|
|
'';
|
|
|
|
homepage = "https://chrisvest.github.io/xxv/";
|
|
|
|
license = with licenses; [ gpl3 ];
|
2024-07-27 06:49:29 +00:00
|
|
|
maintainers = with maintainers; [ ];
|
2024-01-02 11:29:13 +00:00
|
|
|
mainProgram = "xxv";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|