2019-05-28 01:34:35 +02:00
|
|
|
{ stdenv, lib, fetchFromGitHub, rustPlatform
|
|
|
|
, ncurses ? null
|
|
|
|
, darwin ? null }:
|
|
|
|
|
|
|
|
let useNcurses = !stdenv.hostPlatform.isWindows; in
|
|
|
|
|
|
|
|
assert useNcurses -> ncurses != null;
|
2019-04-24 00:45:59 +02:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
2020-02-23 02:23:28 +01:00
|
|
|
pname = "xxv";
|
|
|
|
version = "0.1.2";
|
2019-04-24 00:45:59 +02:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "chrisvest";
|
|
|
|
repo = pname;
|
2019-09-09 01:38:31 +02:00
|
|
|
rev = version;
|
2020-02-23 02:23:28 +01:00
|
|
|
sha256 = "0ppfsgdigza2jppbkg4qanjhlkpnq7p115c4471vc6vpikpfrlk3";
|
2019-04-24 00:45:59 +02:00
|
|
|
};
|
|
|
|
|
2020-02-23 02:23:28 +01:00
|
|
|
cargoSha256 = "1gnyig87a0yqgkng52fpn6hv629vym6k7ydljnxrhb5phmj2qbqx";
|
2019-05-28 01:34:35 +02:00
|
|
|
|
|
|
|
buildInputs = lib.optionals useNcurses [ ncurses ]
|
|
|
|
++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ Security ])
|
|
|
|
;
|
2019-04-24 00:45:59 +02:00
|
|
|
|
2019-05-28 01:34:35 +02: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.
|
|
|
|
cargoBuildFlags = lib.optionals (!useNcurses) [ "--no-default-features" "--features pancurses-backend" ];
|
2019-04-24 00:45:59 +02:00
|
|
|
|
2019-05-28 01:34:35 +02:00
|
|
|
meta = with lib; {
|
2019-04-24 00:45:59 +02:00
|
|
|
description = "A visual hex viewer for the terminal";
|
|
|
|
longDescription = ''
|
2020-02-23 02:23:28 +01:00
|
|
|
XXV is a terminal hex viewer with a text user interface, written in 100% safe Rust.
|
2019-04-24 00:45:59 +02:00
|
|
|
'';
|
2020-02-23 02:23:28 +01:00
|
|
|
homepage = "https://chrisvest.github.io/xxv/";
|
|
|
|
license = with licenses; [ gpl3 ];
|
2019-04-24 00:45:59 +02:00
|
|
|
maintainers = with maintainers; [ lilyball ];
|
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
|
|
|
}
|