2021-02-05 17:12:51 +00:00
|
|
|
{ lib
|
2023-10-09 19:29:22 +00:00
|
|
|
, stdenv
|
2020-04-24 23:36:52 +00:00
|
|
|
, fetchFromGitHub
|
2024-04-21 15:54:59 +00:00
|
|
|
, fetchpatch
|
2020-04-24 23:36:52 +00:00
|
|
|
, rustPlatform
|
|
|
|
, installShellFiles
|
2023-10-09 19:29:22 +00:00
|
|
|
, darwin
|
2022-04-27 09:35:20 +00:00
|
|
|
, pandoc
|
|
|
|
, testers
|
2022-01-19 23:45:15 +00:00
|
|
|
, lsd
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "lsd";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "1.1.2";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2023-10-09 19:29:22 +00:00
|
|
|
owner = "lsd-rs";
|
|
|
|
repo = "lsd";
|
|
|
|
rev = "v${version}";
|
2024-04-21 15:54:59 +00:00
|
|
|
hash = "sha256-ZMaI0Q/xmYJHWvU4Tha+XVV55zKLukrqkROfBzu/JsQ=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
cargoPatches = [
|
|
|
|
# fix cargo lock file
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/lsd-rs/lsd/pull/1021/commits/7593fd7ea0985e273c82b6e80e66a801772024de.patch";
|
|
|
|
hash = "sha256-ykKLVSM6FbL4Jt5Zk7LuPKcYw/wrpiwU8vhuGz8Pbi0=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
|
|
|
cargoHash = "sha256-TDHHY5F4lVrKd7r0QfrfUV2xzT6HMA/PtOIStMryaBA=";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
nativeBuildInputs = [ installShellFiles pandoc ];
|
2023-10-09 19:29:22 +00:00
|
|
|
|
|
|
|
buildInputs = lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.Security ];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
postInstall = ''
|
2022-04-27 09:35:20 +00:00
|
|
|
pandoc --standalone --to man doc/lsd.md -o lsd.1
|
|
|
|
installManPage lsd.1
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
installShellCompletion --cmd lsd \
|
|
|
|
--bash $releaseDir/build/lsd-*/out/lsd.bash \
|
|
|
|
--fish $releaseDir/build/lsd-*/out/lsd.fish \
|
|
|
|
--zsh $releaseDir/build/lsd-*/out/_lsd
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2020-12-25 13:55:36 +00:00
|
|
|
# Found argument '--test-threads' which wasn't expected, or isn't valid in this context
|
|
|
|
doCheck = false;
|
2020-10-27 00:29:36 +00:00
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
passthru.tests.version = testers.testVersion {
|
2022-01-19 23:45:15 +00:00
|
|
|
package = lsd;
|
|
|
|
};
|
2020-11-30 08:33:03 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2023-10-09 19:29:22 +00:00
|
|
|
homepage = "https://github.com/lsd-rs/lsd";
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Next gen ls command";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.asl20;
|
2024-05-15 15:35:15 +00:00
|
|
|
maintainers = with maintainers; [ zowoq SuperSandro2000 ];
|
2024-01-02 11:29:13 +00:00
|
|
|
mainProgram = "lsd";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|