ci: fix GHA's rebuild-xxx: 5001+ labels (#360754)
[NixPkgs.git] / pkgs / by-name / ta / tarsnap / package.nix
blob83d205bb9b50b9faf40c7fd81c7f5ba8b568bfdc
1 { lib, stdenv, fetchurl, openssl, zlib, e2fsprogs, bzip2 }:
3 let
4   zshCompletion = fetchurl {
5     url = "https://gist.githubusercontent.com/thoughtpolice/daa9431044883d3896f6/raw/282360677007db9739e5bf229873d3b231eb303a/tarsnap.zsh";
6     sha256 = "0pawqwichzpz29rva7mh8lpx4zznnrh2rqyzzj6h7z98l0dxpair";
7   };
8 in
9 stdenv.mkDerivation rec {
10   pname = "tarsnap";
11   version = "1.0.40";
13   src = fetchurl {
14     url = "https://www.tarsnap.com/download/tarsnap-autoconf-${version}.tgz";
15     sha256 = "1mbzq81l4my5wdhyxyma04sblr43m8p7ryycbpi6n78w1hwfbjmw";
16   };
18   preConfigure = ''
19     configureFlags="--with-bash-completion-dir=$out/share/bash-completion/completions"
20   '';
22   patchPhase = ''
23     substituteInPlace Makefile.in \
24       --replace "command -p mv" "mv"
25     substituteInPlace configure \
26       --replace "command -p getconf PATH" "echo $PATH"
27   '';
29   postInstall = ''
30     # Install some handy-dandy shell completions
31     install -m 444 -D ${zshCompletion} $out/share/zsh/site-functions/_tarsnap
32   '';
34   buildInputs = [ openssl zlib ] ++ lib.optional stdenv.hostPlatform.isLinux e2fsprogs
35                 ++ lib.optional stdenv.hostPlatform.isDarwin bzip2;
37   meta = {
38     description = "Online backups for the truly paranoid";
39     homepage    = "http://www.tarsnap.com/";
40     license     = lib.licenses.unfree;
41     platforms   = lib.platforms.unix;
42     maintainers = with lib.maintainers; [ thoughtpolice roconnor ];
43     mainProgram = "tarsnap";
44   };