nixpkgs/pkgs/tools/compression/ouch/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

55 lines
1.4 KiB
Nix
Raw Normal View History

2021-11-11 14:05:34 +00:00
{ lib
, rustPlatform
, fetchFromGitHub
, installShellFiles
, pkg-config
, bzip2
, xz
, zlib
, zstd
, stdenv
2021-11-11 14:05:34 +00:00
}:
2021-07-26 03:49:29 +01:00
rustPlatform.buildRustPackage rec {
pname = "ouch";
2023-12-17 13:15:56 +00:00
version = "0.5.1";
2021-07-26 03:49:29 +01:00
src = fetchFromGitHub {
2021-10-07 08:08:21 +01:00
owner = "ouch-org";
repo = "ouch";
2021-07-26 03:49:29 +01:00
rev = version;
2023-12-17 13:15:56 +00:00
hash = "sha256-WO1fetu39fcLGcrbzFh+toHpnyxWuDVHtmjuH203hzQ=";
2021-07-26 03:49:29 +01:00
};
2023-12-17 13:15:56 +00:00
cargoHash = "sha256-OdAu7fStTJCF1JGJG9TRE1Qosy6yjKsWq01MYpbXZcg=";
2021-11-02 20:35:25 +00:00
nativeBuildInputs = [ installShellFiles pkg-config ];
2021-11-11 14:05:34 +00:00
buildInputs = [ bzip2 xz zlib zstd ];
2021-11-16 00:26:03 +00:00
buildFeatures = [ "zstd/pkg-config" ];
2021-11-02 20:35:25 +00:00
preCheck = ''
substituteInPlace tests/ui.rs \
--replace 'format!(r"/private{path}")' 'path.to_string()'
'';
2021-11-02 20:35:25 +00:00
postInstall = ''
installManPage artifacts/*.1
installShellCompletion artifacts/ouch.{bash,fish} --zsh artifacts/_ouch
2021-11-02 20:35:25 +00:00
'';
env = { OUCH_ARTIFACTS_FOLDER = "artifacts"; } //
# Work around https://github.com/NixOS/nixpkgs/issues/166205.
lib.optionalAttrs stdenv.cc.isClang { NIX_LDFLAGS = "-l${stdenv.cc.libcxx.cxxabi.libName}"; };
2021-07-26 03:49:29 +01:00
meta = with lib; {
2021-10-07 08:08:21 +01:00
description = "A command-line utility for easily compressing and decompressing files and directories";
homepage = "https://github.com/ouch-org/ouch";
changelog = "https://github.com/ouch-org/ouch/blob/${version}/CHANGELOG.md";
2021-07-26 03:49:29 +01:00
license = licenses.mit;
2021-11-02 20:35:25 +00:00
maintainers = with maintainers; [ figsoda psibi ];
2023-11-23 02:51:17 +00:00
mainProgram = "ouch";
2021-07-26 03:49:29 +01:00
};
}