acr-cli: init at 0.14 (#359508)
[NixPkgs.git] / pkgs / by-name / re / rex / package.nix
blob0af9628f41a9ade9f3d40b2cfb3ea098f8ff0c08
1 { pkgs, lib, fetchurl, fetchpatch, perlPackages, rsync, which, installShellFiles, ... }:
2 perlPackages.buildPerlPackage rec {
3   pname = "Rex";
4   version = "1.14.3";
5   src = fetchurl {
6     url = "mirror://cpan/authors/id/F/FE/FERKI/Rex-${version}.tar.gz";
7     hash = "sha256-An0wQu+UC2dZDlmJ6W8irh5nunRIlcXdPbVpwFE3Alw=";
8   };
10   buildInputs = with perlPackages; [
11     FileShareDirInstall
12     ParallelForkManager
13     StringEscape
14     TestDeep
15     TestOutput
16     TestWarnings
17     TestUseAllModules
18     TestException
19     SubOverride
21     rsync
22     which
23   ];
25   # These are part of a greater effort to add better support upstream:
26   # https://github.com/RexOps/Rex/compare/master...nixos
27   patches = [
28     # Fix rex's ability to execute things on NixOS managed hosts
29     (fetchpatch {
30       url = "https://github.com/RexOps/Rex/commit/c71f3b255dac8f929abea46913798f132566af55.patch";
31       hash = "sha256-S2tF3IZ96QrxDN3HfBk7RWDZcEwukQYAkSId51dATiU=";
32     })
33     # Fix explicit calls to /bin/mv and /bin/rm
34     (fetchpatch {
35       url = "https://github.com/RexOps/Rex/commit/2782e80bb9789d3afb42e08904c28a4366a58334.patch";
36       hash = "sha256-htm39fF2tumG5b5E1ZBRX5n3vRaZZZzn2lfSN1omP8s=";
37     })
38     # Fix for PATH assumptions
39     (fetchpatch {
40       url = "https://github.com/RexOps/Rex/commit/ec72c8d1fdddf9116afdb21091100fe7cc20f41a.patch";
41       hash = "sha256-a/Sns2f596dbAWbuIveNldc/V3MwR08/ocXVgx0Tbcw=";
42     })
43     # Fix explicit path in Sudo.pm
44     (fetchpatch {
45       url = "https://github.com/RexOps/Rex/commit/f0b312f42178e7e4271b5b010c00efb5cdba2970.patch";
46       hash = "sha256-n/+huVCM8zpgx2LZgMB41PPIYgNhF6AK8+4FGPQH+FU=";
47     })
48   ];
50   nativeBuildInputs = with perlPackages; [ installShellFiles ParallelForkManager ];
52   propagatedBuildInputs = with perlPackages; [
53     AWSSignature4
54     DataValidateIP
55     DevelCaller
56     DigestHMAC
57     FileLibMagic
58     HashMerge
59     HTTPMessage
60     IOPty
61     IOString
62     JSONMaybeXS
63     LWP
64     NetOpenSSH
65     NetSFTPForeign
66     SortNaturally
67     TermReadKey
68     TextGlob
69     URI
70     XMLSimple
71     YAML
72   ];
74   outputs = [ "out" ];
76   postPatch = ''
77     patchShebangs bin
78   '';
80   fixupPhase = ''
81     for sh in bash zsh; do
82       substituteInPlace ./share/rex-tab-completion.$sh \
83         --replace 'perl' "${pkgs.perl.withPackages (ps: [ ps.YAML ])}/bin/perl"
84     done
85     installShellCompletion --name _rex --zsh ./share/rex-tab-completion.zsh
86     installShellCompletion --name rex --bash ./share/rex-tab-completion.bash
87   '';
89   meta = {
90     homepage = "https://www.rexify.org";
91     description = "Friendly automation framework";
92     license = lib.licenses.asl20;
93     maintainers = with lib.maintainers; [ qbit ];
94   };