2021-12-06 16:07:01 +00:00
|
|
|
{ lib
|
|
|
|
, rustPlatform
|
|
|
|
, fetchFromGitHub
|
|
|
|
, installShellFiles
|
|
|
|
, pkg-config
|
|
|
|
, bzip2
|
|
|
|
, xz
|
|
|
|
, zlib
|
|
|
|
, zstd
|
|
|
|
}:
|
2021-08-05 21:33:18 +00:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "ouch";
|
2024-01-02 11:29:13 +00:00
|
|
|
version = "0.5.1";
|
2021-08-05 21:33:18 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2021-10-07 14:46:35 +00:00
|
|
|
owner = "ouch-org";
|
2023-08-22 20:05:09 +00:00
|
|
|
repo = "ouch";
|
2021-08-05 21:33:18 +00:00
|
|
|
rev = version;
|
2024-01-02 11:29:13 +00:00
|
|
|
hash = "sha256-WO1fetu39fcLGcrbzFh+toHpnyxWuDVHtmjuH203hzQ=";
|
2021-08-05 21:33:18 +00:00
|
|
|
};
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
cargoHash = "sha256-OdAu7fStTJCF1JGJG9TRE1Qosy6yjKsWq01MYpbXZcg=";
|
2021-12-06 16:07:01 +00:00
|
|
|
|
2022-11-27 09:42:12 +00:00
|
|
|
nativeBuildInputs = [ installShellFiles pkg-config ];
|
2021-12-06 16:07:01 +00:00
|
|
|
|
|
|
|
buildInputs = [ bzip2 xz zlib zstd ];
|
|
|
|
|
|
|
|
buildFeatures = [ "zstd/pkg-config" ];
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
preCheck = ''
|
|
|
|
substituteInPlace tests/ui.rs \
|
|
|
|
--replace 'format!(r"/private{path}")' 'path.to_string()'
|
|
|
|
'';
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
postInstall = ''
|
2022-11-27 09:42:12 +00:00
|
|
|
installManPage artifacts/*.1
|
|
|
|
installShellCompletion artifacts/ouch.{bash,fish} --zsh artifacts/_ouch
|
2021-12-06 16:07:01 +00:00
|
|
|
'';
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
env.OUCH_ARTIFACTS_FOLDER = "artifacts";
|
2021-08-05 21:33:18 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Command-line utility for easily compressing and decompressing files and directories";
|
2021-10-07 14:46:35 +00:00
|
|
|
homepage = "https://github.com/ouch-org/ouch";
|
2022-11-27 09:42:12 +00:00
|
|
|
changelog = "https://github.com/ouch-org/ouch/blob/${version}/CHANGELOG.md";
|
2021-08-05 21:33:18 +00:00
|
|
|
license = licenses.mit;
|
2021-12-06 16:07:01 +00:00
|
|
|
maintainers = with maintainers; [ figsoda psibi ];
|
2024-01-02 11:29:13 +00:00
|
|
|
mainProgram = "ouch";
|
2021-08-05 21:33:18 +00:00
|
|
|
};
|
|
|
|
}
|