nixpkgs/pkgs/by-name/tl/tldr/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

39 lines
1.2 KiB
Nix

{ lib, stdenv, fetchFromGitHub, curl, libzip, pkg-config, installShellFiles }:
stdenv.mkDerivation rec {
pname = "tldr";
version = "1.6.1";
src = fetchFromGitHub {
owner = "tldr-pages";
repo = "tldr-c-client";
rev = "v${version}";
sha256 = "sha256-1L9frURnzfq0XvPBs8D+hBikybAw8qkb0DyZZtkZleY=";
};
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;
mainProgram = "tldr";
};
}