about summary refs log tree commit diff
path: root/pkgs/tools/misc/tldr/default.nix
blob: 91dae68bebc84060403f98e36fcee71f315e84f3 (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
{ stdenv, fetchFromGitHub, clang, curl, libzip, pkgconfig }:

stdenv.mkDerivation rec {
  name = "tldr-${version}";
  version = "1.3.0";

  src = fetchFromGitHub {
    owner = "tldr-pages";
    repo = "tldr-cpp-client";
    rev = "v${version}";
    sha256 = "10ylpiqc06p0qpma72vwksd7hd107s0vlx9c6s9rz4vc3i274lb6";
  };

  buildInputs = [ curl clang libzip ];
  nativeBuildInputs = [ pkgconfig ];

  preConfigure = stdenv.lib.optionalString stdenv.isDarwin ''
    substituteInPlace Makefile --replace "gcc" "$CC"
    substituteInPlace Makefile --replace "gcc" "$CC"
  '';

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

  meta = with stdenv.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 = http://tldr-pages.github.io;
    license = licenses.mit;
    maintainers = with maintainers; [ taeer carlosdagos ];
    platforms = platforms.all;
  };
}