1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-16 18:03:22 +00:00
nixpkgs/pkgs/tools/misc/xxv/default.nix
Daniël de Kok 85f96822a0 treewide: fix cargoSha256/cargoHash
Rust 1.50.0 incorporated a Cargo change (rust-lang/cargo#8937) in
which cargo vendor erroneously changed permissions of vendored
crates. This was fixed in Rust
1.51.0 (rust-lang/cargo#9131). Unfortunately, this means that all
cargoSha256/cargoHashes produced during the Rust 1.50.0 cycle are
potentially broken.

This change updates cargoSha256/cargoHash tree-wide.

Fixes #121994.
2021-05-08 00:36:37 -07:00

40 lines
1.3 KiB
Nix

{ 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";
};
cargoSha256 = "0pmpvlmy4pw252is34r9af1ysrp78xs8pz8cw4rys9s4fh2hmhjb";
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.
cargoBuildFlags = lib.optionals (!useNcurses) [ "--no-default-features" "--features pancurses-backend" ];
meta = with lib; {
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.
'';
homepage = "https://chrisvest.github.io/xxv/";
license = with licenses; [ gpl3 ];
maintainers = with maintainers; [ lilyball ];
};
}