about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/misc/tldr/default.nix
blob: 01d50e5f7cf8728492b7f9856eec8a7ba2eb0c4c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
{ lib, stdenv, fetchFromGitHub, curl, libzip, pkg-config, installShellFiles }:

stdenv.mkDerivation rec {
  pname = "tldr";
  version = "1.6.0";

  src = fetchFromGitHub {
    owner = "tldr-pages";
    repo = "tldr-c-client";
    rev = "v${version}";
    sha256 = "sha256-9pBMo+t/44tuT/CisS0w60KaKXjPfNTMr2v6Ftjaf1k=";
  };

  buildInputs = [ curl libzip ];
  nativeBuildInputs = [ pkg-config installShellFiles ];

  makeFlags = ["CC=${stdenv.cc.targetPrefix}cc" "LD=${stdenv.cc.targetPrefix}cc" "CFLAGS="];

  installFlags = [ "PREFIX=$(out)" ];

  postInstall = ''
    installShellCompletion --cmd tldr autocomplete/complete.{bash,fish,zsh}
  '';

  meta = with lib; {
    description = "Simplified and community-driven man pages";
    longDescription = ''
      tldr pages gives common use cases for commands, so you don't need to hunt
      through a man page for the correct flags.
    '';
    homepage = "https://tldr.sh";
    changelog = "https://github.com/tldr-pages/tldr-c-client/blob/v${version}/CHANGELOG.md";
    license = licenses.mit;
    maintainers = with maintainers; [ taeer carlosdagos kbdharun];
    platforms = platforms.all;
  };
}