2022-09-22 12:36:57 +00:00
|
|
|
|
{ lib
|
|
|
|
|
, gitSupport ? true
|
|
|
|
|
, stdenv
|
|
|
|
|
, fetchFromGitHub
|
|
|
|
|
, rustPlatform
|
|
|
|
|
, cmake
|
|
|
|
|
, pandoc
|
|
|
|
|
, pkg-config
|
|
|
|
|
, zlib
|
|
|
|
|
, Security
|
|
|
|
|
, libiconv
|
|
|
|
|
, installShellFiles
|
2020-04-24 23:36:52 +00:00
|
|
|
|
}:
|
|
|
|
|
|
2021-03-09 03:18:52 +00:00
|
|
|
|
rustPlatform.buildRustPackage rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
|
pname = "exa";
|
2021-04-13 19:44:15 +00:00
|
|
|
|
version = "0.10.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
|
owner = "ogham";
|
2021-03-09 03:18:52 +00:00
|
|
|
|
repo = pname;
|
2021-04-05 15:23:46 +00:00
|
|
|
|
rev = "v${version}";
|
2021-04-13 19:44:15 +00:00
|
|
|
|
sha256 = "sha256-vChsy/FrJEzTO5O+XFycPMP3jqOeea/hfsC0jJbqUVI=";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
};
|
|
|
|
|
|
2021-04-13 19:44:15 +00:00
|
|
|
|
# Cargo.lock is outdated
|
|
|
|
|
cargoPatches = [ ./update-cargo-lock.diff ];
|
|
|
|
|
|
|
|
|
|
cargoSha256 = "sha256-ah8IjShmivS6IWL3ku/4/j+WNr/LdUnh1YJnPdaFdcM=";
|
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
|
# FIXME: LTO is broken with rustc 1.61, see https://github.com/rust-lang/rust/issues/97255
|
|
|
|
|
# remove this with rustc 1.61.1+
|
|
|
|
|
CARGO_PROFILE_RELEASE_LTO = "false";
|
|
|
|
|
|
2021-09-18 10:52:07 +00:00
|
|
|
|
nativeBuildInputs = [ cmake pkg-config installShellFiles pandoc ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
buildInputs = [ zlib ]
|
2021-02-13 14:23:35 +00:00
|
|
|
|
++ lib.optionals stdenv.isDarwin [ libiconv Security ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
2022-09-22 12:36:57 +00:00
|
|
|
|
buildNoDefaultFeatures = true;
|
|
|
|
|
buildFeatures = lib.optional gitSupport "git";
|
|
|
|
|
|
2021-09-18 10:52:07 +00:00
|
|
|
|
outputs = [ "out" "man" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
2021-09-18 10:52:07 +00:00
|
|
|
|
postInstall = ''
|
2021-03-09 03:18:52 +00:00
|
|
|
|
pandoc --standalone -f markdown -t man man/exa.1.md > man/exa.1
|
|
|
|
|
pandoc --standalone -f markdown -t man man/exa_colors.5.md > man/exa_colors.5
|
|
|
|
|
installManPage man/exa.1 man/exa_colors.5
|
2020-04-24 23:36:52 +00:00
|
|
|
|
installShellCompletion \
|
2021-03-09 03:18:52 +00:00
|
|
|
|
--name exa completions/completions.bash \
|
|
|
|
|
--name exa.fish completions/completions.fish \
|
|
|
|
|
--name _exa completions/completions.zsh
|
2020-04-24 23:36:52 +00:00
|
|
|
|
'';
|
|
|
|
|
|
|
|
|
|
# Some tests fail, but Travis ensures a proper build
|
|
|
|
|
doCheck = false;
|
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
|
description = "Replacement for 'ls' written in Rust";
|
|
|
|
|
longDescription = ''
|
|
|
|
|
exa is a modern replacement for ls. It uses colours for information by
|
|
|
|
|
default, helping you distinguish between many types of files, such as
|
|
|
|
|
whether you are the owner, or in the owning group. It also has extra
|
|
|
|
|
features not present in the original ls, such as viewing the Git status
|
|
|
|
|
for a directory, or recursing into directories with a tree view. exa is
|
|
|
|
|
written in Rust, so it’s small, fast, and portable.
|
|
|
|
|
'';
|
2021-04-13 19:44:15 +00:00
|
|
|
|
changelog = "https://github.com/ogham/exa/releases/tag/v${version}";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
homepage = "https://the.exa.website";
|
|
|
|
|
license = licenses.mit;
|
2021-04-05 15:23:46 +00:00
|
|
|
|
maintainers = with maintainers; [ ehegnes lilyball globin fortuneteller2k ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
};
|
|
|
|
|
}
|