1{ lib
2, rustPlatform
3, fetchFromGitHub
4, installShellFiles
5, pkg-config
6, bzip2
7, xz
8, zlib
9, zstd
10}:
11
12rustPlatform.buildRustPackage rec {
13 pname = "ouch";
14 version = "0.4.1";
15
16 src = fetchFromGitHub {
17 owner = "ouch-org";
18 repo = pname;
19 rev = version;
20 sha256 = "sha256-WzdKr0i31qNRm1EpMZ/W4fOfKKItmvz6BYFbJWcfoHo=";
21 };
22
23 cargoSha256 = "sha256-UhKcWpNuRNyA+uUw5kx84Y2F1Swr05m7JUM1+9lXYPM=";
24
25 nativeBuildInputs = [ installShellFiles pkg-config ];
26
27 buildInputs = [ bzip2 xz zlib zstd ];
28
29 buildFeatures = [ "zstd/pkg-config" ];
30
31 postInstall = ''
32 installManPage artifacts/*.1
33 installShellCompletion artifacts/ouch.{bash,fish} --zsh artifacts/_ouch
34 '';
35
36 OUCH_ARTIFACTS_FOLDER = "artifacts";
37
38 meta = with lib; {
39 description = "A command-line utility for easily compressing and decompressing files and directories";
40 homepage = "https://github.com/ouch-org/ouch";
41 changelog = "https://github.com/ouch-org/ouch/blob/${version}/CHANGELOG.md";
42 license = licenses.mit;
43 maintainers = with maintainers; [ figsoda psibi ];
44 };
45}